diff --git a/.gitignore b/.gitignore index ea8f36ed8..f68c3918a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ Claude.local.md # This repo uses pnpm; ignore an accidental npm lockfile ui/package-lock.json + +# Visual baselines for the Tailwind port (scripts/screenshots.sh) +ui/.screenshots/ diff --git a/Cargo.lock b/Cargo.lock index 4899aa492..3bc99068b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "ahash" version = "0.8.12" @@ -79,6 +85,15 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "async-trait" version = "0.1.89" @@ -104,9 +119,9 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "aws-lc-rs" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" +checksum = "ce2b2dcc879c3bae0d371e77c99f2238400ef24ec001394befa67b6e543add9e" dependencies = [ "aws-lc-sys", "zeroize", @@ -114,14 +129,15 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.41.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" +checksum = "f09fae7be8bb3174e05c6afdb34199e6dc0c7c04ba9fa237b1967adfbde27483" dependencies = [ "cc", "cmake", "dunce", "fs_extra", + "pkg-config", ] [[package]] @@ -343,6 +359,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + [[package]] name = "crypto-common" version = "0.1.7" @@ -353,6 +384,17 @@ dependencies = [ "typenum", ] +[[package]] +name = "derive_arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.10.7" @@ -455,6 +497,16 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -998,11 +1050,11 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.2", "libc", ] @@ -1092,6 +1144,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + [[package]] name = "mio" version = "1.2.1" @@ -1167,6 +1229,7 @@ dependencies = [ "toml", "urlencoding", "uuid", + "zip", ] [[package]] @@ -1483,9 +1546,9 @@ dependencies = [ [[package]] name = "rmcp" -version = "3.1.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "094c075f6698deef5a657cf4df6b684dff65157d255978b92b552ec22503f17a" +checksum = "c8dddc5b1924b9a59fba420166160ca2c4663a4e01803e52eda33070f56d63c8" dependencies = [ "async-trait", "base64 0.23.1", @@ -1638,7 +1701,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1820,11 +1883,17 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + [[package]] name = "simd_cesu8" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" dependencies = [ "rustc_version", "simdutf8", @@ -2429,9 +2498,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267" +checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b" dependencies = [ "rustls-pki-types", ] @@ -2873,8 +2942,37 @@ dependencies = [ "syn", ] +[[package]] +name = "zip" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap", + "memchr", + "thiserror 2.0.18", + "zopfli", +] + [[package]] name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + +[[package]] +name = "zopfli" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] diff --git a/Cargo.toml b/Cargo.toml index ca3da05d9..1ed50af0a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,9 @@ uuid = { version = "1", features = ["v4"] } semver = "1" fd-lock = "4" base64 = "0.22" +# Extract user-uploaded skills shipped as a .zip of a SKILL.md folder. Lean: +# deflate only, no bzip2/zstd/time/aes. +zip = { version = "2", default-features = false, features = ["deflate"] } # `orx up` dashboard: axum for routing/SSE, rust-embed for the SPA, futures for # the stream plumbing. TLS-free, so the rustls-only musl build stays intact. axum = "0.8" diff --git a/SYSTEM_PROMPT.md b/SYSTEM_PROMPT.md index 3125479e0..2a085626f 100644 --- a/SYSTEM_PROMPT.md +++ b/SYSTEM_PROMPT.md @@ -228,6 +228,12 @@ repo-relative paths (from the worktree root), not absolute paths. Reach for this whenever you'd otherwise write a bare file path or a markdown link to a file — the file you edited, the entrypoint you're describing, the config you changed. +The same applies to anything you write into the files dir. Cite every report, +figure, CSV or other output you produced the same way, path relative to the +files dir — never as a bare or backticked path. A citation renders as a chip +the reader can click straight through to; a backticked path is something they +have to go and find. + ## Compute backends {backends_intro} diff --git a/agent-skills/orx-reports/SKILL.local.md b/agent-skills/orx-reports/SKILL.local.md index 9397184d9..b83c00bbe 100644 --- a/agent-skills/orx-reports/SKILL.local.md +++ b/agent-skills/orx-reports/SKILL.local.md @@ -24,3 +24,8 @@ experiment slug: A report's first `# ` heading becomes its title. The markdown references images by relative path (`![](images/foo.png)`). There is no upload step — save the files and they show up in the Files tab, grouped by experiment. + +When you tell the user in chat what you wrote, cite each file as +`` rather than a bare or backticked +path — the citation renders as a chip they can open, a path is something they +have to hunt for. diff --git a/docs/harness-and-upstream-review.md b/docs/harness-and-upstream-review.md new file mode 100644 index 000000000..fc98f1534 --- /dev/null +++ b/docs/harness-and-upstream-review.md @@ -0,0 +1,512 @@ +# Harness and upstream review + +**Date: 14 August 2026.** A research pass over three questions asked together: +what upstream work we haven't merged, what it would take to add Pi as a fourth +harness, and what DeepSeek Harness (`dsh`) and the Cordis paper have to teach us. + +The conclusion is mostly **don't**. This document records the evidence so the +question doesn't get re-opened from scratch, and so the one decision that *is* +live — whether we keep tracking upstream — gets made with numbers attached. + +**If you are about to merge from upstream, read +[the merge playbook](./upstream-merge-playbook.md) first** — it is the operating +guide distilled from this research. + +Companions: [scenario integration spec](./scenario-integration-spec.md), +[idea pipeline orchestration](./idea-pipeline-orchestration-plan.md). + +--- + +## Status + +| Question | Answer | +|---|---| +| Merge upstream? | **Yes — keep tracking** (decided 14 Aug 2026). 3 bug fixes landed; the rest is gated on the Tailwind port | +| Add Pi as a harness? | No, absent a concrete driver | +| Adopt anything from `dsh`/Cordis? | No architecture; two ideas parked for later | +| Next gating item | **Port the Crux theme to Tailwind** — see §5 | + +--- + +## 1. Upstream sync state + +`upstream` is `alphaXiv/openresearch-cli` (push-disabled). Last sync point is +`5e25afa` — *"Surface silently-dropped chat turns (v0.1.87) (#139)"*, **29 July +2026**, landed via `upstream-sync-tranche1..4` (all four merged into `main`). + +- `origin/main` is **92 ahead / 50 behind**. Upstream is on v0.1.101; we version + on our own 1.x line. +- Two of the 50 we already cherry-picked out of order — `4ff8e3a` (Claude auth + recovery) and `3e93476` (Ray Jobs) — so **48 are genuinely new**. +- Measured against `origin/main` (which includes PR #17, the splats work). The + behind-count is the number that matters and it does not move when we ship: + every commit we add widens the gap on the ahead side only. + +A trial merge of `upstream/main` into `main` (throwaway worktree, discarded): + +| | Files | +|---|---| +| Auto-merge clean | 229 | +| Pure additions from upstream | 109 | +| **Conflicted** | **55 (217 hunks)** | + +### The blocking issue: Tailwind + +`8100bdf` **OR-149: Replace CSS files with inline Tailwind classes** deletes +`ui/src/styles.css` (6,162 lines) and replaces it with `tailwind.css` + +`styleClasses.ts` across 45 UI files. Our Crux rebrand lives in that file +(+1,167 lines) plus a `theme.ts` upstream independently rewrote. The merge +reports `UD ui/src/styles.css` (they deleted, we modified) and `AA ui/src/theme.ts` +(both added, whole-file conflict). + +Every upstream UI commit after 10 August is written against the Tailwind world. +**Until we port the Crux theme to Tailwind, the UI half of upstream is frozen for +us.** That is the real decision, not "which commits." + +### What's worth taking + +**Bug fixes — worth taking under any strategy:** + +| Commit | What | Cost (measured, see §6) | +|---|---|---| +| `2530c65` | Handle retained provisioning failures | 0 conflicts | +| `a94c399` | Queue messages sent mid-turn (kills "session is busy — interrupt it first") | 2 conflicts + 2 unmerged-feature refs + Tailwind markup | +| `f28055c` | Fix stale run cancellation recovery | 11 conflicts / 15 hunks + 1 modify/delete | + +**Only if we keep tracking upstream:** + +`055e6bf` (Codex auto-approvals + permission card redesign — supersedes our +`d7075a1` bypass-spawn hack), `4738715` (Skills tab — on-thesis, we ship +`orx-splat`/`spritekit`/`propkit`/`splatkit`), `c43180c` (experiment wake-ups +opt-in), `4cffa77` (clickable file references). + +**Skip — upstream's research pivot, actively wrong for Crux:** + +`3c30487` nanochat demo, `a80f1c9` lit review chat, `75b01c6` research profiles, +`601a201`/`68f1daf`/`b2c52a3`/`5412465`/`b4ee41e` researcher onboarding, +`0ddf502` OpenResearch signup docs, `dccc37c`/`4f0fb0b`/`8c17722` OpenResearch.app +DMG (fights our branding and the `69ada3b` updater repoint), `f6a7198` codeowners, +`c70e387`/`c1e41af` telemetry (we deliberately repointed at our own PostHog in +`4d4278d`). + +**Judgement call:** `6e4f998` "make local file projects the default" (30 Rust + 13 +UI files) is upstream doing the same thing as our `3cf8913`. One of the two has to +give — read theirs before building further on ours. + +**Blocked on Tailwind:** `049891d`, `7edd229`, `12968ac`, `2379b1a`, `e53a84d` +(conflicts head-on with our `79d2640` composer rework), `323799a`, `9508aed`. + +### The trend + +The shared surface is shrinking every week. Upstream is building researcher +onboarding, lit review, paper integration, and a signed OpenResearch.app. We are +building game asset pipelines, splat viewers, and play sessions. We have already +reverted their telemetry and repointed their updater. Merges get more expensive +and buy less each time. + +--- + +## 2. Pi as a fourth harness + +[Pi](https://github.com/earendil-works/pi) (`@earendil-works/pi-coding-agent` +0.84.1) is a Node CLI agent, multi-provider, OAuth in `~/.pi/agent/auth.json`. +Our sibling project `tris-bot` runs it as its runtime. + +**Verdict: don't, absent a concrete driver.** We have Claude, Codex, and OpenCode +working. Pi's advantages — multi-provider, cheaper models — OpenCode already has. +The reason it came up is that tris-bot uses it, which is a "we have this +elsewhere" reason, not a "crux needs this" one. + +The research is recorded here because if a driver appears, it shouldn't be redone. + +### Why it would fit well + +`pi --mode rpc` is newline-delimited JSON over stdio — architecturally the same +shape as `src/local/codex.rs` ("one long-lived `codex app-server` child per chat +session"), but simpler: no JSON-RPC envelope, no bidirectional id correlation. +`docs/rpc.md` in the npm package is 1,579 lines and unusually complete. + +| Crux needs | Pi provides | +|---|---| +| `detect()` auth | `pi auth check --provider X --json` → `{"status":"ready","provider":"anthropic","authType":"oauth"}` | +| `detect()` models | `get_available_models` → objects with `contextWindow`, `cost`, `reasoning` | +| `run_turn` | `prompt` + `message_update`/`tool_execution_*` events | +| native session id | `--session-id ` **creates if missing** — better than Claude's `--resume` | +| `generate_title` | `set_session_name` / `-n` | +| `report_usage` | `get_session_stats` → `contextUsage.percent` | +| reasoning levels | `set_thinking_level`: off/minimal/low/medium/high/xhigh/max — near-exact match to `options.rs` | +| mid-run steering | `steer` / `follow_up` **natively** (what upstream's OR-166 just built) | +| orx skill shim | pi reads `~/.agents/skills/` — **where we already write Codex's shim.** Free. | +| `session_skills_dir` | project `.agents/skills` — same string Codex returns | + +### The gaps + +`docs/usage.md:303` is explicit: *"It intentionally does not include built-in MCP, +sub-agents, permission popups, plan mode, to-dos, or background bash."* + +1. **No permission model, no sandbox.** Fixable with a crux-authored pi extension: + `pi.on("tool_call")` can return `{block: true, reason, terminate}`, and + `ctx.ui.confirm()` surfaces in RPC as `extension_ui_request`/`extension_ui_response` + — which maps exactly onto our inline-approval path (`ResumeAction::Handled`, same + as OpenCode). Pi ships `examples/extensions/permission-gate.ts` and a full + `examples/extensions/plan-mode/` as references. Plan mode via `pi.setActiveTools()` + would be *cheaper* than our 732-line `plan_gate.rs`. +2. **No MCP client at all.** No `@modelcontextprotocol` anywhere in the package. + Would need an MCP→`pi.registerTool` bridge extension (~200–300 lines TS), or pi + sessions ship without Blender/ComfyUI/Scenario. Note tris-bot didn't bridge — it + hand-wrote `.pi/extensions/{scenario,generation,browser}` natively. +3. **Project trust.** Non-interactive modes never prompt and, under the default + `defaultProjectTrust: "ask"`, **silently ignore** project resources — including + the per-session `.agents/skills` we write into every worktree. Must pass + `--approve`/`-a` on spawn. Silent-failure trap. + +### Permanent losses (would not reach parity) + +- **Plan/quota display.** Claude has a live probe (`harness/claude.rs:707`); Codex + captures `rateLimits` on-turn (`harness/codex.rs:854`). Pi has neither. An + extension can read `after_provider_response` headers, so API-key rate limits are + recoverable, but subscription plan windows (the 5h buckets we render) are not. + Pi would land where OpenCode is: cost-derived only. +- **Native subagent nesting.** `harness/claude.rs:1196` routes Task-tool subagent + activity into the Task row's children. Pi has no native subagent tool. Mostly + doesn't matter — our `orx agent suggest` dispatch is harness-agnostic, and + `src/local/opencode.rs:155` already tells agents *not* to use their native + subagent tool. + +### Cost if we ever do it + +Every chat harness is two files: a process host in `src/local/.rs` and a +protocol adapter in `src/local/harness/.rs`. + +| Existing | Host | Adapter | +|---|---|---| +| cursor (detect-only) | — | 41 | +| opencode | 909 | 1,758 | +| claude | 1,063 | 2,925 | +| codex | 851 | 4,287 | + +A pi host would be ~600–800 and an adapter ~1,200–1,600 *if* the protocol's +simplicity holds — but claude and codex were presumably also going to be simple. +Plus a TypeScript extension. **Realistic estimate: 3–4 weeks, not 1–2.** + +Edits elsewhere: `harness/mod.rs` registry line; `chat/mod.rs:526` (ChatHost has +*named* host fields, it is not generic); `mcp_servers.rs`; `commands/up.rs`; +`ui/src/api.ts:1127` HarnessId union; `ModelPicker.tsx:27`; `SettingsPage.tsx:288`; +`ChatPanel.tsx:1893`; a logo. No DB migration — `chat_sessions.harness` is TEXT. + +--- + +## 3. DeepSeek Harness and the Cordis paper + +`dsh` is ~497k lines of TypeScript across 7,412 files and ~50 package groups. +Crux is 53k Rust + 23k UI across 314 files. Different weight classes. + +`dsh` is not a competitor exactly — it's a harness, the layer we wrap. But it has +independently built our harness-adapter layer: `packages/subagent/` holds +`subagent-claude-code`, `subagent-codex`, `subagent-acp`, `subagent-fork-in-process` +and three more, all behind one provider interface. + +The paper (*A Programming Paradigm for Spatiotemporal Composability*, 88pp) is +serious PL theory: revertible effects (every context transformation carries an +inverse the runtime tracks) and reactive coeffects (components declare +dependencies; context changes notify them), unified into a context type, with a +calculus and confluence proofs. **§1–4 is not actionable for us. §5.2 and §6 are.** + +The authors' own §5.3 is worth quoting: *"a single ecosystem in a single host +language… observational rather than a controlled comparison… an +existence-and-adoption result rather than a quantitative one."* It is a well-argued +design philosophy with a formal skeleton, not evidence the architecture wins. + +### What doesn't port — and the paper says why + +§6.4 lists what a host language must supply: runtime module load/unload (Node has +a module registry; *"Native code exposes no module registry"* and needs +dlopen/dlclose) and dynamically mediated dependency access via a Proxy-like +primitive. Rust has neither ergonomically. §6.5 is a warning, not an invitation: +fine-grained decomposition means *"the number of integration components can grow +quadratically."* dsh's 7,412 files are what that costs. + +**Our `Harness` trait does the same job as their subagent seam at a fiftieth of +the size.** The capability-defaults design (detect / chat / skill-install, each +independently optional, Cursor implementing only the third) is right. Don't +re-architect toward dsh. + +### Two ideas parked for later + +**Append-only session log.** dsh's `Session` is an append-only typed event log; +message history is *derived*, never stored. Our `chat_messages(… parts_json …)` +(`store.rs:299`) stores whole blobs, and `flush()` (`chat/mod.rs:1988`) rewrites +the **full** assistant message every 150ms. We have already paid for this twice: +`TOOL_TEXT_CAP = 16_000` (`chat/mod.rs:36`) exists explicitly because "every flush +re-broadcasts (and re-persists) the FULL assistant message", and the `msg_write` +mutex (`chat/mod.rs:558`) exists because `flush` and `respond` both read-modify-write +the same row. Real, but latent — the cap already mitigates it. **Cheap version: +skip the flush when parts haven't changed (~2 hours).** + +**Closed approval outcome.** dsh's `ApprovalOutcome` is +`allowed-once | rejected | cancelled | unavailable`, explicitly fail-closed. Our +`PermissionDecision` (`chat/mod.rs:427`) is Claude's wire type wearing a Rust name +— `#[serde(tag = "behavior")]`, two variants, serialized verbatim into Claude's +permission-prompt-tool contract, and wired only in plan mode for Claude. The +two-tier design in `request_permission` (`chat/mod.rs:712`) is already right; only +the *type* is Claude-shaped. **Worth doing only as part of adding a harness with +no native gate (i.e. Pi).** + +### MCP: a correction + +An earlier draft of this analysis claimed we should route generative tools through +an orx-side proxy instead of per-harness MCP renderers. That was wrong — **we +already run both halves of that pattern:** + +- Blender and ComfyUI are HTTP MCP servers *crux hosts itself* + (`local/blender/server.rs:280`, `local/comfyui/server.rs:384`). +- We already ship a stdio MCP server of our own: `orx mcp-gate` + (`main.rs:182`, `commands/mcp_gate.rs`), spawned as Claude's child for the + permission bridge. + +And the N×M is small: `mcp_servers.rs` is 178 lines with three ~10-line renderers. +A new harness *that has MCP* costs about ten lines. **Not worth restructuring.** + +### Strategic note + +DeepSeek shipping an MIT-licensed, "everything is a plugin" harness in developer +preview, with a `dsh-plugin` GitHub topic and a Discord, is a platform play. dsh +has profiles and bundles that install out-of-tree plugins, and no domain layer of +its own. If it gets traction, "ship the Crux game pipeline as a dsh bundle" becomes +a real distribution option — we'd supply exactly the vocabulary they've left empty. +Worth a bookmark, not a bet; they're pre-1.0 and warning about breaking changes. + +--- + +## 4. Scorecard + +Honest scoring, including a bias worth naming: comparing a 76k-line solo product +against a 500k-line corporate framework will *always* produce a list of things +we're "missing," and it doesn't account for missing them being the correct call at +our size. + +| Change | Ships as estimated | Real benefit | Verdict | +|---|---|---|---| +| Cherry-pick 3 upstream fixes | ~85% | Medium — fixes bugs we plausibly have | **Done** (§6) | +| Tailwind port | ~70% | Zero on its own; option value on everything upstream | **Next** — gating, per §5 | +| Full tranche-5 (8 commits) | ~60% | Low-medium | **After the port**, in upstream order | +| Tier 2 of the port | ~65% | High — unblocks the UI half | Per file, 3–4 days, with `api.ts` frozen — see §5 | +| Flush skip-if-unchanged | ~90% | Low, but ~2 hours | If chats feel sluggish | +| Approval outcome type | ~90% | **Near zero on its own** | Only as part of Pi | +| Pi harness | ~40% at 1–2 weeks | **Unclear** | No, absent a driver | +| Event-sourced chat log | ~50% | Low today | No | + +--- + +## 5. Decision: keep tracking upstream + +**Decided 14 August 2026.** We keep merging from `upstream/main` rather than +hard-forking. The reasoning: their harness layer (Codex approvals, streaming +markdown, file rendering, the permission-card work) is real engineering we would +otherwise maintain alone, and that layer is inherited infrastructure — not our +differentiator, and not where we want to spend solo-team time. + +The accepted cost is the Tailwind port plus a recurring merge tax. §6 measures +what that tax actually looks like. + +### What this makes the next gating item + +**Port the Crux theme to Tailwind.** Until it's done, every upstream UI commit +after 10 August needs its markup hand-translated (as `a94c399` did in §6), and +roughly 15 upstream commits stay unavailable. Concretely: + +- `8100bdf` deletes `ui/src/styles.css` (6,162 lines) for `tailwind.css` + + `styleClasses.ts` across 45 UI files; our brand is +1,167 lines in that file. +- The merge reports `UD ui/src/styles.css` and `AA ui/src/theme.ts`. +- Scored ~70% to ship as estimated, with zero product value on its own. It buys + option value on everything upstream does next, which is exactly why it only + makes sense under this decision and not the other one. + +Sequence from here: + +1. **Tailwind port** — gating; nothing else in the UI half moves without it. +2. **Tranche 5**, in upstream order, not cherry-picked across gaps (§6). Start + with `055e6bf` (Codex approvals + permission cards), then `4738715` (Skills + tab), `c43180c`, `4cffa77`. +3. **Read `6e4f998`** against our `3cf8913` before building further on local + projects — one of the two has to give. +4. Everything else (Pi, the approval type, the event log) still waits for a + concrete trigger. This decision does not change their scoring. + +### Tier 2: freeze `api.ts` + +**This supersedes the section below, which drew the wrong conclusion from the +same evidence.** Tier 2 is per-file after all. The rule that makes it so: + +> `ui/src/api.ts` is our contract of record and **does not move**. Any upstream +> UI referencing a symbol or field it doesn't have is UI for a backend commit we +> haven't merged. Rewrite the reference to our spelling, or delete that feature. +> Never widen `api.ts` to make it compile. + +Merging `api.ts` is what turned this into a cascade: it broke `App`, `ChatPanel` +and `DetailDrawer` at once, and — the real cost — removed the only check that was +catching the problem. With `api.ts` frozen, `tsc` names every offending line, and +a green build is evidence that no unmerged-backend UI slipped through. Widen the +contract and the compiler stops being able to tell you. + +The hazards in `SettingsPage` are **renames, not missing features**, so each is a +one-token edit: + +| upstream | ours | sites | +|---|---|---| +| `toolsFound` | `gitFound` | 4 | +| `configuredDefaultBackend` | `defaultBackend` | 1 | +| `enabled` (on `ComputeTargetSummary`) | `configured` | 7 | + +Two things genuinely can't be taken and must keep our version: components backed +by endpoints we don't serve (`ProjectDefaultsTab`, upstream's rewritten `GitTab` +— see the endpoint note below), and components upstream restructured where our +shape differs (`InstancesTab`, which upstream split into `ComputeActivity` + +`InstancesTable` + `InstanceHistory`). Both surface as `tsc` errors; neither +needs predicting in advance. + +**Do not build tooling for this.** I wrote a preflight to predict the keep-ours +list and a companion to swap components, and put the same brace-matching bug in +both three times — an apostrophe inside a comment swallowed the rest of the file, +and the fix for that made it skip components instead. Each version printed a +confident, wrong list. `tsc` already answers the question exactly, for free, and +cannot silently under-report the way a hand-rolled parser can. + +**Revised estimate:** back to roughly the original 3–4 days, per file, resumable +between files. The 8–10 day figure below assumed the cascade was inherent; it was +self-inflicted. + +### What the rest of tier 2 is actually blocked on + +Five files converted this way (`SettingsPage`, `GitDiff`-era batch, `BackendLogos`, +`Wordmark`, `Tour`). Then every remaining file hit the same wall, and it is not a +merging problem — it is three specific unmerged commits: + +| Missing symbol | Blocks | Comes from | +|---|---|---| +| `githubEnabled`, `cloneUrl` | `CodeTab`, `NewProjectForm` | `6e4f998` OR-131 make local file projects the default | +| `getExperimentDiff`, `DiffPayload` | `BranchChanges`, `WorktreeTab`, `TreeView` | `3cb782e` Redesign experiment navigation and code views | +| `AgentSelection`, `OptionChoice.description` | `ModelPicker`, `ChatPanel` | `68f1daf` OR-154 Clean up onboarding | + +`SettingsPage` was tractable because its hazards were *renames* of things we +already had. These are genuinely new contract, so there is nothing to rewrite +them to. + +Note what that table says about the plan. `68f1daf` is on the **skip list** — +upstream's researcher onboarding. `6e4f998` is the **judgement call** from §1, +where upstream does the same job as our `3cf8913`. So the remainder of the port is +gated on two decisions we already knew were open, plus one ordinary merge: + +1. **`3cb782e`** — the code-view redesign. Ordinary; take it, and `CodeTab`, + `WorktreeTab`, `BranchChanges` and `TreeView` unblock together. +2. **`6e4f998` vs our `3cf8913`** — one has to give. Until it's settled, + `CodeTab` and `NewProjectForm` stay ours. +3. **`68f1daf`** — we skipped it for the onboarding, but `AgentSelection` rides + along with it, and that gates the whole `ChatPanel` cluster (`ChatPanel`, `Md`, + `ModelPicker`, `PlanStrip`, `SubagentTab`, `DetailDrawer`). Either cherry-pick + the type without the onboarding, or the cluster stays unported. + +**This is the useful revision:** the rest of tier 2 is not days of grinding, it is +those three decisions. Grinding harder on the merge would not have found it — +`tsc` did, because `api.ts` stayed frozen. + +### Superseded: "tier 2 is one operation" + +Established by attempting it and backing out (14 Aug). The tier-1 shape — take a +file, re-apply our diff, verify, commit — **does not carry over**, because the +tier-2 files are joined by contracts rather than merely sitting near each other. + +The tool for the re-apply is settled and it works: `git merge-file` with the +merge-base as ancestor. `SettingsPage` came out at 19 conflicts / 373 lines from +a 3342-line file, `api.ts` at 5 conflicts / 192 lines. Hand re-application would +have been far worse. That is not the problem. + +The problem is the dependency shape: + +- **`SettingsPage` cannot move without `api.ts`.** Upstream's version reads + fields ours doesn't declare — `toolsFound` on the SSH/Slurm preflights, + `projectId`, `enabled` on `ComputeTargetSummary`. +- **`api.ts` cannot move alone.** Merging it immediately broke `App`, + `ChatPanel`, and `DetailDrawer`: upstream restructured the file-access + functions, so `getFiles`, `ProjectFiles`, `fileUrl`, `getCommitDiff`, and + `getWorkingTree` vanish from under three consumers we have not converted. +- **`TreeView` cannot move without `CodeTab`**, which is itself deferred: its + converted version imports `type CodeView` from it, and our `CodeTab` does not + export that type. Note the dependency scan reports `TreeView` as clean — + the file exists, only the *export* is missing. File-existence checks are + necessary, not sufficient. + +So tier 2 is `api.ts` plus every consumer, in one branch, landing together: +`SettingsPage`, `ChatPanel`, `App`, `DetailDrawer`, `TreeView`, `CodeTab`, +`WorktreeTab`, plus the three deferred from tier 1 (`Header`, `SubagentTab`, +`PlanStrip`) and the two components the code browser needs (`BranchChanges`, +`CodeBrowserHeader`). Fold `055e6bf` into it rather than sequencing around it — +`PlanStrip`'s `"bypassPermissions"`/`"bypass"` mismatch is the same problem it +fixes. + +**Upstream's settings also carry features our server does not implement.** The +merge pulled in a `ProjectDefaultsTab` and a rewritten `GitTab` calling +`/api/settings/projects`, project git status, and GitHub enable/disable; upstream's +`api.ts` adds 11 endpoints we have no handler for. Those must be dropped on the +way through, not adopted — a UI that typechecks against a missing endpoint fails +at runtime, where neither tsc nor the screenshots will catch it. + +**Estimate:** the 3–4 days in §4's table was per-file thinking. As one atomic +operation with a server-contract review inside it, budget closer to 8–10 days, +and do it on a branch that can be abandoned. + +--- + +## 6. Done + +**14 Aug 2026** — cherry-picked `f28055c`, `a94c399`, `2530c65` (upstream order) +onto `upstream-fixes-aug14`. 413 tests pass (was 410), `cargo fmt --check` and +`cargo clippy --all-targets` clean, `ui` typechecks and builds. + +The three commits cost more than the estimate in §1's first draft, in ways worth +recording because they generalize to any future tranche: + +1. **`f28055c` was not "small."** 11 conflicted files, 15 hunks, plus a + modify/delete on `ui/src/components/ExperimentOverview.tsx` (deleted in our + rebrand; kept deleted). Resolutions of note: + - `commands/up.rs` — `ApiRun` gains `cancel_requested`; the cancel handler + keeps our play-session short-circuit but swaps the bare + `set_cancel_requested` for upstream's `request_local_run_cancel`, which is + the actual fix (locks, persists intent, respawns an orphaned supervisor, + rolls back on spawn failure). + - `commands/supervise.rs` — upstream's terminal-status early return placed + *before* our watcher-heartbeat task, so a supervisor respawned for a + finished run exits instead of idling. + - `TreeView.tsx` — adopted `runDisplayStatus` + the `cancelling` live state, + kept our game vocabulary (Idea/Building/Merge/Prototype) and dropped + upstream's re-added run-squares row. +2. **Two upstream tests were dropped**, both asserting behaviour from commits we + have *not* merged; they rode along only because git couldn't split the block: + - `remote_clone_fetches_recorded_commit_detached` — asserts an + `hf_clone_script` that fetches a recorded commit detached. `f28055c` never + touched `hf_clone_script`; ours still uses `clone --depth 1 --branch`. + Taking the test would have meant taking an unrelated behavioural change. + - `project_json_exposes_artifacts_dir_with_legacy_alias` — builds a + `LocalProject` with `github_sync_enabled`, a field our struct doesn't have. + Upstream test fixtures also needed our six extra `StoredRun` fields. +3. **The Tailwind blocker is already live, not hypothetical.** `a94c399` (11 Aug) + is post-migration, so its queued-message chip markup arrived as Tailwind + utility classes — dead strings in our build. Resolved by keeping the semantic + class names and writing real CSS into `styles.css` (`.composer-queued`, + `.queued-chip*`). Every future UI pick will need this same translation until + the theme is ported. +4. **`a94c399` also referenced an unmerged feature.** Its queue path called + `setAttachError` and read `a.name` off an attachment — both from the PDF/file + upload commit `899c3b6`. Dropped to match our existing send path. + +**Read-through:** upstream commits do not arrive self-contained. Two of three +carried assertions or call sites belonging to commits we skipped, and one +carried markup for a UI system we don't have. Budget for that, or take whole +tranches in upstream order rather than cherry-picking across gaps. + +Everything else waits for a concrete trigger: Pi if a real reason appears, the +event log if a chat gets slow, the approval type if Pi happens. + +The harness layer is inherited infrastructure that currently works. Our +differentiator — the experiment tree, play sessions, verdicts, the asset pipeline +— is the part nobody else is building, including dsh and including upstream. diff --git a/docs/upstream-merge-playbook.md b/docs/upstream-merge-playbook.md new file mode 100644 index 000000000..05ccc0ce8 --- /dev/null +++ b/docs/upstream-merge-playbook.md @@ -0,0 +1,167 @@ +# Merging from upstream: what to know before you start + +**Date: 14 August 2026.** Written after a long session of doing it. The research +and the decisions live in [the review](./harness-and-upstream-review.md); this is +the operating guide — read it first, it will save you a day. + +Upstream is `alphaXiv/openresearch-cli`. We track it deliberately (decision +recorded 14 Aug), but it is building a research product and we are building a +game-design one, and that difference is the source of nearly every trap below. + +--- + +## The one rule + +> **`ui/src/api.ts` is our contract of record and does not move**, unless our +> backend moved with it in the same change. + +Upstream UI that references an api symbol we don't export is not a styling +change — it is UI for a *backend* commit we haven't merged. Rewrite the +reference to our spelling, or drop that feature. + +Never widen `api.ts` to make an error go away. Merging it once broke `App`, +`ChatPanel` and `DetailDrawer` simultaneously, and — the real cost — removed the +only check that was catching the problem. With `api.ts` frozen, `tsc` names +every offending line and a green build is *evidence*. Widen the contract and the +compiler will happily accept UI for a server that doesn't exist, which then +fails at runtime where neither `tsc` nor the screenshots are looking. + +## The check that saves the most time + +**Before calling a missing symbol a blocker, look for it under another name.** +Three of the four "blockers" identified in that session dissolved on inspection: + +| "Missing" | Actually | Fix | +|---|---|---| +| `toolsFound` | our `gitFound` | one token | +| `AgentSelection` | our `ModelSelection`, field for field | one line | +| `bypassPermissions` | our `bypass` (their `from_id` is just lenient) | one token | +| `configuredDefaultBackend` | our `defaultBackend` | one token | + +Only genuinely-new server concepts are real blockers — `enabled`/`disabledReason` +on compute targets, `githubEnabled`, `cloneUrl`/`createFolder`. Those have +nothing to rewrite to, so the feature comes out. + +## Check whether we already built it + +We are ahead of upstream in places, and a commit that sounds like a gap may be +one we solved first, differently: + +- **`c43180c` "make experiment wake-ups opt-in"** — we shipped `autoPrompts` in + `758ad45`: per project, all defaulting off. Months earlier. Do not take it. +- Our **`orx agent` subagent dispatch** is harness-agnostic; upstream's is a + native Task-tool nesting we deliberately steer away from. +- Our **`orx mcp-gate` + `plan_gate`** approval bridge has no upstream equivalent + (they kept both, so there is no collision — but do not assume their approval + work replaces ours). + +--- + +## Tools + +**Three-way merge, not manual re-application.** `git merge-file` with the +merge-base as ancestor put `SettingsPage` at 19 conflicts in a 3342-line file: + +```sh +git show 5e25afa:ui/src/components/X.tsx > /tmp/X.base # merge-base +git show upstream/main:ui/src/components/X.tsx > /tmp/X.theirs +cp ui/src/components/X.tsx /tmp/X.merged +git merge-file -L ours -L base -L upstream /tmp/X.merged /tmp/X.base /tmp/X.theirs +``` + +Conflicts sort into three buckets: **import unions**, **pure class-name swaps** +(take theirs — that is the conversion), and **our features** (keep ours). + +**Screenshots before touching anything.** `scripts/screenshots.sh` — see its +header. Capture, change, capture, compare. It caught a `NewProjectForm` change +with no guesswork, and it is the only thing that can catch a silent CSS +regression. + +**Do not build tooling for this.** A preflight was written to predict which +components could be taken, and the same brace-matching bug went into it three +times — an apostrophe inside a comment swallowed the rest of the file, and the +fix made it skip components instead. Every version printed a confident, wrong +list. `tsc` already answers the question exactly. + +--- + +## Traps, each one paid for + +**A clean merge can still be wrong.** `BackendLogos` merged with zero conflicts +and had two copies of `RayLogo` and `OpenResearchLogo` — both sides had added +them at different offsets. Only `tsc` noticed. + +**Conflict boundaries land mid-function.** Taking "ours" at a hunk whose boundary +sits inside a function leaves the other half of the function behind. This +produced an unclosed `list_project_branches`, a duplicated `project_json`, and a +`list_skills` missing its query parameter — all caught by the compiler, none by +reading carefully. + +**A commit's payload carries their product model.** `4cffa77` is described as +"make file references clickable" and its diff rewrites our reports skill to a +flat artifacts directory, explicitly un-reserving the `project/` namespace our +layout depends on. Port the idea; do not take the text. + +**Inheriting a deletion is as consequential as inheriting an addition.** +`3cb782e` *removed* the per-commit browsing api (`listExperimentCommits`, +`getCommitDiff`, `getWorkingTree`). Our `DetailDrawer` still uses it and our +server still serves it, so the removal had to be reverted after the fact. + +**Screens with the chat pane never reproduce byte-for-byte.** They were gated +three separate times on two runs, then three runs agreeing, and drifted every +time. The flake rate is low, not zero. They stay advisory. + +--- + +## What to take next + +**Wanted, in upstream order:** + +1. **`055e6bf` — Codex approvals + permission cards.** The big one: 60+ hunks + across 17 files, 945 lines of approval flow in `chat/mod.rs`, 28 hunks in + `ChatPanel`. It does *not* collide with `mcp-gate`/`plan_gate` — checked. It + is simply a coherent redesign spanning both halves. Budget days, not hours, + and do it when our approvals actually need something it offers. +2. Anything newer than 13 Aug 2026 — unreviewed, ~54 commits behind and growing. + +**Still unconverted** (all work today, all keep our styling until touched): +`ChatPanel`, `Md`, `DetailDrawer`, `SubagentTab`, `Header`, `App`, `FileViewer`, +`TreeView`, `NewProjectForm`, `Onboarding`, `ProjectsHome`, `StatusBadge`. + +Two of those are blocked by more than effort: + +- **`Md`** needs four new dependencies, one a JSR package not on npm + (`@clo/react-markdown`). It swaps the markdown renderer — behavioural, on + screens with only advisory coverage. +- **`ChatPanel`** imports `LitSourcesPicker`: alphaXiv/OpenAlex/bioRxiv toggles + wired into the composer, backed by an endpoint we don't serve. The research + pivot lives *inside* the file, so taking it means surgery. + +**Never take:** + +- `7dc5155` — copy hygiene for their prompts; ours are different prompts. +- `68f1daf`, `75b01c6`, `601a201`, `b2c52a3`, `5412465`, `b4ee41e` — researcher + onboarding. +- `a80f1c9`, lit sources — literature review. +- `3c30487` — nanochat demo seed. +- `dccc37c`, `4f0fb0b`, `8c17722` — OpenResearch.app DMG; fights our branding + and the `69ada3b` updater repoint. +- `c70e387`, `c1e41af` — telemetry; we point at our own PostHog (`4d4278d`). +- `f6a7198` — their codeowners. + +**Open question:** `6e4f998` "make local file projects the default" does the same +job as our `3cf8913`, and supporting their GitHub-less projects means changing +the project model — 2401 lines across 30 files. One has to give, and nothing +forces the choice yet. + +--- + +## Where a file stands + +Twenty UI files are byte-identical to upstream and will merge cleanly forever. +About eight carry our features on upstream's converted markup and will conflict +manageably. The rest are pre-Tailwind. To check any one file: + +```sh +git diff --quiet upstream/main HEAD -- ui/src/components/X.tsx && echo identical +``` diff --git a/scripts/screenshots.sh b/scripts/screenshots.sh new file mode 100755 index 000000000..a6a9c62b3 --- /dev/null +++ b/scripts/screenshots.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# Visual baseline for the Tailwind port. See ui/scripts/screenshots.mjs for why +# it exists — short version: a utility-class migration fails silently, so a +# passing build proves nothing about how a screen looks. +# +# scripts/screenshots.sh --snapshot (once) freeze the fixture +# scripts/screenshots.sh tier2 capture, labelled "tier2" +# scripts/screenshots.sh --compare tier1 tier2 diff against the last one +# +# Determinism is the whole game: a baseline captured against live data diffs +# against itself the moment a run finishes or a chat moves. So `--snapshot` +# freezes a copy of the data dir's databases once, and every capture runs against +# a throwaway copy of that frozen fixture — your real data dir is only ever read, +# and only by --snapshot. +# +# Only the .db files are copied (~14M). `files/` and `local-runs/` are hundreds of +# megabytes of run artifacts that no screen here renders. +# +# The PNGs and the fixture contain your real project names and chat text. Both +# live under ui/.screenshots/, which is gitignored — keep it that way. +set -euo pipefail + +repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$repo" + +fixture_pin="ui/.screenshots/fixture" +live_data="${ORX_LIVE_DATA_DIR:-$HOME/.local/share/openresearch}" + +if [[ "${1:-}" == "--snapshot" ]]; then + [[ -d "$live_data" ]] || { echo "no data dir at $live_data (set ORX_LIVE_DATA_DIR)" >&2; exit 1; } + rm -rf "$fixture_pin" + mkdir -p "$fixture_pin" + cp "$live_data"/*.db* "$fixture_pin/" 2>/dev/null || true + [[ -d "$live_data/idea-evaluator" ]] && cp -r "$live_data/idea-evaluator" "$fixture_pin/" + echo "froze $(du -sh "$fixture_pin" | cut -f1) fixture from $live_data" + echo "re-run --snapshot only when you WANT the baseline to move." + exit 0 +fi + +if [[ "${1:-}" == "--compare" ]]; then + exec node ui/scripts/screenshots.mjs --compare "${2:?labelA}" "${3:?labelB}" +fi + +[[ -d "$fixture_pin" ]] || { echo "no fixture yet — run: scripts/screenshots.sh --snapshot" >&2; exit 1; } + +label="${1:-baseline}" +port="${ORX_SCREENSHOT_PORT:-3399}" +# A FIXED path, not mktemp: Settings → Storage renders the data dir, so a random +# temp name would change that screenshot on every run all by itself. +workdir="$repo/ui/.screenshots/.run" + +cleanup() { + [[ -n "${server_pid:-}" ]] && kill "$server_pid" 2>/dev/null || true +} +trap cleanup EXIT +rm -rf "$workdir" +mkdir -p "$workdir" + +# Copy, never use the pin directly: the server writes (WAL, logs) and a mutated +# pin would silently drift the baseline out from under later captures. +cp -r "$fixture_pin/." "$workdir/" + +echo "==> building ui" +(cd ui && npm run build >/dev/null) + +echo "==> building orx" +cargo build --quiet --bin orx + +echo "==> starting orx up on :$port" +ORX_DATA_DIR="$workdir" ./target/debug/orx up \ + --port "$port" --no-browser --no-agent >"$workdir/orx-up.log" 2>&1 & +server_pid=$! + +for _ in $(seq 1 60); do + sleep 1 + curl -sf "http://127.0.0.1:$port/" >/dev/null 2>&1 && break +done +if ! curl -sf "http://127.0.0.1:$port/" >/dev/null 2>&1; then + echo "orx up never came up; log:" >&2 + cat "$workdir/orx-up.log" >&2 + exit 1 +fi + +echo "==> capturing" +ORX_SCREENSHOT_URL="http://127.0.0.1:$port" node ui/scripts/screenshots.mjs "$label" diff --git a/src/client.rs b/src/client.rs index 6ae2357ed..b8564bde3 100644 --- a/src/client.rs +++ b/src/client.rs @@ -664,6 +664,12 @@ pub struct Sandbox { pub created_by: Option, pub updated_at: String, pub provision_warnings: Option, + #[serde(default)] + pub failure_code: Option, + #[serde(default)] + pub failure_message: Option, + #[serde(default)] + pub failed_at: Option, pub provider_name: Option, pub provider_instance_id: Option, pub price_per_hour: Option, @@ -1827,6 +1833,48 @@ mod tests { assert_eq!(sb.ssh_username.as_deref(), Some("root")); } + #[test] + fn deserializes_retained_sandbox_failure() { + let json = r#"{ + "sandbox": { + "id": "sb_1", + "organizationId": "org_1", + "projectId": null, + "sshHostname": null, + "sshPort": null, + "sshUsername": null, + "status": "failed", + "machineType": "persistent", + "createdBy": "user_1", + "updatedAt": "2026-06-18T00:05:00Z", + "provisionWarnings": null, + "failureCode": "capacity_unavailable", + "failureMessage": "No capacity is available.", + "failedAt": "2026-06-18T00:05:00Z", + "providerName": "runpod", + "providerInstanceId": null, + "pricePerHour": 2.5, + "gpu": "RTX_4090", + "gpuCount": 2, + "vcpuCount": null + } + }"#; + + let sandbox = serde_json::from_str::(json) + .expect("failed sandbox should deserialize") + .sandbox; + assert_eq!(sandbox.status, "failed"); + assert_eq!( + sandbox.failure_code.as_deref(), + Some("capacity_unavailable") + ); + assert_eq!( + sandbox.failure_message.as_deref(), + Some("No capacity is available.") + ); + assert_eq!(sandbox.failed_at.as_deref(), Some("2026-06-18T00:05:00Z")); + } + /// The api declares `chatSessionId` optional: a lost `rename_all` would send /// `chat_session_id` and a lost `skip_serializing_if` would send `null`, /// either of which silently drops the row's attribution. diff --git a/src/commands/exp.rs b/src/commands/exp.rs index 41d5605b2..f89f67f6f 100644 --- a/src/commands/exp.rs +++ b/src/commands/exp.rs @@ -190,3 +190,158 @@ pub(crate) fn spawn_detached_supervise(run_id: &str) -> Result<()> { .map_err(|e| anyhow!("Could not spawn `orx supervise {}`: {}", run_id, e))?; Ok(()) } + +/// Persist cancel intent and ensure an orphaned run gets a fresh supervisor. +pub(crate) fn request_local_run_cancel(store: &Store, run_id: &str) -> Result<()> { + let lock_path = crate::store::log_path(run_id).with_extension("cancel.lock"); + request_local_run_cancel_with(store, run_id, &lock_path, || {}, spawn_detached_supervise) +} + +fn request_local_run_cancel_with( + store: &Store, + run_id: &str, + lock_path: &std::path::Path, + before_lock: impl FnOnce(), + spawn: impl FnOnce(&str) -> Result<()>, +) -> Result<()> { + let lock_file = std::fs::OpenOptions::new() + .create(true) + .truncate(false) + .write(true) + .open(lock_path)?; + let mut cancel_lock = fd_lock::RwLock::new(lock_file); + before_lock(); + let _cancel_guard = cancel_lock.write()?; + let prior = store + .get_run(run_id)? + .ok_or_else(|| anyhow!("Run {run_id} not found in the local store."))? + .cancel_requested; + store.set_cancel_requested(run_id, true)?; + if let Err(spawn_err) = spawn(run_id) { + if let Err(rollback_err) = store.set_cancel_requested(run_id, prior) { + return Err(anyhow!( + "Could not recover the supervisor: {spawn_err}; could not restore retryable cancel state: {rollback_err}" + )); + } + return Err(spawn_err); + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::store::StoredRun; + + fn run_fixture() -> StoredRun { + StoredRun { + id: "run-1".into(), + experiment_id: "experiment-1".into(), + project_id: "project-1".into(), + status: "running".into(), + backend_json: "{}".into(), + command: String::new(), + created_at: 1, + updated_at: 1, + ended_at: None, + exit_code: None, + commit_sha: None, + result_markdown: None, + cancel_requested: false, + supervisor_heartbeat_ms: None, + kind: "job".into(), + metrics_json: None, + verdict: None, + verdict_notes: None, + verdict_at: None, + chat_session_id: None, + } + } + + #[test] + fn failed_supervisor_spawn_restores_cancel_retry() { + let dir = + std::env::temp_dir().join(format!("orx-cancel-spawn-test-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + let run = run_fixture(); + store.upsert_run(&run).unwrap(); + let lock_path = dir.join("cancel.lock"); + + let result = request_local_run_cancel_with( + &store, + &run.id, + &lock_path, + || {}, + |_| Err(anyhow!("synthetic spawn failure")), + ); + assert!(result.is_err()); + assert!(!store.get_run(&run.id).unwrap().unwrap().cancel_requested); + + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn concurrent_spawn_failure_preserves_successful_cancel_intent() { + let dir = std::env::temp_dir().join(format!( + "orx-cancel-concurrency-test-{}", + uuid::Uuid::new_v4() + )); + let store = Store::open_at(dir.clone()).unwrap(); + let run = run_fixture(); + store.upsert_run(&run).unwrap(); + drop(store); + let lock_path = dir.join("cancel.lock"); + let (entered_tx, entered_rx) = std::sync::mpsc::channel(); + let (release_tx, release_rx) = std::sync::mpsc::channel(); + let (attempted_tx, attempted_rx) = std::sync::mpsc::channel(); + let (completed_tx, completed_rx) = std::sync::mpsc::channel(); + + let first_dir = dir.clone(); + let first_lock = lock_path.clone(); + let first = std::thread::spawn(move || { + let store = Store::open_at(first_dir).unwrap(); + request_local_run_cancel_with( + &store, + "run-1", + &first_lock, + || {}, + |_| { + entered_tx.send(()).unwrap(); + release_rx.recv().unwrap(); + Err(anyhow!("synthetic spawn failure")) + }, + ) + .unwrap_err(); + }); + entered_rx.recv().unwrap(); + + let second_dir = dir.clone(); + let second_lock = lock_path.clone(); + let second = std::thread::spawn(move || { + let store = Store::open_at(second_dir).unwrap(); + request_local_run_cancel_with( + &store, + "run-1", + &second_lock, + || attempted_tx.send(()).unwrap(), + |_| Ok(()), + ) + .unwrap(); + completed_tx.send(()).unwrap(); + }); + attempted_rx.recv().unwrap(); + let completed_while_locked = completed_rx + .recv_timeout(std::time::Duration::from_millis(250)) + .is_ok(); + release_tx.send(()).unwrap(); + first.join().unwrap(); + second.join().unwrap(); + + let store = Store::open_at(dir.clone()).unwrap(); + assert!(!completed_while_locked); + assert!(store.get_run("run-1").unwrap().unwrap().cancel_requested); + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } +} diff --git a/src/commands/supervise.rs b/src/commands/supervise.rs index 6477e49ca..00ef66557 100644 --- a/src/commands/supervise.rs +++ b/src/commands/supervise.rs @@ -37,13 +37,35 @@ const POLL_INTERVAL: Duration = Duration::from_secs(5); /// How long a silent log stream is held before re-checking job state. const LOG_IDLE: Duration = Duration::from_secs(30); +fn open_supervisor_lock(path: &std::path::Path) -> Result> { + let file = std::fs::OpenOptions::new() + .create(true) + .truncate(false) + .write(true) + .open(path)?; + Ok(fd_lock::RwLock::new(file)) +} + pub async fn run(args: crate::SuperviseArgs) -> Result<()> { let run_id = args.run_id; let store = Store::open()?; + let lock_path = log_path(&run_id).with_extension("supervisor.lock"); + let mut supervisor_lock = open_supervisor_lock(&lock_path)?; + let _supervisor_guard = match supervisor_lock.try_write() { + Ok(guard) => guard, + Err(err) if err.kind() == std::io::ErrorKind::WouldBlock => return Ok(()), + Err(err) => return Err(err.into()), + }; let stored = store .get_run(&run_id)? .ok_or_else(|| anyhow!("Run {} not found in the local store.", run_id))?; + // A run that already reached a terminal status has nothing left to + // supervise — bail before spawning the heartbeat below, so a respawned + // supervisor for a finished run exits instead of idling forever. + if crate::local::is_terminal(&stored.status) { + return Ok(()); + } // Watcher heartbeat: the Instances page reads its freshness to tell a // live watcher from one lost to a reboot or kill. One task here covers // every backend; it stops with the process, which is exactly the signal @@ -125,7 +147,7 @@ pub async fn run(args: crate::SuperviseArgs) -> Result<()> { } }; let stage = job.status.stage.as_str(); - let status = stage_to_run_status(stage).to_string(); + let status = run_status_for_stage(&store, &run_id, creds.is_none(), cancel_sent, stage); // Terminal: let the tail drain the stream's remainder, then persist // everything BEFORE reporting the final status, so the moment the UI @@ -224,6 +246,33 @@ fn local_cancel_requested(store: &Store, run_id: &str) -> bool { .unwrap_or(false) } +fn should_report_cancelled( + store: &Store, + run_id: &str, + local_mode: bool, + cancel_sent: bool, +) -> bool { + cancel_sent || (local_mode && local_cancel_requested(store, run_id)) +} + +fn run_status_for_stage( + store: &Store, + run_id: &str, + local_mode: bool, + cancel_sent: bool, + stage: &str, +) -> String { + let status = stage_to_run_status(stage); + if status != "done" + && is_terminal_stage(stage) + && should_report_cancelled(store, run_id, local_mode, cancel_sent) + { + "cancelled".to_string() + } else { + status.to_string() + } +} + /// PATCH the mirror; returns the server's cancel intent. Best-effort. async fn mirror_status( creds: &Credentials, @@ -356,7 +405,7 @@ async fn run_k8s( } }; let stage = job.stage.as_str(); - let status = stage_to_run_status(stage).to_string(); + let status = run_status_for_stage(&store, &run_id, creds.is_none(), cancel_sent, stage); if is_terminal_stage(stage) { store.update_status(&run_id, &status, Some(now_ms()), None)?; @@ -556,11 +605,7 @@ async fn run_modal( let stage = job.stage.as_str(); // A terminated sandbox reports a non-zero exit; if we asked for the // cancel, that terminal state is a cancellation, not a failure. - let status = if cancel_sent && is_terminal_stage(stage) { - "cancelled".to_string() - } else { - stage_to_run_status(stage).to_string() - }; + let status = run_status_for_stage(&store, &run_id, creds.is_none(), cancel_sent, stage); if is_terminal_stage(stage) { store.update_status(&run_id, &status, Some(now_ms()), None)?; @@ -741,11 +786,7 @@ async fn watch_ssh_job( } }; let stage = job.stage.as_str(); - let status = if cancel_sent && is_terminal_stage(stage) { - "cancelled".to_string() - } else { - stage_to_run_status(stage).to_string() - }; + let status = run_status_for_stage(store, run_id, creds.is_none(), cancel_sent, stage); if is_terminal_stage(stage) { store.update_status(run_id, &status, Some(now_ms()), None)?; @@ -877,7 +918,7 @@ async fn cancel_ssh(target: &ssh::SshTarget, dir: &str, run_id: &str, cancel_sen // comes from the platform, so the supervisor first waits for it to come online // (recording the SSH endpoint on the descriptor for restarts), launches the // payload over ssh, runs the shared watch loop, and deletes the box at the -// end. EVERY exit path tears the box down — a leaked box bills the org. +// end. Provisioning cleanup stays API-owned; post-readiness exits tear down here. async fn run_openresearch( store: Store, @@ -932,6 +973,13 @@ async fn run_openresearch( teardown_box(&store, &lifecycle, &sandbox_id, &run_id).await; return Ok(()); } + Ok(openresearch::WaitOutcome::Failed(reason)) + | Ok(openresearch::WaitOutcome::TimedOut(reason)) => { + store.update_status(&run_id, "failed", Some(now_ms()), None)?; + store + .set_result_markdown(&run_id, &format!("Provisioning failed: {reason}"))?; + return Ok(()); + } Err(err) => { store.update_status(&run_id, "failed", Some(now_ms()), None)?; store.set_result_markdown(&run_id, &format!("Provisioning failed: {err}"))?; @@ -1164,11 +1212,7 @@ async fn run_local( loop { let job = localbox::inspect_job(&dir); let stage = job.stage.as_str(); - let status = if cancel_sent && is_terminal_stage(stage) { - "cancelled".to_string() - } else { - stage_to_run_status(stage).to_string() - }; + let status = run_status_for_stage(&store, &run_id, creds.is_none(), cancel_sent, stage); if is_terminal_stage(stage) { store.update_status(&run_id, &status, Some(now_ms()), None)?; @@ -1336,11 +1380,7 @@ async fn run_slurm( gone_polls = 0; } let stage = job.stage.as_str(); - let status = if cancel_sent && is_terminal_stage(stage) { - "cancelled".to_string() - } else { - stage_to_run_status(stage).to_string() - }; + let status = run_status_for_stage(&store, &run_id, creds.is_none(), cancel_sent, stage); if is_terminal_stage(stage) { store.update_status(&run_id, &status, Some(now_ms()), None)?; @@ -1486,11 +1526,7 @@ async fn run_ray( gone_polls = 0; } let stage = job.stage.as_str(); - let status = if cancel_sent && is_terminal_stage(stage) { - "cancelled".to_string() - } else { - stage_to_run_status(stage).to_string() - }; + let status = run_status_for_stage(&store, &run_id, creds.is_none(), cancel_sent, stage); if is_terminal_stage(stage) { store.update_status(&run_id, &status, Some(now_ms()), None)?; @@ -1648,3 +1684,83 @@ async fn cancel_ray(address: &str, submission_id: &str, run_id: &str, cancel_sen Err(err) => eprintln!("supervise {run_id}: ray stop failed (will retry): {err}"), } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::store::StoredRun; + + #[test] + fn recovered_cancel_intent_only_overrides_failed_terminal_state() { + let dir = std::env::temp_dir().join(format!( + "orx-supervise-cancel-test-{}", + uuid::Uuid::new_v4() + )); + let store = Store::open_at(dir.clone()).unwrap(); + let run = StoredRun { + id: "run-1".into(), + experiment_id: "experiment-1".into(), + project_id: "project-1".into(), + status: "running".into(), + backend_json: "{}".into(), + command: String::new(), + created_at: 1, + updated_at: 1, + ended_at: None, + exit_code: None, + commit_sha: None, + result_markdown: None, + cancel_requested: false, + supervisor_heartbeat_ms: None, + kind: "job".into(), + metrics_json: None, + verdict: None, + verdict_notes: None, + verdict_at: None, + chat_session_id: None, + }; + store.upsert_run(&run).unwrap(); + + assert_eq!( + run_status_for_stage(&store, &run.id, true, false, "ERROR"), + "failed" + ); + store.set_cancel_requested(&run.id, true).unwrap(); + assert_eq!( + run_status_for_stage(&store, &run.id, true, false, "ERROR"), + "cancelled" + ); + assert_eq!( + run_status_for_stage(&store, &run.id, true, false, "COMPLETED"), + "done" + ); + assert_eq!( + run_status_for_stage(&store, &run.id, false, false, "ERROR"), + "failed" + ); + + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn only_one_supervisor_owns_a_run_lock() { + let dir = + std::env::temp_dir().join(format!("orx-supervisor-lock-test-{}", uuid::Uuid::new_v4())); + std::fs::create_dir_all(&dir).unwrap(); + let path = dir.join("run.lock"); + let mut first = open_supervisor_lock(&path).unwrap(); + let mut second = open_supervisor_lock(&path).unwrap(); + let first_guard = first.try_write().unwrap(); + + match second.try_write() { + Err(err) => assert_eq!(err.kind(), std::io::ErrorKind::WouldBlock), + Ok(_) => panic!("a second supervisor acquired the same run lock"), + } + + drop(first_guard); + drop(first); + drop(second); + std::fs::remove_dir_all(dir).unwrap(); + } +} diff --git a/src/commands/up.rs b/src/commands/up.rs index cc5a534f1..0006ba0ea 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -50,7 +50,16 @@ pub async fn run(args: UpArgs) -> Result<()> { .await .map_err(|e| anyhow!("Could not bind {}:{}: {}", host, port, e))?; // Open early so the schema exists before any request or agent spawn. - Store::open()?; + { + let store = Store::open()?; + for run in store.list_active_runs()? { + if store.get_local_experiment(&run.experiment_id)?.is_some() { + if let Err(err) = crate::commands::exp::spawn_detached_supervise(&run.id) { + eprintln!("could not recover supervisor for run {}: {err}", run.id); + } + } + } + } // Harnesses spawn lazily on the first message to one of their sessions; // no eager agent bring-up. (--no-agent is now a no-op kept for compat.) @@ -318,6 +327,7 @@ fn router(state: AppState) -> Router { .route("/api/health", get(health)) .route("/api/projects", get(list_projects).post(create_project)) .route("/api/local-repo", get(local_repo)) + .route("/api/project-path/pick", post(pick_project_folder)) .route( "/api/projects/{id}", get(get_project) @@ -364,6 +374,7 @@ fn router(state: AppState) -> Router { .route("/api/experiments/{id}/verdict", post(set_exp_verdict)) .route("/api/runs/{id}/log", get(run_log)) .route("/api/runs/{id}/diff", get(run_diff)) + .route("/api/experiments/{id}/diff", get(experiment_diff)) .route("/api/experiments/{id}/commits", get(experiment_commits)) .route( "/api/experiments/{id}/commits/{sha}/diff", @@ -450,6 +461,14 @@ fn router(state: AppState) -> Router { .route("/api/skills", get(list_skills)) .route("/api/personas", get(list_personas)) .route("/api/github/repos", get(list_github_repos)) + .route( + "/api/user-skills", + get(list_user_skills) + .post(upload_user_skill) + .delete(delete_user_skill), + ) + .route("/api/user-skills/import", post(import_user_skill)) + .route("/api/harness-skills", get(list_harness_skills)) .route( "/api/chat/sessions", get(list_chat_sessions).post(create_chat_session), @@ -462,6 +481,10 @@ fn router(state: AppState) -> Router { .route("/api/chat/sessions/{id}/worktree", get(session_worktree)) .route("/api/chat/sessions/{id}/message", post(send_chat_message)) .route("/api/chat/sessions/{id}/interrupt", post(interrupt_chat)) + .route( + "/api/chat/sessions/{id}/queue/{itemId}", + axum::routing::delete(cancel_queued_chat), + ) .route("/api/chat/sessions/{id}/respond", post(respond_chat)) // Internal: the `orx mcp-gate` permission bridge's long-poll (plan // mode). Token-authenticated in the handler; blocks until the surfaced @@ -508,7 +531,7 @@ type ApiResult = std::result::Result, ApiError>; // --- wire types ----------------------------------------------------------- /// The Run entity the API serves: StoredRun with `backend_json` parsed into an -/// object and internal fields (cancel intent) dropped. +/// object and cancellation intent exposed for pending UI state. #[derive(Serialize)] #[serde(rename_all = "camelCase")] struct ApiRun { @@ -547,6 +570,9 @@ struct ApiRun { verdict_notes: Option, #[serde(skip_serializing_if = "Option::is_none")] verdict_at: Option, + /// Local-mode cancel intent, so the UI can show a pending-cancel state + /// between the request and the supervisor actually stopping the run. + cancel_requested: bool, } /// A watcher heartbeat this old means the supervisor is gone (it stamps every @@ -589,6 +615,7 @@ impl From<&StoredRun> for ApiRun { verdict: run.verdict.clone(), verdict_notes: run.verdict_notes.clone(), verdict_at: run.verdict_at, + cancel_requested: run.cancel_requested, } } } @@ -599,18 +626,44 @@ async fn health() -> Json { Json(json!({ "ok": true, "version": env!("CARGO_PKG_VERSION") })) } -/// Slash-skills the composer's `/` dropdown offers (expanded server-side). -async fn list_skills() -> Json { - let skills: Vec = crate::local::skills::CATALOG +#[derive(Deserialize)] +struct SkillsQ { + /// Include the project's own uploaded skills (plus globals) in the menu. + project: Option, +} + +/// Slash-skills the composer's `/` dropdown offers (expanded server-side): the +/// built-in catalog plus any user-uploaded skills that apply (globals, and the +/// named project's own). +async fn list_skills(Query(q): Query) -> Json { + let mut skills: Vec = crate::local::skills::CATALOG .iter() .map(|s| { json!({ "name": s.name, "description": s.description, "argHint": s.arg_hint, + "source": "builtin", }) }) .collect(); + // One `/name` per skill: a project skill shadows a same-named global + // (list_for_project returns globals first, then the project's own). + let mut user: Vec = Vec::new(); + for s in crate::local::user_skills::list_for_project(q.project.as_deref()) { + match user.iter_mut().find(|e| e.name == s.name) { + Some(existing) => *existing = s, + None => user.push(s), + } + } + for s in user { + skills.push(json!({ + "name": s.name, + "description": s.description, + "argHint": "", + "source": "user", + })); + } Json(json!({ "skills": skills })) } @@ -635,6 +688,144 @@ async fn list_project_branches(Path(id): Path) -> ApiResult { Ok(Json(json!({ "branches": branches, "baseline": baseline }))) } +// --- user-uploaded skills ----------------------------------------------------- + +fn parse_scope(scope: &str) -> std::result::Result { + match scope { + "global" => Ok(crate::local::user_skills::Scope::Global), + "project" => Ok(crate::local::user_skills::Scope::Project), + other => Err(bad_request(format!("unknown scope `{other}`"))), + } +} + +fn user_skill_json(s: &crate::local::user_skills::UserSkill) -> Value { + json!({ + "name": s.name, + "description": s.description, + "scope": s.scope, + "bytes": s.bytes, + "updatedAt": s.updated_at, + }) +} + +/// Resolve the target scope and validate the project exists for project scope. +fn resolve_skill_scope( + scope: crate::local::user_skills::Scope, + project_id: Option<&str>, +) -> std::result::Result, ApiError> { + match scope { + crate::local::user_skills::Scope::Global => Ok(None), + crate::local::user_skills::Scope::Project => { + let id = project_id + .filter(|s| !s.is_empty()) + .ok_or_else(|| bad_request("project scope requires a projectId"))?; + Store::open()? + .get_local_project(id)? + .ok_or_else(|| not_found("project"))?; + Ok(Some(id.to_string())) + } + } +} + +#[derive(Deserialize)] +struct UserSkillsListQ { + project: Option, +} + +/// Both scopes for the Skills tab: globals plus the project's own. +async fn list_user_skills(Query(q): Query) -> ApiResult { + let skills: Vec = crate::local::user_skills::list_for_project(q.project.as_deref()) + .iter() + .map(user_skill_json) + .collect(); + Ok(Json(json!({ "skills": skills }))) +} + +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct UploadSkillReq { + scope: String, + project_id: Option, + /// Original upload filename — its extension picks `.zip` vs single file. + filename: String, + /// The file bytes, base64 (same convention as chat attachments). + content_base64: String, +} + +async fn upload_user_skill(Json(req): Json) -> ApiResult { + let scope = parse_scope(&req.scope)?; + let project = resolve_skill_scope(scope, req.project_id.as_deref())?; + let bytes = base64::engine::general_purpose::STANDARD + .decode(req.content_base64.trim()) + .map_err(|e| bad_request(format!("invalid file data: {e}")))?; + + let lower = req.filename.to_ascii_lowercase(); + let saved = if lower.ends_with(".zip") { + crate::local::user_skills::save_zip(&bytes, scope, project.as_deref()) + } else if lower.ends_with(".md") || lower.ends_with(".markdown") { + crate::local::user_skills::save_skill_md(&bytes, scope, project.as_deref()) + } else { + return Err(bad_request( + "upload a SKILL.md file or a .zip of a skill folder", + )); + } + .map_err(bad_request)?; + + Ok(Json(json!({ "skill": user_skill_json(&saved) }))) +} + +#[derive(Deserialize)] +struct DeleteSkillQ { + scope: String, + name: String, + project: Option, +} + +async fn delete_user_skill(Query(q): Query) -> ApiResult { + let scope = parse_scope(&q.scope)?; + let project = resolve_skill_scope(scope, q.project.as_deref())?; + crate::local::user_skills::delete(&q.name, scope, project.as_deref()).map_err(bad_request)?; + Ok(Json(json!({ "ok": true }))) +} + +/// Skills already installed in the user's coding agents, offered for import. +async fn list_harness_skills() -> ApiResult { + let skills: Vec = crate::local::user_skills::list_harness_skills() + .iter() + .map(|s| { + json!({ + "harnessId": s.harness_id, + "harnessName": s.harness_name, + "name": s.name, + "description": s.description, + }) + }) + .collect(); + Ok(Json(json!({ "skills": skills }))) +} + +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct ImportSkillReq { + harness: String, + name: String, + scope: String, + project_id: Option, +} + +async fn import_user_skill(Json(req): Json) -> ApiResult { + let scope = parse_scope(&req.scope)?; + let project = resolve_skill_scope(scope, req.project_id.as_deref())?; + let saved = crate::local::user_skills::import_from_harness( + &req.harness, + &req.name, + scope, + project.as_deref(), + ) + .map_err(bad_request)?; + Ok(Json(json!({ "skill": user_skill_json(&saved) }))) +} + /// The signed-in user's GitHub repos (most recently pushed first) for the /// New Project repo autocomplete. Empty when no token is configured. async fn list_github_repos() -> ApiResult { @@ -779,6 +970,19 @@ async fn local_repo(Query(q): Query) -> ApiResult { )) } +/// Open the OS folder chooser and report what the user picked (`null` if they +/// cancelled). Only meaningful when the dashboard is on the same machine as the +/// browser — which is the normal case, since it binds loopback. +async fn pick_project_folder() -> ApiResult { + let picked = tokio::task::spawn_blocking(crate::folder_picker::pick_folder) + .await + .map_err(|error| anyhow!("folder picker task failed: {error}"))? + .map_err(bad_request)?; + Ok(Json(json!({ + "path": picked.map(|path| path.to_string_lossy().into_owned()), + }))) +} + /// Create a GitHub repo for a local checkout that has none, push its history, /// and set the checkout's `origin` to it. /// @@ -1092,8 +1296,18 @@ async fn delete_project(State(state): State, Path(id): Path) - .filter(|r| !is_terminal(&r.status)) .collect(); if !in_flight.is_empty() { + let mut failures = Vec::new(); for run in &in_flight { - let _ = store.set_cancel_requested(&run.id, true); + if let Err(err) = crate::commands::exp::request_local_run_cancel(&store, &run.id) { + failures.push(format!("{}: {err}", run.id)); + } + } + if !failures.is_empty() { + let requested = in_flight.len() - failures.len(); + return Err(bad_request(format!( + "{requested} run(s) cancellation requested; cancellation failed for {}", + failures.join(", ") + ))); } return Err(bad_request(format!( "{} run(s) still in flight — cancellation requested; retry once they stop", @@ -1113,6 +1327,7 @@ async fn delete_project(State(state): State, Path(id): Path) - ); } for session in &sessions { + state.chat.clear_queue(&session.id); let _ = state.chat.interrupt(&session.id).await; state.chat.opencode.kill_session(&session.id).await; state.chat.codex.kill_session(&session.id).await; @@ -1387,7 +1602,9 @@ async fn cancel_run(Path(id): Path) -> ApiResult { store.update_status(&run.id, "cancelled", Some(now_ms()), None)?; return Ok(Json(json!({ "ok": true }))); } - store.set_cancel_requested(&run.id, true)?; + // Persists the intent AND respawns a supervisor the run may have lost, so a + // cancel on an orphaned run isn't recorded against nobody. + crate::commands::exp::request_local_run_cancel(&store, &run.id)?; Ok(Json(json!({ "ok": true }))) } @@ -2001,6 +2218,36 @@ async fn run_diff(Path(id): Path) -> ApiResult { .await } +/// Cumulative committed diff of an experiment branch vs its parent branch. +async fn experiment_diff(Path(id): Path) -> ApiResult { + blocking_api(move || { + let store = Store::open()?; + let exp = store + .get_local_experiment(&id)? + .ok_or_else(|| not_found("experiment"))?; + let Some(parent_id) = &exp.parent_experiment_id else { + return Ok(Json(diff_json(local::git::DiffPayload { + diff: String::new(), + truncated: false, + bytes_read: 0, + }))); + }; + let parent = store + .get_local_experiment(parent_id)? + .ok_or_else(|| not_found("parent experiment"))?; + let project = store + .get_local_project(&exp.project_id)? + .ok_or_else(|| not_found("project"))?; + let repo = std::path::Path::new(&project.repo_path); + Ok(Json(diff_json(local::git::diff_range( + repo, + &parent.branch_name, + &exp.branch_name, + )?))) + }) + .await +} + /// Commits on the experiment branch: child experiments list `parent..branch`, /// the baseline lists the branch's recent history. async fn experiment_commits(Path(id): Path) -> ApiResult { @@ -4581,12 +4828,15 @@ async fn update_chat_session( )) } -async fn chat_messages(Path(id): Path) -> ApiResult { +async fn chat_messages(State(state): State, Path(id): Path) -> ApiResult { Store::open()? .get_chat_session(&id)? .ok_or_else(|| not_found("chat session"))?; let messages = local::chat::list_messages(&id)?; - Ok(Json(json!({ "messages": messages }))) + // Parked messages are in-memory, so a reload mid-turn recovers them here + // rather than from the store. + let queued = state.chat.queued_items(&id); + Ok(Json(json!({ "messages": messages, "queued": queued }))) } #[derive(Deserialize)] @@ -4658,6 +4908,15 @@ async fn interrupt_chat(State(state): State, Path(id): Path) - Ok(Json(json!({ "ok": true }))) } +/// Cancel one message parked behind a running turn (the ✕ on a queued chip). +async fn cancel_queued_chat( + State(state): State, + Path((id, item_id)): Path<(String, String)>, +) -> ApiResult { + let removed = state.chat.cancel_queued(&id, &item_id); + Ok(Json(json!({ "ok": true, "removed": removed }))) +} + #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct RespondReq { @@ -5053,6 +5312,35 @@ async fn play_referer_asset(headers: &axum::http::HeaderMap, path: &str) -> Opti mod tests { use super::*; + #[test] + fn api_run_exposes_cancel_intent() { + let run = StoredRun { + id: "run-1".into(), + experiment_id: "experiment-1".into(), + project_id: "project-1".into(), + status: "running".into(), + backend_json: "{}".into(), + command: String::new(), + created_at: 1, + updated_at: 2, + ended_at: None, + exit_code: None, + commit_sha: None, + result_markdown: None, + cancel_requested: true, + supervisor_heartbeat_ms: None, + kind: "job".into(), + metrics_json: None, + verdict: None, + verdict_notes: None, + verdict_at: None, + chat_session_id: None, + }; + + let value = serde_json::to_value(ApiRun::from(&run)).unwrap(); + assert_eq!(value["cancelRequested"], true); + } + fn no_key(path: Option<&str>) -> SshReadiness { SshReadiness::NoUsableKey { pub_path: path.map(str::to_string), diff --git a/src/folder_picker.rs b/src/folder_picker.rs new file mode 100644 index 000000000..8bcd47f46 --- /dev/null +++ b/src/folder_picker.rs @@ -0,0 +1,86 @@ +//! Native folder selection for the loopback dashboard. + +use std::path::PathBuf; +use std::process::Command; + +use crate::error::{anyhow, Result}; + +#[cfg(target_os = "macos")] +pub fn pick_folder() -> Result> { + let output = Command::new("osascript") + .args([ + "-e", + "POSIX path of (choose folder with prompt \"Choose a project folder\")", + ]) + .output() + .map_err(|error| anyhow!("Could not open the folder picker: {error}"))?; + if output.status.success() { + let path = String::from_utf8_lossy(&output.stdout).trim().to_string(); + return Ok((!path.is_empty()).then(|| PathBuf::from(path))); + } + let stderr = String::from_utf8_lossy(&output.stderr); + if stderr.contains("-128") || stderr.to_ascii_lowercase().contains("user canceled") { + return Ok(None); + } + Err(anyhow!("The folder picker failed: {}", stderr.trim())) +} + +#[cfg(target_os = "windows")] +pub fn pick_folder() -> Result> { + let script = r#"Add-Type -AssemblyName System.Windows.Forms; $dialog = New-Object System.Windows.Forms.FolderBrowserDialog; $dialog.Description = 'Choose a project folder'; if ($dialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { Write-Output $dialog.SelectedPath }"#; + let output = Command::new("powershell.exe") + .args(["-NoProfile", "-Command", script]) + .output() + .map_err(|error| anyhow!("Could not open the folder picker: {error}"))?; + if !output.status.success() { + return Err(anyhow!( + "The folder picker failed: {}", + String::from_utf8_lossy(&output.stderr).trim() + )); + } + let path = String::from_utf8_lossy(&output.stdout).trim().to_string(); + Ok((!path.is_empty()).then(|| PathBuf::from(path))) +} + +#[cfg(not(any(target_os = "macos", target_os = "windows")))] +pub fn pick_folder() -> Result> { + for (program, args) in [ + ( + "zenity", + &[ + "--file-selection", + "--directory", + "--title=Choose a project folder", + ][..], + ), + ( + "kdialog", + &[ + "--getexistingdirectory", + ".", + "--title", + "Choose a project folder", + ][..], + ), + ] { + let output = match Command::new(program).args(args).output() { + Ok(output) => output, + Err(error) if error.kind() == std::io::ErrorKind::NotFound => continue, + Err(error) => return Err(anyhow!("Could not open the folder picker: {error}")), + }; + if output.status.success() { + let path = String::from_utf8_lossy(&output.stdout).trim().to_string(); + return Ok((!path.is_empty()).then(|| PathBuf::from(path))); + } + if output.status.code() == Some(1) { + return Ok(None); + } + return Err(anyhow!( + "The folder picker failed: {}", + String::from_utf8_lossy(&output.stderr).trim() + )); + } + Err(anyhow!( + "No native folder picker is available. Install zenity or kdialog, then try again." + )) +} diff --git a/src/jobs/localbox.rs b/src/jobs/localbox.rs index f98b304ac..1edf546f6 100644 --- a/src/jobs/localbox.rs +++ b/src/jobs/localbox.rs @@ -187,11 +187,16 @@ pub fn cancel_job(dir: &Path) -> Result<()> { .map(|s| s.success()) .unwrap_or(false); if !group { - let _ = std::process::Command::new("kill") + let process = std::process::Command::new("kill") .args(["-TERM", &pid]) .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) - .status(); + .status() + .map(|status| status.success()) + .unwrap_or(false); + if !process { + return Err(anyhow!("Could not terminate local process group {pid}")); + } } Ok(()) } diff --git a/src/jobs/openresearch.rs b/src/jobs/openresearch.rs index 7f1cf8df6..e07012b4d 100644 --- a/src/jobs/openresearch.rs +++ b/src/jobs/openresearch.rs @@ -14,10 +14,8 @@ use crate::client::{delete_sandbox, get_sandbox, Sandbox, SandboxTarget}; use crate::config::Credentials; use crate::error::{anyhow, Result}; -/// How long provisioning may take before the run is failed and the box -/// deleted. GPU boxes usually come online in single-digit minutes; a box -/// stuck longer is billing for nothing. -pub const PROVISION_DEADLINE: Duration = Duration::from_secs(15 * 60); +/// The API and CLI share the same five-minute provisioning deadline. +pub const PROVISION_DEADLINE: Duration = Duration::from_secs(5 * 60); const POLL_INTERVAL: Duration = Duration::from_secs(5); @@ -83,14 +81,36 @@ pub fn wrap_with_timeout(script: &str, timeout_secs: u64) -> String { pub enum WaitOutcome { /// The box is online with its SSH endpoint populated. Online(Box), + /// The API retained a terminal provisioning failure. + Failed(String), + /// The local wait ended; the API still owns failure recording and cleanup. + TimedOut(String), /// The caller's cancel check fired first; the box may still be booting. Cancelled, } +fn retained_failure_reason( + status: &str, + code: Option<&str>, + message: Option<&str>, +) -> Option { + (status == "failed").then(|| { + format!( + "{}: {}", + code.unwrap_or("provider_error"), + message.unwrap_or("The provider could not provision this instance.") + ) + }) +} + +fn is_not_found_error(message: &str) -> bool { + message.contains("(404 ") +} + /// Poll the box until it is online (SSH endpoint known), the deadline passes, /// or `cancel_check` fires. `offline`/`dead` mid-provision is a hard error — /// the box will never come up. Transient API errors are retried until the -/// deadline; the caller tears the box down on every non-`Online` outcome. +/// deadline. The API owns cleanup for failed and timed-out provisioning. pub async fn wait_online( creds: &Credentials, sandbox_id: &str, @@ -98,23 +118,21 @@ pub async fn wait_online( mut cancel_check: impl FnMut() -> bool, ) -> Result { let started = std::time::Instant::now(); - let mut last_err: Option = None; loop { if cancel_check() { return Ok(WaitOutcome::Cancelled); } - if started.elapsed() > deadline { - return Err(anyhow!( - "Box {sandbox_id} did not come online within {}m{}.", - deadline.as_secs() / 60, - last_err - .map(|e| format!(" (last API error: {e})")) - .unwrap_or_default() - )); - } - match get_sandbox(creds, sandbox_id).await { + let deadline_reached = started.elapsed() > deadline; + let last_err = match get_sandbox(creds, sandbox_id).await { Ok(envelope) => { let sandbox = envelope.sandbox; + if let Some(reason) = retained_failure_reason( + &sandbox.status, + sandbox.failure_code.as_deref(), + sandbox.failure_message.as_deref(), + ) { + return Ok(WaitOutcome::Failed(reason)); + } match sandbox.status.as_str() { "online" if sandbox.ssh_hostname.is_some() @@ -135,9 +153,23 @@ pub async fn wait_online( } _ => {} } - last_err = None; + None + } + Err(err) if is_not_found_error(&err.to_string()) => { + return Ok(WaitOutcome::Failed(format!( + "Box {sandbox_id} was not found; the server has no retained provisioning result." + ))); } - Err(err) => last_err = Some(err.to_string()), + Err(err) => Some(err.to_string()), + }; + if deadline_reached { + return Ok(WaitOutcome::TimedOut(format!( + "Box {sandbox_id} did not come online within {}m{}.", + deadline.as_secs() / 60, + last_err + .map(|e| format!(" (last API error: {e})")) + .unwrap_or_default() + ))); } tokio::time::sleep(POLL_INTERVAL).await; } @@ -268,4 +300,21 @@ mod tests { fn run_dir_matches_ssh_convention() { assert_eq!(run_dir("abc"), ".orx/runs/abc"); } + + #[test] + fn provisioning_deadline_is_five_minutes() { + assert_eq!(PROVISION_DEADLINE, Duration::from_secs(300)); + } + + #[test] + fn terminal_provisioning_results_are_classified() { + assert_eq!( + retained_failure_reason("failed", Some("capacity_unavailable"), Some("No capacity.")), + Some("capacity_unavailable: No capacity.".to_owned()) + ); + assert!(retained_failure_reason("provisioning", None, None).is_none()); + assert!(is_not_found_error( + "Request to /sandboxes/sb failed (404 Not Found)" + )); + } } diff --git a/src/local/chat/mod.rs b/src/local/chat/mod.rs index c352e7209..69c4cc5e9 100644 --- a/src/local/chat/mod.rs +++ b/src/local/chat/mod.rs @@ -8,7 +8,7 @@ //! normalized parts into the per-turn assistant message; every flush persists //! the message and broadcasts it as a `chat.message` SSE event. -use std::collections::{HashMap, HashSet}; +use std::collections::{HashMap, HashSet, VecDeque}; use std::sync::Arc; use std::time::{Duration, Instant}; @@ -295,8 +295,9 @@ impl WirePart { // --- image attachments --------------------------------------------------------- -/// Pasted image riding the send-message request. -#[derive(Debug, Deserialize)] +/// Pasted image riding the send-message request. `Clone` so a message parked in +/// the mid-run queue can carry its images through to the drained send. +#[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ImageAttachment { pub media_type: String, @@ -571,6 +572,31 @@ pub struct ChatHost { bridge_prompted: std::sync::Mutex>, /// The port `orx up` bound, for the bridge env contract. up_port: std::sync::OnceLock, + /// Messages the user sent while the session's turn was in flight, oldest + /// first. `drain_queue` runs the front one when a turn finishes naturally; + /// a user Stop clears the whole queue. In-memory and uncommitted — a queued + /// message only becomes a transcript bubble once it actually runs. + queued: std::sync::Mutex>>, +} + +/// A user message parked while the session was busy, replayed verbatim through +/// the normal send path once the running turn ends. +#[derive(Clone)] +struct QueuedMessage { + id: String, + text: String, + overrides: TurnOverrides, + images: Vec, +} + +/// Chip label for a parked message: its text, or an attachment count for an +/// image/file-only send (which carries no text to show). +fn queued_label(m: &QueuedMessage) -> String { + if !m.text.trim().is_empty() || m.images.is_empty() { + return m.text.clone(); + } + let n = m.images.len(); + format!("{n} attachment{}", if n == 1 { "" } else { "s" }) } /// Reserves a session's turn slot for the duration of `send_message`'s setup. @@ -665,6 +691,7 @@ impl ChatHost { gate_tokens: std::sync::Mutex::new(HashMap::new()), bridge_prompted: std::sync::Mutex::new(HashSet::new()), up_port: std::sync::OnceLock::new(), + queued: std::sync::Mutex::new(HashMap::new()), } } @@ -945,6 +972,128 @@ impl ChatHost { }) } + /// The session's parked messages, oldest first — for the reload snapshot. + pub fn queued_items(&self, session_id: &str) -> Vec { + self.queued + .lock() + .unwrap() + .get(session_id) + .map(|q| { + q.iter() + .map(|m| json!({ "id": m.id, "text": queued_label(m) })) + .collect() + }) + .unwrap_or_default() + } + + fn queued_json(&self, session_id: &str) -> Value { + json!({ "sessionId": session_id, "items": self.queued_items(session_id) }) + } + + fn emit_queued(&self, session_id: &str) { + self.emit("chat.queued", self.queued_json(session_id)); + } + + /// Drop every parked message for a session (user Stop / delete). Emits an + /// empty `chat.queued` only if there was something to clear. + pub fn clear_queue(&self, session_id: &str) { + let had = self + .queued + .lock() + .unwrap() + .remove(session_id) + .is_some_and(|q| !q.is_empty()); + if had { + self.emit_queued(session_id); + } + } + + /// Remove one parked message by id (the ✕ on a queued chip). + pub fn cancel_queued(&self, session_id: &str, item_id: &str) -> bool { + let removed = { + let mut map = self.queued.lock().unwrap(); + let Some(q) = map.get_mut(session_id) else { + return false; + }; + let before = q.len(); + q.retain(|m| m.id != item_id); + let removed = q.len() != before; + if q.is_empty() { + map.remove(session_id); + } + removed + }; + if removed { + self.emit_queued(session_id); + } + removed + } + + /// Drain the whole parked queue into a single turn once the current turn + /// finishes naturally — successive steering messages run together in one + /// turn, not a full turn each. Boxed return: `drain_queue` → + /// `send_message_showing` → (spawned) `drain_queue` is an async recursion + /// cycle the auto-`Send` solver can't close on its own, so we assert the + /// boxed future is `Send` to break it. + fn drain_queue<'a>( + self: &'a Arc, + session_id: &'a str, + ) -> std::pin::Pin + Send + 'a>> { + Box::pin(async move { + // Scope the guard: a std mutex must never be held across an await. + let items: Vec = { + let mut map = self.queued.lock().unwrap(); + match map.remove(session_id) { + Some(q) => q.into(), + None => return, + } + }; + if items.is_empty() { + return; + } + self.emit_queued(session_id); + // Coalesce every parked message into one turn: join their texts and + // concatenate their attachments; the most recent composer overrides win. + let text = items + .iter() + .map(|m| m.text.trim()) + .filter(|t| !t.is_empty()) + .collect::>() + .join("\n\n"); + let images: Vec = items + .iter() + .flat_map(|m| m.images.iter().cloned()) + .collect(); + let overrides = items + .last() + .map(|m| m.overrides.clone()) + .unwrap_or_default(); + if let Err(err) = self + .send_message_showing(session_id, text, None, overrides, images, false) + .await + { + // Re-park only for the genuine race: a fresh send claimed the + // slot in the gap after `finish_turn` freed it (session busy + // again), so restore the messages up front and let that turn + // drain them. Any other failure (a real setup error, or a session + // being deleted) has no turn to retry against — drop them rather + // than strand chips that re-fail on every future drain. + if self.is_busy(session_id).await { + { + let mut map = self.queued.lock().unwrap(); + let q = map.entry(session_id.to_string()).or_default(); + for item in items.into_iter().rev() { + q.push_front(item); + } + } + self.emit_queued(session_id); + } else { + eprintln!("orx up: dropped queued messages after send failure: {err}"); + } + } + }) + } + /// Persist the user message and run one harness turn in the background. pub async fn send_message( self: &Arc, @@ -953,7 +1102,7 @@ impl ChatHost { overrides: TurnOverrides, images: Vec, ) -> Result<()> { - self.send_message_showing(session_id, text, None, overrides, images) + self.send_message_showing(session_id, text, None, overrides, images, true) .await } @@ -972,6 +1121,7 @@ impl ChatHost { transcript_text: Option, overrides: TurnOverrides, images: Vec, + queue_if_busy: bool, ) -> Result<()> { // Atomically claim the session's turn slot: the busy-check and the // reservation happen under one lock so two concurrent sends (or a @@ -979,6 +1129,24 @@ impl ChatHost { // same session. `_guard` releases the reservation on any early error. let _guard = match TurnGuard::claim(self, session_id).await { Some(guard) => guard, + // Busy: park a genuine user send (Claude-desktop steering) so it + // runs when the turn ends, instead of rejecting it. System/resume + // sends pass `queue_if_busy = false` and keep the old rejection. + None if queue_if_busy && !(text.trim().is_empty() && images.is_empty()) => { + self.queued + .lock() + .unwrap() + .entry(session_id.to_string()) + .or_default() + .push_back(QueuedMessage { + id: format!("q_{}", uuid::Uuid::new_v4()), + text, + overrides, + images, + }); + self.emit_queued(session_id); + return Ok(()); + } None => return Err(anyhow!("session is busy — interrupt it first")), }; let store = Store::open()?; @@ -1098,7 +1266,11 @@ impl ChatHost { // Slash-skills: the transcript keeps the `/name` the user typed; the // harness gets the expanded prompt. - let mut turn_text = crate::local::skills::expand(&text).unwrap_or(text); + // Built-in skills first, then the user's uploaded ones — same `/name` + // syntax, so an upload can't shadow a bundled skill by accident. + let mut turn_text = crate::local::skills::expand(&text) + .or_else(|| crate::local::user_skills::expand(&text, &project.id)) + .unwrap_or(text); // Harnesses take plain text; pasted images ride as on-disk paths every // CLI can open with its own image-viewing tool. if !saved_images.is_empty() { @@ -1179,6 +1351,10 @@ impl ChatHost { } } ctx.host.finish_turn(&ctx.session_id).await; + // Natural completion only: a user Stop aborts this task before + // it reaches here (and clears the queue itself), so an + // interrupted turn never drains. + ctx.host.drain_queue(&ctx.session_id).await; }); turns.insert(sid, Some(task.abort_handle())); if let Some(seed) = title_seed { @@ -1269,6 +1445,9 @@ impl ChatHost { // still paint them in arrival order for a few ms; a reload converges // on the stored order.) let created_at = now_ms(); + // Stop means stop everything: drop any messages parked behind this turn + // so they don't fire the moment it aborts. + self.clear_queue(session_id); if !self.interrupt(session_id).await? { return Ok(()); } @@ -1386,8 +1565,15 @@ impl ChatHost { "plan" | "permission" => Some(req.note.clone().unwrap_or_default()), _ => None, }; - self.send_message_showing(&req.session_id, text, transcript, overrides, Vec::new()) - .await?; + self.send_message_showing( + &req.session_id, + text, + transcript, + overrides, + Vec::new(), + false, + ) + .await?; self.resolve_prompt_card(&req); Ok(()) } @@ -1528,6 +1714,7 @@ impl ChatHost { let _deleting = self .begin_session_delete(session_id) .ok_or_else(|| anyhow!("session deletion is already in progress"))?; + self.clear_queue(session_id); let _ = self.interrupt(session_id).await; // A live opencode serve child would keep running in (and lock) the // session's worktree; the resident claude child's cwd is that worktree @@ -1777,7 +1964,7 @@ impl ChatHost { /// Composer selections a single message can override, mirroring the sticky /// per-session settings. Empty/None fields leave the stored value in place. -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] pub struct TurnOverrides { pub model: Option, pub permission_mode: Option, diff --git a/src/local/harness/mod.rs b/src/local/harness/mod.rs index c5abc42cc..2295bb9e7 100644 --- a/src/local/harness/mod.rs +++ b/src/local/harness/mod.rs @@ -186,6 +186,14 @@ pub trait Harness: Send + Sync { self.config_home().map(|h| h.exists()).unwrap_or(false) } + /// The agent's global native-skills dir (`~/.claude/skills`, + /// `~/.agents/skills`, `/opencode/skills`) — where the user's own + /// installed skills live. Derived from the `skills/orx/SKILL.md` shim + /// target every installable harness shares. `None` if not installable. + fn global_skills_dir(&self) -> Option { + Some(self.skill_target()?.parent()?.parent()?.to_path_buf()) + } + // --- session-skills capability ---------------------------------------- /// The worktree-relative dir this harness discovers native `SKILL.md` skill diff --git a/src/local/mod.rs b/src/local/mod.rs index fd2bc9e1d..48ab0e659 100644 --- a/src/local/mod.rs +++ b/src/local/mod.rs @@ -43,6 +43,7 @@ pub mod slurm; pub mod ssh; pub mod ssh_identity; pub mod unirig; +pub mod user_skills; use crate::error::{anyhow, Error, Result}; use crate::store::{now_ms, Store, StoredRun}; diff --git a/src/local/opencode.rs b/src/local/opencode.rs index 9851c3cc7..eaf575423 100644 --- a/src/local/opencode.rs +++ b/src/local/opencode.rs @@ -388,6 +388,8 @@ pub fn ensure_playbook( // semantics) so this session's agent discovers them natively. if let Some(dir) = session_skills_dir { super::agent_skills::ensure_session_skills(&workdir, dir, project.persona())?; + // User-uploaded skills land beside the built-ins, same freshness. + super::user_skills::write_into_session(&workdir, dir, &project.id)?; } // One shared exclude covers every worktree. exclude_agent_files(&git::clone_path( diff --git a/src/local/user_skills.rs b/src/local/user_skills.rs new file mode 100644 index 000000000..994e8a2e7 --- /dev/null +++ b/src/local/user_skills.rs @@ -0,0 +1,1028 @@ +//! User-uploaded agent skills — the dashboard's Skills tab. +//! +//! Unlike the built-in `orx-*` modules in [`super::agent_skills`] (embedded in +//! the binary), these are authored by the user and stored on disk under the +//! data dir: +//! +//! * **Global** — `data_dir()/user-skills/global//` — every project. +//! * **Project** — `data_dir()/user-skills/projects///` — one +//! project only; shadows a global of the same name for that project. +//! +//! Each skill is a real skill folder (`SKILL.md` plus any supporting files), +//! written into every session worktree's skills dir alongside the built-ins +//! (see [`write_into_session`]) so the harness auto-discovers it, and surfaced +//! in the composer's `/` menu so the user can invoke it by name (see +//! [`expand`]). The `SKILL.md` frontmatter's `name:` is the canonical id — it +//! is the skill dir name and the `/name` the user types. + +use std::fs; +use std::path::{Path, PathBuf}; + +use serde::Serialize; + +use crate::error::{anyhow, Result}; +use crate::local::agent_skills::SkillSet; +use crate::local::harness::registry; + +/// Where an uploaded skill applies. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum Scope { + /// Available in every project's sessions. + Global, + /// Available only in one project's sessions. + Project, +} + +/// Reject pathological archives: a skill is a handful of small text files, not +/// a tarball. Caps guard the extract path against zip bombs (the composer also +/// caps the upload size client-side). +const MAX_FILES: usize = 500; +const MAX_TOTAL_BYTES: u64 = 20 * 1024 * 1024; +const MAX_NAME_LEN: usize = 64; +const MAX_DESCRIPTION_LEN: usize = 2048; + +/// One uploaded skill, as served to the UI. +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct UserSkill { + pub name: String, + pub description: String, + pub scope: Scope, + /// Total size of the skill folder on disk. + pub bytes: u64, + /// `SKILL.md` mtime in epoch millis (0 if unavailable). + pub updated_at: i64, +} + +// --- storage layout ----------------------------------------------------------- + +fn root() -> PathBuf { + crate::store::data_dir().join("user-skills") +} + +/// The directory holding a scope's skill folders under `root`. Validates +/// `project_id` so a crafted id can never escape the store root. +fn scope_dir(root: &Path, scope: Scope, project_id: Option<&str>) -> Result { + match scope { + Scope::Global => Ok(root.join("global")), + Scope::Project => { + let id = project_id.ok_or_else(|| anyhow!("project scope requires a project id"))?; + if !is_valid_project_id(id) { + return Err(anyhow!("invalid project id")); + } + Ok(root.join("projects").join(id)) + } + } +} + +fn is_valid_project_id(id: &str) -> bool { + !id.is_empty() + && id.len() <= 128 + && id + .chars() + .all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_') +} + +// --- frontmatter -------------------------------------------------------------- + +struct Frontmatter { + name: String, + description: String, +} + +/// Parse the `name:`/`description:` from a `SKILL.md` YAML frontmatter block. +/// Deliberately minimal (single-line scalars, quoted or bare) — the same shape +/// the built-in skills use and the shape Claude Code / Codex require. +fn parse_frontmatter(content: &str) -> Result { + let content = content.strip_prefix('\u{feff}').unwrap_or(content); + let after_open = content + .strip_prefix("---") + .and_then(|r| r.strip_prefix('\n').or_else(|| r.strip_prefix("\r\n"))) + .ok_or_else(|| anyhow!("SKILL.md must open with a `---` frontmatter block"))?; + let end = after_open + .find("\n---") + .ok_or_else(|| anyhow!("SKILL.md frontmatter is not closed with `---`"))?; + let block = &after_open[..end]; + + let mut name = None; + let mut description = None; + for line in block.lines() { + if let Some(v) = line.strip_prefix("name:") { + name = Some(parse_scalar(v.trim())); + } else if let Some(v) = line.strip_prefix("description:") { + description = Some(parse_scalar(v.trim())); + } + } + + let name = name + .filter(|s| !s.is_empty()) + .ok_or_else(|| anyhow!("SKILL.md frontmatter is missing a `name:` field"))?; + let description = description + .filter(|s| !s.is_empty()) + .ok_or_else(|| anyhow!("SKILL.md frontmatter is missing a `description:` field"))?; + if description.chars().count() > MAX_DESCRIPTION_LEN { + return Err(anyhow!("SKILL.md `description` is too long")); + } + Ok(Frontmatter { name, description }) +} + +/// Decode a single-line YAML scalar: JSON/double-quoted, single-quoted, or bare. +fn parse_scalar(v: &str) -> String { + if v.starts_with('"') { + if let Ok(s) = serde_json::from_str::(v) { + return s; + } + } + if v.len() >= 2 && v.starts_with('\'') && v.ends_with('\'') { + return v[1..v.len() - 1].replace("''", "'"); + } + v.to_string() +} + +// --- name validation ---------------------------------------------------------- + +/// Slug rule shared with the built-in skills: `^[a-z0-9]+(-[a-z0-9]+)*$`. This +/// is also what the harnesses require of a skill `name`. +fn is_valid_slug(name: &str) -> bool { + !name.is_empty() + && name.len() <= MAX_NAME_LEN + && name.split('-').all(|seg| { + !seg.is_empty() + && seg + .chars() + .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit()) + }) +} + +/// Names owned by the built-ins: the `orx-` namespace, any bundled agent skill +/// (bare or prefixed), and the composer's slash-skill catalog. Rejected so an +/// upload can never shadow or be shadowed by a built-in. +fn is_reserved(name: &str) -> bool { + name.starts_with("orx-") + || crate::local::agent_skills::find(name, SkillSet::Full).is_some() + || crate::local::agent_skills::find(name, SkillSet::Local).is_some() + || crate::local::skills::CATALOG.iter().any(|s| s.name == name) +} + +fn validate_name(name: &str) -> Result<()> { + if !is_valid_slug(name) { + return Err(anyhow!( + "skill name `{name}` must be lowercase letters, digits, and single hyphens" + )); + } + if is_reserved(name) { + return Err(anyhow!("`{name}` is reserved by a built-in skill")); + } + Ok(()) +} + +// --- save --------------------------------------------------------------------- + +/// Save a single-file `SKILL.md` upload. The name comes from its frontmatter. +pub fn save_skill_md(content: &[u8], scope: Scope, project_id: Option<&str>) -> Result { + save_skill_md_in(&root(), content, scope, project_id) +} + +fn save_skill_md_in( + root: &Path, + content: &[u8], + scope: Scope, + project_id: Option<&str>, +) -> Result { + let text = std::str::from_utf8(content).map_err(|_| anyhow!("SKILL.md must be UTF-8 text"))?; + let fm = parse_frontmatter(text)?; + validate_name(&fm.name)?; + write_skill( + root, + scope, + project_id, + &fm.name, + vec![("SKILL.md".to_string(), content.to_vec())], + ) +} + +/// Save a `.zip` of a skill folder. Locates the `SKILL.md` (root or a single +/// wrapping dir), rebases every sibling file beneath it, and writes the folder +/// verbatim. Rejects unsafe paths, oversized archives, and a missing/ambiguous +/// `SKILL.md`. +pub fn save_zip(bytes: &[u8], scope: Scope, project_id: Option<&str>) -> Result { + save_zip_in(&root(), bytes, scope, project_id) +} + +fn save_zip_in( + root: &Path, + bytes: &[u8], + scope: Scope, + project_id: Option<&str>, +) -> Result { + use std::io::{Cursor, Read}; + + let mut zip = zip::ZipArchive::new(Cursor::new(bytes)) + .map_err(|e| anyhow!("not a valid .zip archive: {e}"))?; + + let mut files: Vec<(String, Vec)> = Vec::new(); + let mut skill_md: Option = None; + let mut total: u64 = 0; + for i in 0..zip.len() { + let mut entry = zip + .by_index(i) + .map_err(|e| anyhow!("reading zip entry: {e}"))?; + if entry.is_dir() { + continue; + } + // `enclosed_name` returns None for absolute paths and `..` escapes. + let name = entry + .enclosed_name() + .ok_or_else(|| anyhow!("zip contains an unsafe path"))? + .to_string_lossy() + .replace('\\', "/"); + if name.starts_with("__MACOSX/") || basename(&name) == ".DS_Store" { + continue; + } + if files.len() >= MAX_FILES { + return Err(anyhow!("zip has too many files (max {MAX_FILES})")); + } + // Bound the read to the remaining budget so a deflate-bombed entry + // (whose declared size can't be trusted) can't balloon `buf`. + let mut buf = Vec::new(); + let room = MAX_TOTAL_BYTES.saturating_sub(total); + (&mut entry) + .take(room + 1) + .read_to_end(&mut buf) + .map_err(|e| anyhow!("reading zip entry {name}: {e}"))?; + total = total.saturating_add(buf.len() as u64); + if total > MAX_TOTAL_BYTES { + return Err(anyhow!("zip is too large once extracted")); + } + if basename(&name) == "SKILL.md" { + // Prefer the shallowest SKILL.md if several appear. + if skill_md + .as_deref() + .is_none_or(|existing| depth(&name) < depth(existing)) + { + skill_md = Some(name.clone()); + } + } + files.push((name, buf)); + } + + let skill_md = skill_md.ok_or_else(|| anyhow!("the .zip must contain a SKILL.md"))?; + let prefix = match skill_md.rsplit_once('/') { + Some((dir, _)) => format!("{dir}/"), + None => String::new(), + }; + + let md = files + .iter() + .find(|(n, _)| *n == skill_md) + .map(|(_, b)| b.clone()) + .unwrap_or_default(); + let text = std::str::from_utf8(&md).map_err(|_| anyhow!("SKILL.md must be UTF-8 text"))?; + let fm = parse_frontmatter(text)?; + validate_name(&fm.name)?; + + let mut rebased: Vec<(String, Vec)> = Vec::new(); + for (name, buf) in files { + let Some(rel) = name.strip_prefix(&prefix) else { + continue; // a stray file outside the skill folder — ignore + }; + if rel.is_empty() + || rel + .split('/') + .any(|seg| seg.is_empty() || seg == "." || seg == "..") + { + return Err(anyhow!("zip contains an unsafe path: {name}")); + } + rebased.push((rel.to_string(), buf)); + } + + write_skill(root, scope, project_id, &fm.name, rebased) +} + +fn write_skill( + root: &Path, + scope: Scope, + project_id: Option<&str>, + name: &str, + files: Vec<(String, Vec)>, +) -> Result { + if !files.iter().any(|(rel, _)| rel == "SKILL.md") { + return Err(anyhow!("skill folder must contain a SKILL.md at its root")); + } + let dir = scope_dir(root, scope, project_id)?.join(name); + // A re-upload fully replaces the prior version — no stale sibling files. + if dir.exists() { + fs::remove_dir_all(&dir).map_err(|e| anyhow!("could not replace skill: {e}"))?; + } + for (rel, buf) in &files { + let dest = dir.join(rel); + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent) + .map_err(|e| anyhow!("could not create {}: {e}", parent.display()))?; + } + fs::write(&dest, buf).map_err(|e| anyhow!("could not write {}: {e}", dest.display()))?; + } + read_skill_at(scope, &dir) +} + +// --- list / find / delete ----------------------------------------------------- + +fn read_skill_at(scope: Scope, dir: &Path) -> Result { + let md_path = dir.join("SKILL.md"); + let content = fs::read_to_string(&md_path) + .map_err(|e| anyhow!("could not read {}: {e}", md_path.display()))?; + let fm = parse_frontmatter(&content)?; + Ok(UserSkill { + name: fm.name, + description: fm.description, + scope, + bytes: dir_size(dir), + updated_at: mtime_ms(&md_path), + }) +} + +/// Skills in one scope, name-sorted. Unreadable/malformed folders are skipped +/// rather than failing the whole listing. +fn list_scope_in(root: &Path, scope: Scope, project_id: Option<&str>) -> Vec { + let Ok(base) = scope_dir(root, scope, project_id) else { + return Vec::new(); + }; + let Ok(entries) = fs::read_dir(&base) else { + return Vec::new(); + }; + let mut out: Vec = entries + .flatten() + .filter(|e| e.path().is_dir()) + .filter_map(|e| read_skill_at(scope, &e.path()).ok()) + .collect(); + out.sort_by(|a, b| a.name.cmp(&b.name)); + out +} + +/// Every skill that applies to a project's sessions: globals plus the project's +/// own. Both scopes are returned (the UI manages each separately); a project +/// skill and a global of the same name both appear. +pub fn list_for_project(project_id: Option<&str>) -> Vec { + let root = root(); + let mut out = list_scope_in(&root, Scope::Global, None); + if let Some(id) = project_id { + out.extend(list_scope_in(&root, Scope::Project, Some(id))); + } + out +} + +/// Resolve an applicable skill by name for `/`-invocation. Project scope wins +/// over global. +fn find_in(root: &Path, name: &str, project_id: Option<&str>) -> Option { + if let Some(id) = project_id { + if let Some(s) = list_scope_in(root, Scope::Project, Some(id)) + .into_iter() + .find(|s| s.name == name) + { + return Some(s); + } + } + list_scope_in(root, Scope::Global, None) + .into_iter() + .find(|s| s.name == name) +} + +pub fn delete(name: &str, scope: Scope, project_id: Option<&str>) -> Result<()> { + delete_in(&root(), name, scope, project_id) +} + +fn delete_in(root: &Path, name: &str, scope: Scope, project_id: Option<&str>) -> Result<()> { + if !is_valid_slug(name) { + return Err(anyhow!("invalid skill name")); + } + let dir = scope_dir(root, scope, project_id)?.join(name); + if !dir.exists() { + return Err(anyhow!("skill `{name}` not found")); + } + fs::remove_dir_all(&dir).map_err(|e| anyhow!("could not delete skill: {e}")) +} + +// --- import from a coding agent ----------------------------------------------- + +/// A skill already installed in a coding agent, offered for one-click import. +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct HarnessSkill { + pub harness_id: String, + pub harness_name: String, + pub name: String, + pub description: String, +} + +/// Every importable skill across installed harnesses (their global skill dirs), +/// minus the `orx` shim, the built-in namespace, and anything malformed or +/// name-reserved. Name-sorted within each harness. +pub fn list_harness_skills() -> Vec { + let mut out = Vec::new(); + for harness in registry() { + if !harness.is_installed_locally() { + continue; + } + let Some(dir) = harness.global_skills_dir() else { + continue; + }; + let Ok(entries) = fs::read_dir(&dir) else { + continue; // agent installed but no skills dir yet + }; + for entry in entries.flatten() { + let path = entry.path(); + if !path.is_dir() { + continue; + } + let dir_name = entry.file_name().to_string_lossy().into_owned(); + if dir_name == "orx" || dir_name.starts_with("orx-") { + continue; + } + let Ok(content) = fs::read_to_string(path.join("SKILL.md")) else { + continue; // not a skill dir + }; + let Ok(fm) = parse_frontmatter(&content) else { + continue; + }; + // Import keys off the frontmatter name (it becomes the store dir and + // the `/name`); skip skills whose name isn't a clean, free slug so + // the folder==name invariant always holds after import. + let name = fm.name; + if !is_valid_slug(&name) || is_reserved(&name) { + continue; + } + out.push(HarnessSkill { + harness_id: harness.id().to_string(), + harness_name: harness.name().to_string(), + name, + description: fm.description, + }); + } + } + out.sort_by(|a, b| { + (a.harness_name.as_str(), a.name.as_str()).cmp(&(b.harness_name.as_str(), b.name.as_str())) + }); + out +} + +/// Copy a named skill from an installed harness's global skills dir into the +/// store at `scope`, resources and all. +pub fn import_from_harness( + harness_id: &str, + name: &str, + scope: Scope, + project_id: Option<&str>, +) -> Result { + import_from_harness_in(&root(), harness_id, name, scope, project_id) +} + +fn import_from_harness_in( + root: &Path, + harness_id: &str, + name: &str, + scope: Scope, + project_id: Option<&str>, +) -> Result { + validate_name(name)?; + let harness = registry() + .into_iter() + .find(|h| h.id() == harness_id) + .ok_or_else(|| anyhow!("unknown harness `{harness_id}`"))?; + let skills_dir = harness + .global_skills_dir() + .ok_or_else(|| anyhow!("{} has no skills directory", harness.name()))?; + let src = locate_harness_skill(&skills_dir, name)?; + let files = collect_files(&src, &src)?; + write_skill(root, scope, project_id, name, files) +} + +/// The skill folder in `skills_dir` whose `SKILL.md` frontmatter name matches +/// `name` — the same key `list_harness_skills` surfaces, so the folder stored on +/// import always equals its frontmatter name. +fn locate_harness_skill(skills_dir: &Path, name: &str) -> Result { + let entries = fs::read_dir(skills_dir) + .map_err(|e| anyhow!("could not read {}: {e}", skills_dir.display()))?; + for entry in entries.flatten() { + let path = entry.path(); + if !path.is_dir() { + continue; + } + let Ok(content) = fs::read_to_string(path.join("SKILL.md")) else { + continue; + }; + let Ok(fm) = parse_frontmatter(&content) else { + continue; + }; + if fm.name == name { + return Ok(path); + } + } + Err(anyhow!("skill `{name}` not found in the harness")) +} + +/// Every file under `dir`, as (base-relative path, bytes). +fn collect_files(base: &Path, dir: &Path) -> Result)>> { + let mut out = Vec::new(); + for entry in fs::read_dir(dir).map_err(|e| anyhow!("could not read {}: {e}", dir.display()))? { + let entry = entry.map_err(|e| anyhow!("could not read dir entry: {e}"))?; + let path = entry.path(); + if path.is_dir() { + out.extend(collect_files(base, &path)?); + } else { + let rel = path + .strip_prefix(base) + .unwrap_or(&path) + .to_string_lossy() + .replace('\\', "/"); + let bytes = + fs::read(&path).map_err(|e| anyhow!("could not read {}: {e}", path.display()))?; + out.push((rel, bytes)); + } + } + Ok(out) +} + +// --- session wiring ----------------------------------------------------------- + +/// A manifest of the skill dirs [`write_into_session`] wrote last turn, so it can +/// prune ones the user has since deleted without touching built-in `orx-*` or +/// repo-committed skills. Lives inside the (git-excluded) session skills dir; a +/// dotfile, so the harness never treats it as a skill. +const MANAGED_MANIFEST: &str = ".orx-user-skills"; + +/// Copy every applicable skill folder (globals first, then the project's, so a +/// project skill shadows a global of the same name) into the session worktree's +/// native skills dir, beside the built-in `orx-*` skills. Called fresh each turn +/// from `ensure_playbook`: each managed dir is fully replaced, and any skill the +/// user deleted since last turn is removed — so a session's skills track the +/// store with no drift. +pub fn write_into_session(worktree: &Path, skills_dir_rel: &str, project_id: &str) -> Result<()> { + write_into_session_in(&root(), worktree, skills_dir_rel, project_id) +} + +fn write_into_session_in( + root: &Path, + worktree: &Path, + skills_dir_rel: &str, + project_id: &str, +) -> Result<()> { + let base = worktree.join(skills_dir_rel); + let mut managed: Vec = Vec::new(); + for (scope, pid) in [(Scope::Global, None), (Scope::Project, Some(project_id))] { + let Ok(src_base) = scope_dir(root, scope, pid) else { + continue; + }; + let Ok(entries) = fs::read_dir(&src_base) else { + continue; // no skills for this scope yet + }; + for entry in entries.flatten() { + let src = entry.path(); + if !src.is_dir() { + continue; + } + let name = entry.file_name().to_string_lossy().into_owned(); + let dest = base.join(&name); + // Replace, don't merge: a re-upload with fewer files, or a project + // skill shadowing a global, must not keep stale siblings. + if dest.exists() { + let _ = fs::remove_dir_all(&dest); + } + copy_dir_all(&src, &dest)?; + if !managed.contains(&name) { + managed.push(name); + } + } + } + // Prune skills we wrote before but that no longer apply (deleted or renamed). + if let Ok(prev) = fs::read_to_string(base.join(MANAGED_MANIFEST)) { + for name in prev.lines().filter(|n| !n.is_empty()) { + if !managed.iter().any(|m| m == name) { + let _ = fs::remove_dir_all(base.join(name)); + } + } + } + if base.exists() { + let _ = fs::write(base.join(MANAGED_MANIFEST), managed.join("\n")); + } + Ok(()) +} + +/// Expand a leading `/name [args]` that names a user skill into a prompt that +/// tells the agent to use it — the skill's full `SKILL.md` is already in the +/// worktree (see [`write_into_session`]), so the harness loads it by name. +/// `None` when the text is not a known user skill (the caller sends it on). +pub fn expand(text: &str, project_id: &str) -> Option { + expand_in(&root(), text, project_id) +} + +fn expand_in(root: &Path, text: &str, project_id: &str) -> Option { + let rest = text.strip_prefix('/')?; + let (cmd, args) = match rest.split_once(char::is_whitespace) { + Some((cmd, args)) => (cmd, args.trim()), + None => (rest.trim_end(), ""), + }; + let skill = find_in(root, cmd, Some(project_id))?; + Some(if args.is_empty() { + format!("Use the `{}` skill.", skill.name) + } else { + format!( + "Use the `{}` skill for the following:\n\n{args}", + skill.name + ) + }) +} + +// --- fs helpers --------------------------------------------------------------- + +fn copy_dir_all(src: &Path, dest: &Path) -> Result<()> { + fs::create_dir_all(dest).map_err(|e| anyhow!("could not create {}: {e}", dest.display()))?; + for entry in fs::read_dir(src).map_err(|e| anyhow!("could not read {}: {e}", src.display()))? { + let entry = entry.map_err(|e| anyhow!("could not read dir entry: {e}"))?; + let from = entry.path(); + let to = dest.join(entry.file_name()); + if from.is_dir() { + copy_dir_all(&from, &to)?; + } else { + fs::copy(&from, &to).map_err(|e| anyhow!("could not copy {}: {e}", from.display()))?; + } + } + Ok(()) +} + +fn dir_size(dir: &Path) -> u64 { + let mut total = 0; + let Ok(entries) = fs::read_dir(dir) else { + return 0; + }; + for entry in entries.flatten() { + let path = entry.path(); + if path.is_dir() { + total += dir_size(&path); + } else if let Ok(meta) = entry.metadata() { + total += meta.len(); + } + } + total +} + +fn mtime_ms(path: &Path) -> i64 { + fs::metadata(path) + .and_then(|m| m.modified()) + .ok() + .and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok()) + .map(|d| d.as_millis() as i64) + .unwrap_or(0) +} + +fn basename(path: &str) -> &str { + path.rsplit('/').next().unwrap_or(path) +} + +fn depth(path: &str) -> usize { + path.matches('/').count() +} + +#[cfg(test)] +mod tests { + use super::*; + + fn temp_root() -> PathBuf { + std::env::temp_dir().join(format!("orx-user-skills-test-{}", uuid::Uuid::new_v4())) + } + + fn skill_md(name: &str) -> String { + skill_md_desc(name, &format!("A test skill for {name}. Use when testing.")) + } + + fn skill_md_desc(name: &str, desc: &str) -> String { + format!("---\nname: {name}\ndescription: {desc}\n---\n\n# {name}\nbody\n") + } + + fn make_zip(entries: &[(&str, &[u8])]) -> Vec { + use std::io::Write; + let mut buf = Vec::new(); + { + let mut w = zip::ZipWriter::new(std::io::Cursor::new(&mut buf)); + let opts = zip::write::SimpleFileOptions::default(); + for (name, data) in entries { + w.start_file(*name, opts).unwrap(); + w.write_all(data).unwrap(); + } + w.finish().unwrap(); + } + buf + } + + #[test] + fn frontmatter_parsing() { + let fm = parse_frontmatter("---\nname: foo\ndescription: hi there\n---\n\nbody").unwrap(); + assert_eq!(fm.name, "foo"); + assert_eq!(fm.description, "hi there"); + // A quoted scalar keeps an embedded colon. + let fm = parse_frontmatter("---\nname: foo\ndescription: \"a: b\"\n---\nbody").unwrap(); + assert_eq!(fm.description, "a: b"); + assert!(parse_frontmatter("no frontmatter here").is_err()); + assert!(parse_frontmatter("---\ndescription: x\n---\nb").is_err()); + assert!(parse_frontmatter("---\nname: x\n---\nb").is_err()); + } + + #[test] + fn name_validation() { + assert!(is_valid_slug("data-cleaner")); + assert!(is_valid_slug("skill1")); + assert!(!is_valid_slug("Bad_Name")); + assert!(!is_valid_slug("has space")); + assert!(!is_valid_slug("-leading")); + assert!(!is_valid_slug("double--hyphen")); + // Built-in namespaces are reserved (bare and prefixed forms). + assert!(is_reserved("orx-git")); + assert!(is_reserved("compute")); + assert!(is_reserved("lit-review")); + assert!(!is_reserved("haiku-writer")); + } + + #[test] + fn save_list_find_delete_roundtrip() { + let root = temp_root(); + let saved = + save_skill_md_in(&root, skill_md("alpha").as_bytes(), Scope::Global, None).unwrap(); + assert_eq!(saved.name, "alpha"); + assert_eq!(saved.scope, Scope::Global); + assert!(root.join("global/alpha/SKILL.md").exists()); + + let list = list_scope_in(&root, Scope::Global, None); + assert_eq!(list.len(), 1); + assert_eq!(list[0].name, "alpha"); + assert!(find_in(&root, "alpha", None).is_some()); + + delete_in(&root, "alpha", Scope::Global, None).unwrap(); + assert!(list_scope_in(&root, Scope::Global, None).is_empty()); + // Deleting a missing skill is an error. + assert!(delete_in(&root, "alpha", Scope::Global, None).is_err()); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn rejects_reserved_and_bad_names() { + let root = temp_root(); + assert!(save_skill_md_in( + &root, + skill_md("orx-compute").as_bytes(), + Scope::Global, + None + ) + .is_err()); + assert!(save_skill_md_in( + &root, + skill_md("lit-review").as_bytes(), + Scope::Global, + None + ) + .is_err()); + let bad = "---\nname: Bad_Name\ndescription: nope. Use.\n---\nbody\n"; + assert!(save_skill_md_in(&root, bad.as_bytes(), Scope::Global, None).is_err()); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn save_zip_preserves_folder() { + let root = temp_root(); + let md = skill_md("packager"); + let zip = make_zip(&[ + ("packager/SKILL.md", md.as_bytes()), + ("packager/scripts/run.py", b"print(1)\n"), + ("__MACOSX/packager/._SKILL.md", b"junk"), + ]); + let saved = save_zip_in(&root, &zip, Scope::Global, None).unwrap(); + assert_eq!(saved.name, "packager"); + assert!(root.join("global/packager/SKILL.md").exists()); + assert!(root.join("global/packager/scripts/run.py").exists()); + // The __MACOSX junk was skipped, not written under the skill. + assert!(!root.join("global/packager/__MACOSX").exists()); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn save_zip_requires_a_skill_md() { + let root = temp_root(); + let zip = make_zip(&[("foo/readme.txt", b"hi")]); + assert!(save_zip_in(&root, &zip, Scope::Global, None).is_err()); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn re_upload_replaces_prior_files() { + let root = temp_root(); + let zip = make_zip(&[ + ("s/SKILL.md", skill_md("s").as_bytes()), + ("s/old.txt", b"stale"), + ]); + save_zip_in(&root, &zip, Scope::Global, None).unwrap(); + assert!(root.join("global/s/old.txt").exists()); + // Re-upload without old.txt must drop it. + save_skill_md_in(&root, skill_md("s").as_bytes(), Scope::Global, None).unwrap(); + assert!(!root.join("global/s/old.txt").exists()); + assert!(root.join("global/s/SKILL.md").exists()); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn project_scope_shadows_global() { + let root = temp_root(); + save_skill_md_in( + &root, + skill_md_desc("dup", "GLOBAL body").as_bytes(), + Scope::Global, + None, + ) + .unwrap(); + save_skill_md_in( + &root, + skill_md_desc("dup", "PROJECT body").as_bytes(), + Scope::Project, + Some("proj1"), + ) + .unwrap(); + + let found = find_in(&root, "dup", Some("proj1")).unwrap(); + assert_eq!(found.scope, Scope::Project); + assert!(found.description.contains("PROJECT")); + // A different project falls back to the global. + let other = find_in(&root, "dup", Some("proj2")).unwrap(); + assert_eq!(other.scope, Scope::Global); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn write_into_session_copies_scopes_with_project_shadow() { + let root = temp_root(); + save_skill_md_in(&root, skill_md("g-only").as_bytes(), Scope::Global, None).unwrap(); + save_skill_md_in( + &root, + skill_md_desc("dup", "GLOBAL").as_bytes(), + Scope::Global, + None, + ) + .unwrap(); + save_skill_md_in( + &root, + skill_md_desc("dup", "PROJECT").as_bytes(), + Scope::Project, + Some("p1"), + ) + .unwrap(); + + let wt = temp_root(); + write_into_session_in(&root, &wt, ".claude/skills", "p1").unwrap(); + assert!(wt.join(".claude/skills/g-only/SKILL.md").exists()); + let dup = fs::read_to_string(wt.join(".claude/skills/dup/SKILL.md")).unwrap(); + assert!( + dup.contains("PROJECT"), + "project skill must shadow the global" + ); + let _ = fs::remove_dir_all(&root); + let _ = fs::remove_dir_all(&wt); + } + + #[test] + fn expand_invokes_user_skill() { + let root = temp_root(); + save_skill_md_in(&root, skill_md("greeter").as_bytes(), Scope::Global, None).unwrap(); + let out = expand_in(&root, "/greeter hello there", "p1").unwrap(); + assert!(out.contains("greeter")); + assert!(out.contains("hello there")); + assert_eq!( + expand_in(&root, "/greeter", "p1").unwrap(), + "Use the `greeter` skill." + ); + assert!(expand_in(&root, "/unknown", "p1").is_none()); + assert!(expand_in(&root, "plain text", "p1").is_none()); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn collect_files_walks_nested_dirs() { + let base = temp_root(); + fs::create_dir_all(base.join("scripts")).unwrap(); + fs::write(base.join("SKILL.md"), b"x").unwrap(); + fs::write(base.join("scripts/run.py"), b"y").unwrap(); + let mut files = collect_files(&base, &base).unwrap(); + files.sort_by(|a, b| a.0.cmp(&b.0)); + assert_eq!(files.len(), 2); + assert_eq!(files[0].0, "SKILL.md"); + assert_eq!(files[1].0, "scripts/run.py"); + let _ = fs::remove_dir_all(&base); + } + + #[test] + fn locate_harness_skill_matches_frontmatter_name() { + let skills = temp_root(); + // Match on the frontmatter name even when the dir name differs, and + // never on the dir name alone. + fs::create_dir_all(skills.join("weird-dir")).unwrap(); + fs::write(skills.join("weird-dir/SKILL.md"), skill_md("canonical")).unwrap(); + + assert_eq!( + locate_harness_skill(&skills, "canonical").unwrap(), + skills.join("weird-dir") + ); + assert!(locate_harness_skill(&skills, "weird-dir").is_err()); + assert!(locate_harness_skill(&skills, "missing").is_err()); + let _ = fs::remove_dir_all(&skills); + } + + #[test] + fn write_into_session_prunes_deleted_skills() { + let root = temp_root(); + let wt = temp_root(); + let rel = ".claude/skills"; + save_skill_md_in(&root, skill_md("keep").as_bytes(), Scope::Global, None).unwrap(); + save_skill_md_in(&root, skill_md("gone").as_bytes(), Scope::Global, None).unwrap(); + write_into_session_in(&root, &wt, rel, "p1").unwrap(); + assert!(wt.join(rel).join("keep/SKILL.md").exists()); + assert!(wt.join(rel).join("gone/SKILL.md").exists()); + + // Delete one skill from the store, re-run: it must leave the worktree. + delete_in(&root, "gone", Scope::Global, None).unwrap(); + write_into_session_in(&root, &wt, rel, "p1").unwrap(); + assert!(wt.join(rel).join("keep/SKILL.md").exists()); + assert!( + !wt.join(rel).join("gone").exists(), + "deleted skill must be pruned" + ); + let _ = fs::remove_dir_all(&root); + let _ = fs::remove_dir_all(&wt); + } + + #[test] + fn write_into_session_shadow_replaces_not_merges() { + let root = temp_root(); + let wt = temp_root(); + let rel = ".agents/skills"; + // Global `dup` carries an extra file the project version lacks. + write_skill( + &root, + Scope::Global, + None, + "dup", + vec![ + ( + "SKILL.md".into(), + skill_md_desc("dup", "GLOBAL").into_bytes(), + ), + ("extra.txt".into(), b"global-only".to_vec()), + ], + ) + .unwrap(); + save_skill_md_in( + &root, + skill_md_desc("dup", "PROJECT").as_bytes(), + Scope::Project, + Some("p1"), + ) + .unwrap(); + write_into_session_in(&root, &wt, rel, "p1").unwrap(); + let md = fs::read_to_string(wt.join(rel).join("dup/SKILL.md")).unwrap(); + assert!(md.contains("PROJECT")); + assert!( + !wt.join(rel).join("dup/extra.txt").exists(), + "shadowing project skill must not keep the global's files" + ); + let _ = fs::remove_dir_all(&root); + let _ = fs::remove_dir_all(&wt); + } + + #[test] + fn save_zip_rejects_oversized_and_too_many_files() { + let root = temp_root(); + // One entry whose declared uncompressed size exceeds the cap (zeros + // compress tiny, so the archive itself stays small). + let big = make_zip(&[ + ("s/SKILL.md", skill_md("s").as_bytes()), + ("s/big.bin", &vec![0u8; (MAX_TOTAL_BYTES + 1) as usize]), + ]); + assert!(save_zip_in(&root, &big, Scope::Global, None).is_err()); + + let skill = skill_md("s"); + let many: Vec<(String, Vec)> = (0..MAX_FILES + 1) + .map(|i| (format!("s/f{i}.txt"), b"x".to_vec())) + .collect(); + let mut entries: Vec<(&str, &[u8])> = vec![("s/SKILL.md", skill.as_bytes())]; + for (n, b) in &many { + entries.push((n.as_str(), b.as_slice())); + } + assert!(save_zip_in(&root, &make_zip(&entries), Scope::Global, None).is_err()); + let _ = fs::remove_dir_all(&root); + } + + #[test] + fn quoted_frontmatter_name_is_accepted() { + let root = temp_root(); + let md = + "---\nname: \"data-cleaner\"\ndescription: Clean CSVs. Use when asked.\n---\nbody\n"; + let saved = save_skill_md_in(&root, md.as_bytes(), Scope::Global, None).unwrap(); + assert_eq!(saved.name, "data-cleaner"); + let _ = fs::remove_dir_all(&root); + } +} diff --git a/src/main.rs b/src/main.rs index 868e541ad..6bfa18b96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,7 @@ mod client; mod commands; mod config; mod error; +mod folder_picker; mod jobs; // Local mode (`orx up`): builds out across stages; not all of it is wired yet. #[allow(dead_code)] diff --git a/src/plane/local_plane.rs b/src/plane/local_plane.rs index c941da77b..60873f440 100644 --- a/src/plane/local_plane.rs +++ b/src/plane/local_plane.rs @@ -363,7 +363,7 @@ impl ControlPlane for LocalPlane { return Err(anyhow!("No run in flight for this experiment.")); } for r in &in_flight { - store.set_cancel_requested(&r.id, true)?; + crate::commands::exp::request_local_run_cancel(store, &r.id)?; println!("\u{2713} Cancel requested for run {}.", r.id); } Ok(()) diff --git a/src/store.rs b/src/store.rs index 1b17ee3c8..a0990773c 100644 --- a/src/store.rs +++ b/src/store.rs @@ -605,6 +605,14 @@ impl Store { Ok(n as usize) } + pub fn list_active_runs(&self) -> Result> { + let mut stmt = self.conn.prepare(&format!( + "{SELECT_RUN} WHERE status IN ('starting', 'running') ORDER BY created_at DESC" + ))?; + let rows = stmt.query_map([], row_to_run)?; + Ok(rows.collect::, _>>()?) + } + pub fn list_runs_by_project(&self, project_id: &str) -> Result> { let mut stmt = self.conn.prepare(&format!( "{SELECT_RUN} WHERE project_id = ?1 ORDER BY created_at DESC" @@ -1825,6 +1833,33 @@ mod tests { let _ = std::fs::remove_dir_all(&dir); } + #[test] + fn active_run_listing_excludes_terminal_history() { + let dir = std::env::temp_dir().join(format!("orx-store-active-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + store + .upsert_run(&run_fixture("run_starting", "starting", None)) + .unwrap(); + store + .upsert_run(&run_fixture("run_running", "running", None)) + .unwrap(); + store + .upsert_run(&run_fixture("run_done", "done", None)) + .unwrap(); + + let mut ids: Vec<_> = store + .list_active_runs() + .unwrap() + .into_iter() + .map(|run| run.id) + .collect(); + ids.sort(); + assert_eq!(ids, ["run_running", "run_starting"]); + + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } + #[test] fn run_ownership_is_immutable_across_upserts() { let dir = std::env::temp_dir().join(format!("orx-store-runimmut-{}", uuid::Uuid::new_v4())); diff --git a/ui/dist/assets/ModelViewer-D3HqfNbT.js b/ui/dist/assets/ModelViewer-C_2Z847L.js similarity index 99% rename from ui/dist/assets/ModelViewer-D3HqfNbT.js rename to ui/dist/assets/ModelViewer-C_2Z847L.js index 640d98e47..a9314b353 100644 --- a/ui/dist/assets/ModelViewer-D3HqfNbT.js +++ b/ui/dist/assets/ModelViewer-C_2Z847L.js @@ -1,4 +1,4 @@ -import{c as He,r as I,j as y,P as ve}from"./index-wQaJeB0S.js";import{T as De,a as te,b as Ee,L as Ge,c as X,F as Ae,M as C,V as _e,C as G,d as F,S as q,e as Ue,P as Be,D as Me,f as Y,I as Ke,g as k,Q as Le,h as je,O as we,i as Ve,j as ze,B as Q,k as Xe,l as ye,N as qe,m as We,n as Ye,o as se,p as Se,R as ie,q as Qe,r as Je,s as $e,t as J,u as Ze,v as be,w as en,x as z,y as nn,z as tn,A as sn,E as rn,G as on,H as an,J as cn,K as ln,U as $,W as Ne,X as un,Y as dn,Z as fn,_ as hn,$ as pn,a0 as mn,a1 as Ie,a2 as gn,a3 as le,a4 as ue,a5 as de,a6 as fe,a7 as he,a8 as Tn,a9 as Rn,aa as Oe,ab as xn,ac as En,ad as An,ae as _n,af as Mn,ag as Ln,ah as wn,ai as yn}from"./OrbitControls-m56-zQrj.js";/** +import{c as He,r as I,j as y,P as ve}from"./index-CONGiPgx.js";import{T as De,a as te,b as Ee,L as Ge,c as X,F as Ae,M as C,V as _e,C as G,d as F,S as q,e as Ue,P as Be,D as Me,f as Y,I as Ke,g as k,Q as Le,h as je,O as we,i as Ve,j as ze,B as Q,k as Xe,l as ye,N as qe,m as We,n as Ye,o as se,p as Se,R as ie,q as Qe,r as Je,s as $e,t as J,u as Ze,v as be,w as en,x as z,y as nn,z as tn,A as sn,E as rn,G as on,H as an,J as cn,K as ln,U as $,W as Ne,X as un,Y as dn,Z as fn,_ as hn,$ as pn,a0 as mn,a1 as Ie,a2 as gn,a3 as le,a4 as ue,a5 as de,a6 as fe,a7 as he,a8 as Tn,a9 as Rn,aa as Oe,ab as xn,ac as En,ad as An,ae as _n,af as Mn,ag as Ln,ah as wn,ai as yn}from"./OrbitControls-DVKVHvqt.js";/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/ui/dist/assets/OrbitControls-m56-zQrj.js b/ui/dist/assets/OrbitControls-DVKVHvqt.js similarity index 99% rename from ui/dist/assets/OrbitControls-m56-zQrj.js rename to ui/dist/assets/OrbitControls-DVKVHvqt.js index 6f9b66831..8af7442c1 100644 --- a/ui/dist/assets/OrbitControls-m56-zQrj.js +++ b/ui/dist/assets/OrbitControls-DVKVHvqt.js @@ -1,4 +1,4 @@ -import{c as Lc}from"./index-wQaJeB0S.js";/** +import{c as Lc}from"./index-CONGiPgx.js";/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/ui/dist/assets/SplatViewer-Bz_PebWi.js b/ui/dist/assets/SplatViewer-DWpiLLqa.js similarity index 99% rename from ui/dist/assets/SplatViewer-Bz_PebWi.js rename to ui/dist/assets/SplatViewer-DWpiLLqa.js index 968431bf0..1209b5f47 100644 --- a/ui/dist/assets/SplatViewer-Bz_PebWi.js +++ b/ui/dist/assets/SplatViewer-DWpiLLqa.js @@ -1,4 +1,4 @@ -import{r as oI,j as _A}from"./index-wQaJeB0S.js";import{E as qI,Y as YQ,z as nQ,aj as EQ,ak as ug,w as eQ,al as mg,V as CI,g as t,ah as Og,am as zI,S as _I,an as uA,ao as xA,ap as xI,Q as iA,f as RA,aq as EI,ar as d,as as n,W as $I,at as KQ,d as JB,o as DQ,au as rQ,av as dQ,aw as UB,ax as qQ,v as Ag,C as zA,ay as MA,aa as tB,az as xQ,B as Ig,aA as Tg,p as FI,aB as Cg,aC as CA,O as Zg,L as HB,F as LB,aD as YB,aE as Eg,aF as lQ,aG as nB,a3 as eB,aH as KB,h as rB,aI as dB,ac as qB,ad as xB,ae as lB,ai as pB}from"./OrbitControls-m56-zQrj.js";const fB=new YQ(-1,1,1,-1,0,1);class bB extends nQ{constructor(){super(),this.setAttribute("position",new EQ([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new EQ([0,2,0,0,2,0],2))}}const PB=new bB;class Vg{constructor(A){this._mesh=new qI(PB,A)}dispose(){this._mesh.geometry.dispose()}render(A){A.render(this._mesh,fB)}get material(){return this._mesh.material}set material(A){this._mesh.material=A}}class ng extends xQ{constructor(A,I){super(),this.ordering=A,this.setAttribute("position",new Ig(uB,3)),this.setIndex(new Ig(mB,1)),this._maxInstanceCount=A.length,this.instanceCount=I,this.attribute=new rB(A,1,!1,1),this.attribute.setUsage(dB),this.setAttribute("splatIndex",this.attribute)}update(A,I){this.ordering=A,this.attribute.array=A,this.instanceCount=I,this.attribute.addUpdateRange(0,I),this.attribute.needsUpdate=!0}}const uB=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),mB=new Uint16Array([0,1,2,0,2,3]),pQ=`(function() { +import{r as oI,j as _A}from"./index-CONGiPgx.js";import{E as qI,Y as YQ,z as nQ,aj as EQ,ak as ug,w as eQ,al as mg,V as CI,g as t,ah as Og,am as zI,S as _I,an as uA,ao as xA,ap as xI,Q as iA,f as RA,aq as EI,ar as d,as as n,W as $I,at as KQ,d as JB,o as DQ,au as rQ,av as dQ,aw as UB,ax as qQ,v as Ag,C as zA,ay as MA,aa as tB,az as xQ,B as Ig,aA as Tg,p as FI,aB as Cg,aC as CA,O as Zg,L as HB,F as LB,aD as YB,aE as Eg,aF as lQ,aG as nB,a3 as eB,aH as KB,h as rB,aI as dB,ac as qB,ad as xB,ae as lB,ai as pB}from"./OrbitControls-DVKVHvqt.js";const fB=new YQ(-1,1,1,-1,0,1);class bB extends nQ{constructor(){super(),this.setAttribute("position",new EQ([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new EQ([0,2,0,0,2,0],2))}}const PB=new bB;class Vg{constructor(A){this._mesh=new qI(PB,A)}dispose(){this._mesh.geometry.dispose()}render(A){A.render(this._mesh,fB)}get material(){return this._mesh.material}set material(A){this._mesh.material=A}}class ng extends xQ{constructor(A,I){super(),this.ordering=A,this.setAttribute("position",new Ig(uB,3)),this.setIndex(new Ig(mB,1)),this._maxInstanceCount=A.length,this.instanceCount=I,this.attribute=new rB(A,1,!1,1),this.attribute.setUsage(dB),this.setAttribute("splatIndex",this.attribute)}update(A,I){this.ordering=A,this.attribute.array=A,this.instanceCount=I,this.attribute.addUpdateRange(0,I),this.attribute.needsUpdate=!0}}const uB=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),mB=new Uint16Array([0,1,2,0,2,3]),pQ=`(function() { "use strict"; class CsplatArray { static __wrap(ptr) { diff --git a/ui/dist/assets/index-CONGiPgx.js b/ui/dist/assets/index-CONGiPgx.js new file mode 100644 index 000000000..47370f701 --- /dev/null +++ b/ui/dist/assets/index-CONGiPgx.js @@ -0,0 +1,746 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelViewer-C_2Z847L.js","assets/OrbitControls-DVKVHvqt.js","assets/SplatViewer-DWpiLLqa.js"])))=>i.map(i=>d[i]); +var HN=Object.defineProperty;var K_=e=>{throw TypeError(e)};var FN=(e,t,n)=>t in e?HN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ua=(e,t,n)=>FN(e,typeof t!="symbol"?t+"":t,n),$N=(e,t,n)=>t.has(e)||K_("Cannot "+n);var Z_=(e,t,n)=>t.has(e)?K_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var qa=(e,t,n)=>($N(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function wd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mm={exports:{}},Oc={};/** + * @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 Q_;function PN(){if(Q_)return Oc;Q_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Oc.Fragment=t,Oc.jsx=n,Oc.jsxs=n,Oc}var J_;function UN(){return J_||(J_=1,Mm.exports=PN()),Mm.exports}var d=UN(),jm={exports:{}},mt={};/** + * @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 e3;function qN(){if(e3)return mt;e3=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,y={};function _(I,Y,G){this.props=I,this.context=Y,this.refs=y,this.updater=G||k}_.prototype.isReactComponent={},_.prototype.setState=function(I,Y){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,Y,"setState")},_.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function x(){}x.prototype=_.prototype;function w(I,Y,G){this.props=I,this.context=Y,this.refs=y,this.updater=G||k}var C=w.prototype=new x;C.constructor=w,S(C,_.prototype),C.isPureReactComponent=!0;var T=Array.isArray;function N(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function D(I,Y,G){var se=G.ref;return{$$typeof:e,type:I,key:Y,ref:se!==void 0?se:null,props:G}}function B(I,Y){return D(I.type,Y,I.props)}function H(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function V(I){var Y={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(G){return Y[G]})}var U=/\/+/g;function P(I,Y){return typeof I=="object"&&I!==null&&I.key!=null?V(""+I.key):Y.toString(36)}function K(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(N,N):(I.status="pending",I.then(function(Y){I.status==="pending"&&(I.status="fulfilled",I.value=Y)},function(Y){I.status==="pending"&&(I.status="rejected",I.reason=Y)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function W(I,Y,G,se,oe){var fe=typeof I;(fe==="undefined"||fe==="boolean")&&(I=null);var te=!1;if(I===null)te=!0;else switch(fe){case"bigint":case"string":case"number":te=!0;break;case"object":switch(I.$$typeof){case e:case t:te=!0;break;case m:return te=I._init,W(te(I._payload),Y,G,se,oe)}}if(te)return oe=oe(I),te=se===""?"."+P(I,0):se,T(oe)?(G="",te!=null&&(G=te.replace(U,"$&/")+"/"),W(oe,Y,G,"",function(le){return le})):oe!=null&&(H(oe)&&(oe=B(oe,G+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(U,"$&/")+"/")+te)),Y.push(oe)),1;te=0;var q=se===""?".":se+":";if(T(I))for(var ne=0;ne>>1,L=W[z];if(0>>1;zi(G,ee))sei(oe,G)?(W[z]=oe,W[se]=ee,z=se):(W[z]=G,W[Y]=ee,z=Y);else if(sei(oe,ee))W[z]=oe,W[se]=ee,z=se;else break e}}return Z}function i(W,Z){var ee=W.sortIndex-Z.sortIndex;return ee!==0?ee:W.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var u=[],h=[],m=1,f=null,g=3,v=!1,k=!1,S=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function C(W){for(var Z=n(h);Z!==null;){if(Z.callback===null)r(h);else if(Z.startTime<=W)r(h),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=n(h)}}function T(W){if(S=!1,C(W),!k)if(n(u)!==null)k=!0,N||(N=!0,V());else{var Z=n(h);Z!==null&&K(T,Z.startTime-W)}}var N=!1,j=-1,A=5,D=-1;function B(){return y?!0:!(e.unstable_now()-DW&&B());){var z=f.callback;if(typeof z=="function"){f.callback=null,g=f.priorityLevel;var L=z(f.expirationTime<=W);if(W=e.unstable_now(),typeof L=="function"){f.callback=L,C(W),Z=!0;break t}f===n(u)&&r(u),C(W)}else r(u);f=n(u)}if(f!==null)Z=!0;else{var I=n(h);I!==null&&K(T,I.startTime-W),Z=!1}}break e}finally{f=null,g=ee,v=!1}Z=void 0}}finally{Z?V():N=!1}}}var V;if(typeof w=="function")V=function(){w(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,P=U.port2;U.port1.onmessage=H,V=function(){P.postMessage(null)}}else V=function(){_(H,0)};function K(W,Z){j=_(function(){W(e.unstable_now())},Z)}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(W){W.callback=null},e.unstable_forceFrameRate=function(W){0>W||125z?(W.sortIndex=ee,t(h,W),n(u)===null&&W===n(h)&&(S?(x(j),j=-1):S=!0,K(T,ee-z))):(W.sortIndex=L,t(u,W),k||v||(k=!0,N||(N=!0,V()))),W},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(W){var Z=g;return function(){var ee=g;g=Z;try{return W.apply(this,arguments)}finally{g=ee}}}})(Lm)),Lm}var r3;function WN(){return r3||(r3=1,Rm.exports=VN()),Rm.exports}var Om={exports:{}},er={};/** + * @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 i3;function YN(){if(i3)return er;i3=1;var e=Cu();function t(u){var h="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Om.exports=YN(),Om.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 a3;function XN(){if(a3)return Bc;a3=1;var e=WN(),t=Cu(),n=k7();function r(s){var o="https://react.dev/errors/"+s;if(1L||(s.current=z[L],z[L]=null,L--)}function G(s,o){L++,z[L]=s.current,s.current=o}var se=I(null),oe=I(null),fe=I(null),te=I(null);function q(s,o){switch(G(fe,o),G(oe,s),G(se,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?y_(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=y_(o),s=__(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Y(se),G(se,s)}function ne(){Y(se),Y(oe),Y(fe)}function le(s){s.memoizedState!==null&&G(te,s);var o=se.current,p=__(o,s.type);o!==p&&(G(oe,s),G(se,p))}function ye(s){oe.current===s&&(Y(se),Y(oe)),te.current===s&&(Y(te),jc._currentValue=ee)}var ve,Ee;function je(s){if(ve===void 0)try{throw Error()}catch(p){var o=p.stack.trim().match(/\n( *(at )?)/);ve=o&&o[1]||"",Ee=-1)":-1E||ae[b]!==me[E]){var we=` +`+ae[b].replace(" at new "," at ");return s.displayName&&we.includes("")&&(we=we.replace("",s.displayName)),we}while(1<=b&&0<=E);break}}}finally{Pe=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?je(p):""}function Be(s,o){switch(s.tag){case 26:case 27:case 5:return je(s.type);case 16:return je("Lazy");case 13:return s.child!==o&&o!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return $e(s.type,!1);case 11:return $e(s.type.render,!1);case 1:return $e(s.type,!0);case 31:return je("Activity");default:return""}}function Nt(s){try{var o="",p=null;do o+=Be(s,p),p=s,s=s.return;while(s);return o}catch(b){return` +Error generating stack: `+b.message+` +`+b.stack}}var Rt=Object.prototype.hasOwnProperty,Lt=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,an=e.unstable_shouldYield,wt=e.unstable_requestPaint,Je=e.unstable_now,pt=e.unstable_getCurrentPriorityLevel,_e=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,Qe=e.unstable_LowPriority,rt=e.unstable_IdlePriority,$t=e.log,ct=e.unstable_setDisableYieldValue,Fe=null,et=null;function _t(s){if(typeof $t=="function"&&ct(s),et&&typeof et.setStrictMode=="function")try{et.setStrictMode(Fe,s)}catch{}}var ut=Math.clz32?Math.clz32:hn,on=Math.log,Gn=Math.LN2;function hn(s){return s>>>=0,s===0?32:31-(on(s)/Gn|0)|0}var xn=256,vt=262144,wn=4194304;function At(s){var o=s&42;if(o!==0)return o;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Vr(s,o,p){var b=s.pendingLanes;if(b===0)return 0;var E=0,M=s.suspendedLanes,$=s.pingedLanes;s=s.warmLanes;var Q=b&134217727;return Q!==0?(b=Q&~M,b!==0?E=At(b):($&=Q,$!==0?E=At($):p||(p=Q&~s,p!==0&&(E=At(p))))):(Q=b&~M,Q!==0?E=At(Q):$!==0?E=At($):p||(p=b&~s,p!==0&&(E=At(p)))),E===0?0:o!==0&&o!==E&&(o&M)===0&&(M=E&-E,p=o&-o,M>=p||M===32&&(p&4194048)!==0)?o:E}function Mn(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function ki(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Rs(){var s=wn;return wn<<=1,(wn&62914560)===0&&(wn=4194304),s}function Er(s){for(var o=[],p=0;31>p;p++)o.push(s);return o}function jn(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function hr(s,o,p,b,E,M){var $=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var Q=s.entanglements,ae=s.expirationTimes,me=s.hiddenUpdates;for(p=$&~p;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Ie=/[\n"\\]/g;function Ve(s){return s.replace(Ie,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function at(s,o,p,b,E,M,$,Q){s.name="",$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.type=$:s.removeAttribute("type"),o!=null?$==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Xn(o)):s.value!==""+Xn(o)&&(s.value=""+Xn(o)):$!=="submit"&&$!=="reset"||s.removeAttribute("value"),o!=null?Pt(s,$,Xn(o)):p!=null?Pt(s,$,Xn(p)):b!=null&&s.removeAttribute("value"),E==null&&M!=null&&(s.defaultChecked=!!M),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?s.name=""+Xn(Q):s.removeAttribute("name")}function Jt(s,o,p,b,E,M,$,Q){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.type=M),o!=null||p!=null){if(!(M!=="submit"&&M!=="reset"||o!=null)){ce(s);return}p=p!=null?""+Xn(p):"",o=o!=null?""+Xn(o):p,Q||o===s.value||(s.value=o),s.defaultValue=o}b=b??E,b=typeof b!="function"&&typeof b!="symbol"&&!!b,s.checked=Q?s.checked:!!b,s.defaultChecked=!!b,$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"&&(s.name=$),ce(s)}function Pt(s,o,p){o==="number"&&Me(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function en(s,o,p,b){if(s=s.options,o){o={};for(var E=0;E"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mf=!1;if(Ji)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Mf=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Mf=!1}var Is=null,jf=null,Vu=null;function _b(){if(Vu)return Vu;var s,o=jf,p=o.length,b,E="value"in Is?Is.value:Is.textContent,M=E.length;for(s=0;s=Ql),Eb=" ",Nb=!1;function Ab(s,o){switch(s){case"keyup":return oE.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Mo=!1;function cE(s,o){switch(s){case"compositionend":return Tb(o);case"keypress":return o.which!==32?null:(Nb=!0,Eb);case"textInput":return s=o.data,s===Eb&&Nb?null:s;default:return null}}function uE(s,o){if(Mo)return s==="compositionend"||!Bf&&Ab(s,o)?(s=_b(),Vu=jf=Is=null,Mo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:p,offset:o-s};s=b}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=zb(p)}}function Hb(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?Hb(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function Fb(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Me(s.document);o instanceof s.HTMLIFrameElement;){try{var p=typeof o.contentWindow.location.href=="string"}catch{p=!1}if(p)s=o.contentWindow;else break;o=Me(s.document)}return o}function Hf(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var bE=Ji&&"documentMode"in document&&11>=document.documentMode,jo=null,Ff=null,nc=null,$f=!1;function $b(s,o,p){var b=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;$f||jo==null||jo!==Me(b)||(b=jo,"selectionStart"in b&&Hf(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),nc&&tc(nc,b)||(nc=b,b=Hh(Ff,"onSelect"),0>=$,E-=$,Mi=1<<32-ut(o)+E|p<bt?(Mt=Ye,Ye=null):Mt=Ye.sibling;var Ht=be(de,Ye,pe[bt],ke);if(Ht===null){Ye===null&&(Ye=Mt);break}s&&Ye&&Ht.alternate===null&&o(de,Ye),ue=M(Ht,ue,bt),It===null?nt=Ht:It.sibling=Ht,It=Ht,Ye=Mt}if(bt===pe.length)return p(de,Ye),jt&&ts(de,bt),nt;if(Ye===null){for(;btbt?(Mt=Ye,Ye=null):Mt=Ye.sibling;var aa=be(de,Ye,Ht.value,ke);if(aa===null){Ye===null&&(Ye=Mt);break}s&&Ye&&aa.alternate===null&&o(de,Ye),ue=M(aa,ue,bt),It===null?nt=aa:It.sibling=aa,It=aa,Ye=Mt}if(Ht.done)return p(de,Ye),jt&&ts(de,bt),nt;if(Ye===null){for(;!Ht.done;bt++,Ht=pe.next())Ht=Ce(de,Ht.value,ke),Ht!==null&&(ue=M(Ht,ue,bt),It===null?nt=Ht:It.sibling=Ht,It=Ht);return jt&&ts(de,bt),nt}for(Ye=b(Ye);!Ht.done;bt++,Ht=pe.next())Ht=xe(Ye,de,bt,Ht.value,ke),Ht!==null&&(s&&Ht.alternate!==null&&Ye.delete(Ht.key===null?bt:Ht.key),ue=M(Ht,ue,bt),It===null?nt=Ht:It.sibling=Ht,It=Ht);return s&&Ye.forEach(function(IN){return o(de,IN)}),jt&&ts(de,bt),nt}function Qt(de,ue,pe,ke){if(typeof pe=="object"&&pe!==null&&pe.type===S&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:e:{for(var nt=pe.key;ue!==null;){if(ue.key===nt){if(nt=pe.type,nt===S){if(ue.tag===7){p(de,ue.sibling),ke=E(ue,pe.props.children),ke.return=de,de=ke;break e}}else if(ue.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===A&&Ba(nt)===ue.type){p(de,ue.sibling),ke=E(ue,pe.props),lc(ke,pe),ke.return=de,de=ke;break e}p(de,ue);break}else o(de,ue);ue=ue.sibling}pe.type===S?(ke=ja(pe.props.children,de.mode,ke,pe.key),ke.return=de,de=ke):(ke=nh(pe.type,pe.key,pe.props,null,de.mode,ke),lc(ke,pe),ke.return=de,de=ke)}return $(de);case k:e:{for(nt=pe.key;ue!==null;){if(ue.key===nt)if(ue.tag===4&&ue.stateNode.containerInfo===pe.containerInfo&&ue.stateNode.implementation===pe.implementation){p(de,ue.sibling),ke=E(ue,pe.children||[]),ke.return=de,de=ke;break e}else{p(de,ue);break}else o(de,ue);ue=ue.sibling}ke=Yf(pe,de.mode,ke),ke.return=de,de=ke}return $(de);case A:return pe=Ba(pe),Qt(de,ue,pe,ke)}if(K(pe))return We(de,ue,pe,ke);if(V(pe)){if(nt=V(pe),typeof nt!="function")throw Error(r(150));return pe=nt.call(pe),ot(de,ue,pe,ke)}if(typeof pe.then=="function")return Qt(de,ue,ch(pe),ke);if(pe.$$typeof===w)return Qt(de,ue,sh(de,pe),ke);uh(de,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,ue!==null&&ue.tag===6?(p(de,ue.sibling),ke=E(ue,pe),ke.return=de,de=ke):(p(de,ue),ke=Wf(pe,de.mode,ke),ke.return=de,de=ke),$(de)):p(de,ue)}return function(de,ue,pe,ke){try{oc=0;var nt=Qt(de,ue,pe,ke);return Po=null,nt}catch(Ye){if(Ye===$o||Ye===oh)throw Ye;var It=Ar(29,Ye,null,de.mode);return It.lanes=ke,It.return=de,It}finally{}}}var Ia=u4(!0),h4=u4(!1),Us=!1;function ap(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function op(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function qs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Gs(s,o,p){var b=s.updateQueue;if(b===null)return null;if(b=b.shared,(Ut&2)!==0){var E=b.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),b.pending=o,o=th(s),Yb(s,null,p),o}return eh(s,b,o,p),th(s)}function cc(s,o,p){if(o=o.updateQueue,o!==null&&(o=o.shared,(p&4194048)!==0)){var b=o.lanes;b&=s.pendingLanes,p|=b,o.lanes=p,ge(s,p)}}function lp(s,o){var p=s.updateQueue,b=s.alternate;if(b!==null&&(b=b.updateQueue,p===b)){var E=null,M=null;if(p=p.firstBaseUpdate,p!==null){do{var $={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};M===null?E=M=$:M=M.next=$,p=p.next}while(p!==null);M===null?E=M=o:M=M.next=o}else E=M=o;p={baseState:b.baseState,firstBaseUpdate:E,lastBaseUpdate:M,shared:b.shared,callbacks:b.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=o:s.next=o,p.lastBaseUpdate=o}var cp=!1;function uc(){if(cp){var s=Fo;if(s!==null)throw s}}function hc(s,o,p,b){cp=!1;var E=s.updateQueue;Us=!1;var M=E.firstBaseUpdate,$=E.lastBaseUpdate,Q=E.shared.pending;if(Q!==null){E.shared.pending=null;var ae=Q,me=ae.next;ae.next=null,$===null?M=me:$.next=me,$=ae;var we=s.alternate;we!==null&&(we=we.updateQueue,Q=we.lastBaseUpdate,Q!==$&&(Q===null?we.firstBaseUpdate=me:Q.next=me,we.lastBaseUpdate=ae))}if(M!==null){var Ce=E.baseState;$=0,we=me=ae=null,Q=M;do{var be=Q.lane&-536870913,xe=be!==Q.lane;if(xe?(Tt&be)===be:(b&be)===be){be!==0&&be===Ho&&(cp=!0),we!==null&&(we=we.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var We=s,ot=Q;be=o;var Qt=p;switch(ot.tag){case 1:if(We=ot.payload,typeof We=="function"){Ce=We.call(Qt,Ce,be);break e}Ce=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=ot.payload,be=typeof We=="function"?We.call(Qt,Ce,be):We,be==null)break e;Ce=f({},Ce,be);break e;case 2:Us=!0}}be=Q.callback,be!==null&&(s.flags|=64,xe&&(s.flags|=8192),xe=E.callbacks,xe===null?E.callbacks=[be]:xe.push(be))}else xe={lane:be,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},we===null?(me=we=xe,ae=Ce):we=we.next=xe,$|=be;if(Q=Q.next,Q===null){if(Q=E.shared.pending,Q===null)break;xe=Q,Q=xe.next,xe.next=null,E.lastBaseUpdate=xe,E.shared.pending=null}}while(!0);we===null&&(ae=Ce),E.baseState=ae,E.firstBaseUpdate=me,E.lastBaseUpdate=we,M===null&&(E.shared.lanes=0),Ks|=$,s.lanes=$,s.memoizedState=Ce}}function d4(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function f4(s,o){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;sM?M:8;var $=W.T,Q={};W.T=Q,Ap(s,!1,o,p);try{var ae=E(),me=W.S;if(me!==null&&me(Q,ae),ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var we=NE(ae,b);pc(s,o,we,Rr(s))}else pc(s,o,b,Rr(s))}catch(Ce){pc(s,o,{then:function(){},status:"rejected",reason:Ce},Rr())}finally{Z.p=M,$!==null&&Q.types!==null&&($.types=Q.types),W.T=$}}function RE(){}function Ep(s,o,p,b){if(s.tag!==5)throw Error(r(476));var E=G4(s).queue;q4(s,E,o,ee,p===null?RE:function(){return V4(s),p(b)})}function G4(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:ee},next:null};var p={};return o.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:p},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function V4(s){var o=G4(s);o.next===null&&(o=s.alternate.memoizedState),pc(s,o.next.queue,{},Rr())}function Np(){return Zn(jc)}function W4(){return An().memoizedState}function Y4(){return An().memoizedState}function LE(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var p=Rr();s=qs(p);var b=Gs(o,s,p);b!==null&&(yr(b,o,p),cc(b,o,p)),o={cache:np()},s.payload=o;return}o=o.return}}function OE(s,o,p){var b=Rr();p={lane:b,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},_h(s)?K4(o,p):(p=Gf(s,o,p,b),p!==null&&(yr(p,s,b),Z4(p,o,b)))}function X4(s,o,p){var b=Rr();pc(s,o,p,b)}function pc(s,o,p,b){var E={lane:b,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(_h(s))K4(o,E);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=o.lastRenderedReducer,M!==null))try{var $=o.lastRenderedState,Q=M($,p);if(E.hasEagerState=!0,E.eagerState=Q,Nr(Q,$))return eh(s,o,E,0),tn===null&&Ju(),!1}catch{}finally{}if(p=Gf(s,o,E,b),p!==null)return yr(p,s,b),Z4(p,o,b),!0}return!1}function Ap(s,o,p,b){if(b={lane:2,revertLane:am(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},_h(s)){if(o)throw Error(r(479))}else o=Gf(s,p,b,2),o!==null&&yr(o,s,2)}function _h(s){var o=s.alternate;return s===gt||o!==null&&o===gt}function K4(s,o){qo=fh=!0;var p=s.pending;p===null?o.next=o:(o.next=p.next,p.next=o),s.pending=o}function Z4(s,o,p){if((p&4194048)!==0){var b=o.lanes;b&=s.pendingLanes,p|=b,o.lanes=p,ge(s,p)}}var mc={readContext:Zn,use:gh,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useLayoutEffect:kn,useInsertionEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useSyncExternalStore:kn,useId:kn,useHostTransitionStatus:kn,useFormState:kn,useActionState:kn,useOptimistic:kn,useMemoCache:kn,useCacheRefresh:kn};mc.useEffectEvent=kn;var Q4={readContext:Zn,use:gh,useCallback:function(s,o){return sr().memoizedState=[s,o===void 0?null:o],s},useContext:Zn,useEffect:O4,useImperativeHandle:function(s,o,p){p=p!=null?p.concat([s]):null,bh(4194308,4,H4.bind(null,o,s),p)},useLayoutEffect:function(s,o){return bh(4194308,4,s,o)},useInsertionEffect:function(s,o){bh(4,2,s,o)},useMemo:function(s,o){var p=sr();o=o===void 0?null:o;var b=s();if(Ha){_t(!0);try{s()}finally{_t(!1)}}return p.memoizedState=[b,o],b},useReducer:function(s,o,p){var b=sr();if(p!==void 0){var E=p(o);if(Ha){_t(!0);try{p(o)}finally{_t(!1)}}}else E=o;return b.memoizedState=b.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},b.queue=s,s=s.dispatch=OE.bind(null,gt,s),[b.memoizedState,s]},useRef:function(s){var o=sr();return s={current:s},o.memoizedState=s},useState:function(s){s=xp(s);var o=s.queue,p=X4.bind(null,gt,o);return o.dispatch=p,[s.memoizedState,p]},useDebugValue:kp,useDeferredValue:function(s,o){var p=sr();return Cp(p,s,o)},useTransition:function(){var s=xp(!1);return s=q4.bind(null,gt,s.queue,!0,!1),sr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,p){var b=gt,E=sr();if(jt){if(p===void 0)throw Error(r(407));p=p()}else{if(p=o(),tn===null)throw Error(r(349));(Tt&127)!==0||y4(b,o,p)}E.memoizedState=p;var M={value:p,getSnapshot:o};return E.queue=M,O4(x4.bind(null,b,M,s),[s]),b.flags|=2048,Vo(9,{destroy:void 0},_4.bind(null,b,M,p,o),null),p},useId:function(){var s=sr(),o=tn.identifierPrefix;if(jt){var p=ji,b=Mi;p=(b&~(1<<32-ut(b)-1)).toString(32)+p,o="_"+o+"R_"+p,p=ph++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof b.is=="string"?$.createElement("select",{is:b.is}):$.createElement("select"),b.multiple?M.multiple=!0:b.size&&(M.size=b.size);break;default:M=typeof b.is=="string"?$.createElement(E,{is:b.is}):$.createElement(E)}}M[Bt]=o,M[$n]=b;e:for($=o.child;$!==null;){if($.tag===5||$.tag===6)M.appendChild($.stateNode);else if($.tag!==4&&$.tag!==27&&$.child!==null){$.child.return=$,$=$.child;continue}if($===o)break e;for(;$.sibling===null;){if($.return===null||$.return===o)break e;$=$.return}$.sibling.return=$.return,$=$.sibling}o.stateNode=M;e:switch(Jn(M,E,b),E){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}b&&os(o)}}return cn(o),Pp(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,p),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==b&&os(o);else{if(typeof b!="string"&&o.stateNode===null)throw Error(r(166));if(s=fe.current,zo(o)){if(s=o.stateNode,p=o.memoizedProps,b=null,E=Kn,E!==null)switch(E.tag){case 27:case 5:b=E.memoizedProps}s[Bt]=o,s=!!(s.nodeValue===p||b!==null&&b.suppressHydrationWarning===!0||v_(s.nodeValue,p)),s||$s(o,!0)}else s=Fh(s).createTextNode(b),s[Bt]=o,o.stateNode=s}return cn(o),null;case 31:if(p=o.memoizedState,s===null||s.memoizedState!==null){if(b=zo(o),p!==null){if(s===null){if(!b)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Bt]=o}else Da(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),s=!1}else p=Qf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return o.flags&256?(Mr(o),o):(Mr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return cn(o),null;case 13:if(b=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=zo(o),b!==null&&b.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=o.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[Bt]=o}else Da(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),E=!1}else E=Qf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return o.flags&256?(Mr(o),o):(Mr(o),null)}return Mr(o),(o.flags&128)!==0?(o.lanes=p,o):(p=b!==null,s=s!==null&&s.memoizedState!==null,p&&(b=o.child,E=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(E=b.alternate.memoizedState.cachePool.pool),M=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(M=b.memoizedState.cachePool.pool),M!==E&&(b.flags|=2048)),p!==s&&p&&(o.child.flags|=8192),Ch(o,o.updateQueue),cn(o),null);case 4:return ne(),s===null&&um(o.stateNode.containerInfo),cn(o),null;case 10:return rs(o.type),cn(o),null;case 19:if(Y(Nn),b=o.memoizedState,b===null)return cn(o),null;if(E=(o.flags&128)!==0,M=b.rendering,M===null)if(E)vc(b,!1);else{if(Cn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(M=dh(s),M!==null){for(o.flags|=128,vc(b,!1),s=M.updateQueue,o.updateQueue=s,Ch(o,s),o.subtreeFlags=0,s=p,p=o.child;p!==null;)Xb(p,s),p=p.sibling;return G(Nn,Nn.current&1|2),jt&&ts(o,b.treeForkCount),o.child}s=s.sibling}b.tail!==null&&Je()>Mh&&(o.flags|=128,E=!0,vc(b,!1),o.lanes=4194304)}else{if(!E)if(s=dh(M),s!==null){if(o.flags|=128,E=!0,s=s.updateQueue,o.updateQueue=s,Ch(o,s),vc(b,!0),b.tail===null&&b.tailMode==="hidden"&&!M.alternate&&!jt)return cn(o),null}else 2*Je()-b.renderingStartTime>Mh&&p!==536870912&&(o.flags|=128,E=!0,vc(b,!1),o.lanes=4194304);b.isBackwards?(M.sibling=o.child,o.child=M):(s=b.last,s!==null?s.sibling=M:o.child=M,b.last=M)}return b.tail!==null?(s=b.tail,b.rendering=s,b.tail=s.sibling,b.renderingStartTime=Je(),s.sibling=null,p=Nn.current,G(Nn,E?p&1|2:p&1),jt&&ts(o,b.treeForkCount),s):(cn(o),null);case 22:case 23:return Mr(o),hp(),b=o.memoizedState!==null,s!==null?s.memoizedState!==null!==b&&(o.flags|=8192):b&&(o.flags|=8192),b?(p&536870912)!==0&&(o.flags&128)===0&&(cn(o),o.subtreeFlags&6&&(o.flags|=8192)):cn(o),p=o.updateQueue,p!==null&&Ch(o,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),b=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(b=o.memoizedState.cachePool.pool),b!==p&&(o.flags|=2048),s!==null&&Y(Oa),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),rs(Dn),cn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function FE(s,o){switch(Kf(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return rs(Dn),ne(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return ye(o),null;case 31:if(o.memoizedState!==null){if(Mr(o),o.alternate===null)throw Error(r(340));Da()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Mr(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Da()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return Y(Nn),null;case 4:return ne(),null;case 10:return rs(o.type),null;case 22:case 23:return Mr(o),hp(),s!==null&&Y(Oa),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return rs(Dn),null;case 25:return null;default:return null}}function wy(s,o){switch(Kf(o),o.tag){case 3:rs(Dn),ne();break;case 26:case 27:case 5:ye(o);break;case 4:ne();break;case 31:o.memoizedState!==null&&Mr(o);break;case 13:Mr(o);break;case 19:Y(Nn);break;case 10:rs(o.type);break;case 22:case 23:Mr(o),hp(),s!==null&&Y(Oa);break;case 24:rs(Dn)}}function bc(s,o){try{var p=o.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var E=b.next;p=E;do{if((p.tag&s)===s){b=void 0;var M=p.create,$=p.inst;b=M(),$.destroy=b}p=p.next}while(p!==E)}}catch(Q){Xt(o,o.return,Q)}}function Ys(s,o,p){try{var b=o.updateQueue,E=b!==null?b.lastEffect:null;if(E!==null){var M=E.next;b=M;do{if((b.tag&s)===s){var $=b.inst,Q=$.destroy;if(Q!==void 0){$.destroy=void 0,E=o;var ae=p,me=Q;try{me()}catch(we){Xt(E,ae,we)}}}b=b.next}while(b!==M)}}catch(we){Xt(o,o.return,we)}}function Sy(s){var o=s.updateQueue;if(o!==null){var p=s.stateNode;try{f4(o,p)}catch(b){Xt(s,s.return,b)}}}function ky(s,o,p){p.props=Fa(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(b){Xt(s,o,b)}}function yc(s,o){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var b=s.stateNode;break;case 30:b=s.stateNode;break;default:b=s.stateNode}typeof p=="function"?s.refCleanup=p(b):p.current=b}}catch(E){Xt(s,o,E)}}function Di(s,o){var p=s.ref,b=s.refCleanup;if(p!==null)if(typeof b=="function")try{b()}catch(E){Xt(s,o,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(E){Xt(s,o,E)}else p.current=null}function Cy(s){var o=s.type,p=s.memoizedProps,b=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":p.autoFocus&&b.focus();break e;case"img":p.src?b.src=p.src:p.srcSet&&(b.srcset=p.srcSet)}}catch(E){Xt(s,s.return,E)}}function Up(s,o,p){try{var b=s.stateNode;lN(b,s.type,p,o),b[$n]=o}catch(E){Xt(s,s.return,E)}}function Ey(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ta(s.type)||s.tag===4}function qp(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Ey(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ta(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Gp(s,o,p){var b=s.tag;if(b===5||b===6)s=s.stateNode,o?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,o):(o=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,o.appendChild(s),p=p._reactRootContainer,p!=null||o.onclick!==null||(o.onclick=Qi));else if(b!==4&&(b===27&&ta(s.type)&&(p=s.stateNode,o=null),s=s.child,s!==null))for(Gp(s,o,p),s=s.sibling;s!==null;)Gp(s,o,p),s=s.sibling}function Eh(s,o,p){var b=s.tag;if(b===5||b===6)s=s.stateNode,o?p.insertBefore(s,o):p.appendChild(s);else if(b!==4&&(b===27&&ta(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(Eh(s,o,p),s=s.sibling;s!==null;)Eh(s,o,p),s=s.sibling}function Ny(s){var o=s.stateNode,p=s.memoizedProps;try{for(var b=s.type,E=o.attributes;E.length;)o.removeAttributeNode(E[0]);Jn(o,b,p),o[Bt]=s,o[$n]=p}catch(M){Xt(s,s.return,M)}}var ls=!1,On=!1,Vp=!1,Ay=typeof WeakSet=="function"?WeakSet:Set,Vn=null;function $E(s,o){if(s=s.containerInfo,fm=Wh,s=Fb(s),Hf(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var b=p.getSelection&&p.getSelection();if(b&&b.rangeCount!==0){p=b.anchorNode;var E=b.anchorOffset,M=b.focusNode;b=b.focusOffset;try{p.nodeType,M.nodeType}catch{p=null;break e}var $=0,Q=-1,ae=-1,me=0,we=0,Ce=s,be=null;t:for(;;){for(var xe;Ce!==p||E!==0&&Ce.nodeType!==3||(Q=$+E),Ce!==M||b!==0&&Ce.nodeType!==3||(ae=$+b),Ce.nodeType===3&&($+=Ce.nodeValue.length),(xe=Ce.firstChild)!==null;)be=Ce,Ce=xe;for(;;){if(Ce===s)break t;if(be===p&&++me===E&&(Q=$),be===M&&++we===b&&(ae=$),(xe=Ce.nextSibling)!==null)break;Ce=be,be=Ce.parentNode}Ce=xe}p=Q===-1||ae===-1?null:{start:Q,end:ae}}else p=null}p=p||{start:0,end:0}}else p=null;for(pm={focusedElem:s,selectionRange:p},Wh=!1,Vn=o;Vn!==null;)if(o=Vn,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,Vn=s;else for(;Vn!==null;){switch(o=Vn,M=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p title"))),Jn(M,b,p),M[Bt]=s,Sn(M),b=M;break e;case"link":var $=L_("link","href",E).get(b+(p.href||""));if($){for(var Q=0;Q<$.length;Q++)if(M=$[Q],M.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&M.getAttribute("rel")===(p.rel==null?null:p.rel)&&M.getAttribute("title")===(p.title==null?null:p.title)&&M.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){$.splice(Q,1);break t}}M=E.createElement(b),Jn(M,b,p),E.head.appendChild(M);break;case"meta":if($=L_("meta","content",E).get(b+(p.content||""))){for(Q=0;Q<$.length;Q++)if(M=$[Q],M.getAttribute("content")===(p.content==null?null:""+p.content)&&M.getAttribute("name")===(p.name==null?null:p.name)&&M.getAttribute("property")===(p.property==null?null:p.property)&&M.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&M.getAttribute("charset")===(p.charSet==null?null:p.charSet)){$.splice(Q,1);break t}}M=E.createElement(b),Jn(M,b,p),E.head.appendChild(M);break;default:throw Error(r(468,b))}M[Bt]=s,Sn(M),b=M}s.stateNode=b}else O_(E,s.type,s.stateNode);else s.stateNode=R_(E,b,s.memoizedProps);else M!==b?(M===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):M.count--,b===null?O_(E,s.type,s.stateNode):R_(E,b,s.memoizedProps)):b===null&&s.stateNode!==null&&Up(s,s.memoizedProps,p.memoizedProps)}break;case 27:gr(o,s),vr(s),b&512&&(On||p===null||Di(p,p.return)),p!==null&&b&4&&Up(s,s.memoizedProps,p.memoizedProps);break;case 5:if(gr(o,s),vr(s),b&512&&(On||p===null||Di(p,p.return)),s.flags&32){E=s.stateNode;try{No(E,"")}catch(We){Xt(s,s.return,We)}}b&4&&s.stateNode!=null&&(E=s.memoizedProps,Up(s,E,p!==null?p.memoizedProps:E)),b&1024&&(Vp=!0);break;case 6:if(gr(o,s),vr(s),b&4){if(s.stateNode===null)throw Error(r(162));b=s.memoizedProps,p=s.stateNode;try{p.nodeValue=b}catch(We){Xt(s,s.return,We)}}break;case 3:if(Uh=null,E=hi,hi=$h(o.containerInfo),gr(o,s),hi=E,vr(s),b&4&&p!==null&&p.memoizedState.isDehydrated)try{il(o.containerInfo)}catch(We){Xt(s,s.return,We)}Vp&&(Vp=!1,Oy(s));break;case 4:b=hi,hi=$h(s.stateNode.containerInfo),gr(o,s),vr(s),hi=b;break;case 12:gr(o,s),vr(s);break;case 31:gr(o,s),vr(s),b&4&&(b=s.updateQueue,b!==null&&(s.updateQueue=null,Nh(s,b)));break;case 13:gr(o,s),vr(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(Th=Je()),b&4&&(b=s.updateQueue,b!==null&&(s.updateQueue=null,Nh(s,b)));break;case 22:E=s.memoizedState!==null;var ae=p!==null&&p.memoizedState!==null,me=ls,we=On;if(ls=me||E,On=we||ae,gr(o,s),On=we,ls=me,vr(s),b&8192)e:for(o=s.stateNode,o._visibility=E?o._visibility&-2:o._visibility|1,E&&(p===null||ae||ls||On||$a(s)),p=null,o=s;;){if(o.tag===5||o.tag===26){if(p===null){ae=p=o;try{if(M=ae.stateNode,E)$=M.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none";else{Q=ae.stateNode;var Ce=ae.memoizedProps.style,be=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;Q.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(We){Xt(ae,ae.return,We)}}}else if(o.tag===6){if(p===null){ae=o;try{ae.stateNode.nodeValue=E?"":ae.memoizedProps}catch(We){Xt(ae,ae.return,We)}}}else if(o.tag===18){if(p===null){ae=o;try{var xe=ae.stateNode;E?k_(xe,!0):k_(ae.stateNode,!1)}catch(We){Xt(ae,ae.return,We)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;p===o&&(p=null),o=o.return}p===o&&(p=null),o.sibling.return=o.return,o=o.sibling}b&4&&(b=s.updateQueue,b!==null&&(p=b.retryQueue,p!==null&&(b.retryQueue=null,Nh(s,p))));break;case 19:gr(o,s),vr(s),b&4&&(b=s.updateQueue,b!==null&&(s.updateQueue=null,Nh(s,b)));break;case 30:break;case 21:break;default:gr(o,s),vr(s)}}function vr(s){var o=s.flags;if(o&2){try{for(var p,b=s.return;b!==null;){if(Ey(b)){p=b;break}b=b.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var E=p.stateNode,M=qp(s);Eh(s,M,E);break;case 5:var $=p.stateNode;p.flags&32&&(No($,""),p.flags&=-33);var Q=qp(s);Eh(s,Q,$);break;case 3:case 4:var ae=p.stateNode.containerInfo,me=qp(s);Gp(s,me,ae);break;default:throw Error(r(161))}}catch(we){Xt(s,s.return,we)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function Oy(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;Oy(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function us(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Ty(s,o.alternate,o),o=o.sibling}function $a(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:Ys(4,o,o.return),$a(o);break;case 1:Di(o,o.return);var p=o.stateNode;typeof p.componentWillUnmount=="function"&&ky(o,o.return,p),$a(o);break;case 27:Ac(o.stateNode);case 26:case 5:Di(o,o.return),$a(o);break;case 22:o.memoizedState===null&&$a(o);break;case 30:$a(o);break;default:$a(o)}s=s.sibling}}function hs(s,o,p){for(p=p&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var b=o.alternate,E=s,M=o,$=M.flags;switch(M.tag){case 0:case 11:case 15:hs(E,M,p),bc(4,M);break;case 1:if(hs(E,M,p),b=M,E=b.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(me){Xt(b,b.return,me)}if(b=M,E=b.updateQueue,E!==null){var Q=b.stateNode;try{var ae=E.shared.hiddenCallbacks;if(ae!==null)for(E.shared.hiddenCallbacks=null,E=0;EQt&&($=Qt,Qt=ot,ot=$);var de=Ib(Q,ot),ue=Ib(Q,Qt);if(de&&ue&&(xe.rangeCount!==1||xe.anchorNode!==de.node||xe.anchorOffset!==de.offset||xe.focusNode!==ue.node||xe.focusOffset!==ue.offset)){var pe=Ce.createRange();pe.setStart(de.node,de.offset),xe.removeAllRanges(),ot>Qt?(xe.addRange(pe),xe.extend(ue.node,ue.offset)):(pe.setEnd(ue.node,ue.offset),xe.addRange(pe))}}}}for(Ce=[],xe=Q;xe=xe.parentNode;)xe.nodeType===1&&Ce.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Qp?32:p,W.T=null,p=Jp,Jp=null;var M=Qs,$=fs;if(Pn=0,Zo=Qs=null,fs=0,(Ut&6)!==0)throw Error(r(331));var Q=Ut;if(Ut|=4,Hy(M.current),By(M,M.current,$,p),Ut=Q,Cc(0,!1),et&&typeof et.onPostCommitFiberRoot=="function")try{et.onPostCommitFiberRoot(Fe,M)}catch{}return!0}finally{Z.p=E,W.T=b,r_(s,o)}}function s_(s,o,p){o=Zr(p,o),o=Dp(s.stateNode,o,2),s=Gs(s,o,2),s!==null&&(jn(s,2),Ri(s))}function Xt(s,o,p){if(s.tag===3)s_(s,s,p);else for(;o!==null;){if(o.tag===3){s_(o,s,p);break}else if(o.tag===1){var b=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Zs===null||!Zs.has(b))){s=Zr(p,s),p=ay(2),b=Gs(o,p,2),b!==null&&(oy(p,b,o,s),jn(b,2),Ri(b));break}}o=o.return}}function rm(s,o,p){var b=s.pingCache;if(b===null){b=s.pingCache=new qE;var E=new Set;b.set(o,E)}else E=b.get(o),E===void 0&&(E=new Set,b.set(o,E));E.has(p)||(Xp=!0,E.add(p),s=XE.bind(null,s,o,p),o.then(s,s))}function XE(s,o,p){var b=s.pingCache;b!==null&&b.delete(o),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,tn===s&&(Tt&p)===p&&(Cn===4||Cn===3&&(Tt&62914560)===Tt&&300>Je()-Th?(Ut&2)===0&&Qo(s,0):Kp|=p,Ko===Tt&&(Ko=0)),Ri(s)}function a_(s,o){o===0&&(o=Rs()),s=Ma(s,o),s!==null&&(jn(s,o),Ri(s))}function KE(s){var o=s.memoizedState,p=0;o!==null&&(p=o.retryLane),a_(s,p)}function ZE(s,o){var p=0;switch(s.tag){case 31:case 13:var b=s.stateNode,E=s.memoizedState;E!==null&&(p=E.retryLane);break;case 19:b=s.stateNode;break;case 22:b=s.stateNode._retryCache;break;default:throw Error(r(314))}b!==null&&b.delete(o),a_(s,p)}function QE(s,o){return Lt(s,o)}var Bh=null,el=null,im=!1,zh=!1,sm=!1,ea=0;function Ri(s){s!==el&&s.next===null&&(el===null?Bh=el=s:el=el.next=s),zh=!0,im||(im=!0,eN())}function Cc(s,o){if(!sm&&zh){sm=!0;do for(var p=!1,b=Bh;b!==null;){if(s!==0){var E=b.pendingLanes;if(E===0)var M=0;else{var $=b.suspendedLanes,Q=b.pingedLanes;M=(1<<31-ut(42|s)+1)-1,M&=E&~($&~Q),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(p=!0,u_(b,M))}else M=Tt,M=Vr(b,b===tn?M:0,b.cancelPendingCommit!==null||b.timeoutHandle!==-1),(M&3)===0||Mn(b,M)||(p=!0,u_(b,M));b=b.next}while(p);sm=!1}}function JE(){o_()}function o_(){zh=im=!1;var s=0;ea!==0&&uN()&&(s=ea);for(var o=Je(),p=null,b=Bh;b!==null;){var E=b.next,M=l_(b,o);M===0?(b.next=null,p===null?Bh=E:p.next=E,E===null&&(el=p)):(p=b,(s!==0||(M&3)!==0)&&(zh=!0)),b=E}Pn!==0&&Pn!==5||Cc(s),ea!==0&&(ea=0)}function l_(s,o){for(var p=s.suspendedLanes,b=s.pingedLanes,E=s.expirationTimes,M=s.pendingLanes&-62914561;0Q)break;var we=ae.transferSize,Ce=ae.initiatorType;we&&b_(Ce)&&(ae=ae.responseEnd,$+=we*(ae"u"?null:document;function M_(s,o,p){var b=tl;if(b&&typeof o=="string"&&o){var E=Ve(o);E='link[rel="'+s+'"][href="'+E+'"]',typeof p=="string"&&(E+='[crossorigin="'+p+'"]'),T_.has(E)||(T_.add(E),s={rel:s,crossOrigin:p,href:o},b.querySelector(E)===null&&(o=b.createElement("link"),Jn(o,"link",s),Sn(o),b.head.appendChild(o)))}}function yN(s){ps.D(s),M_("dns-prefetch",s,null)}function _N(s,o){ps.C(s,o),M_("preconnect",s,o)}function xN(s,o,p){ps.L(s,o,p);var b=tl;if(b&&s&&o){var E='link[rel="preload"][as="'+Ve(o)+'"]';o==="image"&&p&&p.imageSrcSet?(E+='[imagesrcset="'+Ve(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(E+='[imagesizes="'+Ve(p.imageSizes)+'"]')):E+='[href="'+Ve(s)+'"]';var M=E;switch(o){case"style":M=nl(s);break;case"script":M=rl(s)}ri.has(M)||(s=f({rel:"preload",href:o==="image"&&p&&p.imageSrcSet?void 0:s,as:o},p),ri.set(M,s),b.querySelector(E)!==null||o==="style"&&b.querySelector(Tc(M))||o==="script"&&b.querySelector(Mc(M))||(o=b.createElement("link"),Jn(o,"link",s),Sn(o),b.head.appendChild(o)))}}function wN(s,o){ps.m(s,o);var p=tl;if(p&&s){var b=o&&typeof o.as=="string"?o.as:"script",E='link[rel="modulepreload"][as="'+Ve(b)+'"][href="'+Ve(s)+'"]',M=E;switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=rl(s)}if(!ri.has(M)&&(s=f({rel:"modulepreload",href:s},o),ri.set(M,s),p.querySelector(E)===null)){switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Mc(M)))return}b=p.createElement("link"),Jn(b,"link",s),Sn(b),p.head.appendChild(b)}}}function SN(s,o,p){ps.S(s,o,p);var b=tl;if(b&&s){var E=Ai(b).hoistableStyles,M=nl(s);o=o||"default";var $=E.get(M);if(!$){var Q={loading:0,preload:null};if($=b.querySelector(Tc(M)))Q.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":o},p),(p=ri.get(M))&&xm(s,p);var ae=$=b.createElement("link");Sn(ae),Jn(ae,"link",s),ae._p=new Promise(function(me,we){ae.onload=me,ae.onerror=we}),ae.addEventListener("load",function(){Q.loading|=1}),ae.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,Ph($,o,b)}$={type:"stylesheet",instance:$,count:1,state:Q},E.set(M,$)}}}function kN(s,o){ps.X(s,o);var p=tl;if(p&&s){var b=Ai(p).hoistableScripts,E=rl(s),M=b.get(E);M||(M=p.querySelector(Mc(E)),M||(s=f({src:s,async:!0},o),(o=ri.get(E))&&wm(s,o),M=p.createElement("script"),Sn(M),Jn(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},b.set(E,M))}}function CN(s,o){ps.M(s,o);var p=tl;if(p&&s){var b=Ai(p).hoistableScripts,E=rl(s),M=b.get(E);M||(M=p.querySelector(Mc(E)),M||(s=f({src:s,async:!0,type:"module"},o),(o=ri.get(E))&&wm(s,o),M=p.createElement("script"),Sn(M),Jn(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},b.set(E,M))}}function j_(s,o,p,b){var E=(E=fe.current)?$h(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(o=nl(p.href),p=Ai(E).hoistableStyles,b=p.get(o),b||(b={type:"style",instance:null,count:0,state:null},p.set(o,b)),b):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=nl(p.href);var M=Ai(E).hoistableStyles,$=M.get(s);if($||(E=E.ownerDocument||E,$={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(s,$),(M=E.querySelector(Tc(s)))&&!M._p&&($.instance=M,$.state.loading=5),ri.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},ri.set(s,p),M||EN(E,s,p,$.state))),o&&b===null)throw Error(r(528,""));return $}if(o&&b!==null)throw Error(r(529,""));return null;case"script":return o=p.async,p=p.src,typeof p=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=rl(p),p=Ai(E).hoistableScripts,b=p.get(o),b||(b={type:"script",instance:null,count:0,state:null},p.set(o,b)),b):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function nl(s){return'href="'+Ve(s)+'"'}function Tc(s){return'link[rel="stylesheet"]['+s+"]"}function D_(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function EN(s,o,p,b){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?b.loading=1:(o=s.createElement("link"),b.preload=o,o.addEventListener("load",function(){return b.loading|=1}),o.addEventListener("error",function(){return b.loading|=2}),Jn(o,"link",p),Sn(o),s.head.appendChild(o))}function rl(s){return'[src="'+Ve(s)+'"]'}function Mc(s){return"script[async]"+s}function R_(s,o,p){if(o.count++,o.instance===null)switch(o.type){case"style":var b=s.querySelector('style[data-href~="'+Ve(p.href)+'"]');if(b)return o.instance=b,Sn(b),b;var E=f({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return b=(s.ownerDocument||s).createElement("style"),Sn(b),Jn(b,"style",E),Ph(b,p.precedence,s),o.instance=b;case"stylesheet":E=nl(p.href);var M=s.querySelector(Tc(E));if(M)return o.state.loading|=4,o.instance=M,Sn(M),M;b=D_(p),(E=ri.get(E))&&xm(b,E),M=(s.ownerDocument||s).createElement("link"),Sn(M);var $=M;return $._p=new Promise(function(Q,ae){$.onload=Q,$.onerror=ae}),Jn(M,"link",b),o.state.loading|=4,Ph(M,p.precedence,s),o.instance=M;case"script":return M=rl(p.src),(E=s.querySelector(Mc(M)))?(o.instance=E,Sn(E),E):(b=p,(E=ri.get(M))&&(b=f({},p),wm(b,E)),s=s.ownerDocument||s,E=s.createElement("script"),Sn(E),Jn(E,"link",b),s.head.appendChild(E),o.instance=E);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(b=o.instance,o.state.loading|=4,Ph(b,p.precedence,s));return o.instance}function Ph(s,o,p){for(var b=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=b.length?b[b.length-1]:null,M=E,$=0;$ title"):null)}function NN(s,o,p){if(p===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function B_(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function AN(s,o,p,b){if(p.type==="stylesheet"&&(typeof b.media!="string"||matchMedia(b.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var E=nl(b.href),M=o.querySelector(Tc(E));if(M){o=M._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=qh.bind(s),o.then(s,s)),p.state.loading|=4,p.instance=M,Sn(M);return}M=o.ownerDocument||o,b=D_(b),(E=ri.get(E))&&xm(b,E),M=M.createElement("link"),Sn(M);var $=M;$._p=new Promise(function(Q,ae){$.onload=Q,$.onerror=ae}),Jn(M,"link",b),p.instance=M}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,o),(o=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=qh.bind(s),o.addEventListener("load",p),o.addEventListener("error",p))}}var Sm=0;function TN(s,o){return s.stylesheets&&s.count===0&&Vh(s,s.stylesheets),0Sm?50:800)+o);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(b),clearTimeout(E)}}:null}function qh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Gh=null;function Vh(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Gh=new Map,o.forEach(MN,s),Gh=null,qh.call(s))}function MN(s,o){if(!(o.state.loading&4)){var p=Gh.get(s);if(p)var b=p.get(null);else{p=new Map,Gh.set(s,p);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dm.exports=XN(),Dm.exports}var ZN=KN();/** + * @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 C7=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).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 QN=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 JN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.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 l3=e=>{const t=JN(e);return t.charAt(0).toUpperCase()+t.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 Bm={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 eA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},tA=O.createContext({}),nA=()=>O.useContext(tA),rA=O.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...c},u)=>{const{size:h=24,strokeWidth:m=2,absoluteStrokeWidth:f=!1,color:g="currentColor",className:v=""}=nA()??{},k=r??f?Number(n??m)*24/Number(t??h):n??m;return O.createElement("svg",{ref:u,...Bm,width:t??h??Bm.width,height:t??h??Bm.height,stroke:e??g,strokeWidth:k,className:C7("lucide",v,i),...!a&&!eA(c)&&{"aria-hidden":"true"},...c},[...l.map(([S,y])=>O.createElement(S,y)),...Array.isArray(a)?a:[a]])});/** + * @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,t)=>{const n=O.forwardRef(({className:r,...i},a)=>O.createElement(rA,{ref:a,iconNode:t,className:C7(`lucide-${QN(l3(e))}`,`lucide-${e}`,r),...i}));return n.displayName=l3(e),n};/** + * @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 iA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],q1=Xe("arrow-left",iA);/** + * @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 sA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zm=Xe("arrow-right",sA);/** + * @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 aA=[["circle",{cx:"9",cy:"9",r:"7",key:"p2h5vp"}],["circle",{cx:"15",cy:"15",r:"7",key:"19ennj"}]],oA=Xe("blend",aA);/** + * @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 lA=[["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"}]],E7=Xe("blocks",lA);/** + * @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 cA=[["path",{d:"M21 8a2 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.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],uA=Xe("box",cA);/** + * @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 hA=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],dA=Xe("boxes",hA);/** + * @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 fA=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],pA=Xe("chart-line",fA);/** + * @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 mA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],kr=Xe("check",mA);/** + * @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 gA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Hi=Xe("chevron-down",gA);/** + * @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 vA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],bA=Xe("chevron-left",vA);/** + * @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 yA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],po=Xe("chevron-right",yA);/** + * @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 _A=[["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"}]],xA=Xe("circle-question-mark",_A);/** + * @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 wA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],SA=Xe("circle-stop",wA);/** + * @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 kA=[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]],c3=Xe("clapperboard",kA);/** + * @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 CA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],EA=Xe("clock",CA);/** + * @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 NA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],N7=Xe("code",NA);/** + * @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 AA=[["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"}]],Sd=Xe("copy",AA);/** + * @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 TA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],A7=Xe("corner-down-left",TA);/** + * @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 MA=[["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"}]],jA=Xe("cpu",MA);/** + * @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 DA=[["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"}]],RA=Xe("download",DA);/** + * @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 LA=[["path",{d:"M10 11h.01",key:"d2at3l"}],["path",{d:"M14 6h.01",key:"k028ub"}],["path",{d:"M18 6h.01",key:"1v4wsw"}],["path",{d:"M6.5 13.1h.01",key:"1748ia"}],["path",{d:"M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3",key:"172yzv"}],["path",{d:"M17.4 9.9c-.8.8-2 .8-2.8 0",key:"1obv0w"}],["path",{d:"M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7",key:"rqjl8i"}],["path",{d:"M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4",key:"1mr6wy"}]],OA=Xe("drama",LA);/** + * @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 BA=[["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"}]],T7=Xe("ellipsis",BA);/** + * @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 zA=[["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"}]],Eu=Xe("external-link",zA);/** + * @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 IA=[["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"}]],M7=Xe("file-code",IA);/** + * @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 HA=[["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"}]],j7=Xe("file-text",HA);/** + * @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 FA=[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],$A=Xe("file-up",FA);/** + * @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 PA=[["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"}]],UA=Xe("flask-conical",PA);/** + * @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 qA=[["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"}]],D7=Xe("folder-git-2",qA);/** + * @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 GA=[["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"}]],gv=Xe("folder-open",GA);/** + * @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 VA=[["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"}]],vv=Xe("folder-tree",VA);/** + * @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 WA=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],R7=Xe("gamepad-2",WA);/** + * @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 YA=[["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"}]],Ol=Xe("git-branch",YA);/** + * @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 XA=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],KA=Xe("hard-drive",XA);/** + * @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 ZA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],QA=Xe("info",ZA);/** + * @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 JA=[["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"}]],eT=Xe("laptop",JA);/** + * @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 tT=[["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"}]],nT=Xe("lightbulb",tT);/** + * @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=[["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"}]],u3=Xe("lock",rT);/** + * @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 iT=[["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"}]],sT=Xe("maximize-2",iT);/** + * @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:"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"}]],oT=Xe("minimize-2",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 lT=[["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"}]],cT=Xe("mouse-pointer-click",lT);/** + * @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 uT=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],hT=Xe("notebook-pen",uT);/** + * @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 dT=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],fT=Xe("palette",dT);/** + * @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 pT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],L7=Xe("panel-left",pT);/** + * @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 mT=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],O7=Xe("play",mT);/** + * @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 gT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bv=Xe("plus",gT);/** + * @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 vT=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],bT=Xe("radio-tower",vT);/** + * @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 yT=[["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"}]],Fi=Xe("refresh-cw",yT);/** + * @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 _T=[["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"}]],kd=Xe("rotate-cw",_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 xT=[["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"}]],B7=Xe("scroll-text",xT);/** + * @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 wT=[["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"}]],G1=Xe("server",wT);/** + * @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=[["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"}]],kT=Xe("settings-2",ST);/** + * @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 CT=[["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"}]],ET=Xe("settings",CT);/** + * @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 NT=[["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"}]],AT=Xe("sliders-horizontal",NT);/** + * @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 TT=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],MT=Xe("sparkles",TT);/** + * @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 jT=[["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"}]],DT=Xe("square-terminal",jT);/** + * @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=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],yv=Xe("terminal",RT);/** + * @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 LT=[["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"}]],Cd=Xe("trash-2",LT);/** + * @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:"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"}]],BT=Xe("upload",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 zT=[["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"}]],z7=Xe("users",zT);/** + * @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 IT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],eo=Xe("x",IT);function wl(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function Es(e){if(!e.ok){const t=await e.text().catch(()=>"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const ft=e=>fetch(e).then(t=>Es(t)),Et=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>Es(n)),Ed=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Es(n)),HT=()=>ft("/api/projects").then(e=>e.projects),FT=e=>ft(`/api/local-repo?path=${encodeURIComponent(e)}`),$T=()=>Et("/api/project-path/pick").then(e=>e.path),PT=e=>Et("/api/projects",e).then(t=>t.project),UT=e=>ft(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),qT=()=>ft("/api/github/account"),GT=(e,t)=>ft(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`),VT=e=>ft(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),V1=(e,t)=>Ed(`/api/projects/${e}`,t).then(n=>n.project),WT=e=>ft(`/api/projects/${e}/branches`),YT=()=>ft("/api/github/repos").then(e=>e.repos),I7=()=>ft("/api/personas").then(e=>e.personas),h3=e=>ft(`/api/projects/${e}/proposals`).then(t=>t.proposals),XT=(e,t)=>Et(`/api/agent/proposals/${e}/approve`,t).then(n=>n.session),KT=e=>Et(`/api/agent/proposals/${e}/dismiss`,{}),ZT=e=>Et(`/api/projects/${e}/open`).then(t=>t.project),QT=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),JT=e=>ft(`/api/projects/${e}/experiments`).then(t=>t.experiments),eM=e=>ft(`/api/projects/${e}/runs`).then(t=>t.runs),tM=()=>ft("/api/instances").then(e=>e.instances),nM=()=>Et("/api/instances/reconcile").then(e=>e.reattached),H7=e=>Et(`/api/runs/${e}/cancel`).then(()=>{}),rM=(e,t,n)=>Et(`/api/runs/${e}/verdict`,{verdict:t,notes:n}).then(r=>r.run),iM=(e,t,n)=>Et(`/api/experiments/${e}/verdict`,{verdict:t,notes:n}).then(r=>r.experiment),sM=e=>ft(`/api/runs/${e}/artifacts`).then(t=>t.artifacts),Im=(e,t)=>`/api/runs/${e}/artifacts/file?path=${encodeURIComponent(t)}`,aM=e=>Et(`/api/experiments/${e}/play-build`),oM=e=>`/play/${e.id}/${e.playEntry??""}`,lM=(e,t)=>Ed(`/api/experiments/${e}`,{playEntry:t}).then(n=>n.experiment),cM=e=>Et(`/api/experiments/${e}/play-session/beat`).then(t=>t.run),F7=(e,t,n)=>Et(`/api/experiments/${e}/play-session/end`,{verdict:t??null,notes:n}).then(r=>r.run),uM=(e,t)=>ft(`/api/runs/${e}/log?offset=${t}`),hM=e=>ft(`/api/runs/${e}/diff`),dM=e=>ft(`/api/experiments/${e}/diff`),fM=e=>ft(`/api/experiments/${e}/commits`).then(t=>t.commits),pM=(e,t)=>ft(`/api/experiments/${e}/commits/${t}/diff`),d3=e=>ft(`/api/projects/${e}/working-tree`),$7=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),mM=(e,t,n={})=>ft(`/api/projects/${e}/file?${$7(n,new URLSearchParams({path:t}))}`),W1=(e,t={})=>{const n=$7(t).toString();return ft(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},gM=e=>ft(`/api/chat/sessions/${e}/worktree`),Nd=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,vM=()=>ft("/api/settings/hf"),bM=e=>Et("/api/settings/hf",{token:e}),yM=()=>ft("/api/settings/k8s"),_M=e=>Et("/api/settings/k8s",e),xM=()=>ft("/api/settings/modal"),wM=()=>Et("/api/settings/modal/provision"),SM=()=>Et("/api/settings/scenario/connect"),kM=()=>Et("/api/settings/scenario/disconnect"),CM=()=>Et("/api/settings/comfyui/start"),EM=(e=!1)=>ft(`/api/settings/genai${e?"?refresh=1":""}`).then(t=>t.providers),NM=()=>ft("/api/settings/env").then(e=>e.vars),P7=(e,t)=>Et("/api/settings/env",{key:e,value:t}).then(n=>n.vars),AM=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>Es(t)).then(t=>t.vars),TM=()=>ft("/api/settings/data-dir"),MM=e=>Et("/api/settings/data-dir/validate",{path:e}),jM=e=>Et("/api/settings/data-dir/move",{path:e}),DM=()=>ft("/api/settings/ssh").then(e=>e.hosts),RM=e=>Et("/api/settings/ssh/preflight",{host:e}),LM=()=>ft("/api/settings/slurm"),OM=e=>Et("/api/settings/slurm",e),BM=e=>Et("/api/settings/slurm/preflight",{host:e}),zM=()=>ft("/api/settings/ray"),IM=e=>Et("/api/settings/ray",e),HM=e=>Et("/api/settings/ray/preflight",{address:e??null}),FM=()=>ft("/api/settings/compute"),U7=e=>Et("/api/settings/compute/default",e),$M=()=>ft("/api/settings/local"),PM=()=>ft("/api/settings/openresearch"),f3=e=>ft(`/api/projects/${e}/files`),q7=(e,t)=>ft(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),UM=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Es(n)),mo=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,qM=(e,t)=>fetch(mo(e,t)).then(n=>{if(n.status===404)return null;if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.text()}),G7=()=>ft("/api/settings/git"),GM=e=>Et("/api/settings/git",e),VM=e=>Et("/api/settings/git/token",{token:e}),WM=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>Es(e)),YM=()=>ft("/api/settings/telemetry"),XM=e=>Et("/api/settings/telemetry",{enabled:e}),KM=e=>Et("/api/settings/telemetry/consent",{enabled:e}),X0=e=>e.displayName??xv(e.id),K0="default";function _v(e,t){var l,c,u;const n=e==null?void 0:e.models.find(h=>h.id===t),r=(n==null?void 0:n.reasoningLevels)??((l=e==null?void 0:e.options)==null?void 0:l.reasoningLevels)??[],i=n==null?void 0:n.defaultReasoningLevel,a=i&&r.some(h=>h.id===i)?i:r.some(h=>h.id===K0)?K0:((c=e==null?void 0:e.options)==null?void 0:c.defaultReasoningLevel)??((u=r[0])==null?void 0:u.id)??null;return{choices:r,defaultId:a}}function V7(e,t,n){if(!e)return n;const{choices:r,defaultId:i}=_v(e,t);return r.length===0?K0:n&&r.some(a=>a.id===n)?n:i}const Sl=(e=!1,t=!1)=>{const n=new URLSearchParams;e&&n.set("refresh","1"),t&&n.set("retry","1");const r=n.size>0?`?${n.toString()}`:"";return ft(`/api/harnesses${r}`).then(i=>i.harnesses)},ZM=e=>ft(`/api/skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),QM=e=>ft(`/api/user-skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),JM=e=>Et("/api/user-skills",e).then(t=>t.skill),ej=e=>{const t=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&t.set("project",e.projectId),fetch(`/api/user-skills?${t.toString()}`,{method:"DELETE"}).then(n=>Es(n))},tj=()=>ft("/api/harness-skills").then(e=>e.skills),nj=e=>Et("/api/user-skills/import",e).then(t=>t.skill);function xv(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const i of t.split("-"))/^\d+(\.\d+)?$/.test(i)?r.push(i):(r.length&&n.push(r.splice(0).join(".")),n.push(i==="gpt"?"GPT":i.charAt(0).toUpperCase()+i.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const R0=e=>ft(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),rj=(e,t,n={})=>Et("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),ij=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>Es(t)),sj=(e,t)=>Ed(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),aj=(e,t)=>Ed(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),L0=e=>ft(`/api/chat/sessions/${e}/messages`).then(t=>({messages:t.messages,queued:t.queued??[]})),oj=(e,t)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Es(n)),lj=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,p3=(e,t,n={},r)=>Et(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),cj=e=>Et(`/api/chat/sessions/${e}/interrupt`),uj=(e,t)=>Et(`/api/chat/sessions/${e}/respond`,t);function Pi(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Z0(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function fa(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function Ad(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function W7(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:Ad(e)==="ray_job"?"":typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}const g3={producer:{id:"producer",label:"Producer",Icon:c3,color:"var(--persona-producer)",cls:"persona-producer",role:"Orchestrates the funnel; suggests the next agent for you to approve."},"idea-foundry":{id:"idea-foundry",label:"Idea foundry",Icon:nT,color:"var(--persona-idea-foundry)",cls:"persona-idea-foundry",role:"Interviews a vague seed into a thesis with a real hook."},analyst:{id:"analyst",label:"Analyst",Icon:pA,color:"var(--persona-analyst)",cls:"persona-analyst",role:"Scores an idea against the 35-signal market-fit rubric."},"game-designer":{id:"game-designer",label:"Game designer",Icon:R7,color:"var(--persona-game-designer)",cls:"persona-game-designer",role:"Builds the playable prototype — loop first, then polish."},blender:{id:"blender",label:"Blender artist",Icon:uA,color:"var(--persona-blender)",cls:"persona-blender",role:"Models 3D assets in your open Blender and exports them for the build."},comfyui:{id:"comfyui",label:"ComfyUI artist",Icon:oA,color:"var(--persona-comfyui)",cls:"persona-comfyui",role:"Generates 2D art on your local ComfyUI and checks the result."},"game-artist":{id:"game-artist",label:"Game artist",Icon:c3,color:"var(--persona-game-artist)",cls:"persona-game-artist",role:"Animates characters — walk, idle, attack — by whichever local route fits."},research:{id:"research",label:"Research",Icon:UA,color:"var(--persona-research)",cls:"persona-research",role:"The general base agent. Fallback for non-game work."}};function io(e){return g3[e??"research"]??g3.research}const hj=["producer","idea-foundry","analyst","game-designer","blender","comfyui","game-artist","research"],Y7="producer";function X7({persona:e,showLabel:t=!0,compact:n=!1,size:r=14}){const i=io(e),a=i.Icon;return d.jsxs("span",{className:`persona-badge ${i.cls}${n?" compact":""}`,title:`${i.label} persona`,children:[d.jsx(a,{size:r,style:{color:i.color}}),t&&!n&&d.jsx("span",{className:"persona-badge-label",children:i.label})]})}function dj({value:e,onChange:t,locked:n=!1}){const[r,i]=O.useState(!1),a=O.useRef(null);if(O.useEffect(()=>{if(!r)return;const h=f=>{a.current&&!a.current.contains(f.target)&&i(!1)},m=f=>f.key==="Escape"&&i(!1);return document.addEventListener("mousedown",h),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",m)}},[r]),n)return d.jsx(X7,{persona:e});const l=io(e),c=l.Icon,u=e??"research";return d.jsxs("div",{className:"persona-picker",ref:a,children:[d.jsxs("button",{className:`persona-badge ${l.cls} persona-badge-btn`,onClick:()=>i(h=>!h),title:"Change persona","aria-haspopup":"listbox","aria-expanded":r,children:[d.jsx(c,{size:14,style:{color:l.color}}),d.jsx("span",{className:"persona-badge-label",children:l.label}),d.jsx(Hi,{size:13,className:"persona-badge-chev"})]}),r&&d.jsxs("div",{className:"persona-menu",role:"listbox",children:[d.jsx("div",{className:"persona-menu-h",children:"Start this session as"}),hj.map(h=>{const m=io(h),f=m.Icon,g=h===u;return d.jsxs("button",{className:`persona-opt ${m.cls} ${g?"sel":""}`,role:"option","aria-selected":g,onClick:()=>{t(h),i(!1)},children:[d.jsx("span",{className:"persona-opt-ic",children:d.jsx(f,{size:15,style:{color:m.color}})}),d.jsxs("span",{className:"persona-opt-t",children:[d.jsxs("span",{className:"persona-opt-n",style:{color:m.color},children:[m.label,h===Y7&&d.jsx("span",{className:"persona-opt-def",children:"default"})]}),d.jsx("span",{className:"persona-opt-d",children:m.role})]}),g&&d.jsx("span",{className:"persona-opt-check",children:"✓"})]},h)}),d.jsx("div",{className:"persona-menu-foot",children:"You rarely need this — the Producer routes you to the others as you go."})]})]})}function K7(e){return e<=10?"crit":e<=25?"warn":"ok"}function Hm(e){const t=K7(e);return t==="crit"?"var(--accent-red)":t==="warn"?"var(--accent-amber)":"var(--accent-green)"}function fj(e){const t=e-Date.now();return t>0&&t<18*36e5}function Z7(e){if(!e)return"";const t=e-Date.now();if(t<=0)return"now";const n=Math.floor(t/6e4);if(n<60)return`${n}m`;const r=Math.floor(n/60);if(r<18)return`${r}h ${n%60}m`;const i=new Date(e);return`${i.toLocaleDateString(void 0,{weekday:"short"})} ${i.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`}function pj(e){return e?`resets ${fj(e)?"in ":""}${Z7(e)}`:""}function mj(e){if(!e)return"";const t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function gj({pct:e,color:t,size:n=18}){const r=n/2-1.3,i=2*Math.PI*r;return d.jsxs("svg",{className:"usage-ring",width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":"true",children:[d.jsx("circle",{cx:n/2,cy:n/2,r,fill:"none",stroke:"var(--border-variant)",strokeWidth:"2.6"}),d.jsx("circle",{cx:n/2,cy:n/2,r,fill:"none",stroke:t,strokeWidth:"2.6",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:i*(1-Math.max(0,Math.min(100,e))/100),transform:`rotate(-90 ${n/2} ${n/2})`})]})}function vj({harness:e}){const[t,n]=O.useState(!1),[r,i]=O.useState(!1),[a,l]=O.useState(e),c=O.useRef(null);O.useEffect(()=>l(e),[e]),O.useEffect(()=>{if(!t)return;const k=y=>{c.current&&!c.current.contains(y.target)&&n(!1)},S=y=>y.key==="Escape"&&n(!1);return document.addEventListener("mousedown",k),document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",S)}},[t]);async function u(){if(a){i(!0);try{const S=(await Sl(!0)).find(y=>y.id===a.id);S&&l(S)}catch{}finally{i(!1)}}}const h=()=>{n(k=>!k),!t&&!(a!=null&&a.usage)&&u()};if(!a)return null;const m=a.usage,f=(m==null?void 0:m.windows)??[],g=f.length?f.reduce((k,S)=>S.remainingPercent0?f.map((k,S)=>d.jsxs("div",{className:"usage-wrow",children:[d.jsxs("div",{className:"usage-wt",children:[d.jsx("div",{className:"usage-wlabel",children:k.label}),k.resetsAtMs&&d.jsx("div",{className:"usage-wsub",children:pj(k.resetsAtMs)}),d.jsx("div",{className:"usage-bar",children:d.jsx("i",{style:{width:`${k.remainingPercent}%`,background:Hm(k.remainingPercent)}})})]}),d.jsxs("div",{className:"usage-pct",style:{color:Hm(k.remainingPercent)},children:[Math.round(k.remainingPercent),"%"]})]},S)):d.jsx("div",{className:"usage-empty",children:(m==null?void 0:m.note)??(r?"Checking usage…":"No usage limits reported.")}),d.jsxs("div",{className:"usage-pop-foot",children:[d.jsxs("button",{className:"usage-refresh",onClick:u,disabled:r,children:[d.jsx(Fi,{size:12,className:r?"spin":""})," ",r?"Refreshing…":"Refresh"]}),(m==null?void 0:m.manageUrl)&&d.jsx("a",{href:m.manageUrl,target:"_blank",rel:"noreferrer",children:"Manage ↗"})]})]})]})}const bj="M0 -9 L2.4 -2.4 L9 0 L2.4 2.4 L0 9 L-2.4 2.4 L-9 0 L-2.4 -2.4 Z",yj=[[52,23,.82],[49,79,1.06],[25,49,.72],[77,55,.78]];function Yc(){return d.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[d.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[d.jsx("rect",{width:"100",height:"100",rx:"24",fill:"var(--primary)"}),d.jsxs("g",{stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",opacity:"0.4",children:[d.jsx("line",{x1:"52",y1:"23",x2:"49",y2:"79"}),d.jsx("line",{x1:"25",y1:"49",x2:"77",y2:"55"})]}),d.jsx("g",{fill:"#fff",children:yj.map(([e,t,n],r)=>d.jsx("path",{transform:`translate(${e} ${t}) scale(${n})`,d:bj},r))})]}),"Crux"]})}const O0=new Map;function _j(e,t){let n=O0.get(e);return n||(n=new Set,O0.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&O0.delete(e)}}function xj(e){var t;(t=O0.get(e.runId))==null||t.forEach(n=>n(e))}const X1=new Set;function iu(e){return X1.add(e),()=>{X1.delete(e)}}function Ga(e){X1.forEach(t=>t(e))}const K1=new Set;function wv(e){return K1.add(e),()=>{K1.delete(e)}}function v3(e){K1.forEach(t=>t(e))}const Z1=new Set;function wj(e){return Z1.add(e),()=>{Z1.delete(e)}}function Fm(e){Z1.forEach(t=>t(e))}const Q1=new Set;function Sj(e){return Q1.add(e),()=>{Q1.delete(e)}}function kj(e){Q1.forEach(t=>t(e))}const J1=new Set;function Cj(e){return J1.add(e),()=>{J1.delete(e)}}function b3(e){J1.forEach(t=>t(e))}function Ej(e){const t=O.useRef(e);t.current=e,O.useEffect(()=>{const n=new EventSource("/api/events");let r=!1;n.onerror=()=>{r=!0},n.onopen=()=>{r&&(Ga({type:"reconnected"}),v3({harness:"*",authState:"unknown"})),r=!0};const i=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const l=i(a);l!=null&&l.run&&t.current.onRun(l.run)}),n.addEventListener("experiment.updated",a=>{const l=i(a);l!=null&&l.experiment&&t.current.onExperiment(l.experiment)}),n.addEventListener("project.updated",a=>{const l=i(a);l!=null&&l.project&&t.current.onProject(l.project)}),n.addEventListener("files.updated",a=>{var c,u;const l=i(a);l!=null&&l.projectId&&((u=(c=t.current).onFiles)==null||u.call(c,l.projectId))}),n.addEventListener("run.log",a=>{const l=i(a);l!=null&&l.runId&&xj(l)}),n.addEventListener("chat.session",a=>{const l=i(a);l!=null&&l.session&&Ga({type:"session",session:l.session})}),n.addEventListener("chat.session.deleted",a=>{const l=i(a);l!=null&&l.sessionId&&Ga({type:"sessionDeleted",sessionId:l.sessionId})}),n.addEventListener("chat.message",a=>{const l=i(a);l!=null&&l.message&&Ga({type:"message",sessionId:l.sessionId,message:l.message})}),n.addEventListener("chat.busy",a=>{const l=i(a);l!=null&&l.sessionId&&Ga({type:"busy",sessionId:l.sessionId,busy:l.busy})}),n.addEventListener("chat.usage",a=>{const l=i(a);l!=null&&l.sessionId&&l.usage&&Ga({type:"usage",sessionId:l.sessionId,usage:l.usage})}),n.addEventListener("chat.queued",a=>{const l=i(a);l!=null&&l.sessionId&&Ga({type:"queued",sessionId:l.sessionId,items:l.items??[]})}),n.addEventListener("harness.auth",a=>{const l=i(a);l!=null&&l.harness&&l.authState&&v3(l)}),n.addEventListener("datadir.move.progress",a=>{const l=i(a);l&&Fm({type:"progress",...l})}),n.addEventListener("datadir.move.done",a=>{const l=i(a);l&&Fm({type:"done",path:l.path,oldPathLeft:l.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const l=i(a);l&&Fm({type:"error",error:l.error})}),n.addEventListener("scenario.connect.done",a=>{const l=i(a);l&&b3({type:"done",scopes:l.scopes??[]})}),n.addEventListener("scenario.connect.error",a=>{const l=i(a);l!=null&&l.error&&b3({type:"error",error:l.error})}),n.addEventListener("project.clone.progress",a=>{const l=i(a);l!=null&&l.phase&&kj(l)}),()=>n.close()},[])}function y3(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const l=n.slice(i,r).trim();(l||!a)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function Nj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Aj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mj={};function _3(e,t){return(Mj.jsx?Tj:Aj).test(e)}const jj=/[ \t\n\f\r]/g;function Dj(e){return typeof e=="object"?e.type==="text"?x3(e.value):!1:x3(e)}function x3(e){return e.replace(jj,"")===""}class Nu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Nu.prototype.normal={};Nu.prototype.property={};Nu.prototype.space=void 0;function Q7(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Nu(n,r,t)}function su(e){return e.toLowerCase()}class Cr{constructor(t,n){this.attribute=n,this.property=t}}Cr.prototype.attribute="";Cr.prototype.booleanish=!1;Cr.prototype.boolean=!1;Cr.prototype.commaOrSpaceSeparated=!1;Cr.prototype.commaSeparated=!1;Cr.prototype.defined=!1;Cr.prototype.mustUseProperty=!1;Cr.prototype.number=!1;Cr.prototype.overloadedBoolean=!1;Cr.prototype.property="";Cr.prototype.spaceSeparated=!1;Cr.prototype.space=void 0;let Rj=0;const ht=go(),Bn=go(),eg=go(),Re=go(),nn=go(),to=go(),Lr=go();function go(){return 2**++Rj}const tg=Object.freeze(Object.defineProperty({__proto__:null,boolean:ht,booleanish:Bn,commaOrSpaceSeparated:Lr,commaSeparated:to,number:Re,overloadedBoolean:eg,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),$m=Object.keys(tg);class Sv extends Cr{constructor(t,n,r,i){let a=-1;if(super(t,n),w3(this,"space",i),typeof r=="number")for(;++a<$m.length;){const l=$m[a];w3(this,$m[a],(r&tg[l])===tg[l])}}}Sv.prototype.defined=!0;function w3(e,t,n){n&&(e[t]=n)}function Bl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Sv(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[su(r)]=r,n[su(a.attribute)]=r}return new Nu(t,n,e.space)}const J7=Bl({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:nn,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:Re,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:nn,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:Bn,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ew(e,t){return t in e?e[t]:t}function tw(e,t){return ew(e,t.toLowerCase())}const Lj=Bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:to,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:ht,allowPaymentRequest:ht,allowUserMedia:ht,alpha:ht,alt:null,as:null,async:ht,autoCapitalize:null,autoComplete:nn,autoFocus:ht,autoPlay:ht,blocking:nn,capture:null,charSet:null,checked:ht,cite:null,className:nn,closedBy:null,colorSpace:null,cols:Re,colSpan:Re,command:null,commandFor:null,content:null,contentEditable:Bn,controls:ht,controlsList:nn,coords:Re|to,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ht,defer:ht,dir:null,dirName:null,disabled:ht,download:eg,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ht,formTarget:null,headers:nn,height:Re,hidden:eg,high:Re,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:ht,inputMode:null,integrity:null,is:null,isMap:ht,itemId:null,itemProp:nn,itemRef:nn,itemScope:ht,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ht,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:ht,muted:ht,name:null,nonce:null,noModule:ht,noValidate:ht,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ht,optimum:Re,pattern:null,ping:nn,placeholder:null,playsInline:ht,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ht,referrerPolicy:null,rel:nn,required:ht,reversed:ht,rows:Re,rowSpan:Re,sandbox:nn,scope:null,scoped:ht,seamless:ht,selected:ht,shadowRootClonable:ht,shadowRootCustomElementRegistry:ht,shadowRootDelegatesFocus:ht,shadowRootMode:null,shadowRootSerializable:ht,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:ht,useMap:null,value:Bn,width:Re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ht,declare:ht,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:ht,noHref:ht,noShade:ht,noWrap:ht,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ht,disablePictureInPicture:ht,disableRemotePlayback:ht,exportParts:to,part:nn,prefix:null,property:null,results:Re,security:null,unselectable:null},space:"html",transform:tw}),Oj=Bl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Lr,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:nn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:ht,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:to,g2:to,glyphName:to,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:Lr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Lr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Lr,rev:Lr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Lr,requiredFeatures:Lr,requiredFonts:Lr,requiredFormats:Lr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:Lr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Lr,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Lr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ew}),nw=Bl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),rw=Bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tw}),iw=Bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zj=/[A-Z]/g,S3=/-[a-z]/g,Ij=/^data[-\w.:]+$/i;function sw(e,t){const n=su(t);let r=t,i=Cr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ij.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(S3,Fj);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!S3.test(a)){let l=a.replace(zj,Hj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Sv}return new i(r,t)}function Hj(e){return"-"+e.toLowerCase()}function Fj(e){return e.charAt(1).toUpperCase()}const aw=Q7([J7,Lj,nw,rw,iw],"html"),Td=Q7([J7,Oj,nw,rw,iw],"svg");function k3(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $j(e){return e.join(" ").trim()}var sl={},Pm,C3;function Pj(){if(C3)return Pm;C3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,u=` +`,h="/",m="*",f="",g="comment",v="declaration";function k(y,_){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];_=_||{};var x=1,w=1;function C(P){var K=P.match(t);K&&(x+=K.length);var W=P.lastIndexOf(u);w=~W?P.length-W:w+P.length}function T(){var P={line:x,column:w};return function(K){return K.position=new N(P),D(),K}}function N(P){this.start=P,this.end={line:x,column:w},this.source=_.source}N.prototype.content=y;function j(P){var K=new Error(_.source+":"+x+":"+w+": "+P);if(K.reason=P,K.filename=_.source,K.line=x,K.column=w,K.source=y,!_.silent)throw K}function A(P){var K=P.exec(y);if(K){var W=K[0];return C(W),y=y.slice(W.length),K}}function D(){A(n)}function B(P){var K;for(P=P||[];K=H();)K!==!1&&P.push(K);return P}function H(){var P=T();if(!(h!=y.charAt(0)||m!=y.charAt(1))){for(var K=2;f!=y.charAt(K)&&(m!=y.charAt(K)||h!=y.charAt(K+1));)++K;if(K+=2,f===y.charAt(K-1))return j("End of comment missing");var W=y.slice(2,K-2);return w+=2,C(W),y=y.slice(K),w+=2,P({type:g,comment:W})}}function V(){var P=T(),K=A(r);if(K){if(H(),!A(i))return j("property missing ':'");var W=A(a),Z=P({type:v,property:S(K[0].replace(e,f)),value:W?S(W[0].replace(e,f)):f});return A(l),Z}}function U(){var P=[];B(P);for(var K;K=V();)K!==!1&&(P.push(K),B(P));return P}return D(),U()}function S(y){return y?y.replace(c,f):f}return Pm=k,Pm}var E3;function Uj(){if(E3)return sl;E3=1;var e=sl&&sl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sl,"__esModule",{value:!0}),sl.default=n;const t=e(Pj());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:m}=u;c?i(h,m,u):m&&(a=a||{},a[h]=m)}),a}return sl}var zc={},N3;function qj(){if(N3)return zc;N3=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},u=function(h,m){return m===void 0&&(m={}),a(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(i,c):h=h.replace(r,c),h.replace(t,l))};return zc.camelCase=u,zc}var Ic,A3;function Gj(){if(A3)return Ic;A3=1;var e=Ic&&Ic.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Uj()),n=qj();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(c,u){c&&u&&(l[(0,n.camelCase)(c,a)]=u)}),l}return r.default=r,Ic=r,Ic}var Vj=Gj();const Wj=wd(Vj),ow=lw("end"),kv=lw("start");function lw(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Yj(e){const t=kv(e),n=ow(e);if(t&&n)return{start:t,end:n}}function Xc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?T3(e.position):"start"in e||"end"in e?T3(e):"line"in e||"column"in e?ng(e):""}function ng(e){return M3(e&&e.line)+":"+M3(e&&e.column)}function T3(e){return ng(e&&e.start)+"-"+ng(e&&e.end)}function M3(e){return e&&typeof e=="number"?e:1}class ir extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Xc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ir.prototype.file="";ir.prototype.name="";ir.prototype.reason="";ir.prototype.message="";ir.prototype.stack="";ir.prototype.column=void 0;ir.prototype.line=void 0;ir.prototype.ancestors=void 0;ir.prototype.cause=void 0;ir.prototype.fatal=void 0;ir.prototype.place=void 0;ir.prototype.ruleId=void 0;ir.prototype.source=void 0;const Cv={}.hasOwnProperty,Xj=new Map,Kj=/[A-Z]/g,Zj=new Set(["table","tbody","thead","tfoot","tr"]),Qj=new Set(["td","th"]),cw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jj(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=oD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=aD(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Td:aw,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=uw(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function uw(e,t,n){if(t.type==="element")return eD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rD(e,t,n);if(t.type==="mdxjsEsm")return nD(e,t);if(t.type==="root")return iD(e,t,n);if(t.type==="text")return sD(e,t)}function eD(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Td,e.schema=i),e.ancestors.push(t);const a=dw(e,t.tagName,!1),l=lD(e,t);let c=Nv(e,t);return Zj.has(t.tagName)&&(c=c.filter(function(u){return typeof u=="string"?!Dj(u):!0})),hw(e,l,a,t),Ev(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function tD(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}au(e,t.position)}function nD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);au(e,t.position)}function rD(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Td,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:dw(e,t.name,!0),l=cD(e,t),c=Nv(e,t);return hw(e,l,a,t),Ev(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function iD(e,t,n){const r={};return Ev(r,Nv(e,t)),e.create(t,e.Fragment,r,n)}function sD(e,t){return t.value}function hw(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ev(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function aD(e,t,n){return r;function r(i,a,l,c){const h=Array.isArray(l.children)?n:t;return c?h(a,l,c):h(a,l)}}function oD(e,t){return n;function n(r,i,a,l){const c=Array.isArray(a.children),u=kv(r);return t(i,a,l,c,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function lD(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Cv.call(t.properties,i)){const a=uD(e,i,t.properties[i]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&Qj.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cD(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else au(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else au(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Nv(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Xj;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a0?(zr(e,e.length,0,t),e):t}const R3={}.hasOwnProperty;function pw(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function bi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lr=Sa(/[A-Za-z]/),tr=Sa(/[\dA-Za-z]/),yD=Sa(/[#-'*+\--9=?A-Z^-~]/);function Q0(e){return e!==null&&(e<32||e===127)}const rg=Sa(/\d/),_D=Sa(/[\dA-Fa-f]/),xD=Sa(/[!-/:-@[-`{-~]/);function Ke(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function Ct(e){return e===-2||e===-1||e===32}const Md=Sa(new RegExp("\\p{P}|\\p{S}","u")),so=Sa(/\s/);function Sa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(u){return Ct(u)?(e.enter(n),c(u)):t(u)}function c(u){return Ct(u)&&a++l))return;const j=t.events.length;let A=j,D,B;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(D){B=t.events[A][1].end;break}D=!0}for(_(r),N=j;Nw;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=w}function x(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ED(e,t,n){return xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kl(e){if(e===null||rn(e)||so(e))return 1;if(Md(e))return 2}function jd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},g={...e[n][1].start};O3(f,-u),O3(g,u),l={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},c={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=ii(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=ii(h,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=ii(h,jd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=ii(h,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=ii(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,zr(e,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n0&&Ct(N)?xt(e,x,"linePrefix",a+1)(N):x(N)}function x(N){return N===null||Ke(N)?e.check(B3,S,C)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||Ke(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),w)}function C(N){return e.exit("codeFenced"),t(N)}function T(N,j,A){let D=0;return B;function B(K){return N.enter("lineEnding"),N.consume(K),N.exit("lineEnding"),H}function H(K){return N.enter("codeFencedFence"),Ct(K)?xt(N,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):V(K)}function V(K){return K===c?(N.enter("codeFencedFenceSequence"),U(K)):A(K)}function U(K){return K===c?(D++,N.consume(K),U):D>=l?(N.exit("codeFencedFenceSequence"),Ct(K)?xt(N,P,"whitespace")(K):P(K)):A(K)}function P(K){return K===null||Ke(K)?(N.exit("codeFencedFence"),j(K)):A(K)}}}function ID(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const qm={name:"codeIndented",tokenize:FD},HD={partial:!0,tokenize:$D};function FD(e,t,n){const r=this;return i;function i(h){return e.enter("codeIndented"),xt(e,a,"linePrefix",5)(h)}function a(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?u(h):Ke(h)?e.attempt(HD,l,u)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ke(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function u(h){return e.exit("codeIndented"),t(h)}}function $D(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Ke(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):xt(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ke(l)?i(l):n(l)}}const PD={name:"codeText",previous:qD,resolve:UD,tokenize:GD};function UD(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Hc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function _w(e,t,n,r,i,a,l,c,u){const h=u||Number.POSITIVE_INFINITY;let m=0;return f;function f(_){return _===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(_),e.exit(a),g):_===null||_===32||_===41||Q0(_)?n(_):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(_))}function g(_){return _===62?(e.enter(a),e.consume(_),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===62?(e.exit("chunkString"),e.exit(c),g(_)):_===null||_===60||Ke(_)?n(_):(e.consume(_),_===92?k:v)}function k(_){return _===60||_===62||_===92?(e.consume(_),v):v(_)}function S(_){return!m&&(_===null||_===41||rn(_))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(_)):m999||v===null||v===91||v===93&&!u||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Ke(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===null||v===91||v===93||Ke(v)||c++>999?(e.exit("chunkString"),m(v)):(e.consume(v),u||(u=!Ct(v)),v===92?g:f)}function g(v){return v===91||v===92||v===93?(e.consume(v),c++,f):f(v)}}function ww(e,t,n,r,i,a){let l;return c;function c(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),l=g===40?41:g,u):n(g)}function u(g){return g===l?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),h(g))}function h(g){return g===l?(e.exit(a),u(l)):g===null?n(g):Ke(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),xt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===l||g===null||Ke(g)?(e.exit("chunkString"),h(g)):(e.consume(g),g===92?f:m)}function f(g){return g===l||g===92?(e.consume(g),m):m(g)}}function Kc(e,t){let n;return r;function r(i){return Ke(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ct(i)?xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const JD={name:"definition",tokenize:tR},eR={partial:!0,tokenize:nR};function tR(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return xw.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return i=bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),u):n(v)}function u(v){return rn(v)?Kc(e,h)(v):h(v)}function h(v){return _w(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(eR,f,f)(v)}function f(v){return Ct(v)?xt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||Ke(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function nR(e,t,n){return r;function r(c){return rn(c)?Kc(e,i)(c):n(c)}function i(c){return ww(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Ct(c)?xt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ke(c)?t(c):n(c)}}const rR={name:"hardBreakEscape",tokenize:iR};function iR(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ke(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const sR={name:"headingAtx",resolve:aR,tokenize:oR};function aR(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},zr(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function oR(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||rn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||Ke(m)?(e.exit("atxHeading"),t(m)):Ct(m)?xt(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||rn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const lR=["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"],I3=["pre","script","style","textarea"],cR={concrete:!0,name:"htmlFlow",resolveTo:dR,tokenize:fR},uR={partial:!0,tokenize:mR},hR={partial:!0,tokenize:pR};function dR(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function fR(e,t,n){const r=this;let i,a,l,c,u;return h;function h(G){return m(G)}function m(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),f}function f(G){return G===33?(e.consume(G),g):G===47?(e.consume(G),a=!0,S):G===63?(e.consume(G),i=3,r.interrupt?t:L):lr(G)?(e.consume(G),l=String.fromCharCode(G),y):n(G)}function g(G){return G===45?(e.consume(G),i=2,v):G===91?(e.consume(G),i=5,c=0,k):lr(G)?(e.consume(G),i=4,r.interrupt?t:L):n(G)}function v(G){return G===45?(e.consume(G),r.interrupt?t:L):n(G)}function k(G){const se="CDATA[";return G===se.charCodeAt(c++)?(e.consume(G),c===se.length?r.interrupt?t:V:k):n(G)}function S(G){return lr(G)?(e.consume(G),l=String.fromCharCode(G),y):n(G)}function y(G){if(G===null||G===47||G===62||rn(G)){const se=G===47,oe=l.toLowerCase();return!se&&!a&&I3.includes(oe)?(i=1,r.interrupt?t(G):V(G)):lR.includes(l.toLowerCase())?(i=6,se?(e.consume(G),_):r.interrupt?t(G):V(G)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(G):a?x(G):w(G))}return G===45||tr(G)?(e.consume(G),l+=String.fromCharCode(G),y):n(G)}function _(G){return G===62?(e.consume(G),r.interrupt?t:V):n(G)}function x(G){return Ct(G)?(e.consume(G),x):B(G)}function w(G){return G===47?(e.consume(G),B):G===58||G===95||lr(G)?(e.consume(G),C):Ct(G)?(e.consume(G),w):B(G)}function C(G){return G===45||G===46||G===58||G===95||tr(G)?(e.consume(G),C):T(G)}function T(G){return G===61?(e.consume(G),N):Ct(G)?(e.consume(G),T):w(G)}function N(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(e.consume(G),u=G,j):Ct(G)?(e.consume(G),N):A(G)}function j(G){return G===u?(e.consume(G),u=null,D):G===null||Ke(G)?n(G):(e.consume(G),j)}function A(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||rn(G)?T(G):(e.consume(G),A)}function D(G){return G===47||G===62||Ct(G)?w(G):n(G)}function B(G){return G===62?(e.consume(G),H):n(G)}function H(G){return G===null||Ke(G)?V(G):Ct(G)?(e.consume(G),H):n(G)}function V(G){return G===45&&i===2?(e.consume(G),W):G===60&&i===1?(e.consume(G),Z):G===62&&i===4?(e.consume(G),I):G===63&&i===3?(e.consume(G),L):G===93&&i===5?(e.consume(G),z):Ke(G)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(uR,Y,U)(G)):G===null||Ke(G)?(e.exit("htmlFlowData"),U(G)):(e.consume(G),V)}function U(G){return e.check(hR,P,Y)(G)}function P(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),K}function K(G){return G===null||Ke(G)?U(G):(e.enter("htmlFlowData"),V(G))}function W(G){return G===45?(e.consume(G),L):V(G)}function Z(G){return G===47?(e.consume(G),l="",ee):V(G)}function ee(G){if(G===62){const se=l.toLowerCase();return I3.includes(se)?(e.consume(G),I):V(G)}return lr(G)&&l.length<8?(e.consume(G),l+=String.fromCharCode(G),ee):V(G)}function z(G){return G===93?(e.consume(G),L):V(G)}function L(G){return G===62?(e.consume(G),I):G===45&&i===2?(e.consume(G),L):V(G)}function I(G){return G===null||Ke(G)?(e.exit("htmlFlowData"),Y(G)):(e.consume(G),I)}function Y(G){return e.exit("htmlFlow"),t(G)}}function pR(e,t,n){const r=this;return i;function i(l){return Ke(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function mR(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Au,t,n)}}const gR={name:"htmlText",tokenize:vR};function vR(e,t,n){const r=this;let i,a,l;return c;function c(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),u}function u(L){return L===33?(e.consume(L),h):L===47?(e.consume(L),T):L===63?(e.consume(L),w):lr(L)?(e.consume(L),A):n(L)}function h(L){return L===45?(e.consume(L),m):L===91?(e.consume(L),a=0,k):lr(L)?(e.consume(L),x):n(L)}function m(L){return L===45?(e.consume(L),v):n(L)}function f(L){return L===null?n(L):L===45?(e.consume(L),g):Ke(L)?(l=f,Z(L)):(e.consume(L),f)}function g(L){return L===45?(e.consume(L),v):f(L)}function v(L){return L===62?W(L):L===45?g(L):f(L)}function k(L){const I="CDATA[";return L===I.charCodeAt(a++)?(e.consume(L),a===I.length?S:k):n(L)}function S(L){return L===null?n(L):L===93?(e.consume(L),y):Ke(L)?(l=S,Z(L)):(e.consume(L),S)}function y(L){return L===93?(e.consume(L),_):S(L)}function _(L){return L===62?W(L):L===93?(e.consume(L),_):S(L)}function x(L){return L===null||L===62?W(L):Ke(L)?(l=x,Z(L)):(e.consume(L),x)}function w(L){return L===null?n(L):L===63?(e.consume(L),C):Ke(L)?(l=w,Z(L)):(e.consume(L),w)}function C(L){return L===62?W(L):w(L)}function T(L){return lr(L)?(e.consume(L),N):n(L)}function N(L){return L===45||tr(L)?(e.consume(L),N):j(L)}function j(L){return Ke(L)?(l=j,Z(L)):Ct(L)?(e.consume(L),j):W(L)}function A(L){return L===45||tr(L)?(e.consume(L),A):L===47||L===62||rn(L)?D(L):n(L)}function D(L){return L===47?(e.consume(L),W):L===58||L===95||lr(L)?(e.consume(L),B):Ke(L)?(l=D,Z(L)):Ct(L)?(e.consume(L),D):W(L)}function B(L){return L===45||L===46||L===58||L===95||tr(L)?(e.consume(L),B):H(L)}function H(L){return L===61?(e.consume(L),V):Ke(L)?(l=H,Z(L)):Ct(L)?(e.consume(L),H):D(L)}function V(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,U):Ke(L)?(l=V,Z(L)):Ct(L)?(e.consume(L),V):(e.consume(L),P)}function U(L){return L===i?(e.consume(L),i=void 0,K):L===null?n(L):Ke(L)?(l=U,Z(L)):(e.consume(L),U)}function P(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||rn(L)?D(L):(e.consume(L),P)}function K(L){return L===47||L===62||rn(L)?D(L):n(L)}function W(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function Z(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ee}function ee(L){return Ct(L)?xt(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):z(L)}function z(L){return e.enter("htmlTextData"),l(L)}}const Tv={name:"labelEnd",resolveAll:xR,resolveTo:wR,tokenize:SR},bR={tokenize:kR},yR={tokenize:CR},_R={tokenize:ER};function xR(e){let t=-1;const n=[];for(;++t=3&&(h===null||Ke(h))?(e.exit("thematicBreak"),t(h)):n(h)}function u(h){return h===i?(e.consume(h),r++,u):(e.exit("thematicBreakSequence"),Ct(h)?xt(e,c,"whitespace")(h):c(h))}}const _r={continuation:{tokenize:BR},exit:IR,name:"list",tokenize:OR},RR={partial:!0,tokenize:HR},LR={partial:!0,tokenize:zR};function OR(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(v){const k=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:rg(v)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(B0,n,h)(v):h(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(v)}return n(v)}function u(v){return rg(v)&&++l<10?(e.consume(v),u):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),h(v)):n(v)}function h(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Au,r.interrupt?n:m,e.attempt(RR,g,f))}function m(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function f(v){return Ct(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function BR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Au,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xt(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Ct(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(LR,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,xt(e,e.attempt(_r,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function zR(e,t,n){const r=this;return xt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function IR(e){e.exit(this.containerState.type)}function HR(e,t,n){const r=this;return xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!Ct(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const H3={name:"setextUnderline",resolveTo:FR,tokenize:$R};function FR(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function $R(e,t,n){const r=this;let i;return a;function a(h){let m=r.events.length,f;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){f=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===i?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ct(h)?xt(e,u,"lineSuffix")(h):u(h))}function u(h){return h===null||Ke(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const PR={tokenize:UR};function UR(e){const t=this,n=e.attempt(Au,r,e.attempt(this.parser.constructs.flowInitial,i,xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(YD,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qR={resolveAll:kw()},GR=Sw("string"),VR=Sw("text");function Sw(e){return{resolveAll:kw(e==="text"?WR:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,c);return l;function l(m){return h(m)?a(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return h(m)?(n.exit("data"),a(m)):(n.consume(m),u)}function h(m){if(m===null)return!0;const f=i[m];let g=-1;if(f)for(;++g-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function aL(e,t){let n=-1;const r=[];let i;for(;++n0){const $t=He.tokenStack[He.tokenStack.length-1];($t[1]||$3).call(He,void 0,$t[0])}for(Ne.position={start:oa(_e.length>0?_e[0][1].start:{line:1,column:1,offset:0}),end:oa(_e.length>0?_e[_e.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function _L(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=zl(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const h={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,h),e.applyData(t,h)}function SL(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Nw(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function CL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Nw(e,t);const i={src:zl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function EL(e,t){const n={src:zl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function NL(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function AL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Nw(e,t);const i={href:zl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function TL(e,t){const n={href:zl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ML(e,t,n){const r=e.all(t),i=n?jL(n):Aw(t),a={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let f;m&&m.type==="element"&&m.tagName==="p"?f=m:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c1}function DL(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=kv(t.children[1]),u=ow(t.children[t.children.length-1]);c&&u&&(l.position={start:c,end:u}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function zL(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let u=-1;const h=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(q3(t.slice(i),i>0,!1)),a.join("")}function q3(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===P3||a===U3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===P3||a===U3;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function FL(e,t){const n={type:"text",value:HL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $L(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const PL={blockquote:vL,break:bL,code:yL,delete:_L,emphasis:xL,footnoteReference:wL,heading:SL,html:kL,imageReference:CL,image:EL,inlineCode:NL,linkReference:AL,link:TL,listItem:ML,list:DL,paragraph:RL,root:LL,strong:OL,table:BL,tableCell:IL,tableRow:zL,text:FL,thematicBreak:$L,toml:t0,yaml:t0,definition:t0,footnoteDefinition:t0};function t0(){}const Tw=-1,Dd=0,Zc=1,J0=2,Mv=3,jv=4,Dv=5,Rv=6,Mw=7,jw=8,UL=typeof self=="object"?self:globalThis,G3=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new UL[e](t)},qL=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case Dd:case Tw:return n(l,i);case Zc:{const c=n([],i);for(const u of l)c.push(r(u));return c}case J0:{const c=n({},i);for(const[u,h]of l)c[r(u)]=r(h);return c}case Mv:return n(new Date(l),i);case jv:{const{source:c,flags:u}=l;return n(new RegExp(c,u),i)}case Dv:{const c=n(new Map,i);for(const[u,h]of l)c.set(r(u),r(h));return c}case Rv:{const c=n(new Set,i);for(const u of l)c.add(r(u));return c}case Mw:{const{name:c,message:u}=l;return n(G3(c,u),i)}case jw:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(G3(a,l),i)};return r},V3=e=>qL(new Map,e)(0),Xa="",{toString:GL}={},{keys:VL}=Object,Fc=e=>{const t=typeof e;if(t!=="object"||!e)return[Dd,t];const n=GL.call(e).slice(8,-1);switch(n){case"Array":return[Zc,Xa];case"Object":return[J0,Xa];case"Date":return[Mv,Xa];case"RegExp":return[jv,Xa];case"Map":return[Dv,Xa];case"Set":return[Rv,Xa];case"DataView":return[Zc,n]}return n.includes("Array")?[Zc,n]:n.includes("Error")?[Mw,n]:[J0,n]},n0=([e,t])=>e===Dd&&(t==="function"||t==="symbol"),WL=(e,t,n,r)=>{const i=(l,c)=>{const u=r.push(l)-1;return n.set(c,u),u},a=l=>{if(n.has(l))return n.get(l);let[c,u]=Fc(l);switch(c){case Dd:{let m=l;switch(u){case"bigint":c=jw,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([Tw],l)}return i([c,m],l)}case Zc:{if(u){let g=l;return u==="DataView"?g=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(l)),i([u,[...g]],l)}const m=[],f=i([c,m],l);for(const g of l)m.push(a(g));return f}case J0:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const m=[],f=i([c,m],l);for(const g of VL(l))(e||!n0(Fc(l[g])))&&m.push([a(g),a(l[g])]);return f}case Mv:return i([c,isNaN(l.getTime())?Xa:l.toISOString()],l);case jv:{const{source:m,flags:f}=l;return i([c,{source:m,flags:f}],l)}case Dv:{const m=[],f=i([c,m],l);for(const[g,v]of l)(e||!(n0(Fc(g))||n0(Fc(v))))&&m.push([a(g),a(v)]);return f}case Rv:{const m=[],f=i([c,m],l);for(const g of l)(e||!n0(Fc(g)))&&m.push(a(g));return f}}const{message:h}=l;return i([c,{name:u,message:h}],l)};return a},W3=(e,{json:t,lossy:n}={})=>{const r=[];return WL(!(t||n),!!t,new Map,r)(e),r},ed=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?V3(W3(e,t)):structuredClone(e):(e,t)=>V3(W3(e,t));function YL(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function XL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function KL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||YL,r=e.options.footnoteBackLabel||XL,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let u=-1;for(;++u0&&k.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,v);typeof x=="string"&&(x={type:"text",value:x}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,v),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=m[m.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...k)}else m.push(...k);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(h,_),c.push(_)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...ed(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:` +`}]}}const Tu=(function(e){if(e==null)return eO;if(typeof e=="function")return Rd(e);if(typeof e=="object")return Array.isArray(e)?ZL(e):QL(e);if(typeof e=="string")return JL(e);throw new Error("Expected function, string, or object as test")});function ZL(e){const t=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let v=Dw,k,S,y;if((!t||a(u,h,m[m.length-1]||void 0))&&(v=rO(n(u,m)),v[0]===sg))return v;if("children"in u&&u.children){const _=u;if(_.children&&v[0]!==Rw)for(S=(r?_.children.length:-1)+l,y=m.concat(_);S>-1&&S<_.children.length;){const x=_.children[S];if(k=c(x,S,y)(),k[0]===sg)return k;S=typeof k[1]=="number"?k[1]:S+l}}return v}}}function rO(e){return Array.isArray(e)?e:typeof e=="number"?[nO,e]:e==null?Dw:[e]}function Ov(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),Lv(e,a,c,i);function c(u,h){const m=h[h.length-1],f=m?m.children.indexOf(u):void 0;return l(u,f,m)}}const ag={}.hasOwnProperty,iO={};function sO(e,t){const n=t||iO,r=new Map,i=new Map,a=new Map,l={...PL,...n.handlers},c={all:h,applyData:oO,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:u,options:n,patch:aO,wrap:cO};return Ov(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const f=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();f.has(g)||f.set(g,m)}}),c;function u(m,f){const g=m.type,v=c.handlers[g];if(ag.call(c.handlers,g)&&v)return v(c,m,f);if(c.options.passThrough&&c.options.passThrough.includes(g)){if("children"in m){const{children:S,...y}=m,_=ed(y);return _.children=c.all(m),_}return ed(m)}return(c.options.unknownHandler||lO)(c,m,f)}function h(m){const f=[];if("children"in m){const g=m.children;let v=-1;for(;++v0&&n.push({type:"text",value:` +`}),n}function Y3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function X3(e,t){const n=sO(e,t),r=n.one(e,void 0),i=KL(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` +`},i),a}function uO(e,t){return e&&"run"in e?async function(n,r){const i=X3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return X3(n,{file:r,...e||t})}}function K3(e){if(e)throw e}var Vm,Z3;function hO(){if(Z3)return Vm;Z3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),f=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!f)return!1;var g;for(g in h);return typeof g>"u"||e.call(h,g)},l=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return Vm=function u(){var h,m,f,g,v,k,S=arguments[0],y=1,_=arguments.length,x=!1;for(typeof S=="boolean"&&(x=S,S=arguments[1]||{},y=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});y<_;++y)if(h=arguments[y],h!=null)for(m in h)f=c(S,m),g=c(h,m),S!==g&&(x&&g&&(a(g)||(v=i(g)))?(v?(v=!1,k=f&&i(f)?f:[]):k=f&&a(f)?f:{},l(S,{name:m,newValue:u(x,k,g)})):typeof g<"u"&&l(S,{name:m,newValue:g}));return S},Vm}var dO=hO();const Wm=wd(dO);function og(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fO(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(u,...h){const m=e[++a];let f=-1;if(u){l(u);return}for(;++fl.length;let u;c&&l.push(i);try{u=e.apply(this,l)}catch(h){const m=h;if(c&&n)throw m;return i(m)}c||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(l,...c){n||(n=!0,t(l,...c))}function a(l){i(null,l)}}const Li={basename:mO,dirname:gO,extname:vO,join:bO,sep:"/"};function mO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function gO(e){if(Mu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function vO(e){Mu(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function bO(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _O(e,t){let n="",r=0,i=-1,a=0,l=-1,c,u;for(;++l<=e.length;){if(l2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function Mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xO={cwd:wO};function wO(){return"/"}function lg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function SO(e){if(typeof e=="string")e=new URL(e);else if(!lg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kO(e)}function kO(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[v,...k]=m;const S=r[g][1];og(S)&&og(v)&&(v=Wm(!0,S,v)),r[g]=[h,v,...k]}}}}const AO=new Bv().freeze();function Zm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function J3(e){if(!og(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ex(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function r0(e){return TO(e)?e:new Lw(e)}function TO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function MO(e){return typeof e=="string"||jO(e)}function jO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",tx=[],nx={allowDangerousHtml:!0},RO=/^(https?|ircs?|mailto|xmpp)$/i,LO=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ow(e){const t=OO(e),n=BO(e);return zO(t.runSync(t.parse(n),n),e)}function OO(e){const t=e.rehypePlugins||tx,n=e.remarkPlugins||tx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nx}:nx;return AO().use(gL).use(n).use(uO,r).use(t)}function BO(e){const t=e.children||"",n=new Lw;return typeof t=="string"&&(n.value=t),n}function zO(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,u=t.urlTransform||IO;for(const m of LO)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+DO+m.id,void 0);return Ov(e,h),Jj(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(m,f,g){if(m.type==="raw"&&g&&typeof f=="number")return l?g.children.splice(f,1):g.children[f]={type:"text",value:m.value},f;if(m.type==="element"){let v;for(v in Um)if(Object.hasOwn(Um,v)&&Object.hasOwn(m.properties,v)){const k=m.properties[v],S=Um[v];(S===null||S.includes(m.tagName))&&(m.properties[v]=u(String(k||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!v&&r&&typeof f=="number"&&(v=!r(m,f,g)),v&&g&&typeof f=="number")return c&&m.children?g.children.splice(f,1,...m.children):g.children.splice(f,1),f}}}function IO(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||RO.test(e.slice(0,t))?e:""}const rx=/[#.]/g;function HO(e,t){const n=e||"",r={};let i=0,a,l;for(;ih&&(h=m):m&&(h!==void 0&&h>-1&&u.push(` +`.repeat(h)||" "),h=-1,u.push(m))}return u.join("")}function $w(e,t,n){return e.type==="element"?oB(e,t,n):e.type==="text"?n.whitespace==="normal"?Pw(e,n):lB(e):[]}function oB(e,t,n){const r=Uw(e,n),i=e.children||[];let a=-1,l=[];if(sB(e))return l;let c,u;for(ug(e)||ux(e)&&ax(t,e,ux)?u=` +`:iB(e)?(c=2,u=2):Fw(e)&&(c=1,u=1);++a15?h="…"+c.slice(i-15,i):h=c.slice(0,i);var m;a+15e.replace(fB,"-$1").toLowerCase(),mB={"&":"&",">":">","<":"<",'"':""","'":"'"},gB=/[&><"']/g,nr=e=>String(e).replace(gB,t=>mB[t]),z0=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?z0(e.body[0]):e:e.type==="font"?z0(e.body):e,vB=new Set(["mathord","textord","atom"]),Ns=e=>vB.has(z0(e).type),bB=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},hg={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,t)=>(t.push(e),t)},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 yB(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 _B(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return yB(t)}function xB(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:_B(r)}class Iv{constructor(t){t===void 0&&(t={}),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,t=t||{};for(var n of Object.keys(hg)){var r=hg[n];r&&xB(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Le("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=bB(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class la{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Oi[wB[this.id]]}sub(){return Oi[SB[this.id]]}fracNum(){return Oi[kB[this.id]]}fracDen(){return Oi[CB[this.id]]}cramp(){return Oi[EB[this.id]]}text(){return Oi[NB[this.id]]}isTight(){return this.size>=2}}var Hv=0,td=1,yl=2,ys=3,lu=4,si=5,Cl=6,cr=7,Oi=[new la(Hv,0,!1),new la(td,0,!0),new la(yl,1,!1),new la(ys,1,!0),new la(lu,2,!1),new la(si,2,!0),new la(Cl,3,!1),new la(cr,3,!0)],wB=[lu,si,lu,si,Cl,cr,Cl,cr],SB=[si,si,si,si,cr,cr,cr,cr],kB=[yl,ys,lu,si,Cl,cr,Cl,cr],CB=[ys,ys,si,si,cr,cr,cr,cr],EB=[td,td,ys,ys,si,si,cr,cr],NB=[Hv,td,yl,ys,yl,ys,yl,ys],dt={DISPLAY:Oi[Hv],TEXT:Oi[yl],SCRIPT:Oi[lu],SCRIPTSCRIPT:Oi[Cl]},dg=[{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 AB(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var I0=[];dg.forEach(e=>e.blocks.forEach(t=>I0.push(...t)));function qw(e){for(var t=0;t=I0[t]&&e<=I0[t+1])return!0;return!1}var Un=e=>e+" "+e,al=80,TB=function(t,n){return"M95,"+(622+t+n)+` +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`+t/2.075+" -"+t+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+t)+`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+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},MB=function(t,n){return"M263,"+(601+t+n)+`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`+t/2.084+" -"+t+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+t)+`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+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},jB=function(t,n){return"M983 "+(10+t+n)+` +l`+t/3.13+" -"+t+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` +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+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},DB=function(t,n){return"M424,"+(2398+t+n)+` +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`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+t)+`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+t)+" "+n+` +h400000v`+(40+t)+"h-400000z"},RB=function(t,n){return"M473,"+(2713+t+n)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`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+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},LB=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},OB=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` +H742v`+i+`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 `+n+"H400000v"+(40+t)+"H742z"},BB=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=TB(n,al);break;case"sqrtSize1":i=MB(n,al);break;case"sqrtSize2":i=jB(n,al);break;case"sqrtSize3":i=DB(n,al);break;case"sqrtSize4":i=RB(n,al);break;case"sqrtTall":i=OB(n,al,r)}return i},zB=function(t,n){switch(t){case"⎜":return Un("M291 0 H417 V"+n+" H291z");case"∣":return Un("M145 0 H188 V"+n+" H145z");case"∥":return Un("M145 0 H188 V"+n+" H145z")+Un("M367 0 H410 V"+n+" H367z");case"⎟":return Un("M457 0 H583 V"+n+" H457z");case"⎢":return Un("M319 0 H403 V"+n+" H319z");case"⎥":return Un("M263 0 H347 V"+n+" H263z");case"⎪":return Un("M384 0 H504 V"+n+" H384z");case"⏐":return Un("M312 0 H355 V"+n+" H312z");case"‖":return Un("M257 0 H300 V"+n+" H257z")+Un("M478 0 H521 V"+n+" H478z");default:return""}},hx={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:Un("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Un("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Un("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Un("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:Un("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:Un("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Un("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Un("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`},IB=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z +M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z +M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z +M347 1759 V0 h-84 V1759 v`+n+" 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,`+(n+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,-`+(n+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,`+(n+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,-`+(n+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 HB(e){return"toText"in e}class Il{constructor(t){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=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n{if(HB(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var fg={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},FB={ex:!0,em:!0,mu:!0},Gw=function(t){return typeof t!="string"&&(t=t.unit),t in fg||t in FB||t==="ex"},yn=function(t,n){var r;if(t.unit in fg)r=fg[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new Le("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},ze=function(t){return+t.toFixed(4)+"em"},va=function(t){return t.filter(n=>n).join(" ")},Fv=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=pB(r)+":"+i+";")}return n},Vw=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},Ww=function(t){var n=document.createElement(t);n.className=va(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,Yw=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+nr(va(this.classes))+'"');var r=Fv(this.style);r&&(n+=' style="'+nr(r)+'"');for(var i of Object.keys(this.attributes)){if($B.test(i))throw new Le("Invalid attribute name '"+i+"'");n+=" "+i+'="'+nr(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class Hl{constructor(t,n,r,i){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,Vw.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Ww.call(this,"span")}toMarkup(){return Yw.call(this,"span")}}class Ld{constructor(t,n,r,i){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,Vw.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Ww.call(this,"a")}toMarkup(){return Yw.call(this,"a")}}class PB{constructor(t,n,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=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t=''+nr(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=ze(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=va(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+ze(this.italic)+";"),r+=Fv(this.style),r&&(t=!0,n+=' style="'+nr(r)+'"');var i=nr(this.text);return t?(n+=">",n+=i,n+="",n):i}}class xs{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class pg{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var VB=e=>e instanceof Hl||e instanceof Ld||e instanceof Il,zi={"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]}},i0={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]},dx={Å:"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 WB(e,t){zi[e]=t}function $v(e,t,n){if(!zi[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=zi[t][r];if(!i&&e[0]in dx&&(r=dx[e[0]].charCodeAt(0),i=zi[t][r]),!i&&n==="text"&&qw(r)&&(i=zi[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var t1={};function YB(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!t1[t]){var n=t1[t]={cssEmPerMu:i0.quad[t]/18};for(var r in i0)i0.hasOwnProperty(r)&&(n[r]=i0[r][t])}return t1[t]}var pn={math:{},text:{}};function R(e,t,n,r,i,a){pn[e][i]={font:t,group:n,replace:r},a&&r&&(pn[e][r]=pn[e][i])}var F="math",Ae="text",X="main",re="ams",gn="accent-token",qe="bin",ur="close",Fl="inner",st="mathord",Hn="op-token",qr="open",ju="punct",ie="rel",As="spacing",he="textord";R(F,X,ie,"≡","\\equiv",!0);R(F,X,ie,"≺","\\prec",!0);R(F,X,ie,"≻","\\succ",!0);R(F,X,ie,"∼","\\sim",!0);R(F,X,ie,"⊥","\\perp");R(F,X,ie,"⪯","\\preceq",!0);R(F,X,ie,"⪰","\\succeq",!0);R(F,X,ie,"≃","\\simeq",!0);R(F,X,ie,"∣","\\mid",!0);R(F,X,ie,"≪","\\ll",!0);R(F,X,ie,"≫","\\gg",!0);R(F,X,ie,"≍","\\asymp",!0);R(F,X,ie,"∥","\\parallel");R(F,X,ie,"⋈","\\bowtie",!0);R(F,X,ie,"⌣","\\smile",!0);R(F,X,ie,"⊑","\\sqsubseteq",!0);R(F,X,ie,"⊒","\\sqsupseteq",!0);R(F,X,ie,"≐","\\doteq",!0);R(F,X,ie,"⌢","\\frown",!0);R(F,X,ie,"∋","\\ni",!0);R(F,X,ie,"∝","\\propto",!0);R(F,X,ie,"⊢","\\vdash",!0);R(F,X,ie,"⊣","\\dashv",!0);R(F,X,ie,"∋","\\owns");R(F,X,ju,".","\\ldotp");R(F,X,ju,"⋅","\\cdotp");R(F,X,ju,"⋅","·");R(Ae,X,he,"⋅","·");R(F,X,he,"#","\\#");R(Ae,X,he,"#","\\#");R(F,X,he,"&","\\&");R(Ae,X,he,"&","\\&");R(F,X,he,"ℵ","\\aleph",!0);R(F,X,he,"∀","\\forall",!0);R(F,X,he,"ℏ","\\hbar",!0);R(F,X,he,"∃","\\exists",!0);R(F,X,he,"∇","\\nabla",!0);R(F,X,he,"♭","\\flat",!0);R(F,X,he,"ℓ","\\ell",!0);R(F,X,he,"♮","\\natural",!0);R(F,X,he,"♣","\\clubsuit",!0);R(F,X,he,"℘","\\wp",!0);R(F,X,he,"♯","\\sharp",!0);R(F,X,he,"♢","\\diamondsuit",!0);R(F,X,he,"ℜ","\\Re",!0);R(F,X,he,"♡","\\heartsuit",!0);R(F,X,he,"ℑ","\\Im",!0);R(F,X,he,"♠","\\spadesuit",!0);R(F,X,he,"§","\\S",!0);R(Ae,X,he,"§","\\S");R(F,X,he,"¶","\\P",!0);R(Ae,X,he,"¶","\\P");R(F,X,he,"†","\\dag");R(Ae,X,he,"†","\\dag");R(Ae,X,he,"†","\\textdagger");R(F,X,he,"‡","\\ddag");R(Ae,X,he,"‡","\\ddag");R(Ae,X,he,"‡","\\textdaggerdbl");R(F,X,ur,"⎱","\\rmoustache",!0);R(F,X,qr,"⎰","\\lmoustache",!0);R(F,X,ur,"⟯","\\rgroup",!0);R(F,X,qr,"⟮","\\lgroup",!0);R(F,X,qe,"∓","\\mp",!0);R(F,X,qe,"⊖","\\ominus",!0);R(F,X,qe,"⊎","\\uplus",!0);R(F,X,qe,"⊓","\\sqcap",!0);R(F,X,qe,"∗","\\ast");R(F,X,qe,"⊔","\\sqcup",!0);R(F,X,qe,"◯","\\bigcirc",!0);R(F,X,qe,"∙","\\bullet",!0);R(F,X,qe,"‡","\\ddagger");R(F,X,qe,"≀","\\wr",!0);R(F,X,qe,"⨿","\\amalg");R(F,X,qe,"&","\\And");R(F,X,ie,"⟵","\\longleftarrow",!0);R(F,X,ie,"⇐","\\Leftarrow",!0);R(F,X,ie,"⟸","\\Longleftarrow",!0);R(F,X,ie,"⟶","\\longrightarrow",!0);R(F,X,ie,"⇒","\\Rightarrow",!0);R(F,X,ie,"⟹","\\Longrightarrow",!0);R(F,X,ie,"↔","\\leftrightarrow",!0);R(F,X,ie,"⟷","\\longleftrightarrow",!0);R(F,X,ie,"⇔","\\Leftrightarrow",!0);R(F,X,ie,"⟺","\\Longleftrightarrow",!0);R(F,X,ie,"↦","\\mapsto",!0);R(F,X,ie,"⟼","\\longmapsto",!0);R(F,X,ie,"↗","\\nearrow",!0);R(F,X,ie,"↩","\\hookleftarrow",!0);R(F,X,ie,"↪","\\hookrightarrow",!0);R(F,X,ie,"↘","\\searrow",!0);R(F,X,ie,"↼","\\leftharpoonup",!0);R(F,X,ie,"⇀","\\rightharpoonup",!0);R(F,X,ie,"↙","\\swarrow",!0);R(F,X,ie,"↽","\\leftharpoondown",!0);R(F,X,ie,"⇁","\\rightharpoondown",!0);R(F,X,ie,"↖","\\nwarrow",!0);R(F,X,ie,"⇌","\\rightleftharpoons",!0);R(F,re,ie,"≮","\\nless",!0);R(F,re,ie,"","\\@nleqslant");R(F,re,ie,"","\\@nleqq");R(F,re,ie,"⪇","\\lneq",!0);R(F,re,ie,"≨","\\lneqq",!0);R(F,re,ie,"","\\@lvertneqq");R(F,re,ie,"⋦","\\lnsim",!0);R(F,re,ie,"⪉","\\lnapprox",!0);R(F,re,ie,"⊀","\\nprec",!0);R(F,re,ie,"⋠","\\npreceq",!0);R(F,re,ie,"⋨","\\precnsim",!0);R(F,re,ie,"⪹","\\precnapprox",!0);R(F,re,ie,"≁","\\nsim",!0);R(F,re,ie,"","\\@nshortmid");R(F,re,ie,"∤","\\nmid",!0);R(F,re,ie,"⊬","\\nvdash",!0);R(F,re,ie,"⊭","\\nvDash",!0);R(F,re,ie,"⋪","\\ntriangleleft");R(F,re,ie,"⋬","\\ntrianglelefteq",!0);R(F,re,ie,"⊊","\\subsetneq",!0);R(F,re,ie,"","\\@varsubsetneq");R(F,re,ie,"⫋","\\subsetneqq",!0);R(F,re,ie,"","\\@varsubsetneqq");R(F,re,ie,"≯","\\ngtr",!0);R(F,re,ie,"","\\@ngeqslant");R(F,re,ie,"","\\@ngeqq");R(F,re,ie,"⪈","\\gneq",!0);R(F,re,ie,"≩","\\gneqq",!0);R(F,re,ie,"","\\@gvertneqq");R(F,re,ie,"⋧","\\gnsim",!0);R(F,re,ie,"⪊","\\gnapprox",!0);R(F,re,ie,"⊁","\\nsucc",!0);R(F,re,ie,"⋡","\\nsucceq",!0);R(F,re,ie,"⋩","\\succnsim",!0);R(F,re,ie,"⪺","\\succnapprox",!0);R(F,re,ie,"≆","\\ncong",!0);R(F,re,ie,"","\\@nshortparallel");R(F,re,ie,"∦","\\nparallel",!0);R(F,re,ie,"⊯","\\nVDash",!0);R(F,re,ie,"⋫","\\ntriangleright");R(F,re,ie,"⋭","\\ntrianglerighteq",!0);R(F,re,ie,"","\\@nsupseteqq");R(F,re,ie,"⊋","\\supsetneq",!0);R(F,re,ie,"","\\@varsupsetneq");R(F,re,ie,"⫌","\\supsetneqq",!0);R(F,re,ie,"","\\@varsupsetneqq");R(F,re,ie,"⊮","\\nVdash",!0);R(F,re,ie,"⪵","\\precneqq",!0);R(F,re,ie,"⪶","\\succneqq",!0);R(F,re,ie,"","\\@nsubseteqq");R(F,re,qe,"⊴","\\unlhd");R(F,re,qe,"⊵","\\unrhd");R(F,re,ie,"↚","\\nleftarrow",!0);R(F,re,ie,"↛","\\nrightarrow",!0);R(F,re,ie,"⇍","\\nLeftarrow",!0);R(F,re,ie,"⇏","\\nRightarrow",!0);R(F,re,ie,"↮","\\nleftrightarrow",!0);R(F,re,ie,"⇎","\\nLeftrightarrow",!0);R(F,re,ie,"△","\\vartriangle");R(F,re,he,"ℏ","\\hslash");R(F,re,he,"▽","\\triangledown");R(F,re,he,"◊","\\lozenge");R(F,re,he,"Ⓢ","\\circledS");R(F,re,he,"®","\\circledR");R(Ae,re,he,"®","\\circledR");R(F,re,he,"∡","\\measuredangle",!0);R(F,re,he,"∄","\\nexists");R(F,re,he,"℧","\\mho");R(F,re,he,"Ⅎ","\\Finv",!0);R(F,re,he,"⅁","\\Game",!0);R(F,re,he,"‵","\\backprime");R(F,re,he,"▲","\\blacktriangle");R(F,re,he,"▼","\\blacktriangledown");R(F,re,he,"■","\\blacksquare");R(F,re,he,"⧫","\\blacklozenge");R(F,re,he,"★","\\bigstar");R(F,re,he,"∢","\\sphericalangle",!0);R(F,re,he,"∁","\\complement",!0);R(F,re,he,"ð","\\eth",!0);R(Ae,X,he,"ð","ð");R(F,re,he,"╱","\\diagup");R(F,re,he,"╲","\\diagdown");R(F,re,he,"□","\\square");R(F,re,he,"□","\\Box");R(F,re,he,"◊","\\Diamond");R(F,re,he,"¥","\\yen",!0);R(Ae,re,he,"¥","\\yen",!0);R(F,re,he,"✓","\\checkmark",!0);R(Ae,re,he,"✓","\\checkmark");R(F,re,he,"ℶ","\\beth",!0);R(F,re,he,"ℸ","\\daleth",!0);R(F,re,he,"ℷ","\\gimel",!0);R(F,re,he,"ϝ","\\digamma",!0);R(F,re,he,"ϰ","\\varkappa");R(F,re,qr,"┌","\\@ulcorner",!0);R(F,re,ur,"┐","\\@urcorner",!0);R(F,re,qr,"└","\\@llcorner",!0);R(F,re,ur,"┘","\\@lrcorner",!0);R(F,re,ie,"≦","\\leqq",!0);R(F,re,ie,"⩽","\\leqslant",!0);R(F,re,ie,"⪕","\\eqslantless",!0);R(F,re,ie,"≲","\\lesssim",!0);R(F,re,ie,"⪅","\\lessapprox",!0);R(F,re,ie,"≊","\\approxeq",!0);R(F,re,qe,"⋖","\\lessdot");R(F,re,ie,"⋘","\\lll",!0);R(F,re,ie,"≶","\\lessgtr",!0);R(F,re,ie,"⋚","\\lesseqgtr",!0);R(F,re,ie,"⪋","\\lesseqqgtr",!0);R(F,re,ie,"≑","\\doteqdot");R(F,re,ie,"≓","\\risingdotseq",!0);R(F,re,ie,"≒","\\fallingdotseq",!0);R(F,re,ie,"∽","\\backsim",!0);R(F,re,ie,"⋍","\\backsimeq",!0);R(F,re,ie,"⫅","\\subseteqq",!0);R(F,re,ie,"⋐","\\Subset",!0);R(F,re,ie,"⊏","\\sqsubset",!0);R(F,re,ie,"≼","\\preccurlyeq",!0);R(F,re,ie,"⋞","\\curlyeqprec",!0);R(F,re,ie,"≾","\\precsim",!0);R(F,re,ie,"⪷","\\precapprox",!0);R(F,re,ie,"⊲","\\vartriangleleft");R(F,re,ie,"⊴","\\trianglelefteq");R(F,re,ie,"⊨","\\vDash",!0);R(F,re,ie,"⊪","\\Vvdash",!0);R(F,re,ie,"⌣","\\smallsmile");R(F,re,ie,"⌢","\\smallfrown");R(F,re,ie,"≏","\\bumpeq",!0);R(F,re,ie,"≎","\\Bumpeq",!0);R(F,re,ie,"≧","\\geqq",!0);R(F,re,ie,"⩾","\\geqslant",!0);R(F,re,ie,"⪖","\\eqslantgtr",!0);R(F,re,ie,"≳","\\gtrsim",!0);R(F,re,ie,"⪆","\\gtrapprox",!0);R(F,re,qe,"⋗","\\gtrdot");R(F,re,ie,"⋙","\\ggg",!0);R(F,re,ie,"≷","\\gtrless",!0);R(F,re,ie,"⋛","\\gtreqless",!0);R(F,re,ie,"⪌","\\gtreqqless",!0);R(F,re,ie,"≖","\\eqcirc",!0);R(F,re,ie,"≗","\\circeq",!0);R(F,re,ie,"≜","\\triangleq",!0);R(F,re,ie,"∼","\\thicksim");R(F,re,ie,"≈","\\thickapprox");R(F,re,ie,"⫆","\\supseteqq",!0);R(F,re,ie,"⋑","\\Supset",!0);R(F,re,ie,"⊐","\\sqsupset",!0);R(F,re,ie,"≽","\\succcurlyeq",!0);R(F,re,ie,"⋟","\\curlyeqsucc",!0);R(F,re,ie,"≿","\\succsim",!0);R(F,re,ie,"⪸","\\succapprox",!0);R(F,re,ie,"⊳","\\vartriangleright");R(F,re,ie,"⊵","\\trianglerighteq");R(F,re,ie,"⊩","\\Vdash",!0);R(F,re,ie,"∣","\\shortmid");R(F,re,ie,"∥","\\shortparallel");R(F,re,ie,"≬","\\between",!0);R(F,re,ie,"⋔","\\pitchfork",!0);R(F,re,ie,"∝","\\varpropto");R(F,re,ie,"◀","\\blacktriangleleft");R(F,re,ie,"∴","\\therefore",!0);R(F,re,ie,"∍","\\backepsilon");R(F,re,ie,"▶","\\blacktriangleright");R(F,re,ie,"∵","\\because",!0);R(F,re,ie,"⋘","\\llless");R(F,re,ie,"⋙","\\gggtr");R(F,re,qe,"⊲","\\lhd");R(F,re,qe,"⊳","\\rhd");R(F,re,ie,"≂","\\eqsim",!0);R(F,X,ie,"⋈","\\Join");R(F,re,ie,"≑","\\Doteq",!0);R(F,re,qe,"∔","\\dotplus",!0);R(F,re,qe,"∖","\\smallsetminus");R(F,re,qe,"⋒","\\Cap",!0);R(F,re,qe,"⋓","\\Cup",!0);R(F,re,qe,"⩞","\\doublebarwedge",!0);R(F,re,qe,"⊟","\\boxminus",!0);R(F,re,qe,"⊞","\\boxplus",!0);R(F,re,qe,"⋇","\\divideontimes",!0);R(F,re,qe,"⋉","\\ltimes",!0);R(F,re,qe,"⋊","\\rtimes",!0);R(F,re,qe,"⋋","\\leftthreetimes",!0);R(F,re,qe,"⋌","\\rightthreetimes",!0);R(F,re,qe,"⋏","\\curlywedge",!0);R(F,re,qe,"⋎","\\curlyvee",!0);R(F,re,qe,"⊝","\\circleddash",!0);R(F,re,qe,"⊛","\\circledast",!0);R(F,re,qe,"⋅","\\centerdot");R(F,re,qe,"⊺","\\intercal",!0);R(F,re,qe,"⋒","\\doublecap");R(F,re,qe,"⋓","\\doublecup");R(F,re,qe,"⊠","\\boxtimes",!0);R(F,re,ie,"⇢","\\dashrightarrow",!0);R(F,re,ie,"⇠","\\dashleftarrow",!0);R(F,re,ie,"⇇","\\leftleftarrows",!0);R(F,re,ie,"⇆","\\leftrightarrows",!0);R(F,re,ie,"⇚","\\Lleftarrow",!0);R(F,re,ie,"↞","\\twoheadleftarrow",!0);R(F,re,ie,"↢","\\leftarrowtail",!0);R(F,re,ie,"↫","\\looparrowleft",!0);R(F,re,ie,"⇋","\\leftrightharpoons",!0);R(F,re,ie,"↶","\\curvearrowleft",!0);R(F,re,ie,"↺","\\circlearrowleft",!0);R(F,re,ie,"↰","\\Lsh",!0);R(F,re,ie,"⇈","\\upuparrows",!0);R(F,re,ie,"↿","\\upharpoonleft",!0);R(F,re,ie,"⇃","\\downharpoonleft",!0);R(F,X,ie,"⊶","\\origof",!0);R(F,X,ie,"⊷","\\imageof",!0);R(F,re,ie,"⊸","\\multimap",!0);R(F,re,ie,"↭","\\leftrightsquigarrow",!0);R(F,re,ie,"⇉","\\rightrightarrows",!0);R(F,re,ie,"⇄","\\rightleftarrows",!0);R(F,re,ie,"↠","\\twoheadrightarrow",!0);R(F,re,ie,"↣","\\rightarrowtail",!0);R(F,re,ie,"↬","\\looparrowright",!0);R(F,re,ie,"↷","\\curvearrowright",!0);R(F,re,ie,"↻","\\circlearrowright",!0);R(F,re,ie,"↱","\\Rsh",!0);R(F,re,ie,"⇊","\\downdownarrows",!0);R(F,re,ie,"↾","\\upharpoonright",!0);R(F,re,ie,"⇂","\\downharpoonright",!0);R(F,re,ie,"⇝","\\rightsquigarrow",!0);R(F,re,ie,"⇝","\\leadsto");R(F,re,ie,"⇛","\\Rrightarrow",!0);R(F,re,ie,"↾","\\restriction");R(F,X,he,"‘","`");R(F,X,he,"$","\\$");R(Ae,X,he,"$","\\$");R(Ae,X,he,"$","\\textdollar");R(F,X,he,"%","\\%");R(Ae,X,he,"%","\\%");R(F,X,he,"_","\\_");R(Ae,X,he,"_","\\_");R(Ae,X,he,"_","\\textunderscore");R(F,X,he,"∠","\\angle",!0);R(F,X,he,"∞","\\infty",!0);R(F,X,he,"′","\\prime");R(F,X,he,"△","\\triangle");R(F,X,he,"Γ","\\Gamma",!0);R(F,X,he,"Δ","\\Delta",!0);R(F,X,he,"Θ","\\Theta",!0);R(F,X,he,"Λ","\\Lambda",!0);R(F,X,he,"Ξ","\\Xi",!0);R(F,X,he,"Π","\\Pi",!0);R(F,X,he,"Σ","\\Sigma",!0);R(F,X,he,"Υ","\\Upsilon",!0);R(F,X,he,"Φ","\\Phi",!0);R(F,X,he,"Ψ","\\Psi",!0);R(F,X,he,"Ω","\\Omega",!0);R(F,X,he,"A","Α");R(F,X,he,"B","Β");R(F,X,he,"E","Ε");R(F,X,he,"Z","Ζ");R(F,X,he,"H","Η");R(F,X,he,"I","Ι");R(F,X,he,"K","Κ");R(F,X,he,"M","Μ");R(F,X,he,"N","Ν");R(F,X,he,"O","Ο");R(F,X,he,"P","Ρ");R(F,X,he,"T","Τ");R(F,X,he,"X","Χ");R(F,X,he,"¬","\\neg",!0);R(F,X,he,"¬","\\lnot");R(F,X,he,"⊤","\\top");R(F,X,he,"⊥","\\bot");R(F,X,he,"∅","\\emptyset");R(F,re,he,"∅","\\varnothing");R(F,X,st,"α","\\alpha",!0);R(F,X,st,"β","\\beta",!0);R(F,X,st,"γ","\\gamma",!0);R(F,X,st,"δ","\\delta",!0);R(F,X,st,"ϵ","\\epsilon",!0);R(F,X,st,"ζ","\\zeta",!0);R(F,X,st,"η","\\eta",!0);R(F,X,st,"θ","\\theta",!0);R(F,X,st,"ι","\\iota",!0);R(F,X,st,"κ","\\kappa",!0);R(F,X,st,"λ","\\lambda",!0);R(F,X,st,"μ","\\mu",!0);R(F,X,st,"ν","\\nu",!0);R(F,X,st,"ξ","\\xi",!0);R(F,X,st,"ο","\\omicron",!0);R(F,X,st,"π","\\pi",!0);R(F,X,st,"ρ","\\rho",!0);R(F,X,st,"σ","\\sigma",!0);R(F,X,st,"τ","\\tau",!0);R(F,X,st,"υ","\\upsilon",!0);R(F,X,st,"ϕ","\\phi",!0);R(F,X,st,"χ","\\chi",!0);R(F,X,st,"ψ","\\psi",!0);R(F,X,st,"ω","\\omega",!0);R(F,X,st,"ε","\\varepsilon",!0);R(F,X,st,"ϑ","\\vartheta",!0);R(F,X,st,"ϖ","\\varpi",!0);R(F,X,st,"ϱ","\\varrho",!0);R(F,X,st,"ς","\\varsigma",!0);R(F,X,st,"φ","\\varphi",!0);R(F,X,qe,"∗","*",!0);R(F,X,qe,"+","+");R(F,X,qe,"−","-",!0);R(F,X,qe,"⋅","\\cdot",!0);R(F,X,qe,"∘","\\circ",!0);R(F,X,qe,"÷","\\div",!0);R(F,X,qe,"±","\\pm",!0);R(F,X,qe,"×","\\times",!0);R(F,X,qe,"∩","\\cap",!0);R(F,X,qe,"∪","\\cup",!0);R(F,X,qe,"∖","\\setminus",!0);R(F,X,qe,"∧","\\land");R(F,X,qe,"∨","\\lor");R(F,X,qe,"∧","\\wedge",!0);R(F,X,qe,"∨","\\vee",!0);R(F,X,he,"√","\\surd");R(F,X,qr,"⟨","\\langle",!0);R(F,X,qr,"∣","\\lvert");R(F,X,qr,"∥","\\lVert");R(F,X,ur,"?","?");R(F,X,ur,"!","!");R(F,X,ur,"⟩","\\rangle",!0);R(F,X,ur,"∣","\\rvert");R(F,X,ur,"∥","\\rVert");R(F,X,ie,"=","=");R(F,X,ie,":",":");R(F,X,ie,"≈","\\approx",!0);R(F,X,ie,"≅","\\cong",!0);R(F,X,ie,"≥","\\ge");R(F,X,ie,"≥","\\geq",!0);R(F,X,ie,"←","\\gets");R(F,X,ie,">","\\gt",!0);R(F,X,ie,"∈","\\in",!0);R(F,X,ie,"","\\@not");R(F,X,ie,"⊂","\\subset",!0);R(F,X,ie,"⊃","\\supset",!0);R(F,X,ie,"⊆","\\subseteq",!0);R(F,X,ie,"⊇","\\supseteq",!0);R(F,re,ie,"⊈","\\nsubseteq",!0);R(F,re,ie,"⊉","\\nsupseteq",!0);R(F,X,ie,"⊨","\\models");R(F,X,ie,"←","\\leftarrow",!0);R(F,X,ie,"≤","\\le");R(F,X,ie,"≤","\\leq",!0);R(F,X,ie,"<","\\lt",!0);R(F,X,ie,"→","\\rightarrow",!0);R(F,X,ie,"→","\\to");R(F,re,ie,"≱","\\ngeq",!0);R(F,re,ie,"≰","\\nleq",!0);R(F,X,As," ","\\ ");R(F,X,As," ","\\space");R(F,X,As," ","\\nobreakspace");R(Ae,X,As," ","\\ ");R(Ae,X,As," "," ");R(Ae,X,As," ","\\space");R(Ae,X,As," ","\\nobreakspace");R(F,X,As,"","\\nobreak");R(F,X,As,"","\\allowbreak");R(F,X,ju,",",",");R(F,X,ju,";",";");R(F,re,qe,"⊼","\\barwedge",!0);R(F,re,qe,"⊻","\\veebar",!0);R(F,X,qe,"⊙","\\odot",!0);R(F,X,qe,"⊕","\\oplus",!0);R(F,X,qe,"⊗","\\otimes",!0);R(F,X,he,"∂","\\partial",!0);R(F,X,qe,"⊘","\\oslash",!0);R(F,re,qe,"⊚","\\circledcirc",!0);R(F,re,qe,"⊡","\\boxdot",!0);R(F,X,qe,"△","\\bigtriangleup");R(F,X,qe,"▽","\\bigtriangledown");R(F,X,qe,"†","\\dagger");R(F,X,qe,"⋄","\\diamond");R(F,X,qe,"⋆","\\star");R(F,X,qe,"◃","\\triangleleft");R(F,X,qe,"▹","\\triangleright");R(F,X,qr,"{","\\{");R(Ae,X,he,"{","\\{");R(Ae,X,he,"{","\\textbraceleft");R(F,X,ur,"}","\\}");R(Ae,X,he,"}","\\}");R(Ae,X,he,"}","\\textbraceright");R(F,X,qr,"{","\\lbrace");R(F,X,ur,"}","\\rbrace");R(F,X,qr,"[","\\lbrack",!0);R(Ae,X,he,"[","\\lbrack",!0);R(F,X,ur,"]","\\rbrack",!0);R(Ae,X,he,"]","\\rbrack",!0);R(F,X,qr,"(","\\lparen",!0);R(F,X,ur,")","\\rparen",!0);R(Ae,X,he,"<","\\textless",!0);R(Ae,X,he,">","\\textgreater",!0);R(F,X,qr,"⌊","\\lfloor",!0);R(F,X,ur,"⌋","\\rfloor",!0);R(F,X,qr,"⌈","\\lceil",!0);R(F,X,ur,"⌉","\\rceil",!0);R(F,X,he,"\\","\\backslash");R(F,X,he,"∣","|");R(F,X,he,"∣","\\vert");R(Ae,X,he,"|","\\textbar",!0);R(F,X,he,"∥","\\|");R(F,X,he,"∥","\\Vert");R(Ae,X,he,"∥","\\textbardbl");R(Ae,X,he,"~","\\textasciitilde");R(Ae,X,he,"\\","\\textbackslash");R(Ae,X,he,"^","\\textasciicircum");R(F,X,ie,"↑","\\uparrow",!0);R(F,X,ie,"⇑","\\Uparrow",!0);R(F,X,ie,"↓","\\downarrow",!0);R(F,X,ie,"⇓","\\Downarrow",!0);R(F,X,ie,"↕","\\updownarrow",!0);R(F,X,ie,"⇕","\\Updownarrow",!0);R(F,X,Hn,"∐","\\coprod");R(F,X,Hn,"⋁","\\bigvee");R(F,X,Hn,"⋀","\\bigwedge");R(F,X,Hn,"⨄","\\biguplus");R(F,X,Hn,"⋂","\\bigcap");R(F,X,Hn,"⋃","\\bigcup");R(F,X,Hn,"∫","\\int");R(F,X,Hn,"∫","\\intop");R(F,X,Hn,"∬","\\iint");R(F,X,Hn,"∭","\\iiint");R(F,X,Hn,"∏","\\prod");R(F,X,Hn,"∑","\\sum");R(F,X,Hn,"⨂","\\bigotimes");R(F,X,Hn,"⨁","\\bigoplus");R(F,X,Hn,"⨀","\\bigodot");R(F,X,Hn,"∮","\\oint");R(F,X,Hn,"∯","\\oiint");R(F,X,Hn,"∰","\\oiiint");R(F,X,Hn,"⨆","\\bigsqcup");R(F,X,Hn,"∫","\\smallint");R(Ae,X,Fl,"…","\\textellipsis");R(F,X,Fl,"…","\\mathellipsis");R(Ae,X,Fl,"…","\\ldots",!0);R(F,X,Fl,"…","\\ldots",!0);R(F,X,Fl,"⋯","\\@cdots",!0);R(F,X,Fl,"⋱","\\ddots",!0);R(F,X,he,"⋮","\\varvdots");R(Ae,X,he,"⋮","\\varvdots");R(F,X,gn,"ˊ","\\acute");R(F,X,gn,"ˋ","\\grave");R(F,X,gn,"¨","\\ddot");R(F,X,gn,"~","\\tilde");R(F,X,gn,"ˉ","\\bar");R(F,X,gn,"˘","\\breve");R(F,X,gn,"ˇ","\\check");R(F,X,gn,"^","\\hat");R(F,X,gn,"⃗","\\vec");R(F,X,gn,"˙","\\dot");R(F,X,gn,"˚","\\mathring");R(F,X,st,"","\\@imath");R(F,X,st,"","\\@jmath");R(F,X,he,"ı","ı");R(F,X,he,"ȷ","ȷ");R(Ae,X,he,"ı","\\i",!0);R(Ae,X,he,"ȷ","\\j",!0);R(Ae,X,he,"ß","\\ss",!0);R(Ae,X,he,"æ","\\ae",!0);R(Ae,X,he,"œ","\\oe",!0);R(Ae,X,he,"ø","\\o",!0);R(Ae,X,he,"Æ","\\AE",!0);R(Ae,X,he,"Œ","\\OE",!0);R(Ae,X,he,"Ø","\\O",!0);R(Ae,X,gn,"ˊ","\\'");R(Ae,X,gn,"ˋ","\\`");R(Ae,X,gn,"ˆ","\\^");R(Ae,X,gn,"˜","\\~");R(Ae,X,gn,"ˉ","\\=");R(Ae,X,gn,"˘","\\u");R(Ae,X,gn,"˙","\\.");R(Ae,X,gn,"¸","\\c");R(Ae,X,gn,"˚","\\r");R(Ae,X,gn,"ˇ","\\v");R(Ae,X,gn,"¨",'\\"');R(Ae,X,gn,"˝","\\H");R(Ae,X,gn,"◯","\\textcircled");var Xw={"--":!0,"---":!0,"``":!0,"''":!0};R(Ae,X,he,"–","--",!0);R(Ae,X,he,"–","\\textendash");R(Ae,X,he,"—","---",!0);R(Ae,X,he,"—","\\textemdash");R(Ae,X,he,"‘","`",!0);R(Ae,X,he,"‘","\\textquoteleft");R(Ae,X,he,"’","'",!0);R(Ae,X,he,"’","\\textquoteright");R(Ae,X,he,"“","``",!0);R(Ae,X,he,"“","\\textquotedblleft");R(Ae,X,he,"”","''",!0);R(Ae,X,he,"”","\\textquotedblright");R(F,X,he,"°","\\degree",!0);R(Ae,X,he,"°","\\degree");R(Ae,X,he,"°","\\textdegree",!0);R(F,X,he,"£","\\pounds");R(F,X,he,"£","\\mathsterling",!0);R(Ae,X,he,"£","\\pounds");R(Ae,X,he,"£","\\textsterling",!0);R(F,re,he,"✠","\\maltese");R(Ae,re,he,"✠","\\maltese");var fx='0123456789/@."';for(var n1=0;n1{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return Sx[i]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return KB[a]}else{if(r===120485||r===120486)return Sx[0];if(120486{if(va(e.classes)!==va(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},Kw=e=>{for(var t=0;tn&&(n=l.height),l.depth>r&&(r=l.depth),l.maxFontSize>i&&(i=l.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},Te=function(t,n,r,i){var a=new Hl(t,n,r,i);return Uv(a),a},ya=(e,t,n,r)=>new Hl(e,t,n,r),El=function(t,n,r){var i=Te([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=ze(i.height),i.maxFontSize=1,i},ez=function(t,n,r,i){var a=new Ld(t,n,r,i);return Uv(a),a},Ts=function(t){var n=new Il(t);return Uv(n),n},Nl=function(t,n){return t instanceof Il?Te([],[t],n):t},tz=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,l=1;l{var n=Te(["mspace"],[],t),r=yn(e,t);return n.style.marginRight=ze(r),n},o0=(e,t,n)=>{var r,i;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 t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},_g={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"}},Qw={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Jw=function(t,n){var[r,i,a]=Qw[t],l=new ba(r),c=new xs([l],{width:ze(i),height:ze(a),style:"width:"+ze(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=ya(["overlay"],[c],n);return u.height=a,u.style.height=ze(a),u.style.width=ze(i),u},bn={number:3,unit:"mu"},Wa={number:4,unit:"mu"},ms={number:5,unit:"mu"},nz={mord:{mop:bn,mbin:Wa,mrel:ms,minner:bn},mop:{mord:bn,mop:bn,mrel:ms,minner:bn},mbin:{mord:Wa,mop:Wa,mopen:Wa,minner:Wa},mrel:{mord:ms,mop:ms,mopen:ms,minner:ms},mopen:{},mclose:{mop:bn,mbin:Wa,mrel:ms,minner:bn},mpunct:{mord:bn,mop:bn,mrel:ms,mopen:bn,mclose:bn,mpunct:bn,minner:bn},minner:{mord:bn,mop:bn,mbin:Wa,mrel:ms,mopen:bn,mpunct:bn,minner:bn}},rz={mord:{mop:bn},mop:{mord:bn,mop:bn},mbin:{},mrel:{},mopen:{},mclose:{mop:bn},mpunct:{},minner:{mop:bn}},eS={},rd={},id={};function Ue(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:l}=e,c={type:t,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:i},u=0;u{var y=S.classes[0],_=k.classes[0];y==="mbin"&&sz.has(_)?S.classes[0]="mord":_==="mbin"&&iz.has(y)&&(k.classes[0]="mord")},{node:f},g,v),xg(a,(k,S)=>{var y,_,x=Sg(S),w=Sg(k),C=x&&w?k.hasClass("mtight")?(y=rz[x])==null?void 0:y[w]:(_=nz[x])==null?void 0:_[w]:null;if(C)return Zw(C,h)},{node:f},g,v),a},xg=function(t,n,r,i,a){i&&t.push(i);for(var l=0;lg=>{t.splice(f+1,0,g),l++})(l)}i&&t.pop()},tS=function(t){return t instanceof Il||t instanceof Ld||t instanceof Hl&&t.hasClass("enclosing")?t:null},wg=function(t,n){var r=tS(t);if(r){var i=r.children;if(i.length){if(n==="right")return wg(i[i.length-1],"right");if(n==="left")return wg(i[0],"left")}}return t},Sg=function(t,n){if(!t)return null;n&&(t=wg(t,n));var r=t.classes[0];return oz[r]||null},cu=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Te(n.concat(r))},Vt=function(t,n,r){if(!t)return Te();if(rd[t.type]){var i=rd[t.type](t,n);if(r&&n.size!==r.size){i=Te(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Le("Got group of unknown type: '"+t.type+"'")};function l0(e,t){var n=Te(["base"],e,t),r=Te(["strut"]);return r.style.height=ze(n.height+n.depth),n.depth&&(r.style.verticalAlign=ze(-n.depth)),n.children.unshift(r),n}function kg(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=qn(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],l=[],c=0;c0&&(a.push(l0(l,t)),l=[]),a.push(r[c]));l.length>0&&a.push(l0(l,t));var h;n?(h=l0(qn(n,t,!0),t),h.classes=["tag"],a.push(h)):i&&a.push(i);var m=Te(["katex-html"],a);if(m.setAttribute("aria-hidden","true"),h){var f=h.children[0];f.style.height=ze(m.height+m.depth),m.depth&&(f.style.verticalAlign=ze(-m.depth))}return m}function nS(e){return new Il(e)}class Oe{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=va(this.classes));for(var r=0;r0&&(t+=' class ="'+nr(va(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class In{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return nr(this.toText())}toText(){return this.text}}class rS{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",ze(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var lz=new Set(["\\imath","\\jmath"]),cz=new Set(["mrow","mtable"]),ai=function(t,n,r){return pn[n][t]&&pn[n][t].replace&&t.charCodeAt(0)!==55349&&!(Xw.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=pn[n][t].replace),new In(t)},qv=function(t){return t.length===1?t[0]:new Oe("mrow",t)},uz={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"},Gv=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=uz[n];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(lz.has(a))return null;if(pn[r][a]){var l=pn[r][a].replace;l&&(a=l)}var c=_g[n].fontName;return $v(a,c,r)?_g[n].variant:null};function a1(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof In&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof In&&n.text===","}else return!1}var Gr=function(t,n,r){if(t.length===1){var i=sn(t[0],n);return r&&i instanceof Oe&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],l,c=0;c=1&&(l.type==="mn"||a1(l))){var h=u.children[0];h instanceof Oe&&h.type==="mn"&&(h.children=[...l.children,...h.children],a.pop())}else if(l.type==="mi"&&l.children.length===1){var m=l.children[0];if(m instanceof In&&m.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var f=u.children[0];f instanceof In&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),a.pop())}}}a.push(u),l=u}return a},_a=function(t,n,r){return qv(Gr(t,n,r))},sn=function(t,n){if(!t)return new Oe("mrow");if(id[t.type])return id[t.type](t,n);throw new Le("Got group of unknown type: '"+t.type+"'")};function kx(e,t,n,r,i){var a=Gr(e,n),l;a.length===1&&a[0]instanceof Oe&&cz.has(a[0].type)?l=a[0]:l=new Oe("mrow",a);var c=new Oe("annotation",[new In(t)]);c.setAttribute("encoding","application/x-tex");var u=new Oe("semantics",[l,c]),h=new Oe("math",[u]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&h.setAttribute("display","block");var m=i?"katex":"katex-mathml";return Te([m],[h])}var hz=[[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]],Cx=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ex=function(t,n){return n.size<2?t:hz[t-1][n.size-1]};class vs{constructor(t){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=t.style,this.color=t.color,this.size=t.size||vs.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Cx[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={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(n,t),new vs(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Ex(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Cx[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Ex(vs.BASESIZE,t);return this.size===n&&this.textSize===vs.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==vs.BASESIZE?["sizing","reset-size"+this.size,"size"+vs.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=YB(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}vs.BASESIZE=6;var iS=function(t){return new vs({style:t.displayMode?dt.DISPLAY:dt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},sS=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=Te(r,[t])}return t},dz=function(t,n,r){var i=iS(r),a;if(r.output==="mathml")return kx(t,n,i,r.displayMode,!0);if(r.output==="html"){var l=kg(t,i);a=Te(["katex"],[l])}else{var c=kx(t,n,i,r.displayMode,!1),u=kg(t,i);a=Te(["katex"],[c,u])}return sS(a,r)},fz=function(t,n,r){var i=iS(r),a=kg(t,i),l=Te(["katex"],[a]);return sS(l,r)},pz={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":"="},zd=function(t){var n=new Oe("mo",[new In(pz[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},mz={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]},gz=new Set(["widehat","widecheck","widetilde","utilde"]),Id=function(t,n){function r(){var c=4e5,u=t.label.slice(1);if(gz.has(u)&&"base"in t){var h=t.base.type==="ordgroup"?t.base.body.length:1,m,f,g;if(h>5)u==="widehat"||u==="widecheck"?(m=420,c=2364,g=.42,f=u+"4"):(m=312,c=2340,g=.34,f="tilde4");else{var v=[1,1,2,2,3,3][h];u==="widehat"||u==="widecheck"?(c=[0,1062,2364,2364,2364][v],m=[0,239,300,360,420][v],g=[0,.24,.3,.3,.36,.42][v],f=u+v):(c=[0,600,1033,2339,2340][v],m=[0,260,286,306,312][v],g=[0,.26,.286,.3,.306,.34][v],f="tilde"+v)}var k=new ba(f),S=new xs([k],{width:"100%",height:ze(g),viewBox:"0 0 "+c+" "+m,preserveAspectRatio:"none"});return{span:ya([],[S],n),minWidth:0,height:g}}else{var y=[],_=mz[u];if(!_)throw new Error('No SVG data for "'+u+'".');var[x,w,C]=_,T=C/1e3,N=x.length,j,A;if(N===1){if(_.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');j=["hide-tail"],A=[_[3]]}else if(N===2)j=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(N===3)j=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var D=0;D0&&(i.style.minWidth=ze(a)),i},vz=function(t,n,r,i,a){var l,c=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(l=Te(["stretchy",n],[],a),n==="fbox"){var u=a.color&&a.getColor();u&&(l.style.borderColor=u)}}else{var h=[];/^[bx]cancel$/.test(n)&&h.push(new pg({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&h.push(new pg({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new xs(h,{width:"100%",height:ze(c)});l=ya([],[m],a)}return l.height=c,l.style.height=ze(c),l},bz={bin:1,close:1,inner:1,open:1,punct:1,rel:1},yz={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function _z(e){return e in bz}function yt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Hd(e){var t=Fd(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Fd(e){return e&&(e.type==="atom"||yz.hasOwnProperty(e.type))?e:null}var aS=e=>{if(e instanceof $r)return e;if(VB(e)&&e.children.length===1)return aS(e.children[0])},Vv=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=yt(e.base,"accent"),n=r.base,e.base=n,i=GB(Vt(e,t)),e.base=r):(r=yt(e,"accent"),n=r.base);var a=Vt(n,t.havingCrampedStyle()),l=r.isShifty&&Ns(n),c=0;if(l){var u,h;c=(u=(h=aS(a))==null?void 0:h.skew)!=null?u:0}var m=r.label==="\\c",f=m?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),g;if(r.isStretchy)g=Id(r,t),g=qt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+ze(2*c)+")",marginLeft:ze(2*c)}:void 0}]});else{var v,k;r.label==="\\vec"?(v=Jw("vec",t),k=Qw.vec[1]):(v=Bd({mode:r.mode,text:r.label},t,"textord"),v=qB(v),v.italic=0,k=v.width,m&&(f+=v.depth)),g=Te(["accent-body"],[v]);var S=r.label==="\\textcircled";S&&(g.classes.push("accent-full"),f=a.height);var y=c;S||(y-=k/2),g.style.left=ze(y),r.label==="\\textcircled"&&(g.style.top=".2em"),g=qt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-f},{type:"elem",elem:g}]})}var _=Te(["mord","accent"],[g],t);return i?(i.children[0]=_,i.height=Math.max(_.height,i.height),i.classes[0]="mord",i):_},oS=(e,t)=>{var n=e.isStretchy?zd(e.label):new Oe("mo",[ai(e.label,e.mode)]),r=new Oe("mover",[sn(e.base,t),n]);return r.setAttribute("accent","true"),r},xz=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ue({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,t)=>{var n=sd(t[0]),r=!xz.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Vv,mathmlBuilder:oS});Ue({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[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:n}},htmlBuilder:Vv,mathmlBuilder:oS});Ue({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Vt(e.base,t),r=Id(e,t),i=e.label==="\\utilde"?.12:0,a=qt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return Te(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=zd(e.label),r=new Oe("munder",[sn(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var c0=e=>{var t=new Oe("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ue({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,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=Nl(Vt(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var l;e.below&&(r=t.havingStyle(n.sub()),l=Nl(Vt(e.below,r,t),t),l.classes.push(a+"-arrow-pad"));var c=Id(e,t),u=-t.fontMetrics().axisHeight+.5*c.height,h=-t.fontMetrics().axisHeight-.5*c.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(h-=i.depth);var m;if(l){var f=-t.fontMetrics().axisHeight+l.height+.5*c.height+.111;m=qt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:c,shift:u,wrapperClasses:["svg-align"]},{type:"elem",elem:l,shift:f}]})}else m=qt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:c,shift:u,wrapperClasses:["svg-align"]}]});return Te(["mrel","x-arrow"],[m],t)},mathmlBuilder(e,t){var n=zd(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=c0(sn(e.body,t));if(e.below){var a=c0(sn(e.below,t));r=new Oe("munderover",[n,a,i])}else r=new Oe("mover",[n,i])}else if(e.below){var l=c0(sn(e.below,t));r=new Oe("munder",[n,l])}else r=c0(),r=new Oe("mover",[n,r]);return r}});function lS(e,t){var n=qn(e.body,t,!0);return Te([e.mclass],n,t)}function cS(e,t){var n,r=Gr(e.body,t);return e.mclass==="minner"?n=new Oe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new Oe("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new Oe("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ue({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:zn(i),isCharacterBox:Ns(i)}},htmlBuilder:lS,mathmlBuilder:cS});var $d=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ue({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:$d(t[0]),body:zn(t[1]),isCharacterBox:Ns(t[1])}}});Ue({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],l;r!=="\\stackrel"?l=$d(i):l="mrel";var c={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:zn(i)},u={type:"supsub",mode:a.mode,base:c,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:l,body:[u],isCharacterBox:Ns(u)}},htmlBuilder:lS,mathmlBuilder:cS});Ue({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:$d(t[0]),body:zn(t[0])}},htmlBuilder(e,t){var n=qn(e.body,t,!0),r=Te([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Gr(e.body,t),r=new Oe("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var wz={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Nx=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Ax=e=>e.type==="textord"&&e.text==="@",Sz=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function kz(e,t,n){var r=wz[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},l=n.callFunction("\\Big",[a],[]),c=n.callFunction("\\\\cdright",[t[1]],[]),u={type:"ordgroup",mode:"math",body:[i,l,c]};return n.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Cz(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Le("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;aAV".includes(h))for(var f=0;f<2;f++){for(var g=!0,v=u+1;vAV=|." after @',l[u]);var k=kz(h,m,e),S={type:"styling",body:[k],mode:"math",style:"display",resetFont:!0};r.push(S),c=Nx()}a%2===0?r.push(c):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Ue({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Nl(Vt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ze(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Oe("mrow",[sn(e.label,t)]);return n=new Oe("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Oe("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ue({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Nl(Vt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Oe("mrow",[sn(e.fragment,t)])}});Ue({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=yt(t[0],"ordgroup"),i=r.body,a="",l=0;l=1114111)throw new Le("\\@char with invalid code point "+a);return u<=65535?h=String.fromCharCode(u):(u-=65536,h=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:n.mode,text:h}}});var uS=(e,t)=>{var n=qn(e.body,t.withColor(e.color),!1);return Ts(n)},hS=(e,t)=>{var n=Gr(e.body,t.withColor(e.color)),r=new Oe("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Ue({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=yt(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:zn(i)}},htmlBuilder:uS,mathmlBuilder:hS});Ue({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=yt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:uS,mathmlBuilder:hS});Ue({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&yt(i,"size").value}},htmlBuilder(e,t){var n=Te(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ze(yn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Oe("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ze(yn(e.size,t)))),n}});var Cg={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},dS=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Le("Expected a control sequence",e);return t},Ez=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},fS=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Ue({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Cg[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Cg[r.text]),yt(t.parseFunction(),"internal");throw new Le("Invalid token after macro prefix",r)}});Ue({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Le("Expected a control sequence",r);for(var a=0,l,c=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){l=t.gullet.future(),c[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Le('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Le('Argument number "'+r.text+'" out of order');a++,c.push([])}else{if(r.text==="EOF")throw new Le("Expected a macro definition");c[a].push(r.text)}var{tokens:u}=t.gullet.consumeArg();return l&&u.unshift(l),(n==="\\edef"||n==="\\xdef")&&(u=t.gullet.expandTokens(u),u.reverse()),t.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:c},n===Cg[n]),{type:"internal",mode:t.mode}}});Ue({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=dS(t.gullet.popToken());t.gullet.consumeSpaces();var i=Ez(t);return fS(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ue({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=dS(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return fS(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var Gc=function(t,n,r){var i=pn.math[t]&&pn.math[t].replace,a=$v(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},Wv=function(t,n,r,i){var a=r.havingBaseStyle(n),l=Te(i.concat(a.sizingClasses(r)),[t],r),c=a.sizeMultiplier/r.sizeMultiplier;return l.height*=c,l.depth*=c,l.maxFontSize=a.sizeMultiplier,l},pS=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=ze(a),t.height-=a,t.depth+=a},Nz=function(t,n,r,i,a,l){var c=or(t,"Main-Regular",a,i),u=Wv(c,n,i,l);return pS(u,i,n),u},Az=function(t,n,r,i){return or(t,"Size"+n+"-Regular",r,i)},mS=function(t,n,r,i,a,l){var c=Az(t,n,a,i),u=Wv(Te(["delimsizing","size"+n],[c],i),dt.TEXT,i,l);return r&&pS(u,i,dt.TEXT),u},o1=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Te(["delimsizinginner",i],[Te([],[or(t,n,r)])]);return{type:"elem",elem:a}},l1=function(t,n,r){var i=zi["Size4-Regular"][t.charCodeAt(0)]?zi["Size4-Regular"][t.charCodeAt(0)][4]:zi["Size1-Regular"][t.charCodeAt(0)][4],a=new ba("inner",zB(t,Math.round(1e3*n))),l=new xs([a],{width:ze(i),height:ze(n),style:"width:"+ze(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),c=ya([],[l],r);return c.height=n,c.style.height=ze(n),c.style.width=ze(i),{type:"elem",elem:c}},Eg=.008,u0={type:"kern",size:-1*Eg},Tz=new Set(["|","\\lvert","\\rvert","\\vert"]),Mz=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),gS=function(t,n,r,i,a,l){var c,u,h,m,f="",g=0;c=h=m=t,u=null;var v="Size1-Regular";t==="\\uparrow"?h=m="⏐":t==="\\Uparrow"?h=m="‖":t==="\\downarrow"?c=h="⏐":t==="\\Downarrow"?c=h="‖":t==="\\updownarrow"?(c="\\uparrow",h="⏐",m="\\downarrow"):t==="\\Updownarrow"?(c="\\Uparrow",h="‖",m="\\Downarrow"):Tz.has(t)?(h="∣",f="vert",g=333):Mz.has(t)?(h="∥",f="doublevert",g=556):t==="["||t==="\\lbrack"?(c="⎡",h="⎢",m="⎣",v="Size4-Regular",f="lbrack",g=667):t==="]"||t==="\\rbrack"?(c="⎤",h="⎥",m="⎦",v="Size4-Regular",f="rbrack",g=667):t==="\\lfloor"||t==="⌊"?(h=c="⎢",m="⎣",v="Size4-Regular",f="lfloor",g=667):t==="\\lceil"||t==="⌈"?(c="⎡",h=m="⎢",v="Size4-Regular",f="lceil",g=667):t==="\\rfloor"||t==="⌋"?(h=c="⎥",m="⎦",v="Size4-Regular",f="rfloor",g=667):t==="\\rceil"||t==="⌉"?(c="⎤",h=m="⎥",v="Size4-Regular",f="rceil",g=667):t==="("||t==="\\lparen"?(c="⎛",h="⎜",m="⎝",v="Size4-Regular",f="lparen",g=875):t===")"||t==="\\rparen"?(c="⎞",h="⎟",m="⎠",v="Size4-Regular",f="rparen",g=875):t==="\\{"||t==="\\lbrace"?(c="⎧",u="⎨",m="⎩",h="⎪",v="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(c="⎫",u="⎬",m="⎭",h="⎪",v="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(c="⎧",m="⎩",h="⎪",v="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(c="⎫",m="⎭",h="⎪",v="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(c="⎧",m="⎭",h="⎪",v="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(c="⎫",m="⎩",h="⎪",v="Size4-Regular");var k=Gc(c,v,a),S=k.height+k.depth,y=Gc(h,v,a),_=y.height+y.depth,x=Gc(m,v,a),w=x.height+x.depth,C=0,T=1;if(u!==null){var N=Gc(u,v,a);C=N.height+N.depth,T=2}var j=S+w+C,A=Math.max(0,Math.ceil((n-j)/(T*_))),D=j+A*T*_,B=i.fontMetrics().axisHeight;r&&(B*=i.sizeMultiplier);var H=D/2-B,V=[];if(f.length>0){var U=D-S-w,P=Math.round(D*1e3),K=IB(f,Math.round(U*1e3)),W=new ba(f,K),Z=ze(g/1e3),ee=ze(P/1e3),z=new xs([W],{width:Z,height:ee,viewBox:"0 0 "+g+" "+P}),L=ya([],[z],i);L.height=P/1e3,L.style.width=Z,L.style.height=ee,V.push({type:"elem",elem:L})}else{if(V.push(o1(m,v,a)),V.push(u0),u===null){var I=D-S-w+2*Eg;V.push(l1(h,I,i))}else{var Y=(D-S-w-C)/2+2*Eg;V.push(l1(h,Y,i)),V.push(u0),V.push(o1(u,v,a)),V.push(u0),V.push(l1(h,Y,i))}V.push(u0),V.push(o1(c,v,a))}var G=i.havingBaseStyle(dt.TEXT),se=qt({positionType:"bottom",positionData:H,children:V});return Wv(Te(["delimsizing","mult"],[se],G),dt.TEXT,i,l)},c1=80,u1=.08,h1=function(t,n,r,i,a){var l=BB(t,i,r),c=new ba(t,l),u=new xs([c],{width:"400em",height:ze(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return ya(["hide-tail"],[u],a)},jz=function(t,n){var r=n.havingBaseSizing(),i=xS("\\surd",t*r.sizeMultiplier,_S,r),a=r.sizeMultiplier,l=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),c,u,h,m,f;return i.type==="small"?(m=1e3+1e3*l+c1,t<1?a=1:t<1.4&&(a=.7),u=(1+l+u1)/a,h=(1+l)/a,c=h1("sqrtMain",u,m,l,n),c.style.minWidth="0.853em",f=.833/a):i.type==="large"?(m=(1e3+c1)*Qc[i.size],h=(Qc[i.size]+l)/a,u=(Qc[i.size]+l+u1)/a,c=h1("sqrtSize"+i.size,u,m,l,n),c.style.minWidth="1.02em",f=1/a):(u=t+l+u1,h=t+l,m=Math.floor(1e3*t+l)+c1,c=h1("sqrtTall",u,m,l,n),c.style.minWidth="0.742em",f=1.056),c.height=h,c.style.height=ze(u),{span:c,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+l)*a}},vS=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Dz=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),bS=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Qc=[0,1.2,1.8,2.4,3],yS=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),vS.has(t)||bS.has(t))return mS(t,n,!1,r,i,a);if(Dz.has(t))return gS(t,Qc[n],!1,r,i,a);throw new Le("Illegal delimiter: '"+t+"'")},Rz=[{type:"small",style:dt.SCRIPTSCRIPT},{type:"small",style:dt.SCRIPT},{type:"small",style:dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Lz=[{type:"small",style:dt.SCRIPTSCRIPT},{type:"small",style:dt.SCRIPT},{type:"small",style:dt.TEXT},{type:"stack"}],_S=[{type:"small",style:dt.SCRIPTSCRIPT},{type:"small",style:dt.SCRIPT},{type:"small",style:dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Oz=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},xS=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),l=a;ln)return c}return r[r.length-1]},Ng=function(t,n,r,i,a,l){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var c;bS.has(t)?c=Rz:vS.has(t)?c=_S:c=Lz;var u=xS(t,n,c,i);return u.type==="small"?Nz(t,u.style,r,i,a,l):u.type==="large"?mS(t,u.size,r,i,a,l):gS(t,n,r,i,a,l)},d1=function(t,n,r,i,a,l){var c=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,h=5/i.fontMetrics().ptPerEm,m=Math.max(n-c,r+c),f=Math.max(m/500*u,2*m-h);return Ng(t,f,!0,i,a,l)},Tx={"\\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}},Bz=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 Mx(e){return"isMiddle"in e}function Pd(e,t){var n=Fd(e);if(n&&Bz.has(n.text))return n;throw n?new Le("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Le("Invalid delimiter type '"+e.type+"'",e)}Ue({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,t)=>{var n=Pd(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Tx[e.funcName].size,mclass:Tx[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Te([e.mclass]):yS(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(ai(e.delim,e.mode));var n=new Oe("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ze(Qc[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function jx(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ue({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Le("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Pd(t[0],e).text,color:n}}});Ue({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Pd(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=yt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{jx(e);for(var n=qn(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,l=0;l{jx(e);var n=Gr(e.body,t);if(e.left!=="."){var r=new Oe("mo",[ai(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new Oe("mo",[ai(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return qv(n)}});Ue({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Pd(t[0],e);if(!e.parser.leftrightDepth)throw new Le("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=cu(t,[]):(n=yS(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?ai("|","text"):ai(e.delim,e.mode),r=new Oe("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ud=(e,t)=>{var n=Nl(Vt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,l,c=Ns(e.body);if(r==="sout")a=Te(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,l=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var u=yn({number:.6,unit:"pt"},t),h=yn({number:.35,unit:"ex"},t),m=t.havingBaseSizing();i=i/m.sizeMultiplier;var f=n.height+n.depth+u+h;n.style.paddingLeft=ze(f/2+u);var g=Math.floor(1e3*f*i),v=LB(g),k=new xs([new ba("phase",v)],{width:"400em",height:ze(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});a=ya(["hide-tail"],[k],t),a.style.height=ze(f),l=n.depth+u+h}else{/cancel/.test(r)?c||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var S,y,_=0;/box/.test(r)?(_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),S=t.fontMetrics().fboxsep+(r==="colorbox"?0:_),y=S):r==="angl"?(_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),S=4*_,y=Math.max(0,.25-n.depth)):(S=c?.2:0,y=S),a=vz(n,r,S,y,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=ze(_)):r==="angl"&&_!==.049&&(a.style.borderTopWidth=ze(_),a.style.borderRightWidth=ze(_)),l=n.depth+y,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var x;if(e.backgroundColor)x=qt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:l},{type:"elem",elem:n,shift:0}]});else{var w=/cancel|phase/.test(r)?["svg-align"]:[];x=qt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:l,wrapperClasses:w}]})}return/cancel/.test(r)&&(x.height=n.height,x.depth=n.depth),/cancel/.test(r)&&!c?Te(["mord","cancel-lap"],[x],t):Te(["mord"],[x],t)},qd=(e,t)=>{var n,r=new Oe(e.label.includes("colorbox")?"mpadded":"menclose",[sn(e.body,t)]);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(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+ze(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Ue({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=yt(t[0],"color-token").color,l=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:l}},htmlBuilder:Ud,mathmlBuilder:qd});Ue({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=yt(t[0],"color-token").color,l=yt(t[1],"color-token").color,c=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:l,borderColor:a,body:c}},htmlBuilder:Ud,mathmlBuilder:qd});Ue({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ue({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Ud,mathmlBuilder:qd});Ue({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Ud,mathmlBuilder:qd});Ue({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var wS={};function Ui(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:l}=e,c={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u{var t=e.parser.settings;if(!t.displayMode)throw new Le("{"+e.envName+"} can be used only in display mode.")},zz=new Set(["gather","gather*"]);function Yv(e){if(!e.includes("ed"))return!e.includes("*")}function ka(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:l,colSeparationType:c,autoTag:u,singleRow:h,emptySingleRow:m,maxNumCols:f,leqno:g}=t;if(e.gullet.beginGroup(),h||e.gullet.macros.set("\\cr","\\\\\\relax"),!l){var v=e.gullet.expandMacroAsText("\\arraystretch");if(v==null)l=1;else if(l=parseFloat(v),!l||l<0)throw new Le("Invalid \\arraystretch: "+v)}e.gullet.beginGroup();var k=[],S=[k],y=[],_=[],x=u!=null?[]:void 0;function w(){u&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){x&&(e.gullet.macros.get("\\df@tag")?(x.push(e.subparse([new yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!u&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(w(),_.push(Dx(e));;){var T=e.parseExpression(!1,h?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:T};n&&(N={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[N]}),k.push(N);var j=e.fetch().text;if(j==="&"){if(f&&k.length===f){if(h||c)throw new Le("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(j==="\\end"){C(),k.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!m)&&S.pop(),_.length0&&(w+=.25),h.push({pos:w,isDashed:He[Qe]})}for(C(l[0]),r=0;r0&&(H+=x,jHe))for(r=0;r=c)){var ne=void 0;if(i>0||t.hskipBeforeAndAfter){var le,ye;ne=(le=(ye=G)==null?void 0:ye.pregap)!=null?le:g,ne!==0&&(K=Te(["arraycolsep"],[]),K.style.width=ze(ne),P.push(K))}var ve=[];for(r=0;r0){for(var Ft=El("hline",n,m),an=El("hdashline",n,m),wt=[{type:"elem",elem:Lt,shift:0}];h.length>0;){var Je=h.pop(),pt=Je.pos-V;Je.isDashed?wt.push({type:"elem",elem:an,shift:pt}):wt.push({type:"elem",elem:Ft,shift:pt})}Lt=qt({positionType:"individualShift",children:wt})}if(Z.length===0)return Te(["mord"],[Lt],n);var _e=qt({positionType:"individualShift",children:Z}),Ne=Te(["tag"],[_e],n);return Ts([Lt,Ne])},Iz={c:"center ",l:"left ",r:"right "},Gi=function(t,n){for(var r=[],i=new Oe("mtd",[],["mtr-glue"]),a=new Oe("mtd",[],["mml-eqn-num"]),l=0;l0){var k=t.cols,S="",y=!1,_=0,x=k.length;k[0].type==="separator"&&(g+="top ",_=1),k[k.length-1].type==="separator"&&(g+="bottom ",x-=1);for(var w=_;w0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var B=1;B0&&v&&(y=1),r[k]={type:"align",align:S,pregap:y,postgap:0}}return l.colSeparationType=v?"align":"alignat",l};Ui({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Fd(t[0]),r=n?[t[0]]:yt(t[0],"ordgroup").body,i=r.map(function(l){var c=Hd(l),u=c.text;if("lcr".includes(u))return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new Le("Unknown column alignment: "+u,l)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return ka(e.parser,a,Xv(e.envName))},htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new Le("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=ka(e.parser,r,Xv(e.envName)),l=Math.max(0,...a.body.map(c=>c.length));return a.cols=new Array(l).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=ka(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Fd(t[0]),r=n?[t[0]]:yt(t[0],"ordgroup").body,i=r.map(function(c){var u=Hd(c),h=u.text;if("lc".includes(h))return{type:"align",align:h};throw new Le("Unknown column alignment: "+h,c)});if(i.length>1)throw new Le("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},l=ka(e.parser,a,"script");if(l.body.length>0&&l.body[0].length>1)throw new Le("{subarray} can contain only one column");return l},htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ka(e.parser,t,Xv(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:CS,htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){zz.has(e.envName)&&Gd(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Yv(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ka(e.parser,t,"display")},htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:CS,htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Gd(e);var t={autoTag:Yv(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return ka(e.parser,t,"display")},htmlBuilder:qi,mathmlBuilder:Gi});Ui({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Gd(e),Cz(e.parser)},htmlBuilder:qi,mathmlBuilder:Gi});J("\\nonumber","\\gdef\\@eqnsw{0}");J("\\notag","\\nonumber");Ue({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Le(e.funcName+" valid only within array environment")}});var Rx=wS;Ue({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new Le("Invalid environment name",i);for(var a="",l=0;l{var n=e.font,r=t.withFont(n);return Vt(e.body,r)},NS=(e,t)=>{var n=e.font,r=t.withFont(n);return sn(e.body,r)},Lx={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ue({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=sd(t[0]),a=r;return a in Lx&&(a=Lx[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:ES,mathmlBuilder:NS});Ue({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:$d(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Ns(r)}}});Ue({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,l=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:l}}},htmlBuilder:ES,mathmlBuilder:NS});var Hz=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var l=Vt(e.numer,a,t);if(e.continued){var c=8.5/t.fontMetrics().ptPerEm,u=3.5/t.fontMetrics().ptPerEm;l.height=l.height0?k=3*g:k=7*g,S=t.fontMetrics().denom1):(f>0?(v=t.fontMetrics().num2,k=g):(v=t.fontMetrics().num3,k=3*g),S=t.fontMetrics().denom2);var y;if(m){var x=t.fontMetrics().axisHeight;v-l.depth-(x+.5*f){var n=new Oe("mfrac",[sn(e.numer,t),sn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=yn(e.barSize,t);n.setAttribute("linethickness",ze(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Oe("mo",[new In(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),e.rightDelim!=null){var l=new Oe("mo",[new In(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),i.push(l)}return qv(i)}return n},AS=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ue({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],l,c=null,u=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,c="(",u=")";break;case"\\\\bracefrac":l=!1,c="\\{",u="\\}";break;case"\\\\brackfrac":l=!1,c="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}var h=r==="\\cfrac",m=null;return h||r.startsWith("\\d")?m="display":r.startsWith("\\t")&&(m="text"),AS({type:"genfrac",mode:n.mode,numer:i,denom:a,continued:h,hasBarLine:l,leftDelim:c,rightDelim:u,barSize:null},m)},htmlBuilder:Hz,mathmlBuilder:Fz});Ue({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var Ox=["display","text","script","scriptscript"],Bx=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ue({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=sd(t[0]),l=a.type==="atom"&&a.family==="open"?Bx(a.text):null,c=sd(t[1]),u=c.type==="atom"&&c.family==="close"?Bx(c.text):null,h=yt(t[2],"size"),m,f=null;h.isBlank?m=!0:(f=h.value,m=f.number>0);var g=null,v=t[3];if(v.type==="ordgroup"){if(v.body.length>0){var k=yt(v.body[0],"textord");g=Ox[Number(k.text)]}}else v=yt(v,"textord"),g=Ox[Number(v.text)];return AS({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:m,barSize:f,leftDelim:l,rightDelim:u},g)}});Ue({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:yt(t[0],"size").value,token:i}}});Ue({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=yt(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var l=t[2],c=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:l,continued:!1,hasBarLine:c,barSize:a,leftDelim:null,rightDelim:null}}});var TS=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?Vt(e.sup,t.havingStyle(n.sup()),t):Vt(e.sub,t.havingStyle(n.sub()),t),i=yt(e.base,"horizBrace")):i=yt(e,"horizBrace");var a=Vt(i.base,t.havingBaseStyle(dt.DISPLAY)),l=Id(i,t),c;if(i.isOver?c=qt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:l,wrapperClasses:["svg-align"]}]}):c=qt({positionType:"bottom",positionData:a.depth+.1+l.height,children:[{type:"elem",elem:l,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var u=Te(["minner",i.isOver?"mover":"munder"],[c],t);i.isOver?c=qt({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]}):c=qt({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]})}return Te(["minner",i.isOver?"mover":"munder"],[c],t)},$z=(e,t)=>{var n=zd(e.label);return new Oe(e.isOver?"mover":"munder",[sn(e.base,t),n])};Ue({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:TS,mathmlBuilder:$z});Ue({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=yt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:zn(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=qn(e.body,t,!1);return ez(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=_a(e.body,t);return n instanceof Oe||(n=new Oe("mrow",[n])),n.setAttribute("href",e.href),n}});Ue({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=yt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=yt(t[0],"raw").string,l=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var c,u={};switch(r){case"\\htmlClass":u.class=a,c={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,c={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,c={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var h=a.split(","),m=0;m{var n=qn(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Te(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>_a(e.body,t)});Ue({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:zn(t[0]),mathml:zn(t[1])}},htmlBuilder:(e,t)=>{var n=qn(e.html,t,!1);return Ts(n)},mathmlBuilder:(e,t)=>_a(e.mathml,t)});var f1=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Le("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!Gw(r))throw new Le("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ue({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},l={number:0,unit:"em"},c="";if(n[0])for(var u=yt(n[0],"raw").string,h=u.split(","),m=0;m{var n=yn(e.height,t),r=0;e.totalheight.number>0&&(r=yn(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=yn(e.width,t));var a={height:ze(n+r)};i>0&&(a.width=ze(i)),r>0&&(a.verticalAlign=ze(-r));var l=new PB(e.src,e.alt,a);return l.height=n,l.depth=r,l},mathmlBuilder:(e,t)=>{var n=new Oe("mglyph",[]);n.setAttribute("alt",e.alt);var r=yn(e.height,t),i=0;if(e.totalheight.number>0&&(i=yn(e.totalheight,t)-r,n.setAttribute("valign",ze(-i))),n.setAttribute("height",ze(r+i)),e.width.number>0){var a=yn(e.width,t);n.setAttribute("width",ze(a))}return n.setAttribute("src",e.src),n}});Ue({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=yt(t[0],"size");if(n.settings.strict){var a=r[1]==="m",l=i.value.unit==="mu";a?(l||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):l&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return Zw(e.dimension,t)},mathmlBuilder(e,t){var n=yn(e.dimension,t);return new rS(n)}});Ue({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Te([],[Vt(e.body,t)]),n=Te(["inner"],[n],t)):n=Te(["inner"],[Vt(e.body,t)]);var r=Te(["fix"],[]),i=Te([e.alignment],[n,r],t),a=Te(["strut"]);return a.style.height=ze(i.height+i.depth),i.depth&&(a.style.verticalAlign=ze(-i.depth)),i.children.unshift(a),i=Te(["thinbox"],[i],t),Te(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Oe("mpadded",[sn(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ue({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",l=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:l}}});Ue({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Le("Mismatched "+e.funcName)}});var zx=(e,t)=>{switch(t.style.size){case dt.DISPLAY.size:return e.display;case dt.TEXT.size:return e.text;case dt.SCRIPT.size:return e.script;case dt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ue({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:zn(t[0]),text:zn(t[1]),script:zn(t[2]),scriptscript:zn(t[3])}},htmlBuilder:(e,t)=>{var n=zx(e,t),r=qn(n,t,!1);return Ts(r)},mathmlBuilder:(e,t)=>{var n=zx(e,t);return _a(n,t)}});var MS=(e,t,n,r,i,a,l)=>{e=Te([],[e]);var c=n&&Ns(n),u,h;if(t){var m=Vt(t,r.havingStyle(i.sup()),r);h={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-m.depth)}}if(n){var f=Vt(n,r.havingStyle(i.sub()),r);u={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var g;if(h&&u){var v=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+e.depth+l;g=qt({positionType:"bottom",positionData:v,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:ze(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ze(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(u){var k=e.height-l;g=qt({positionType:"top",positionData:k,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:ze(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e}]})}else if(h){var S=e.depth+l;g=qt({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ze(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var y=[g];if(u&&a!==0&&!c){var _=Te(["mspace"],[],r);_.style.marginRight=ze(a),y.unshift(_)}return Te(["mop","op-limits"],y,r)},jS=new Set(["\\smallint"]),$l=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=yt(e.base,"op"),i=!0):a=yt(e,"op");var l=t.style,c=!1;l.size===dt.DISPLAY.size&&a.symbol&&!jS.has(a.name)&&(c=!0);var u,h;if(a.symbol){var m=c?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),u=or(a.name,m,"math",t,["mop","op-symbol",c?"large-op":"small-op"]),h=u.italic,f.length>0){var g=Jw(f+"Size"+(c?"2":"1"),t);u=qt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:g,shift:c?.08:0}]}),a.name="\\"+f,u.classes.unshift("mop"),u.italic=h}}else if(a.body){var v=qn(a.body,t,!0);v.length===1&&v[0]instanceof $r?(u=v[0],u.classes[0]="mop"):u=Te(["mop"],v,t)}else{for(var k=[],S=1;S{var n;if(e.symbol)n=new Oe("mo",[ai(e.name,e.mode)]),jS.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Oe("mo",Gr(e.body,t));else{n=new Oe("mi",[new In(e.name.slice(1))]);var r=new Oe("mo",[ai("⁡","text")]);e.parentIsSupSub?n=new Oe("mrow",[n,r]):n=nS([n,r])}return n},Pz={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ue({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=Pz[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:$l,mathmlBuilder:Du});Ue({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:zn(r)}},htmlBuilder:$l,mathmlBuilder:Du});var Uz={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ue({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:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:$l,mathmlBuilder:Du});Ue({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:$l,mathmlBuilder:Du});Ue({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=Uz[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:$l,mathmlBuilder:Du});var DS=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=yt(e.base,"operatorname"),i=!0):a=yt(e,"operatorname");var l;if(a.body.length>0){for(var c=a.body.map(f=>{var g="text"in f?f.text:void 0;return typeof g=="string"?{type:"textord",mode:f.mode,text:g}:f}),u=qn(c,t.withFont("mathrm"),!0),h=0;h{for(var n=Gr(e.body,t.withFont("mathrm")),r=!0,i=0;im.toText()).join("");n=[new In(c)]}var u=new Oe("mi",n);u.setAttribute("mathvariant","normal");var h=new Oe("mo",[ai("⁡","text")]);return e.parentIsSupSub?new Oe("mrow",[u,h]):nS([u,h])};Ue({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:zn(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:DS,mathmlBuilder:qz});J("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");bo({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Ts(qn(e.body,t,!1)):Te(["mord"],qn(e.body,t,!0),t)},mathmlBuilder(e,t){return _a(e.body,t,!0)}});Ue({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Vt(e.body,t.havingCrampedStyle()),r=El("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=qt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return Te(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new Oe("mo",[new In("‾")]);n.setAttribute("stretchy","true");var r=new Oe("mover",[sn(e.body,t),n]);return r.setAttribute("accent","true"),r}});Ue({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:zn(r)}},htmlBuilder:(e,t)=>{var n=qn(e.body,t.withPhantom(),!1);return Ts(n)},mathmlBuilder:(e,t)=>{var n=Gr(e.body,t);return new Oe("mphantom",n)}});J("\\hphantom","\\smash{\\phantom{#1}}");Ue({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Te(["inner"],[Vt(e.body,t.withPhantom())]),r=Te(["fix"],[]);return Te(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Gr(zn(e.body),t),r=new Oe("mphantom",n),i=new Oe("mpadded",[r]);return i.setAttribute("width","0px"),i}});Ue({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=yt(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Vt(e.body,t),r=yn(e.dy,t);return qt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Oe("mpadded",[sn(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});Ue({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ue({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=yt(t[0],"size"),l=yt(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&yt(i,"size").value,width:a.value,height:l.value}},htmlBuilder(e,t){var n=Te(["mord","rule"],[],t),r=yn(e.width,t),i=yn(e.height,t),a=e.shift?yn(e.shift,t):0;return n.style.borderRightWidth=ze(r),n.style.borderTopWidth=ze(i),n.style.bottom=ze(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=yn(e.width,t),r=yn(e.height,t),i=e.shift?yn(e.shift,t):0,a=t.color&&t.getColor()||"black",l=new Oe("mspace");l.setAttribute("mathbackground",a),l.setAttribute("width",ze(n)),l.setAttribute("height",ze(r));var c=new Oe("mpadded",[l]);return i>=0?c.setAttribute("height",ze(i)):(c.setAttribute("height",ze(i)),c.setAttribute("depth",ze(-i))),c.setAttribute("voffset",ze(i)),c}});function RS(e,t,n){for(var r=qn(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=t.havingSize(e.size);return RS(e.body,n,t)};Ue({type:"sizing",names:Ix,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:Ix.indexOf(r)+1,body:a}},htmlBuilder:Gz,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Gr(e.body,n),i=new Oe("mstyle",r);return i.setAttribute("mathsize",ze(n.sizeMultiplier)),i}});Ue({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,l=n[0]&&yt(n[0],"ordgroup");if(l)for(var c,u=0;u{var n=Te([],[Vt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Te(["mord","smash"],[n],t);if(n.children)for(var r=0;r{var n=new Oe("mpadded",[sn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ue({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Vt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Nl(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.idn.height+n.depth+l&&(l=(l+f-n.height-n.depth)/2);var g=u.height-n.height-l-h;n.style.paddingLeft=ze(m);var v=qt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:h}]});if(e.index){var k=t.havingStyle(dt.SCRIPTSCRIPT),S=Vt(e.index,k,t),y=.6*(v.height-v.depth),_=qt({positionType:"shift",positionData:-y,children:[{type:"elem",elem:S}]}),x=Te(["root"],[_]);return Te(["mord","sqrt"],[x,v],t)}else return Te(["mord","sqrt"],[v],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Oe("mroot",[sn(n,t),sn(r,t)]):new Oe("msqrt",[sn(n,t)])}});var Ag={display:dt.DISPLAY,text:dt.TEXT,script:dt.SCRIPT,scriptscript:dt.SCRIPTSCRIPT};function Vz(e){return e in Ag}Ue({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),l=r.slice(1,r.length-5);if(!Vz(l))throw new Error("Unknown style: "+l);return{type:"styling",mode:i.mode,style:l,body:a}},htmlBuilder(e,t){var n=Ag[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),RS(e.body,r,t)},mathmlBuilder(e,t){var n=Ag[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=Gr(e.body,r),a=new Oe("mstyle",i),l={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},c=l[e.style];return a.setAttribute("scriptlevel",c[0]),a.setAttribute("displaystyle",c[1]),a}});var Wz=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===dt.DISPLAY.size||r.alwaysHandleSupSub);return i?$l:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===dt.DISPLAY.size||r.limits);return a?DS:null}else{if(r.type==="accent")return Ns(r.base)?Vv:null;if(r.type==="horizBrace"){var l=!t.sub;return l===r.isOver?TS:null}else return null}else return null};bo({type:"supsub",htmlBuilder(e,t){var n=Wz(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,l=Vt(r,t),c,u,h=t.fontMetrics(),m=0,f=0,g=r&&Ns(r);if(i){var v=t.havingStyle(t.style.sup());c=Vt(i,v,t),g||(m=l.height-v.fontMetrics().supDrop*v.sizeMultiplier/t.sizeMultiplier)}if(a){var k=t.havingStyle(t.style.sub());u=Vt(a,k,t),g||(f=l.depth+k.fontMetrics().subDrop*k.sizeMultiplier/t.sizeMultiplier)}var S;t.style===dt.DISPLAY?S=h.sup1:t.style.cramped?S=h.sup3:S=h.sup2;var y=t.sizeMultiplier,_=ze(.5/h.ptPerEm/y),x=null;if(u){var w=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(l instanceof $r||w){var C;x=ze(-((C=l.italic)!=null?C:0))}}var T;if(c&&u){m=Math.max(m,S,c.depth+.25*h.xHeight),f=Math.max(f,h.sub2);var N=h.defaultRuleThickness,j=4*N;if(m-c.depth-(u.height-f)0&&(m+=A,f-=A)}var D=[{type:"elem",elem:u,shift:f,marginRight:_,marginLeft:x},{type:"elem",elem:c,shift:-m,marginRight:_}];T=qt({positionType:"individualShift",children:D})}else if(u){f=Math.max(f,h.sub1,u.height-.8*h.xHeight);var B=[{type:"elem",elem:u,marginLeft:x,marginRight:_}];T=qt({positionType:"shift",positionData:f,children:B})}else if(c)m=Math.max(m,S,c.depth+.25*h.xHeight),T=qt({positionType:"shift",positionData:-m,children:[{type:"elem",elem:c,marginRight:_}]});else throw new Error("supsub must have either sup or sub.");var H=Sg(l,"right")||"mord";return Te([H],[l,Te(["msupsub"],[T])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[sn(e.base,t)];e.sub&&a.push(sn(e.sub,t)),e.sup&&a.push(sn(e.sup,t));var l;if(n)l=r?"mover":"munder";else if(e.sub)if(e.sup){var h=e.base;h&&h.type==="op"&&h.limits&&t.style===dt.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(t.style===dt.DISPLAY||h.limits)?l="munderover":l="msubsup"}else{var u=e.base;u&&u.type==="op"&&u.limits&&(t.style===dt.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||t.style===dt.DISPLAY)?l="munder":l="msub"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(t.style===dt.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||t.style===dt.DISPLAY)?l="mover":l="msup"}return new Oe(l,a)}});bo({type:"atom",htmlBuilder(e,t){return Pv(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Oe("mo",[ai(e.text,e.mode)]);if(e.family==="bin"){var r=Gv(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var LS={mi:"italic",mn:"normal",mtext:"normal"};bo({type:"mathord",htmlBuilder(e,t){return Bd(e,t,"mathord")},mathmlBuilder(e,t){var n=new Oe("mi",[ai(e.text,e.mode,t)]),r=Gv(e,t)||"italic";return r!==LS[n.type]&&n.setAttribute("mathvariant",r),n}});bo({type:"textord",htmlBuilder(e,t){return Bd(e,t,"textord")},mathmlBuilder(e,t){var n=ai(e.text,e.mode,t),r=Gv(e,t)||"normal",i;return e.mode==="text"?i=new Oe("mtext",[n]):/[0-9]/.test(e.text)?i=new Oe("mn",[n]):e.text==="\\prime"?i=new Oe("mo",[n]):i=new Oe("mi",[n]),r!==LS[i.type]&&i.setAttribute("mathvariant",r),i}});var p1={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},m1={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};bo({type:"spacing",htmlBuilder(e,t){if(m1.hasOwnProperty(e.text)){var n=m1[e.text].className||"";if(e.mode==="text"){var r=Bd(e,t,"textord");return r.classes.push(n),r}else return Te(["mspace",n],[Pv(e.text,e.mode,t)],t)}else{if(p1.hasOwnProperty(e.text))return Te(["mspace",p1[e.text]],[],t);throw new Le('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(m1.hasOwnProperty(e.text))n=new Oe("mtext",[new In(" ")]);else{if(p1.hasOwnProperty(e.text))return new Oe("mspace");throw new Le('Unknown type of space "'+e.text+'"')}return n}});var Hx=()=>{var e=new Oe("mtd",[]);return e.setAttribute("width","50%"),e};bo({type:"tag",mathmlBuilder(e,t){var n=new Oe("mtable",[new Oe("mtr",[Hx(),new Oe("mtd",[_a(e.body,t)]),Hx(),new Oe("mtd",[_a(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Fx={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$x={"\\textbf":"textbf","\\textmd":"textmd"},Yz={"\\textit":"textit","\\textup":"textup"},Px=(e,t)=>{var n=e.font;if(n){if(Fx[n])return t.withTextFontFamily(Fx[n]);if($x[n])return t.withTextFontWeight($x[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(Yz[n])};Ue({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:zn(i),font:r}},htmlBuilder(e,t){var n=Px(e,t),r=qn(e.body,n,!0);return Te(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Px(e,t);return _a(e.body,n)}});Ue({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Vt(e.body,t),r=El("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=qt({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return Te(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new Oe("mo",[new In("‾")]);n.setAttribute("stretchy","true");var r=new Oe("munder",[sn(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});Ue({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Vt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return qt({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Oe("mpadded",[sn(e.body,t)],["vcenter"]);return new Oe("mrow",[n])}});Ue({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Le("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Ux(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),pa=eS,OS=`[ \r + ]`,Xz="\\\\[a-zA-Z@]+",Kz="\\\\[^\uD800-\uDFFF]",Zz="("+Xz+")"+OS+"*",Qz=`\\\\( +|[ \r ]+ +?)[ \r ]*`,Tg="[̀-ͯ]",Jz=new RegExp(Tg+"+$"),eI="("+OS+"+)|"+(Qz+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Tg+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Tg+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Zz)+("|"+Kz+")");class qx{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(eI,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new yi("EOF",new wr(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new Le("Unexpected character: '"+t[n]+"'",new yi(t[n],new wr(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.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=a+1,this.lex()}return new yi(i,new wr(this,n,this.tokenRegex.lastIndex))}}class tI{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Le("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var nI=SS;J("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});J("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});J("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});J("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});J("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});J("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");J("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Gx={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};J("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Le("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=Gx[t.text],r==null||r>=n)throw new Le("Invalid base-"+n+" digit "+t.text);for(var i;(i=Gx[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new Le("\\newcommand's first argument must be a macro name");var a=i[0].text,l=e.isDefined(a);if(l&&!t)throw new Le("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!l&&!n)throw new Le("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var c=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var u="",h=e.expandNextToken();h.text!=="]"&&h.text!=="EOF";)u+=h.text,h=e.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new Le("Invalid number of arguments: "+u);c=parseInt(u),i=e.consumeArg().tokens}return l&&r||e.macros.set(a,{tokens:i,numArgs:c}),""};J("\\newcommand",e=>Kv(e,!1,!0,!1));J("\\renewcommand",e=>Kv(e,!0,!1,!1));J("\\providecommand",e=>Kv(e,!0,!0,!0));J("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});J("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});J("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),pa[n],pn.math[n],pn.text[n]),""});J("\\bgroup","{");J("\\egroup","}");J("~","\\nobreakspace");J("\\lq","`");J("\\rq","'");J("\\aa","\\r a");J("\\AA","\\r A");J("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");J("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");J("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");J("ℬ","\\mathscr{B}");J("ℰ","\\mathscr{E}");J("ℱ","\\mathscr{F}");J("ℋ","\\mathscr{H}");J("ℐ","\\mathscr{I}");J("ℒ","\\mathscr{L}");J("ℳ","\\mathscr{M}");J("ℛ","\\mathscr{R}");J("ℭ","\\mathfrak{C}");J("ℌ","\\mathfrak{H}");J("ℨ","\\mathfrak{Z}");J("\\Bbbk","\\Bbb{k}");J("\\llap","\\mathllap{\\textrm{#1}}");J("\\rlap","\\mathrlap{\\textrm{#1}}");J("\\clap","\\mathclap{\\textrm{#1}}");J("\\mathstrut","\\vphantom{(}");J("\\underbar","\\underline{\\text{#1}}");J("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');J("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");J("\\ne","\\neq");J("≠","\\neq");J("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");J("∉","\\notin");J("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");J("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");J("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");J("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");J("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");J("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");J("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");J("⟂","\\perp");J("‼","\\mathclose{!\\mkern-0.8mu!}");J("∌","\\notni");J("⌜","\\ulcorner");J("⌝","\\urcorner");J("⌞","\\llcorner");J("⌟","\\lrcorner");J("©","\\copyright");J("®","\\textregistered");J("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');J("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');J("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');J("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');J("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");J("⋮","\\vdots");J("\\varGamma","\\mathit{\\Gamma}");J("\\varDelta","\\mathit{\\Delta}");J("\\varTheta","\\mathit{\\Theta}");J("\\varLambda","\\mathit{\\Lambda}");J("\\varXi","\\mathit{\\Xi}");J("\\varPi","\\mathit{\\Pi}");J("\\varSigma","\\mathit{\\Sigma}");J("\\varUpsilon","\\mathit{\\Upsilon}");J("\\varPhi","\\mathit{\\Phi}");J("\\varPsi","\\mathit{\\Psi}");J("\\varOmega","\\mathit{\\Omega}");J("\\substack","\\begin{subarray}{c}#1\\end{subarray}");J("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");J("\\boxed","\\fbox{$\\displaystyle{#1}$}");J("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");J("\\implies","\\DOTSB\\;\\Longrightarrow\\;");J("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");J("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");J("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Vx={",":"\\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"},rI=new Set(["bin","rel"]);J("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Vx?t=Vx[n]:(n.slice(0,4)==="\\not"||n in pn.math&&rI.has(pn.math[n].group))&&(t="\\dotsb"),t});var Zv={")":!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};J("\\dotso",function(e){var t=e.future().text;return t in Zv?"\\ldots\\,":"\\ldots"});J("\\dotsc",function(e){var t=e.future().text;return t in Zv&&t!==","?"\\ldots\\,":"\\ldots"});J("\\cdots",function(e){var t=e.future().text;return t in Zv?"\\@cdots\\,":"\\@cdots"});J("\\dotsb","\\cdots");J("\\dotsm","\\cdots");J("\\dotsi","\\!\\cdots");J("\\dotsx","\\ldots\\,");J("\\DOTSI","\\relax");J("\\DOTSB","\\relax");J("\\DOTSX","\\relax");J("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");J("\\,","\\tmspace+{3mu}{.1667em}");J("\\thinspace","\\,");J("\\>","\\mskip{4mu}");J("\\:","\\tmspace+{4mu}{.2222em}");J("\\medspace","\\:");J("\\;","\\tmspace+{5mu}{.2777em}");J("\\thickspace","\\;");J("\\!","\\tmspace-{3mu}{.1667em}");J("\\negthinspace","\\!");J("\\negmedspace","\\tmspace-{4mu}{.2222em}");J("\\negthickspace","\\tmspace-{5mu}{.277em}");J("\\enspace","\\kern.5em ");J("\\enskip","\\hskip.5em\\relax");J("\\quad","\\hskip1em\\relax");J("\\qquad","\\hskip2em\\relax");J("\\tag","\\@ifstar\\tag@literal\\tag@paren");J("\\tag@paren","\\tag@literal{({#1})}");J("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Le("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});J("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");J("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");J("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");J("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");J("\\newline","\\\\\\relax");J("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var BS=ze(zi["Main-Regular"][84][1]-.7*zi["Main-Regular"][65][1]);J("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+BS+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");J("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+BS+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");J("\\hspace","\\@ifstar\\@hspacer\\@hspace");J("\\@hspace","\\hskip #1\\relax");J("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");J("\\ordinarycolon",":");J("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");J("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');J("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');J("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');J("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');J("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');J("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');J("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');J("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');J("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');J("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');J("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');J("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');J("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');J("∷","\\dblcolon");J("∹","\\eqcolon");J("≔","\\coloneqq");J("≕","\\eqqcolon");J("⩴","\\Coloneqq");J("\\ratio","\\vcentcolon");J("\\coloncolon","\\dblcolon");J("\\colonequals","\\coloneqq");J("\\coloncolonequals","\\Coloneqq");J("\\equalscolon","\\eqqcolon");J("\\equalscoloncolon","\\Eqqcolon");J("\\colonminus","\\coloneq");J("\\coloncolonminus","\\Coloneq");J("\\minuscolon","\\eqcolon");J("\\minuscoloncolon","\\Eqcolon");J("\\coloncolonapprox","\\Colonapprox");J("\\coloncolonsim","\\Colonsim");J("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");J("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");J("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");J("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");J("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");J("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");J("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");J("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");J("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");J("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");J("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");J("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");J("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");J("\\nleqq","\\html@mathml{\\@nleqq}{≰}");J("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");J("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");J("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");J("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");J("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");J("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");J("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");J("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");J("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");J("\\imath","\\html@mathml{\\@imath}{ı}");J("\\jmath","\\html@mathml{\\@jmath}{ȷ}");J("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");J("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");J("⟦","\\llbracket");J("⟧","\\rrbracket");J("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");J("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");J("⦃","\\lBrace");J("⦄","\\rBrace");J("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");J("⦵","\\minuso");J("\\darr","\\downarrow");J("\\dArr","\\Downarrow");J("\\Darr","\\Downarrow");J("\\lang","\\langle");J("\\rang","\\rangle");J("\\uarr","\\uparrow");J("\\uArr","\\Uparrow");J("\\Uarr","\\Uparrow");J("\\N","\\mathbb{N}");J("\\R","\\mathbb{R}");J("\\Z","\\mathbb{Z}");J("\\alef","\\aleph");J("\\alefsym","\\aleph");J("\\Alpha","\\mathrm{A}");J("\\Beta","\\mathrm{B}");J("\\bull","\\bullet");J("\\Chi","\\mathrm{X}");J("\\clubs","\\clubsuit");J("\\cnums","\\mathbb{C}");J("\\Complex","\\mathbb{C}");J("\\Dagger","\\ddagger");J("\\diamonds","\\diamondsuit");J("\\empty","\\emptyset");J("\\Epsilon","\\mathrm{E}");J("\\Eta","\\mathrm{H}");J("\\exist","\\exists");J("\\harr","\\leftrightarrow");J("\\hArr","\\Leftrightarrow");J("\\Harr","\\Leftrightarrow");J("\\hearts","\\heartsuit");J("\\image","\\Im");J("\\infin","\\infty");J("\\Iota","\\mathrm{I}");J("\\isin","\\in");J("\\Kappa","\\mathrm{K}");J("\\larr","\\leftarrow");J("\\lArr","\\Leftarrow");J("\\Larr","\\Leftarrow");J("\\lrarr","\\leftrightarrow");J("\\lrArr","\\Leftrightarrow");J("\\Lrarr","\\Leftrightarrow");J("\\Mu","\\mathrm{M}");J("\\natnums","\\mathbb{N}");J("\\Nu","\\mathrm{N}");J("\\Omicron","\\mathrm{O}");J("\\plusmn","\\pm");J("\\rarr","\\rightarrow");J("\\rArr","\\Rightarrow");J("\\Rarr","\\Rightarrow");J("\\real","\\Re");J("\\reals","\\mathbb{R}");J("\\Reals","\\mathbb{R}");J("\\Rho","\\mathrm{P}");J("\\sdot","\\cdot");J("\\sect","\\S");J("\\spades","\\spadesuit");J("\\sub","\\subset");J("\\sube","\\subseteq");J("\\supe","\\supseteq");J("\\Tau","\\mathrm{T}");J("\\thetasym","\\vartheta");J("\\weierp","\\wp");J("\\Zeta","\\mathrm{Z}");J("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");J("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");J("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");J("\\bra","\\mathinner{\\langle{#1}|}");J("\\ket","\\mathinner{|{#1}\\rangle}");J("\\braket","\\mathinner{\\langle{#1}\\rangle}");J("\\Bra","\\left\\langle#1\\right|");J("\\Ket","\\left|#1\\right\\rangle");var zS=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,l=t.macros.get("|"),c=t.macros.get("\\|");t.macros.beginGroup();var u=f=>g=>{e&&(g.macros.set("|",l),i.length&&g.macros.set("\\|",c));var v=f;if(!f&&i.length){var k=g.future();k.text==="|"&&(g.popToken(),v=!0)}return{tokens:v?i:r,numArgs:0}};t.macros.set("|",u(!1)),i.length&&t.macros.set("\\|",u(!0));var h=t.consumeArg().tokens,m=t.expandTokens([...a,...h,...n]);return t.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};J("\\bra@ket",zS(!1));J("\\bra@set",zS(!0));J("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");J("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");J("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");J("\\angln","{\\angl n}");J("\\blue","\\textcolor{##6495ed}{#1}");J("\\orange","\\textcolor{##ffa500}{#1}");J("\\pink","\\textcolor{##ff00af}{#1}");J("\\red","\\textcolor{##df0030}{#1}");J("\\green","\\textcolor{##28ae7b}{#1}");J("\\gray","\\textcolor{gray}{#1}");J("\\purple","\\textcolor{##9d38bd}{#1}");J("\\blueA","\\textcolor{##ccfaff}{#1}");J("\\blueB","\\textcolor{##80f6ff}{#1}");J("\\blueC","\\textcolor{##63d9ea}{#1}");J("\\blueD","\\textcolor{##11accd}{#1}");J("\\blueE","\\textcolor{##0c7f99}{#1}");J("\\tealA","\\textcolor{##94fff5}{#1}");J("\\tealB","\\textcolor{##26edd5}{#1}");J("\\tealC","\\textcolor{##01d1c1}{#1}");J("\\tealD","\\textcolor{##01a995}{#1}");J("\\tealE","\\textcolor{##208170}{#1}");J("\\greenA","\\textcolor{##b6ffb0}{#1}");J("\\greenB","\\textcolor{##8af281}{#1}");J("\\greenC","\\textcolor{##74cf70}{#1}");J("\\greenD","\\textcolor{##1fab54}{#1}");J("\\greenE","\\textcolor{##0d923f}{#1}");J("\\goldA","\\textcolor{##ffd0a9}{#1}");J("\\goldB","\\textcolor{##ffbb71}{#1}");J("\\goldC","\\textcolor{##ff9c39}{#1}");J("\\goldD","\\textcolor{##e07d10}{#1}");J("\\goldE","\\textcolor{##a75a05}{#1}");J("\\redA","\\textcolor{##fca9a9}{#1}");J("\\redB","\\textcolor{##ff8482}{#1}");J("\\redC","\\textcolor{##f9685d}{#1}");J("\\redD","\\textcolor{##e84d39}{#1}");J("\\redE","\\textcolor{##bc2612}{#1}");J("\\maroonA","\\textcolor{##ffbde0}{#1}");J("\\maroonB","\\textcolor{##ff92c6}{#1}");J("\\maroonC","\\textcolor{##ed5fa6}{#1}");J("\\maroonD","\\textcolor{##ca337c}{#1}");J("\\maroonE","\\textcolor{##9e034e}{#1}");J("\\purpleA","\\textcolor{##ddd7ff}{#1}");J("\\purpleB","\\textcolor{##c6b9fc}{#1}");J("\\purpleC","\\textcolor{##aa87ff}{#1}");J("\\purpleD","\\textcolor{##7854ab}{#1}");J("\\purpleE","\\textcolor{##543b78}{#1}");J("\\mintA","\\textcolor{##f5f9e8}{#1}");J("\\mintB","\\textcolor{##edf2df}{#1}");J("\\mintC","\\textcolor{##e0e5cc}{#1}");J("\\grayA","\\textcolor{##f6f7f7}{#1}");J("\\grayB","\\textcolor{##f0f1f2}{#1}");J("\\grayC","\\textcolor{##e3e5e6}{#1}");J("\\grayD","\\textcolor{##d6d8da}{#1}");J("\\grayE","\\textcolor{##babec2}{#1}");J("\\grayF","\\textcolor{##888d93}{#1}");J("\\grayG","\\textcolor{##626569}{#1}");J("\\grayH","\\textcolor{##3b3e40}{#1}");J("\\grayI","\\textcolor{##21242c}{#1}");J("\\kaBlue","\\textcolor{##314453}{#1}");J("\\kaGreen","\\textcolor{##71B307}{#1}");var IS={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class iI{constructor(t,n,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=n,this.expansionCount=0,this.feed(t),this.macros=new tI(nI,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new qx(t,this.settings)}switchMode(t){this.mode=t}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(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new yi("EOF",r.loc)),this.pushTokens(i),new yi("",wr.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,l=0,c=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++l;else if(a.text==="}"){if(--l,l===-1)throw new Le("Extra }",a)}else if(a.text==="EOF")throw new Le("Unexpected end of input in a macro argument, expected '"+(t&&r?t[c]:"}")+"'",a);if(t&&r)if((l===0||l===1&&t[c]==="{")&&a.text===t[c]){if(++c,c===t.length){n.splice(-c,c);break}}else c=0}while(l!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Le("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new Le("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new Le("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,l=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var c=a.length-1;c>=0;--c){var u=a[c];if(u.text==="#"){if(c===0)throw new Le("Incomplete placeholder at end of macro body",u);if(u=a[--c],u.text==="#")a.splice(c+1,1);else if(/^[1-9]$/.test(u.text))a.splice(c,2,...l[+u.text-1]);else throw new Le("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new yi(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var l=i.replace(/##/g,"");l.includes("#"+(a+1));)++a;for(var c=new qx(i,this.settings),u=[],h=c.lex();h.text!=="EOF";)u.push(h),h=c.lex();u.reverse();var m={tokens:u,numArgs:a};return m}return i}isDefined(t){return this.macros.has(t)||pa.hasOwnProperty(t)||pn.math.hasOwnProperty(t)||pn.text.hasOwnProperty(t)||IS.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:pa.hasOwnProperty(t)&&!pa[t].primitive}}var Wx=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,h0=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),g1={"́":{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"}},Yx={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Vd{constructor(t,n){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 iI(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Le("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new yi("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Vd.endOfExpression.has(i.text)||n&&i.text===n||t&&pa[i.text]&&pa[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=128)this.settings.strict&&(qw(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),l={type:"textord",mode:"text",loc:wr.range(t),text:n};else return null;if(this.consume(),a)for(var m=0;m0?{type:"text",value:N}:void 0),N===!1?g.lastIndex=C+1:(k!==C&&x.push({type:"text",value:h.value.slice(k,C)}),Array.isArray(N)?x.push(...N):N&&x.push(N),k=C+w[0].length,_=!0),!g.global)break;w=g.exec(h.value)}return _?(k?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Kx(e,"(");let a=Kx(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function PS(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||so(n)||Md(n))&&(!t||n!==47)}US.peek=zI;function TI(){this.buffer()}function MI(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jI(){this.buffer()}function DI(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function RI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LI(e){this.exit(e)}function OI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function BI(e){this.exit(e)}function zI(){return"["}function US(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=i.move("]"),a}function II(){return{enter:{gfmFootnoteCallString:TI,gfmFootnoteCall:MI,gfmFootnoteDefinitionLabelString:jI,gfmFootnoteDefinition:DI},exit:{gfmFootnoteCallString:RI,gfmFootnoteCall:LI,gfmFootnoteDefinitionLabelString:OI,gfmFootnoteDefinition:BI}}}function HI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:US},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,l){const c=a.createTracker(l);let u=c.move("[^");const h=a.enter("footnoteDefinition"),m=a.enter("label");return u+=c.move(a.safe(a.associationId(r),{before:u,after:"]"})),m(),u+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),u+=c.move((t?` +`:" ")+a.indentLines(a.containerFlow(r,c.current()),t?qS:FI))),h(),u}}function FI(e,t,n){return t===0?e:qS(e,t,n)}function qS(e,t,n){return(n?"":" ")+e}const $I=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GS.peek=VI;function PI(){return{canContainEols:["delete"],enter:{strikethrough:qI},exit:{strikethrough:GI}}}function UI(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$I}],handlers:{delete:GS}}}function qI(e){this.enter({type:"delete",children:[]},e)}function GI(e){this.exit(e)}function GS(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function VI(){return"~"}function WI(e){return e.length}function YI(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||WI,a=[],l=[],c=[],u=[];let h=0,m=-1;for(;++mh&&(h=e[m].length);++_u[_])&&(u[_]=w)}S.push(x)}l[m]=S,c[m]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fu[f]&&(u[f]=x),v[f]=x),g[f]=w}l.splice(1,0,g),c.splice(1,0,v),m=-1;const k=[];for(;++m "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),ZI);return i(),l}function ZI(e,t,n){return">"+(n?"":" ")+e}function QI(e,t){return Qx(e,t.inConstruct,!0)&&!Qx(e,t.notInConstruct,!1)}function Qx(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rl&&(l=a):a=1,i=r+t.length,r=n.indexOf(t,i);return l}function JI(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function eH(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function tH(e,t,n,r){const i=eH(n),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(JI(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(a,nH);return f(),g}const c=n.createTracker(r),u=i.repeat(Math.max(VS(a,i)+1,3)),h=n.enter("codeFenced");let m=c.move(u);if(e.lang){const f=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:` +`,encode:["`"],...c.current()})),f()}return m+=c.move(` +`),a&&(m+=c.move(a+` +`)),m+=c.move(u),h(),m}function nH(e,t,n){return(n?"":" ")+e}function e2(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function rH(e,t,n,r){const i=e2(n),a=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const u=n.createTracker(r);let h=u.move("[");return h+=u.move(n.safe(n.associationId(e),{before:h,after:"]",...u.current()})),h+=u.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(c=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":` +`,...u.current()}))),c(),e.title&&(c=n.enter(`title${a}`),h+=u.move(" "+i),h+=u.move(n.safe(e.title,{before:h,after:i,...u.current()})),h+=u.move(i),c()),l(),h}function iH(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function uu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ad(e,t,n){const r=kl(e),i=kl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}WS.peek=sH;function WS(e,t,n,r){const i=iH(n),a=n.enter("emphasis"),l=n.createTracker(r),c=l.move(i);let u=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const h=u.charCodeAt(0),m=ad(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(u=uu(h)+u.slice(1));const f=u.charCodeAt(u.length-1),g=ad(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+uu(f));const v=l.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},c+u+v}function sH(e,t,n){return n.options.emphasis||"*"}function aH(e,t){let n=!1;return Ov(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,sg}),!!((!e.depth||e.depth<3)&&Av(e)&&(t.options.setext||n))}function oH(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(aH(e,n)){const m=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:` +`,after:` +`});return f(),m(),g+` +`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` +`))+1))}const l="#".repeat(i),c=n.enter("headingAtx"),u=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:` +`,...a.current()});return/^[\t ]/.test(h)&&(h=uu(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),u(),c(),h}YS.peek=lH;function YS(e){return e.value||""}function lH(){return"<"}XS.peek=cH;function XS(e,t,n,r){const i=e2(n),a=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const u=n.createTracker(r);let h=u.move("![");return h+=u.move(n.safe(e.alt,{before:h,after:"]",...u.current()})),h+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(c=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${a}`),h+=u.move(" "+i),h+=u.move(n.safe(e.title,{before:h,after:i,...u.current()})),h+=u.move(i),c()),h+=u.move(")"),l(),h}function cH(){return"!"}KS.peek=uH;function KS(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("![");const h=n.safe(e.alt,{before:u,after:"]",...c.current()});u+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...c.current()});return l(),n.stack=m,a(),i==="full"||!h||h!==f?u+=c.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function uH(){return"!"}ZS.peek=hH;function ZS(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}JS.peek=dH;function JS(e,t,n,r){const i=e2(n),a=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,u;if(QS(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let f=l.move("<");return f+=l.move(n.containerPhrasing(e,{before:f,after:">",...l.current()})),f+=l.move(">"),c(),n.stack=m,f}c=n.enter("link"),u=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(u=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=l.move(" "+i),h+=l.move(n.safe(e.title,{before:h,after:i,...l.current()})),h+=l.move(i),u()),h+=l.move(")"),c(),h}function dH(e,t,n){return QS(e,n)?"<":"["}e8.peek=fH;function e8(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("[");const h=n.containerPhrasing(e,{before:u,after:"]",...c.current()});u+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...c.current()});return l(),n.stack=m,a(),i==="full"||!h||h!==f?u+=c.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function fH(){return"["}function t2(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pH(e){const t=t2(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function mH(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function t8(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function gH(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?mH(n):t2(n);const c=e.ordered?l==="."?")":".":pH(n);let u=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),t8(n)===l&&m){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const u=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),m);return u(),h;function m(f,g,v){return g?(v?"":" ".repeat(l))+f:(v?a:a+" ".repeat(l-a.length))+f}}function yH(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),i(),l}const _H=Tu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function xH(e,t,n,r){return(e.children.some(function(l){return _H(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wH(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}n8.peek=SH;function n8(e,t,n,r){const i=wH(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(i+i);let u=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const h=u.charCodeAt(0),m=ad(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(u=uu(h)+u.slice(1));const f=u.charCodeAt(u.length-1),g=ad(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+uu(f));const v=l.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},c+u+v}function SH(e,t,n){return n.options.strong||"*"}function kH(e,t,n,r){return n.safe(e.value,r)}function CH(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function EH(e,t,n){const r=(t8(n)+(n.options.ruleSpaces?" ":"")).repeat(CH(n));return n.options.ruleSpaces?r.slice(0,-1):r}const r8={blockquote:KI,break:Jx,code:tH,definition:rH,emphasis:WS,hardBreak:Jx,heading:oH,html:YS,image:XS,imageReference:KS,inlineCode:ZS,link:JS,linkReference:e8,list:gH,listItem:bH,paragraph:yH,root:xH,strong:n8,text:kH,thematicBreak:EH};function NH(){return{enter:{table:AH,tableData:e5,tableHeader:e5,tableRow:MH},exit:{codeText:jH,table:TH,tableData:_1,tableHeader:_1,tableRow:_1}}}function AH(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function TH(e){this.exit(e),this.data.inTable=void 0}function MH(e){this.enter({type:"tableRow",children:[]},e)}function _1(e){this.exit(e)}function e5(e){this.enter({type:"tableCell",children:[]},e)}function jH(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,DH));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function DH(e,t){return t==="|"?t:e}function RH(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:l,tableCell:u,tableRow:c}};function l(v,k,S,y){return h(m(v,S,y),v.align)}function c(v,k,S,y){const _=f(v,S,y),x=h([_]);return x.slice(0,x.indexOf(` +`))}function u(v,k,S,y){const _=S.enter("tableCell"),x=S.enter("phrasing"),w=S.containerPhrasing(v,{...y,before:a,after:a});return x(),_(),w}function h(v,k){return YI(v,{align:k,alignDelimiters:r,padding:n,stringLength:i})}function m(v,k,S){const y=v.children;let _=-1;const x=[],w=k.enter("table");for(;++_0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ZH={tokenize:sF,partial:!0};function QH(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nF,continuation:{tokenize:rF},exit:iF}},text:{91:{name:"gfmFootnoteCall",tokenize:tF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:JH,resolveTo:eF}}}}function JH(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return c;function c(u){if(!l||!l._balanced)return n(u);const h=bi(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function eF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function tF(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(f){if(a>999||f===93&&!l||f===null||f===91||rn(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(bi(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return rn(f)||(l=!0),a++,e.consume(f),f===92?m:h}function m(f){return f===91||f===92||f===93?(e.consume(f),a++,h):h(f)}}function nF(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return u;function u(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(k)}function m(k){if(l>999||k===93&&!c||k===null||k===91||rn(k))return n(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=bi(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return rn(k)||(c=!0),l++,e.consume(k),k===92?f:m}function f(k){return k===91||k===92||k===93?(e.consume(k),l++,m):m(k)}function g(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),i.includes(a)||i.push(a),xt(e,v,"gfmFootnoteDefinitionWhitespace")):n(k)}function v(k){return t(k)}}function rF(e,t,n){return e.check(Au,t,e.attempt(ZH,t,n))}function iF(e){e.exit("gfmFootnoteDefinition")}function sF(e,t,n){const r=this;return xt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function aF(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,c){let u=-1;for(;++u1?u(k):(l.consume(k),f++,v);if(f<2&&!n)return u(k);const y=l.exit("strikethroughSequenceTemporary"),_=kl(k);return y._open=!_||_===2&&!!S,y._close=!S||S===2&&!!_,c(k)}}}class oF{constructor(){this.map=[]}add(t,n,r){lF(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function lF(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const P=r.events[H][1].type;if(P==="lineEnding"||P==="linePrefix")H--;else break}const V=H>-1?r.events[H][1].type:null,U=V==="tableHead"||V==="tableRow"?N:u;return U===N&&r.parser.lazy[r.now().line]?n(B):U(B)}function u(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,a+=1),m(B)}function m(B){return B===null?n(B):Ke(B)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),v):n(B):Ct(B)?xt(e,m,"whitespace")(B):(a+=1,l&&(l=!1,i+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),f(B)))}function f(B){return B===null||B===124||rn(B)?(e.exit("data"),m(B)):(e.consume(B),B===92?g:f)}function g(B){return B===92||B===124?(e.consume(B),f):f(B)}function v(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,Ct(B)?xt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):k(B))}function k(B){return B===45||B===58?y(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),S):T(B)}function S(B){return Ct(B)?xt(e,y,"whitespace")(B):y(B)}function y(B){return B===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),_):B===45?(a+=1,_(B)):B===null||Ke(B)?C(B):T(B)}function _(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):T(B)}function x(B){return B===45?(e.consume(B),x):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(B))}function w(B){return Ct(B)?xt(e,C,"whitespace")(B):C(B)}function C(B){return B===124?k(B):B===null||Ke(B)?!l||i!==a?T(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):T(B)}function T(B){return n(B)}function N(B){return e.enter("tableRow"),j(B)}function j(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),j):B===null||Ke(B)?(e.exit("tableRow"),t(B)):Ct(B)?xt(e,j,"whitespace")(B):(e.enter("data"),A(B))}function A(B){return B===null||B===124||rn(B)?(e.exit("data"),j(B)):(e.consume(B),B===92?D:A)}function D(B){return B===92||B===124?(e.consume(B),A):A(B)}}function dF(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,u=0,h,m,f;const g=new oF;for(;++nn[2]+1){const k=n[2]+1,S=n[3]-n[2]-1;e.add(k,S,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},ul(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function n5(e,t,n,r,i){const a=[],l=ul(t.events,n);i&&(i.end=Object.assign({},l),a.push(["exit",i,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function ul(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const fF={name:"tasklistCheck",tokenize:mF};function pF(){return{text:{91:fF}}}function mF(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return rn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):n(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(u)}function c(u){return Ke(u)?t(u):Ct(u)?e.check({tokenize:gF},t,n)(u):n(u)}}function gF(e,t,n){return xt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function vF(e){return pw([PH(),QH(),aF(e),uF(),pF()])}const bF={};function d8(e){const t=this,n=e||bF,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(vF(n)),a.push(IH()),l.push(HH(n))}function yF(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:c,mathText:l,mathTextData:c}};function e(u){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},u)}function t(){this.buffer()}function n(){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(u){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=h;const f=m.data.hChildren[0];f.type,f.tagName,f.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function a(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function l(u){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=h,m.data.hChildren.push({type:"text",value:h})}function c(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function _F(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(a,l,c,u){const h=a.value||"",m=c.createTracker(u),f="$".repeat(Math.max(VS(h,"$")+1,2)),g=c.enter("mathFlow");let v=m.move(f);if(a.meta){const k=c.enter("mathFlowMeta");v+=m.move(c.safe(a.meta,{after:` +`,before:v,encode:["$"],...m.current()})),k()}return v+=m.move(` +`),h&&(v+=m.move(h+` +`)),v+=m.move(f),g(),v}function r(a,l,c){let u=a.value||"",h=1;for(t||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(u);)h++;const m="$".repeat(h);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let f=-1;for(;++f]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}Ru.displayName="c";Ru.aliases=[];function Ru(e){e.register(Wi),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}Wd.displayName="cpp";Wd.aliases=[];function Wd(e){e.register(Ru),(function(t){var n=/\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 n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return n.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:n,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/}),t.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}}),t.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:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}r2.displayName="arduino";r2.aliases=["ino"];function r2(e){e.register(Wd),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}i2.displayName="bash";i2.aliases=["sh","shell"];function i2(e){(function(t){var n="\\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},i={bash:r,environment:{pattern:RegExp("\\$"+n),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("(\\{)"+n),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})/};t.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;|&]|[<>]\\()"+n),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:i},{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:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.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=t.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],l=i.variable[1].inside,c=0;c>/g,function(Y,G){return"(?:"+I[+G]+")"})}function r(L,I,Y){return RegExp(n(L,I),"")}function i(L,I){for(var Y=0;Y>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var a={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 c=l(a.typeDeclaration),u=RegExp(l(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),h=l(a.typeDeclaration+" "+a.contextual+" "+a.other),m=l(a.type+" "+a.typeDeclaration+" "+a.other),f=i(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),g=i(/\((?:[^()]|<>)*\)/.source,2),v=/@?\b[A-Za-z_]\w*\b/.source,k=n(/<<0>>(?:\s*<<1>>)?/.source,[v,f]),S=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[h,k]),y=/\[\s*(?:,\s*)*\]/.source,_=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,y]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,g,y]),w=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),C=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,S,y]),T={keyword:u,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,j=/"(?:\\.|[^\\"\r\n])*"/.source,A=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:T},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[v,C]),lookbehind:!0,inside:T},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[v]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[c,k]),lookbehind:!0,inside:T},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:T},{pattern:r(/(\bwhere\s+)<<0>>/.source,[v]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[_]),lookbehind:!0,inside:T},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,m,v]),inside:T}],keyword:u,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:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[v]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[v]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[g]),lookbehind:!0,alias:"class-name",inside:T},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:T,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:T,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[v,f]),inside:{function:r(/^<<0>>/.source,[v]),generic:{pattern:RegExp(f),alias:"class-name",inside:T}}},"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,[c,k,v,C,u.source,g,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[k,g]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(C),greedy:!0,inside:T},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=j+"|"+N,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),H=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),V=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,H]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[V,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[V]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[H]),inside:t.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var P=/:[^}\r\n]+/.source,K=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),W=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[K,P]),Z=i(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),ee=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,P]);function z(L,I){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[I,P]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[W]),lookbehind:!0,greedy:!0,inside:z(W,K)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[ee]),lookbehind:!0,greedy:!0,inside:z(ee,Z)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}Lu.displayName="markup";Lu.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function Lu(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(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var i={};i["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:i}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var l={};l[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\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:[n,"language-"+n],inside:e.languages[n]},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}Pl.displayName="css";Pl.aliases=[];function Pl(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}a2.displayName="diff";a2.aliases=[];function a2(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var i=n[r],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+i+`].*(?:\r +?| +|(?![\\s\\S])))+`,"m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}o2.displayName="go";o2.aliases=[];function o2(e){e.register(Wi),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"]}l2.displayName="ini";l2.aliases=[];function l2(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:/=/}}c2.displayName="java";c2.aliases=[];function c2(e){e.register(Wi),(function(t){var n=/\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,i={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:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[i,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:i.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:i.inside}],keyword:n,function:[t.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/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.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":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:i.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:i.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 n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}u2.displayName="regex";u2.aliases=[];function u2(e){(function(t){var n={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]|.)/,i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l="(?:[^\\\\-]|"+r.source+")",c=RegExp(l+"-"+l),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.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:c,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":a,escape:r}},"special-escape":n,"char-set":i,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],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}h2.displayName="json";h2.aliases=["webmanifest"];function h2(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}d2.displayName="kotlin";d2.aliases=["kt","kts"];function d2(e){e.register(Wi),(function(t){t.languages.kotlin=t.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 t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}f2.displayName="less";f2.aliases=[];function f2(e){e.register(Pl),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"}})}p2.displayName="lua";p2.aliases=[];function p2(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:/[\[\](){},;]|\.+|:+/}}m2.displayName="makefile";m2.aliases=[];function m2(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:/[:;(){}]/}}g2.displayName="yaml";g2.aliases=["yml"];function g2(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\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 c(u,h){h=(h||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return u});return RegExp(m,h)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+a+"|"+l+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\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:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(l),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}v2.displayName="markdown";v2.aliases=["md"];function v2(e){e.register(Lu),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(c){return c=c.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.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:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+l+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+l+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(i),alias:"important",inside:t.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(c){["url","bold","italic","strike","code-snippet"].forEach(function(u){c!==u&&(t.languages.markdown[c].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(c){if(c.language!=="markdown"&&c.language!=="md")return;function u(h){if(!(!h||typeof h=="string"))for(var m=0,f=h.length;m]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}y2.displayName="perl";y2.aliases=[];function y2(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.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,n].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,n].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,n+/\s*/.source+n].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)}Xd.displayName="markup-templating";Xd.aliases=[];function Xd(e){e.register(Lu),(function(t){function n(r,i){return"___"+r.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,i,a,l){if(r.language===i){var c=r.tokenStack=[];r.code=r.code.replace(a,function(u){if(typeof l=="function"&&!l(u))return u;for(var h=c.length,m;r.code.indexOf(m=n(i,h))!==-1;)++h;return c[h]=u,m}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,i){if(r.language!==i||!r.tokenStack)return;r.grammar=t.languages[i];var a=0,l=Object.keys(r.tokenStack);function c(u){for(var h=0;h=l.length);h++){var m=u[h];if(typeof m=="string"||m.content&&typeof m.content=="string"){var f=l[a],g=r.tokenStack[f],v=typeof m=="string"?m:m.content,k=n(i,f),S=v.indexOf(k);if(S>-1){++a;var y=v.substring(0,S),_=new t.Token(i,t.tokenize(g,r.grammar),"language-"+i,g),x=v.substring(S+k.length),w=[];y&&w.push.apply(w,c([y])),w.push(_),x&&w.push.apply(w,c([x])),typeof m=="string"?u.splice.apply(u,[h,1].concat(w)):m.content=w}}else m.content&&c(m.content)}return u}c(r.tokens)}}})})(e)}_2.displayName="php";_2.aliases=[];function _2(e){e.register(Xd),(function(t){var n=/\/\*[\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*\()/],i=/\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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,l=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,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:i,operator:a,punctuation:l};var c={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},u=[{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:c}},{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:c}}];t.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:u,"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:i,operator:a,punctuation:l}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(h){if(/<\?/.test(h.code)){var m=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(h,"php",m)}}),t.hooks.add("after-tokenize",function(h){t.languages["markup-templating"].tokenizePlaceholders(h,"php")})})(e)}x2.displayName="python";x2.aliases=["py"];function x2(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}w2.displayName="r";w2.aliases=[];function w2(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:/[(){}\[\],;]/}}S2.displayName="ruby";S2.aliases=["rb"];function S2(e){e.register(Wi),(function(t){t.languages.ruby=t.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:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.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("|")+")",i=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+i),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+i+/(?=:(?!:))/.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:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,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:n,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:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.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)/}),t.languages.rb=t.languages.ruby})(e)}k2.displayName="rust";k2.aliases=[];function k2(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}C2.displayName="sass";C2.aliases=[];function C2(e){e.register(Pl),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.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)}E2.displayName="scss";E2.aliases=[];function E2(e){e.register(Pl),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}N2.displayName="sql";N2.aliases=[];function N2(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:/[;[\]()`,.]/}}A2.displayName="swift";A2.aliases=[];function A2(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(t){t.inside.interpolation.inside=e.languages.swift})}T2.displayName="typescript";T2.aliases=["ts"];function T2(e){e.register(Yd),(function(t){t.languages.typescript=t.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/}),t.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 t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.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:n}}}}),t.languages.ts=t.languages.typescript})(e)}Kd.displayName="basic";Kd.aliases=[];function Kd(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:/[,;:()]/}}M2.displayName="vbnet";M2.aliases=[];function M2(e){e.register(Kd),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 jF=["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"],i5={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 m8(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function DF(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function RF(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function s5(e){return RF(e)||m8(e)}const LF=["","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 OF(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let a=0,l=-1,c="",u,h;n.position&&("start"in n.position||"indent"in n.position?(h=n.position.indent,u=n.position.start):u=n.position);let m=(u?u.line:0)||1,f=(u?u.column:0)||1,g=k(),v;for(a--;++a<=e.length;)if(v===10&&(f=(h?h[l]:0)||1),v=e.charCodeAt(a),v===38){const _=e.charCodeAt(a+1);if(_===9||_===10||_===12||_===32||_===38||_===60||Number.isNaN(_)||r&&_===r){c+=String.fromCharCode(v),f++;continue}const x=a+1;let w=x,C=x,T;if(_===35){C=++w;const U=e.charCodeAt(C);U===88||U===120?(T="hexadecimal",C=++w):T="decimal"}else T="named";let N="",j="",A="";const D=T==="named"?s5:T==="decimal"?m8:DF;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!D(U))break;A+=String.fromCharCode(U),T==="named"&&jF.includes(A)&&(N=A,j=ou(A))}let B=e.charCodeAt(C)===59;if(B){C++;const U=T==="named"?ou(A):!1;U&&(N=A,j=U)}let H=1+C-x,V="";if(!(!B&&n.nonTerminated===!1))if(!A)T!=="named"&&S(4,H);else if(T==="named"){if(B&&!j)S(5,1);else if(N!==A&&(C=w+N.length,H=1+C-w,B=!1),!B){const U=N?1:3;if(n.attribute){const P=e.charCodeAt(C);P===61?(S(U,H),j=""):s5(P)?j="":S(U,H)}else S(U,H)}V=j}else{B||S(2,H);let U=Number.parseInt(A,T==="hexadecimal"?16:10);if(BF(U))S(7,H),V="�";else if(U in i5)S(6,H),V=i5[U];else{let P="";zF(U)&&S(6,H),U>65535&&(U-=65536,P+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),V=P+String.fromCharCode(U)}}if(V){y(),g=k(),a=C-1,f+=C-x+1,i.push(V);const U=k();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,V,{start:g,end:U},e.slice(x-1,C)),g=U}else A=e.slice(x-1,C),c+=A,f+=A.length,a=C-1}else v===10&&(m++,l++,f=0),Number.isNaN(v)?y():(c+=String.fromCharCode(v),f++);return i.join("");function k(){return{line:m,column:f,offset:a+((u?u.offset:0)||0)}}function S(_,x){let w;n.warning&&(w=k(),w.column+=x,w.offset+=x,n.warning.call(n.warningContext||void 0,LF[_],w,_))}function y(){c&&(i.push(c),n.text&&n.text.call(n.textContext||void 0,c,{start:g,end:k()}),c="")}}function BF(e){return e>=55296&&e<=57343||e>1114111}function zF(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 IF=0,f0={},Wn={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++IF}),e.__id},clone:function e(t,n){n=n||{};var r,i;switch(Wn.util.type(t)){case"Object":if(i=Wn.util.objId(t),n[i])return n[i];r={},n[i]=r;for(var a in t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=Wn.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(l,c){r[c]=e(l,n)}),r);default:return t}}},languages:{plain:f0,plaintext:f0,text:f0,txt:f0,extend:function(e,t){var n=Wn.util.clone(Wn.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Wn.languages;var i=r[e],a={};for(var l in i)if(i.hasOwnProperty(l)){if(l==t)for(var c in n)n.hasOwnProperty(c)&&(a[c]=n[c]);n.hasOwnProperty(l)||(a[l]=i[l])}var u=r[e];return r[e]=a,Wn.languages.DFS(Wn.languages,function(h,m){m===u&&h!=e&&(this[h]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=Wn.util.objId;for(var l in t)if(t.hasOwnProperty(l)){n.call(t,l,t[l],r||l);var c=t[l],u=Wn.util.type(c);u==="Object"&&!i[a(c)]?(i[a(c)]=!0,e(c,n,null,i)):u==="Array"&&!i[a(c)]&&(i[a(c)]=!0,e(c,n,l,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Wn.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Wn.tokenize(r.code,r.grammar),Wn.hooks.run("after-tokenize",r),Jc.stringify(Wn.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new HF;return H0(i,i.head,e),g8(e,i,t,i.head,0),$F(i)},hooks:{all:{},add:function(e,t){var n=Wn.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Wn.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:Jc};function Jc(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function a5(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function g8(e,t,n,r,i,a){for(var l in n)if(!(!n.hasOwnProperty(l)||!n[l])){var c=n[l];c=Array.isArray(c)?c:[c];for(var u=0;u=a.reach);_+=y.value.length,y=y.next){var x=y.value;if(t.length>e.length)return;if(!(x instanceof Jc)){var w=1,C;if(g){if(C=a5(S,_,e,f),!C||C.index>=e.length)break;var A=C.index,T=C.index+C[0].length,N=_;for(N+=y.value.length;A>=N;)y=y.next,N+=y.value.length;if(N-=y.value.length,_=N,y.value instanceof Jc)continue;for(var j=y;j!==t.tail&&(Na.reach&&(a.reach=V);var U=y.prev;B&&(U=H0(t,U,B),_+=B.length),FF(t,U,w);var P=new Jc(l,m?Wn.tokenize(D,m):D,v,D);if(y=H0(t,U,P),H&&H0(t,y,H),w>1){var K={cause:l+","+u,reach:V};g8(e,t,n,y.prev,_,K),a&&K.reach>a.reach&&(a.reach=K.reach)}}}}}}function HF(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function H0(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function FF(e,t,n){for(var r=t.next,i=0;in)return e;try{return tt.highlight(e,t).children.map(y8)}catch{return e}}const x8=/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i,XF=/\.(mp4|webm|mov|m4v)$/i,KF=/\.(mp3|ogg|wav|flac|m4a)$/i,ZF=/\.(glb|gltf)$/i,QF=/\.(ply|spz|splat|ksplat)$/i,JF=/\.pdf$/i,e$=/\.(md|mdx|markdown)$/i;function j2(e){return x8.test(e)?"image":XF.test(e)?"video":KF.test(e)?"audio":ZF.test(e)?"model":QF.test(e)?"splat":JF.test(e)?"pdf":null}const t$=1e5;function n$({code:e,lang:t}){const[n,r]=O.useState(!1),i=()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return d.jsxs("div",{className:"md-code",children:[d.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:i,children:n?d.jsx(kr,{size:13}):d.jsx(Sd,{size:13})}),d.jsx("pre",{children:d.jsx("code",{children:_8(e,t,t$)})})]})}function r$(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function i$(e){const t=/]*?)\/?>/gi,n=[];let r=0,i=!1;for(const a of e.matchAll(t)){const l=r$(a[1]??"");l.path&&(i=!0,a.index>r&&n.push({type:"text",value:e.slice(r,a.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:l},type:"fileMention"}),r=a.index+a[0].length)}return i?(rw8(e)}function o5({path:e,lines:t,onOpenFile:n,fileSrc:r}){const i=e.split("/").pop()||e,a=j2(e),l=a&&r?r(e):null,[c,u]=O.useState(!1);if(l&&!c&&(a==="image"||a==="video"))return d.jsxs("span",{className:"chat-media",children:[d.jsx("button",{className:"chat-media-open",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:a==="image"?d.jsx("img",{src:l,alt:i,loading:"lazy",onError:()=>u(!0)}):d.jsx("video",{src:l,controls:!0,loop:!0,muted:!0,playsInline:!0,onError:()=>u(!0)})}),d.jsx("span",{className:"chat-media-name",children:i})]});const h=t&&Number.parseInt(t,10)||void 0,m=h!=null?`${i}:${h}`:i;return d.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[d.jsx(M7,{size:12}),d.jsx("span",{className:"file-chip-label",children:m})]})}const a$=/(```[\s\S]*?(?:```|$)|~~~[\s\S]*?(?:~~~|$)|`[^`\n]*`)/g,S8={singleDollarTextMath:!1};function k8(e){return!e.includes("\\(")&&!e.includes("\\[")?e:e.split(a$).map((t,n)=>n%2===1?t:t.replace(/\\\[([\s\S]+?)\\\]/g,(r,i)=>`$$${i}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,i)=>`$$${i}$$`)).join("")}function o$(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const C8={code:({node:e,className:t,children:n,...r})=>{const i=t??"",a=/language-(\w+)/.exec(i),l=String(n??"").replace(/\n$/,"");if(!(a!=null||l.includes(` +`)))return d.jsx("code",{className:i,...r,children:n});const u=a?jg(a[1]):null;return d.jsx(n$,{code:l,lang:u})},pre:({children:e})=>d.jsx(d.Fragment,{children:e})},ao=O.memo(function({text:t,onOpenFile:n,fileSrc:r}){const i={"file-mention":a=>d.jsx(o5,{path:a.path,lines:a.lines,onOpenFile:n,fileSrc:r}),a:({node:a,href:l,children:c,...u})=>l&&o$(l)&&n?d.jsx(o5,{path:decodeURI(l),onOpenFile:n,fileSrc:r}):d.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",...u,children:c}),...C8};return d.jsx("div",{className:"md",children:d.jsx(Ow,{remarkPlugins:[d8,[f8,S8],s$],rehypePlugins:[$S],components:i,children:k8(t)})})}),l5=["prompt-actions flex flex-wrap [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:rounded-sm","[&_.btn-primary]:cursor-pointer [&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard","[&_.btn-ghost]:inline-flex [&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5","[&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px] [&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:rounded-sm","[&_.btn-ghost]:cursor-pointer [&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-ghost]:border-border [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default plan-strip-actions gap-y-1.5 gap-x-2 justify-end","[&_.btn-primary]:bg-transparent [&_.btn-primary]:border [&_.btn-primary]:border-text","[&_.btn-primary]:text-text [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border [&_.btn-ghost]:border-text [&_.btn-ghost]:text-text","[&_.btn-primary:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-primary:hover:not(:disabled)]:border-text","[&_.btn-primary:hover:not(:disabled)]:text-text [&_.btn-primary:hover:not(:disabled)]:opacity-100","[&_.btn-ghost:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-ghost:hover:not(:disabled)]:border-text","[&_.btn-ghost:hover:not(:disabled)]:text-text [&_.btn-ghost:hover:not(:disabled)]:opacity-100","[&_.plan-strip-primary]:bg-text [&_.plan-strip-primary]:border-text","[&_.plan-strip-primary]:text-background","[&_.plan-strip-primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--text)_85%,_var(--base))]","[&_.plan-strip-primary:hover:not(:disabled)]:border-text","[&_.plan-strip-primary:hover:not(:disabled)]:text-background","[&_.plan-strip-caret]:rounded-tl-none [&_.plan-strip-caret]:rounded-bl-none","[&_.plan-strip-caret]:py-0 [&_.plan-strip-caret]:px-1.5 [&_.plan-strip-caret]:flex","[&_.plan-strip-caret]:items-center","[&_.plan-strip-caret]:border-l [&_.plan-strip-caret]:border-l-[color-mix(in_oklab,_var(--base)_35%,_var(--text))]"].join(" ");function l$({synthesized:e,agentLabel:t,onView:n,onApprove:r,showResumeModes:i,onReject:a,onRevise:l}){const[c,u]=O.useState(!1),h=O.useRef(null),[m,f]=O.useState(!1),[g,v]=O.useState(""),k=O.useRef(null);O.useEffect(()=>{if(!c)return;const y=_=>{h.current&&!h.current.contains(_.target)&&u(!1)};return window.addEventListener("pointerdown",y),()=>window.removeEventListener("pointerdown",y)},[c]),O.useEffect(()=>{var y;m&&((y=k.current)==null||y.focus())},[m]);const S=()=>{l(g.trim()||"no specific feedback — use your judgment"),v(""),f(!1)};return d.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-l-[3px] border-l-accent-blue rounded-md bg-surface shadow-[0_2px_10px_rgb(0_0_0_/_6%)]",children:[d.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[d.jsx(B7,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),d.jsx("span",{className:"plan-strip-title text-md font-semibold whitespace-nowrap",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),d.jsx("button",{className:"plan-strip-open ml-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-md cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",onClick:n,children:"Open plan"})]}),m?d.jsxs(d.Fragment,{children:[d.jsx("textarea",{ref:k,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-md font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:"What should change? (optional)",rows:2,value:g,onChange:y=>v(y.target.value),onKeyDown:y=>{y.key==="Escape"?(y.preventDefault(),v(""),f(!1)):y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),S())}}),d.jsxs("div",{className:l5,children:[d.jsx("button",{className:"btn-ghost",onClick:()=>{v(""),f(!1)},children:"Back"}),d.jsx("span",{className:"plan-strip-spacer flex-1"}),d.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:S,children:["Revise",d.jsx(A7,{size:13})]})]})]}):d.jsxs("div",{className:l5,children:[d.jsx("button",{className:"btn-ghost",onClick:a,children:"Reject"}),d.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),d.jsx("span",{className:"plan-strip-spacer flex-1"}),i?d.jsxs("div",{className:"plan-strip-approve relative flex [&_.btn-primary:first-child]:rounded-tr-none [&_.btn-primary:first-child]:rounded-br-none",ref:h,children:[d.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),d.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(y=>!y),children:d.jsx(Hi,{size:13})}),c&&d.jsx("div",{className:"plan-strip-menu absolute right-0 bottom-[calc(100%_+_4px)] flex flex-col min-w-47.5 p-1 border border-border rounded-md bg-surface shadow-[0_6px_20px_rgb(0_0_0_/_12%)] z-6 [&_button]:text-left [&_button]:py-[7px] [&_button]:px-[9px] [&_button]:border-0 [&_button]:rounded-sm [&_button]:bg-transparent [&_button]:text-text [&_button]:text-md [&_button]:cursor-pointer [&_button:hover]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]",children:d.jsx("button",{onClick:()=>{u(!1),r("bypass")},children:"Accept and bypass all"})})]}):d.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r(),children:"Accept plan"})]})]})}const Rg=[{id:"crucible",name:"Crux",jp:"朱 · shu",dark:!1,primary:"#db4d2b",tokens:{"--base":"#ffffff","--canvas":"#faf5f0","--panel":"#f2ebe2","--surface":"#fbf7f2","--surface-bright":"#fffdfb","--highlight":"#fdeee7","--text":"#231f1c","--subtext":"#776f66","--muted":"#a89f95","--primary":"#db4d2b","--primary-subtle":"#fbe7df","--secondary":"#c98a2e","--border":"#e4dbd1","--border-variant":"#ece4da","--dots-muted":"#e8ded2","--dots-strong":"#c7bcab"}},{id:"ai",name:"Indigo",jp:"藍 · ai",dark:!1,primary:"#2f4d80",tokens:{"--base":"#ffffff","--canvas":"#f4f6f9","--panel":"#e9edf3","--surface":"#f7f9fc","--surface-bright":"#ffffff","--highlight":"#e9f0f9","--text":"#1b2230","--subtext":"#66707f","--muted":"#9aa3b1","--primary":"#2f4d80","--primary-subtle":"#e6ecf6","--secondary":"#3f8fa6","--border":"#d9e0e8","--border-variant":"#e6ebf1","--dots-muted":"#dde3ec","--dots-strong":"#b6bfcd"}},{id:"kurenai",name:"Safflower",jp:"紅 · kurenai",dark:!1,primary:"#b03052",tokens:{"--base":"#ffffff","--canvas":"#faf5f6","--panel":"#f2e9ec","--surface":"#fbf6f7","--surface-bright":"#fffcfd","--highlight":"#fbe9ef","--text":"#241b1f","--subtext":"#7a6a70","--muted":"#ab9ba1","--primary":"#b03052","--primary-subtle":"#f8e5ec","--secondary":"#c98a2e","--border":"#e6dbe0","--border-variant":"#ede4e8","--dots-muted":"#ecdee4","--dots-strong":"#cab3bd"}},{id:"uguisu",name:"Nightingale",jp:"鶯 · uguisu",dark:!1,primary:"#6f7d3f",tokens:{"--base":"#ffffff","--canvas":"#f7f8f1","--panel":"#ecefe1","--surface":"#faf9f2","--surface-bright":"#fffefb","--highlight":"#f0f3e2","--text":"#22231b","--subtext":"#6f7264","--muted":"#a3a690","--primary":"#6f7d3f","--primary-subtle":"#edf0dd","--secondary":"#c98a2e","--border":"#e0e2d1","--border-variant":"#e9ebdc","--dots-muted":"#e5e7d4","--dots-strong":"#bfc2a4"}},{id:"botan",name:"Peony",jp:"牡丹 · botan",dark:!1,primary:"#bd3a84",tokens:{"--base":"#ffffff","--canvas":"#faf5f8","--panel":"#f2e9ef","--surface":"#fbf6f9","--surface-bright":"#fffcfe","--highlight":"#fbe8f2","--text":"#241c22","--subtext":"#7a6c74","--muted":"#ab9ca5","--primary":"#bd3a84","--primary-subtle":"#f8e5f0","--secondary":"#8f6fd6","--border":"#e7dbe3","--border-variant":"#eee4ea","--dots-muted":"#eddee7","--dots-strong":"#ccb3c2"}},{id:"sumi",name:"Ink",jp:"墨 · sumi",dark:!0,primary:"#e0813e",tokens:{"--base":"#15130f","--canvas":"#1a1713","--panel":"#211d18","--surface":"#231f19","--surface-bright":"#2b261f","--highlight":"#2f281f","--text":"#ede7dd","--subtext":"#a79d8e","--muted":"#756d5f","--primary":"#e0813e","--primary-subtle":"#3a2c1c","--secondary":"#c9a24e","--border":"#332e26","--border-variant":"#3d372d","--dots-muted":"#2c2820","--dots-strong":"#4a4437"}}],E8="crux:theme",c5="crucible";function c$(e){return Rg.find(t=>t.id===e)??Rg[0]}function N8(e){const t=c$(e),n=document.documentElement;for(const[r,i]of Object.entries(t.tokens))i!=null&&n.style.setProperty(r,i);n.setAttribute("data-theme",t.id),n.setAttribute("data-theme-mode",t.dark?"dark":"light"),n.style.colorScheme=t.dark?"dark":"light"}function A8(){try{return localStorage.getItem(E8)||c5}catch{return c5}}function u$(e){try{localStorage.setItem(E8,e)}catch{}N8(e)}function h$(){N8(A8())}const d$=["icon-btn relative inline-flex items-center justify-center","text-subtext [&:hover]:text-text [&:hover]:bg-surface","[.chat-header.rail-hidden_>_&:first-child]:mr-3 [&.active]:text-primary","[&.active]:bg-surface"].join(" "),oo=[d$,"w-7 h-7"].join(" "),ml=["model-item [&.danger]:text-accent-red [&.danger:hover]:text-accent-red flex","items-center justify-between gap-2 w-full text-left py-1.5 px-2","text-md rounded-sm [&:hover]:bg-surface","[&_.model-id]:block [&_.model-id]:font-mono [&_.model-id]:text-2xs","[&_.model-id]:text-muted"].join(" "),oi=["settings-loading flex items-center gap-2 text-subtext text-md","py-1 px-0"].join(" "),Yn=["spinner w-[13px] h-[13px] border-2 border-border border-t-primary","rounded-full animate-[spin_0.8s_linear_infinite] shrink-0"].join(" "),Tn="mono font-mono text-sm",eu="code-tab-body flex-1 min-h-0 overflow-auto bg-background",pi=["code-tab-note py-2 px-4 text-sm text-muted","border-b border-b-border-variant shrink-0"].join(" "),yo=["btn inline-flex items-center justify-center gap-1.5 py-1.5 px-3.5","text-sm font-semibold border border-border","rounded-md bg-background text-text whitespace-nowrap","transition-[background,border-color,color] duration-120 ease-standard","[&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight","[&:disabled]:opacity-45 [&:disabled]:cursor-default [&.primary]:bg-primary","[&.primary]:border-primary [&.primary]:text-background","[&.primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:hover:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.primary:active:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.danger]:text-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_8%,_transparent)]","[&.danger:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_14%,_transparent)]","[&.ghost]:border-transparent [&.ghost]:text-text","[&.ghost:hover:not(:disabled)]:text-text [&.ghost:hover:not(:disabled)]:bg-surface","[&.sm]:py-[3px] [&.sm]:px-[9px] [&.sm]:text-xs [&.sm]:rounded-sm"].join(" "),ws=`${yo} sm`,_o=`${yo} primary`,f$=`${yo} ghost`,rr=["badge inline-flex items-center font-sans text-xs","font-medium py-px px-[7px] border border-border","rounded-sm text-text [&.ok]:text-accent-green","[&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle","[&.err]:text-accent-red [&.err]:border-accent-red","[&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber","[&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle"].join(" "),Ir=`${rr} err`,_i=`${rr} ok`,D2=`${rr} warn`;function T8({onSaved:e}){const[t,n]=O.useState(""),[r,i]=O.useState(!1),[a,l]=O.useState(null);async function c(u){if(u.preventDefault(),!(r||!t.trim())){i(!0),l(null);try{e(await VM(t.trim())),n("")}catch(h){l(h instanceof Error?h.message:String(h))}finally{i(!1)}}}return d.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:font-mono [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap",onSubmit:c,children:[d.jsx("input",{type:"password",value:t,onChange:u=>n(u.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),d.jsx("button",{type:"submit",className:yo,disabled:r||!t.trim(),children:r?"Checking…":"Save"}),d.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),a&&d.jsx("div",{className:"error",children:a})]})}function p$(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"Crux";case"local_job":return"This machine";default:return e||"—"}}function m$({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[d.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"}),d.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"}),d.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"}),d.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"}),d.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"}),d.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"}),d.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 g$({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[d.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"}),d.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)"}),d.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)"}),d.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"}),d.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"}),d.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)"}),d.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)"}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#BFF9B4"}),d.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),d.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#80EE64"}),d.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),d.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),d.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),d.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),d.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),d.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),d.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#BFF9B4"}),d.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),d.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#80EE64"}),d.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),d.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),d.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),d.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),d.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),d.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function v$({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:d.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 b$({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:d.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 y$({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[d.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),d.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 R2({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.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 M8({kind:e,size:t=16}){switch(e){case"modal_job":return d.jsx(g$,{size:t});case"hf_job":return d.jsx(m$,{size:t});case"k8s_job":return d.jsx(v$,{size:t});case"ssh_job":return d.jsx(G1,{size:t});case"slurm_job":return d.jsx(dA,{size:t});case"ray_job":return d.jsx(b$,{size:t});case"openresearch_job":return d.jsx(y$,{size:t});case"local_job":return d.jsx(eT,{size:t});default:return d.jsx(G1,{size:t})}}function j8({backend:e}){const t=Ad(e),n=W7(e);return t?d.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:[d.jsx(M8,{kind:t}),d.jsx("span",{className:"backend-name",children:p$(t)}),n&&d.jsx("span",{className:`backend-detail ${Tn}`,children:n})]}):d.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 D8({value:e,max:t,label:n,caption:r,fillColor:i}){const a=t>0?Math.min(100,Math.round(e/t*100)):0;return d.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[d.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:d.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${a}%`,background:i}})}),(n!==void 0||r!==void 0)&&d.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[d.jsx("span",{children:n??`${a}%`}),r]})]})}const u5={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelling:{className:"st-cancelling",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1},keep:{className:"st-done",live:!1},kill:{className:"st-failed",live:!1},iterate:{className:"st-editing",live:!1}};function _$(e){return u5[e]??u5.idle}function x$(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ss({status:e,label:t}){const n=_$(e);return d.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[d.jsx("span",{className:"dot"}),t??x$(e)]})}const hu=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.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-sm [&_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(" "),xo=["kv grid grid-cols-[auto_1fr] gap-y-[3px] gap-x-3.5 text-md","[&_.k]:text-subtext [&_.v]:font-mono [&_.v]:text-sm","[&_.v]:break-all"].join(" "),_n=["settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),Ou=["form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono","[&_.repo-hint]:font-normal [&_.repo-hint]:text-xs","[&_.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-left","[&_.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-[0_2px_8px_rgb(0_0_0_/_5%)]","[&_.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-semibold [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-semibold","[&_.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]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-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-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))]","[&_.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-left [&_.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-md","[&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:font-mono [&_.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-md [&_.paper-pick_.title]:font-semibold","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-xs [&_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 [&_.new-project-actions_.primary]:ml-auto","[&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" ");function x1(e){return e.agentReady?{cls:"ok",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"warn",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"warn",label:"Update required"}:{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function w$({h:e}){return e.authMethod?d.jsx(d.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):d.jsx(d.Fragment,{children:"—"})}function S$(e){const t=Math.max(0,Math.floor(e/1e3));if(t===0)return"now";const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?`${n}d ${r}h`:r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}function k$({u:e,now:t}){const n=e.windows??[];return n.length>0?d.jsxs("div",{className:"harness-usage",children:[n.map(r=>{const i=Math.max(0,Math.min(100,r.remainingPercent)),a=i<=10;return d.jsxs("div",{className:"usage-window",children:[d.jsx("span",{className:"usage-win-label",children:r.label}),d.jsx("span",{className:"usage-bar",children:d.jsx("span",{className:`usage-bar-fill${a?" low":""}`,style:{width:`${i}%`}})}),d.jsxs("span",{className:"usage-pct",children:[Math.round(i),"% left"]}),r.resetsAtMs!=null&&d.jsxs("span",{className:"usage-reset",title:new Date(r.resetsAtMs).toLocaleString(),children:["resets in ",S$(r.resetsAtMs-t)]})]},r.label)}),e.observedAtMs!=null&&d.jsxs("div",{className:"usage-asof",children:["as of ",Pi(e.observedAtMs)]})]}):d.jsxs("span",{className:"harness-usage-note",children:[e.note??"—",e.manageUrl&&d.jsxs(d.Fragment,{children:[" ",d.jsx("a",{href:e.manageUrl,target:"_blank",rel:"noreferrer",children:"Manage ↗"})]})]})}const h5=6e4;function C$(){const[e,t]=O.useState(null),[n,r]=O.useState("claude-code"),[i,a]=O.useState(!1),[l,c]=O.useState(()=>Date.now()+h5),[u,h]=O.useState(()=>Date.now()),m=(g,v=!1)=>{a(!0),c(Date.now()+h5),Sl(g,v).then(t).catch(()=>{}).finally(()=>a(!1))};O.useEffect(()=>m(!1),[]),O.useEffect(()=>{const g=setTimeout(()=>m(!0),Math.max(0,l-Date.now()));return()=>clearTimeout(g)},[l]),O.useEffect(()=>{const g=setInterval(()=>h(Date.now()),1e3);return()=>clearInterval(g)},[]),O.useEffect(()=>wv(()=>m(!0)),[]);const f=e==null?void 0:e.find(g=>g.id===n);return d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:"Harnesses"}),d.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),d.jsx("div",{className:"harness-tabs 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-md [&_button]:font-semibold [&_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(g=>d.jsxs("button",{className:g.id===n?"active":"",onClick:()=>r(g.id),children:[g.name,d.jsx("span",{className:`harness-dot w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${x1(g).cls}`})]},g.id))}),e?f?d.jsxs("div",{className:hu,children:[d.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[d.jsx("span",{className:`${rr} ${x1(f).cls}`,children:x1(f).label}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:ws,onClick:()=>m(!0,!0),disabled:i,children:[d.jsx(Fi,{size:12,className:i?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),d.jsxs("div",{className:xo,children:[d.jsx("span",{className:"k",children:"Binary"}),d.jsx("span",{className:"v",children:f.binPath??"not found on PATH"}),d.jsx("span",{className:"k",children:"Version"}),d.jsx("span",{className:"v",children:f.version??"—"}),d.jsx("span",{className:"k",children:"Auth"}),d.jsx("span",{className:"v",children:d.jsx(w$,{h:f})}),f.account&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:f.id==="opencode"?"Providers":"Account"}),d.jsx("span",{className:"v",children:f.account})]}),f.org&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Org"}),d.jsx("span",{className:"v",children:f.org})]}),f.plan&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Plan"}),d.jsx("span",{className:"v",children:f.plan})]}),f.usage&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Usage"}),d.jsx("span",{className:"v",children:d.jsx(k$,{u:f.usage,now:u})})]}),d.jsx("span",{className:"k",children:"Agent models"}),d.jsx("span",{className:"v",children:f.models.length>0?`${f.models.length} available — ${f.models.slice(0,4).map(g=>X0(g)).join(", ")}${f.models.length>4?", …":""}`:"none"})]}),!f.agentReady&&f.agentNote&&d.jsx("p",{className:_n,children:f.agentNote})]}):null:d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Detecting harnesses…"]})]})}function Ul(e){return e.ready?{cls:"ok",label:"Ready"}:e.kind==="scenario"?e.state==="expired"?{cls:"err",label:"Login expired"}:e.state==="error"?{cls:"err",label:"Error"}:e.reachable===!1?{cls:"err",label:"Unreachable"}:{cls:"",label:"Not connected"}:e.kind==="comfyui"?e.mcpFound&&!e.mcpRunnable?{cls:"err",label:"Server broken"}:e.mcpFound?{cls:"warn",label:"ComfyUI not running"}:{cls:"",label:"Not installed"}:e.kind==="unirig"?e.portOpen?{cls:"err",label:"Wrong service on port"}:{cls:"warn",label:"Container not running"}:e.kind==="kimodo"?e.repoFound?{cls:"warn",label:"No checkpoint"}:{cls:"",label:"Not installed"}:e.serverFound&&!e.serverRunnable?{cls:"err",label:"Server broken"}:e.serverFound?{cls:"warn",label:"Blender not running"}:{cls:"",label:"Not installed"}}function E$(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState("scenario"),[l,c]=O.useState(!1),u=(m=!1)=>(c(!0),EM(m).then(f=>{t(f),r(null)}).catch(f=>r(f instanceof Error?f.message:String(f))).finally(()=>c(!1)));O.useEffect(()=>{u()},[]);const h=e==null?void 0:e.find(m=>m.id===i);return d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:"Generative AI"}),d.jsx("p",{className:"settings-sub",children:"Asset-generation backends the agent can drive. Scenario runs in the cloud on your own account; Blender and ComfyUI run on this machine, each through its own MCP server."}),n?d.jsx("div",{className:"error",children:n}):e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"harness-tabs",children:e.map(m=>d.jsxs("button",{className:m.id===i?"active":"",onClick:()=>a(m.id),children:[m.name,d.jsx("span",{className:`harness-dot ${Ul(m).cls}`})]},m.id))}),(h==null?void 0:h.kind)==="scenario"&&d.jsx(j$,{s:h,onChanged:u}),(h==null?void 0:h.kind)==="blender"&&d.jsx(T$,{s:h,refreshing:l,onRefresh:()=>void u(!0)}),(h==null?void 0:h.kind)==="unirig"&&d.jsx(N$,{s:h,refreshing:l,onRefresh:()=>u(!0)}),(h==null?void 0:h.kind)==="kimodo"&&d.jsx(A$,{s:h,refreshing:l,onRefresh:()=>u(!0)}),(h==null?void 0:h.kind)==="comfyui"&&d.jsx(M$,{s:h,refreshing:l,onRefresh:()=>void u(!0)})]}):d.jsxs("div",{className:"settings-loading",children:[d.jsx("span",{className:"spinner"})," Checking providers…"]})]})}function N$({s:e,refreshing:t,onRefresh:n}){const r=Ul(e);return d.jsxs("div",{className:"settings-card",children:[d.jsxs("div",{className:"settings-card-head",children:[d.jsx("span",{className:`badge ${r.cls}`,children:r.label}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[d.jsx(Fi,{size:12,className:t?"spin":""})," Refresh"]})]}),d.jsxs("div",{className:"kv",children:[d.jsx("span",{className:"k",children:"Service"}),d.jsx("span",{className:"v",children:e.serviceReachable?"answering":e.portOpen?"port open, but not the UniRig API":"not running"}),d.jsx("span",{className:"k",children:"Address"}),d.jsx("span",{className:"v",children:d.jsx("code",{children:e.address})}),d.jsx("span",{className:"k",children:"Rig endpoint"}),d.jsx("span",{className:"v",children:d.jsxs("code",{children:["POST ",e.rigUrl]})}),e.docsUrl&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"API docs"}),d.jsx("span",{className:"v",children:d.jsx("a",{href:e.docsUrl,target:"_blank",rel:"noopener noreferrer",children:e.docsUrl})})]})]}),e.error&&d.jsx("div",{className:"settings-note",children:e.error}),d.jsx("p",{className:"settings-sub",children:"Runs as a container rather than an MCP server — crux posts a mesh to it directly."})]})}function A$({s:e,refreshing:t,onRefresh:n}){const r=Ul(e);return d.jsxs("div",{className:"settings-card",children:[d.jsxs("div",{className:"settings-card-head",children:[d.jsx("span",{className:`badge ${r.cls}`,children:r.label}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[d.jsx(Fi,{size:12,className:t?"spin":""})," Refresh"]})]}),d.jsxs("div",{className:"kv",children:[d.jsx("span",{className:"k",children:"Checkout"}),d.jsx("span",{className:"v",children:e.repoFound?d.jsx("code",{children:e.repoPath}):"not found"}),d.jsx("span",{className:"k",children:"Python env"}),d.jsx("span",{className:"v",children:e.venvFound?d.jsx("code",{children:e.pythonPath}):"none — run `uv sync` in the checkout"}),d.jsx("span",{className:"k",children:"Checkpoints"}),d.jsx("span",{className:"v",children:e.checkpoints.length===0?"none downloaded":e.checkpoints.map(i=>d.jsx("div",{children:d.jsx("code",{children:i.repo})},i.repo))})]}),e.error&&d.jsx("div",{className:"settings-note",children:e.error}),d.jsx("p",{className:"settings-sub",children:"Nothing to start — Kimodo runs as a Python job against the checkout, so this card reports disk state rather than a process."})]})}function T$({s:e,refreshing:t,onRefresh:n}){const r=Ul(e);return d.jsxs("div",{className:"settings-card",children:[d.jsxs("div",{className:"settings-card-head",children:[d.jsx("span",{className:`badge ${r.cls}`,children:r.label}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[d.jsx(Fi,{size:12,className:t?"spin":""})," Refresh"]})]}),d.jsxs("div",{className:"kv",children:[d.jsx("span",{className:"k",children:"MCP server"}),d.jsx("span",{className:"v",children:e.serverFound?e.serverRunnable?e.serverRunning?`running on ${e.serverUrl}`:"installed — restart crux to start it":"installed, but will not run":"not installed"}),e.serverPath&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Path"}),d.jsx("span",{className:"v",children:d.jsx("code",{children:e.serverPath})})]}),d.jsx("span",{className:"k",children:"Blender"}),d.jsx("span",{className:"v",children:e.blenderReachable?[e.blenderVersion,e.blendFile??"unsaved file",e.objectCount!==void 0?`${e.objectCount} objects`:null].filter(Boolean).join(" · "):`not reachable on ${e.addonAddress}`}),e.toolCount!==void 0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Tools"}),d.jsxs("span",{className:"v",children:[e.toolCount," offered to the agent"]})]})]}),!e.serverFound&&d.jsxs("p",{className:"settings-note",children:["Install the Blender MCP server with ",d.jsx("code",{children:"pipx install blender-mcp"}),", then restart crux so it can start one."]}),e.serverFound&&!e.serverRunnable&&e.serverError&&d.jsx("p",{className:"settings-note",children:e.serverError}),e.serverRunnable&&!e.blenderReachable&&d.jsxs("p",{className:"settings-note",children:[e.blenderError??`Nothing answered on ${e.addonAddress}.`," ","Blender-backed tools will fail until Blender is open; documentation tools keep working."]}),e.serverRunnable&&!e.serverRunning&&d.jsxs("p",{className:"settings-note",children:["The server is usable but crux has no child running — it starts one at launch, so restart"," ",d.jsx("code",{children:"crux up"})," to pick it up."]})]})}function M$({s:e,refreshing:t,onRefresh:n}){var m;const r=Ul(e),[i,a]=O.useState(!1),[l,c]=O.useState(null);async function u(){if(!i){a(!0),c(null);try{await CM(),n()}catch(f){c(f instanceof Error?f.message:String(f))}finally{a(!1)}}}const h=f=>f===void 0?null:`${(f/1024**3).toFixed(1)} GB`;return d.jsxs("div",{className:"settings-card",children:[d.jsxs("div",{className:"settings-card-head",children:[d.jsx("span",{className:`badge ${r.cls}`,children:r.label}),d.jsx("div",{className:"spacer",style:{flex:1}}),e.comfyReachable&&d.jsxs("a",{className:"btn sm",href:e.dashboardUrl,target:"_blank",rel:"noreferrer",title:"Open ComfyUI's own web UI",children:["Open ComfyUI ",d.jsx(Eu,{size:12})]}),d.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[d.jsx(Fi,{size:12,className:t?"spin":""})," Refresh"]})]}),d.jsxs("div",{className:"kv",children:[d.jsx("span",{className:"k",children:"MCP server"}),d.jsx("span",{className:"v",children:e.mcpFound?e.mcpRunnable?e.serverRunning?`running on ${e.serverUrl}`:"installed — restart crux to start it":"installed, but will not run":"not installed"}),d.jsx("span",{className:"k",children:"ComfyUI"}),d.jsx("span",{className:"v",children:e.comfyReachable?[e.comfyVersion&&`v${e.comfyVersion}`,e.comfyManaged?"started by crux":"already running",e.nodeClasses!==void 0&&`${e.nodeClasses} nodes`,e.queueDepth!==void 0&&(e.queueDepth===0?"queue idle":`${e.queueDepth} queued`)].filter(Boolean).join(" · "):`not running at ${e.dashboardUrl}`}),e.device&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Device"}),d.jsxs("span",{className:"v",children:[e.device,e.vramTotal!==void 0&&` — ${h(e.vramFree)} free of ${h(e.vramTotal)}`]})]}),e.toolCount!==void 0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Tools"}),d.jsxs("span",{className:"v",children:[e.toolCount," offered to the agent"]})]}),d.jsx("span",{className:"k",children:"Install"}),d.jsx("span",{className:"v",children:d.jsx("code",{children:e.installPath})})]}),!e.mcpFound&&d.jsxs("p",{className:"settings-note",children:["Install the MCP server with ",d.jsx("code",{children:"npm install -g comfyui-mcp"}),", then restart crux so it can start one. There is no official local server yet — Comfy's own is in private test, and their hosted Cloud one doesn't drive a self-hosted install."]}),e.mcpFound&&!e.mcpRunnable&&e.mcpError&&d.jsx("p",{className:"settings-note",children:e.mcpError}),e.mcpRunnable&&!e.comfyReachable&&d.jsxs("p",{className:"settings-note",children:["Nothing is listening at ",d.jsx("code",{children:e.dashboardUrl}),". Start it below, or run it yourself from ",d.jsx("code",{children:e.installPath})," — the agent's ComfyUI tools fail until it's up."]}),(m=e.brokenPacks)==null?void 0:m.map(f=>d.jsxs("p",{className:"settings-note",children:[d.jsx("strong",{children:f.pack})," serves ",f.templates," workflow",f.templates===1?"":"s"," referencing node classes that aren't registered, so those workflows cannot run. Missing: ",d.jsx("code",{children:f.missingNodes.slice(0,4).join(", ")}),f.missingNodes.length>4&&` and ${f.missingNodes.length-4} more`,". Either the pack failed to import — a compiled dependency built against a different torch does this, and ComfyUI's own log says which — or the templates need other packs you haven't installed."]},f.pack)),l&&d.jsx("div",{className:"error",children:l}),e.mcpRunnable&&!e.comfyReachable&&d.jsx("div",{className:"actions",children:d.jsx("button",{className:"btn primary",onClick:()=>void u(),disabled:i,children:i?"Starting… (imports torch, ~30s+)":"Start ComfyUI"})})]})}function j$({s:e,onChanged:t}){const[n,r]=O.useState(!1),[i,a]=O.useState(null),[l,c]=O.useState(null),u=()=>t().then(()=>{r(!1)});O.useEffect(()=>Cj(v=>{r(!1),c(null),v.type==="error"?a(v.error):a(null),t()}),[t]);async function h(){if(!n){r(!0),a(null),c(null);try{const v=await SM();v.browserOpened||c(v.authorizeUrl),await t()}catch(v){r(!1),a(v instanceof Error?v.message:String(v))}}}async function m(){if(!n){r(!0),a(null),c(null);try{await kM(),await t()}catch(v){a(v instanceof Error?v.message:String(v))}finally{r(!1)}}}const f=n||e.connecting,g=Ul(e);return d.jsxs("div",{className:"settings-card",children:[d.jsxs("div",{className:"settings-card-head",children:[d.jsx("span",{className:`badge ${g.cls}`,children:e.state==="connected"?"Connected":g.label}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:"btn sm",onClick:()=>void u(),children:[d.jsx(Fi,{size:12})," Refresh"]})]}),d.jsxs("div",{className:"kv",children:[d.jsx("span",{className:"k",children:"Login"}),d.jsx("span",{className:"v",children:e.state==="connected"?"Signed in and working":e.state==="expired"?"Stored, but no longer accepted":e.state==="error"?"Stored, but the check failed":"Not signed in"}),e.toolCount!==void 0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Tools"}),d.jsxs("span",{className:"v",children:[e.toolCount," available in this workspace"]})]}),d.jsx("span",{className:"k",children:"Token"}),d.jsxs("span",{className:"v",children:[d.jsx("code",{children:e.authPath})," (private to your user)"]})]}),e.state==="disconnected"&&e.reachable===!1&&d.jsxs("p",{className:"settings-note",children:["Scenario didn't answer with the OAuth details a login needs, so signing in can't succeed right now — the service may be down. ",e.error]}),e.state==="expired"&&d.jsx("p",{className:"settings-note",children:"The stored login no longer works — signing in again replaces it. This happens when the same account is re-authorised somewhere else."}),e.state==="error"&&e.error&&d.jsx("p",{className:"settings-note",children:e.error}),f&&d.jsxs("p",{className:"settings-note",children:["Waiting for you to finish signing in",l?"":" in the browser tab that just opened","…",l&&d.jsxs(d.Fragment,{children:[" ","This server has no browser of its own, so open this yourself:"," ",d.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",children:["the Scenario login page ",d.jsx(Eu,{size:11})]})]})]}),i&&d.jsx("div",{className:"error",children:i}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{className:"btn primary",onClick:()=>void h(),disabled:f,children:f?"Waiting for the browser…":e.state==="connected"?"Sign in again":e.state==="expired"?"Reconnect":"Connect"}),e.state!=="disconnected"&&d.jsx("button",{className:"btn",onClick:()=>void m(),disabled:f,children:"Disconnect"})]})]})}function D$({s:e}){if(!e.configured)return d.jsx("span",{className:rr,children:"Not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?d.jsx("span",{className:_i,children:"Connected"}):d.jsx("span",{className:Ir,children:"No job-create permission"}):d.jsx("span",{className:Ir,children:"Cluster unreachable"}):d.jsx("span",{className:Ir,children:"kubectl not found"})}function R$(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[l,c]=O.useState(""),[u,h]=O.useState(!1),[m,f]=O.useState(null),g=S=>{t(S),a(S.context??""),c(S.namespace)};O.useEffect(()=>{yM().then(g).catch(S=>r(S instanceof Error?S.message:String(S)))},[]);const v=e!==null&&i===(e.context??"")&&l.trim()===e.namespace;async function k(S){if(S.preventDefault(),!u){h(!0),f(null);try{g(await _M({context:i,namespace:l.trim()}))}catch(y){f(y instanceof Error?y.message:String(y))}finally{h(!1)}}}return d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",d.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",d.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?d.jsx("div",{className:"error",children:n}):e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:xo,children:[d.jsx("span",{className:"k",children:"Cluster"}),d.jsx("span",{className:"v",children:d.jsx(D$,{s:e})})]}),e.preflight.error&&d.jsx("p",{className:_n,children:e.preflight.error}),d.jsxs("form",{className:Ou,onSubmit:k,children:[d.jsxs("div",{className:"row2",children:[d.jsxs("label",{children:["Context",d.jsxs("select",{value:i,onChange:S=>a(S.target.value),children:[d.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(S=>d.jsx("option",{value:S,children:S},S))]})]}),d.jsxs("label",{children:["Namespace",d.jsx("input",{className:Tn,type:"text",value:l,onChange:S=>c(S.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),m&&d.jsx("div",{className:"error",children:m}),d.jsx("div",{className:"actions",children:d.jsx("button",{type:"submit",className:_o,disabled:u||v,children:u?"Saving…":"Save"})})]}),d.jsxs("div",{className:hu,children:[d.jsx("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:d.jsx("h3",{children:"Run manifest"})}),d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Each run applies the manifest committed on its experiment branch — default"," ",d.jsx("code",{children:".orx/k8s.yaml"}),", or ",d.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",d.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",d.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",d.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",d.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Checking kubectl…"]})]})}const L$={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function O$({s:e}){return e.ready?d.jsx("span",{className:_i,children:"Connected"}):!e.tokenConfigured&&!e.modalImportable?d.jsx("span",{className:rr,children:"Not set up"}):e.modalImportable?e.tokenConfigured?d.jsx("span",{className:rr,children:"Unknown"}):d.jsx("span",{className:Ir,children:"No token"}):d.jsx("span",{className:Ir,children:e.envProvisioned?"Env broken":"Env not built"})}function B$(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(!1),[l,c]=O.useState(null);O.useEffect(()=>{xM().then(t).catch(h=>r(h instanceof Error?h.message:String(h)))},[]);async function u(){if(!i){a(!0),c(null);try{t(await wM())}catch(h){c(h instanceof Error?h.message:String(h))}finally{a(!1)}}}return d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Serverless GPUs on your own Modal account with"," ",d.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?d.jsx("div",{className:"error",children:n}):e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:xo,children:[d.jsx("span",{className:"k",children:"Status"}),d.jsx("span",{className:"v",children:d.jsx(O$,{s:e})}),d.jsx("span",{className:"k",children:"Environment"}),d.jsx("span",{className:"v",children:e.modalImportable?"Ready":e.envProvisioned?"Provisioned (modal import failing)":"Not built yet"}),d.jsx("span",{className:"k",children:"Token"}),d.jsx("span",{className:"v",children:e.tokenSource?L$[e.tokenSource]:"Not configured"})]}),!e.tokenConfigured&&d.jsxs("p",{className:_n,children:["No Modal token found. Run ",d.jsx("code",{children:"modal token new"}),", or add"," ",d.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",d.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&d.jsx("p",{className:_n,children:e.error}),l&&d.jsx("div",{className:"error",children:l}),!e.modalImportable&&d.jsx("div",{className:"actions",children:d.jsx("button",{className:_o,onClick:()=>void u(),disabled:i,children:i?"Setting up… (~30–60s)":"Set up environment"})})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Checking Modal…"]})]})}function z$({test:e}){if(e===void 0)return d.jsx("span",{className:"muted text-muted",children:"never tested"});if(e==="testing")return d.jsx("span",{className:Yn});const t=e.reachable?e.gitFound?d.jsx("span",{className:_i,children:"Ready"}):d.jsx("span",{className:Ir,children:"Missing bash/tar"}):d.jsx("span",{className:Ir,title:e.error??void 0,children:"Unreachable"});return d.jsxs(d.Fragment,{children:[t,d.jsx("span",{className:"ssh-tested-at block mt-0.5 text-muted text-xs",children:Pi(e.testedAt)})]})}function I$(){const[e,t]=O.useState(null),[n,r]=O.useState({});O.useEffect(()=>{DM().then(t).catch(()=>t([]))},[]);async function i(a){r(l=>({...l,[a]:"testing"}));try{const l=await RM(a);r(c=>({...c,[a]:l}))}catch(l){r(c=>({...c,[a]:{reachable:!1,gitFound:!1,error:l instanceof Error?l.message:String(l),testedAt:Date.now()}}))}}return d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments directly on your own boxes with"," ",d.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",d.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",d.jsx("code",{children:"git"})," and ",d.jsx("code",{children:"bash"}),"."]}),e===null?d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Reading ~/.ssh/config…"]}):e.length===0?d.jsx("p",{className:"settings-empty text-muted text-md mt-1 mx-0 mb-0",children:"No hosts found in ~/.ssh/config."}):d.jsxs("table",{className:"flavor-table w-full border-collapse text-md [&_th]:pt-[5px] [&_th]:pr-2.5 [&_th]:pb-[5px] [&_th]:pl-0 [&_th]:border-b [&_th]:border-b-border [&_th]:text-left [&_th]:font-medium [&_th]:text-text [&_td]:pt-[5px] [&_td]:pr-2.5 [&_td]:pb-[5px] [&_td]:pl-0 [&_td]:border-b [&_td]:border-b-border-variant ssh-table table-fixed [&_th:nth-child(1)]:w-[20%] [&_th:nth-child(2)]:w-[26%] [&_th:nth-child(4)]:w-27 [&_th:nth-child(5)]:w-13 [&_td]:wrap-anywhere [&_td:last-child]:pr-0 [&_td:last-child]:text-right",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Host"}),d.jsx("th",{children:"Address"}),d.jsx("th",{children:"Identity"}),d.jsx("th",{children:"Status"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:e.map(a=>d.jsxs("tr",{children:[d.jsx("td",{className:Tn,children:a.host}),d.jsxs("td",{className:`${Tn} muted text-muted`,children:[[a.user,a.hostname??"—"].filter(Boolean).join("@"),a.port?`:${a.port}`:""]}),d.jsx("td",{className:`${Tn} muted text-muted`,children:a.identityFile??"—"}),d.jsx("td",{children:d.jsx(z$,{test:n[a.host]??a.lastTest})}),d.jsx("td",{children:d.jsx("button",{className:ws,onClick:()=>void i(a.host),disabled:n[a.host]==="testing",children:"Test"})})]},a.host))})]})]})}function H$({test:e}){return e===null?null:e==="testing"?d.jsx("span",{className:Yn}):e.reachable?e.slurmFound?e.gitFound?d.jsx("span",{className:_i,children:"Ready"}):d.jsx("span",{className:Ir,children:"Missing bash/tar"}):d.jsx("span",{className:Ir,children:"No Slurm CLI"}):d.jsx("span",{className:Ir,title:e.error??void 0,children:"Unreachable"})}function F$(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[l,c]=O.useState(""),[u,h]=O.useState(""),[m,f]=O.useState(""),[g,v]=O.useState(!1),[k,S]=O.useState(null),[y,_]=O.useState(null),x=y!==null&&y!=="testing"?y:null,w=j=>{t(j),a(j.host??""),c(j.partition??""),h(j.account??""),f(j.timeLimit??"")};O.useEffect(()=>{LM().then(w).catch(j=>r(j instanceof Error?j.message:String(j)))},[]);const C=e!==null&&i===(e.host??"")&&l.trim()===(e.partition??"")&&u.trim()===(e.account??"")&&m.trim()===(e.timeLimit??"");async function T(j){if(j.preventDefault(),!g){v(!0),S(null);try{w(await OM({host:i,partition:l.trim(),account:u.trim(),timeLimit:m.trim()}))}catch(A){S(A instanceof Error?A.message:String(A))}finally{v(!1)}}}async function N(j){_("testing");try{_(await BM(j))}catch(A){_({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:A instanceof Error?A.message:String(A)})}}return d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",d.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",d.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?d.jsx("div",{className:"error",children:n}):e?d.jsxs(d.Fragment,{children:[(x==null?void 0:x.error)&&d.jsx("p",{className:_n,children:x.error}),x&&x.partitions.length>0&&d.jsxs("p",{className:_n,children:["Partitions: ",d.jsx("code",{children:x.partitions.join(", ")})]}),d.jsxs("form",{className:Ou,onSubmit:T,children:[d.jsxs("div",{className:"row2",children:[d.jsxs("label",{children:["Login node",d.jsxs("select",{value:i,onChange:j=>{a(j.target.value),_(null)},children:[d.jsx("option",{value:"",children:"not set (pass --host per launch)"}),i&&!e.hosts.some(j=>j.host===i)&&d.jsxs("option",{value:i,children:[i," (not in ~/.ssh/config)"]}),e.hosts.map(j=>d.jsx("option",{value:j.host,children:j.host},j.host))]})]}),d.jsxs("label",{children:["Partition",d.jsx("input",{className:Tn,type:"text",list:"slurm-partitions",value:l,onChange:j=>c(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),d.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(j=>d.jsx("option",{value:j},j))})]})]}),d.jsxs("div",{className:"row2",children:[d.jsxs("label",{children:["Account",d.jsx("input",{className:Tn,type:"text",value:u,onChange:j=>h(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),d.jsxs("label",{children:["Time limit",d.jsx("input",{className:Tn,type:"text",value:m,onChange:j=>f(j.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),k&&d.jsx("div",{className:"error",children:k}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{type:"submit",className:_o,disabled:g||C,children:g?"Saving…":"Save"}),d.jsx("button",{type:"button",className:yo,onClick:()=>void N(i),disabled:!i||y==="testing",title:i?void 0:"Pick a login node first",children:"Test connection"}),d.jsx(H$,{test:y})]})]})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Loading slurm settings…"]})]})}function $$(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[l,c]=O.useState(!1),[u,h]=O.useState(null),[m,f]=O.useState(null),g=m!==null&&m!=="testing"?m:null,v=_=>{t(_),a(_.address??"")};O.useEffect(()=>{zM().then(v).catch(_=>r(_ instanceof Error?_.message:String(_)))},[]);const k=e!==null&&i===(e.address??"");async function S(_){if(_.preventDefault(),!l){c(!0),h(null);try{v(await IM({address:i}))}catch(x){h(x instanceof Error?x.message:String(x))}finally{c(!1)}}}async function y(){f("testing");try{f(await HM(i.trim()||void 0))}catch(_){f({reachable:!1,address:i.trim()||"(unknown)",rayVersion:null,error:_ instanceof Error?_.message:String(_)})}}return d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on a Ray cluster with ",d.jsx("code",{children:"--backend ray [--flavor gpu:1]"}),". orx submits via the Ray Jobs API (Dashboard URL). Address resolution: this setting, then ",d.jsx("code",{children:"ASTROAI_RAY_JOBS_ADDRESS"})," /"," ",d.jsx("code",{children:"RAY_DASHBOARD_URL"}),", then ",d.jsx("code",{children:"http://127.0.0.1:8265"}),". Optional flavor maps to entrypoint CPUs/GPUs/memory (e.g."," ",d.jsx("code",{children:"cpu:2"}),", ",d.jsx("code",{children:"gpu:1,mem:8GiB"}),")."]}),n?d.jsx("div",{className:"error",children:n}):e?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:_n,children:["Effective: ",d.jsx("code",{children:e.resolvedAddress})," (",e.source,")"]}),(g==null?void 0:g.error)&&d.jsx("p",{className:_n,children:g.error}),(g==null?void 0:g.reachable)&&g.rayVersion&&d.jsxs("p",{className:_n,children:["Ray version: ",d.jsx("code",{children:g.rayVersion})]}),d.jsxs("form",{className:Ou,onSubmit:S,children:[d.jsxs("label",{children:["Jobs / Dashboard URL",d.jsx("input",{className:Tn,type:"text",value:i,onChange:_=>{a(_.target.value),f(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),u&&d.jsx("div",{className:"error",children:u}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{type:"submit",className:_o,disabled:l||k,children:l?"Saving…":"Save"}),d.jsx("button",{type:"button",className:yo,onClick:()=>void y(),disabled:m==="testing",children:"Test connection"}),d.jsx(P$,{test:m})]})]})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Loading Ray settings…"]})]})}function P$({test:e}){return e===null?null:e==="testing"?d.jsx("span",{className:rr,children:"Testing…"}):e.reachable?d.jsx("span",{className:_i,children:"Reachable"}):d.jsx("span",{className:D2,children:"Unreachable"})}function U$(){const[e,t]=O.useState(null),[n,r]=O.useState(null);return O.useEffect(()=>{$M().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",d.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?d.jsx("div",{className:"error",children:n}):e?d.jsxs("div",{className:xo,children:[d.jsx("span",{className:"k",children:"Hostname"}),d.jsx("span",{className:`v ${Tn}`,children:e.hostname}),d.jsx("span",{className:"k",children:"System"}),d.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),d.jsx("span",{className:"k",children:"CPU"}),d.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),d.jsx("span",{className:"k",children:"RAM"}),d.jsx("span",{className:"v",children:e.memBytes!==null?fa(e.memBytes):"—"}),d.jsx("span",{className:"k",children:"GPUs"}),d.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(i=>`${i.name}${i.memMib!==null?` — ${fa(i.memMib*1024*1024)}`:""}`).join(", ")})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Detecting hardware…"]})]})}function q$(){const[e,t]=O.useState(null),[n,r]=O.useState(null);return O.useEffect(()=>{PM().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",d.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",d.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",d.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?d.jsx("div",{className:"error",children:n}):e?e.loggedIn?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:xo,children:[d.jsx("span",{className:"k",children:"Status"}),d.jsx("span",{className:"v",children:d.jsx("span",{className:_i,children:"Signed in"})}),d.jsx("span",{className:"k",children:"Orgs"}),d.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),d.jsx("span",{className:"k",children:"SSH key"}),d.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?d.jsx("span",{className:_i,children:"On this computer"}):e.sshKeyStatus==="no_local_match"?d.jsx("span",{className:D2,children:"Not on this computer"}):e.sshKeyStatus==="none_registered"?d.jsx("span",{className:Ir,children:"None registered"}):d.jsx("span",{className:rr,children:"Unknown"})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?d.jsxs("p",{className:_n,children:["Add one with ",d.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):d.jsxs("p",{className:_n,children:["No key on this computer yet — create one with"," ",d.jsx("code",{children:"ssh-keygen -t ed25519"}),", then add it with"," ",d.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?d.jsxs("p",{className:_n,children:["Register this computer with ",d.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),", or load a registered key with ",d.jsx("code",{children:"ssh-add"}),"."]}):d.jsxs("p",{className:_n,children:["No key on this computer to register — load a registered key with"," ",d.jsx("code",{children:"ssh-add"}),", or create one with"," ",d.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&d.jsx("p",{className:_n,children:e.error})]}):d.jsxs("p",{className:_n,children:["Not signed in. Run ",d.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Checking credentials…"]})]})}const d5={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",ray:"Ray",openresearch:"OpenResearch"},G$={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},V$=["hf","modal","slurm","ray","openresearch"],f5=["hf","modal","openresearch"],p5={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"]};function W$({t:e,isDefault:t}){return e.id==="local"?d.jsx("span",{className:_i,children:"Ready"}):e.unverified?d.jsx("span",{className:rr,children:"Unknown"}):!e.configured&&t?d.jsx("span",{className:D2,children:"Not configured"}):e.configured?d.jsx("span",{className:_i,children:"Configured"}):d.jsx("span",{className:rr,children:"Not set up"})}function Y$({target:e,flavor:t,onSaved:n}){var f;const[r,i]=O.useState(t??""),[a,l]=O.useState(!1),[c,u]=O.useState(null);O.useEffect(()=>i(t??""),[t]);async function h(g){if(g.preventDefault(),!a){l(!0),u(null);try{n(await U7({backend:e,flavor:r.trim()||null}))}catch(v){u(v instanceof Error?v.message:String(v))}finally{l(!1)}}}const m=r.trim()===(t??"");return d.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-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.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-left [&_.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-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.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-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.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]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-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-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.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-left [&_.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-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.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-md [&_.paper-pick_.title]:font-semibold flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_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 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap settings-form mt-3.5 pt-3.5 border-t border-t-border compute-flavor-form mb-3.5 [&_label]:max-w-80",onSubmit:h,children:[d.jsxs("label",{children:["Default flavor",d.jsx("input",{className:Tn,type:"text",list:`flavors-${e}`,value:r,onChange:g=>i(g.target.value),placeholder:f5.includes(e)?`e.g. ${((f=p5[e])==null?void 0:f[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),d.jsx("datalist",{id:`flavors-${e}`,children:(p5[e]??[]).map(g=>d.jsx("option",{value:g},g))})]}),c&&d.jsx("div",{className:"error",children:c}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{type:"submit",className:ws,disabled:a||m,children:a?"Saving…":"Save flavor"}),f5.includes(e)&&!t&&d.jsxs("span",{className:"muted text-muted compute-flavor-hint text-sm",children:["This backend requires a flavor — without a default one, each launch must pass"," ",d.jsx("code",{children:"--flavor"}),"."]})]})]})}function X$({target:e,isDefault:t,isFallbackDefault:n,defaultFlavor:r,open:i,onToggle:a,onSettings:l,onError:c}){const[u,h]=O.useState(!1),[m,f]=O.useState(!1);i&&!u&&h(!0);async function g(v){if(!m){f(!0);try{l(await U7({backend:v}))}catch(k){c(k instanceof Error?k.message:String(k))}finally{f(!1)}}}return d.jsxs("div",{className:`compute-row bg-background border border-border rounded-lg [&.disabled]:opacity-52 [&.disabled_.compute-row-head]:cursor-default [&.open_.compute-row-head:hover]:rounded-[var(--radius-lg)_var(--radius-lg)_0_0] [&.open_.compute-chevron]:rotate-180${i?" open":""}`,children:[d.jsxs("div",{className:"compute-row-head flex items-center gap-2.5 py-3 px-3.5 cursor-pointer select-none [&:hover]:bg-surface [&:hover]:rounded-lg [&_.badge]:flex-none",onClick:a,children:[d.jsx("span",{className:"compute-row-logo inline-flex items-center flex-none",children:d.jsx(M8,{kind:G$[e.id],size:18})}),d.jsx("span",{className:"compute-row-name text-md font-semibold text-text flex-none",children:d5[e.id]}),d.jsx("span",{className:"compute-row-summary flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-muted text-sm",children:e.summary}),d.jsx(W$,{t:e,isDefault:t}),t?d.jsx("span",{className:"badge inline-flex items-center font-sans text-xs font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle compute-default-pill flex-none text-primary border-primary",children:n?"Local fallback":"Default"}):d.jsx("button",{type:"button",className:`${ws} compute-make-default flex-none`,onClick:v=>{v.stopPropagation(),g(e.id)},disabled:m,children:"Make default"}),d.jsx("button",{type:"button",className:"compute-chevron-btn flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":i,"aria-label":`${i?"Collapse":"Expand"} ${d5[e.id]}`,onClick:v=>{v.stopPropagation(),a()},children:d.jsx(Hi,{size:16,className:"compute-chevron text-muted transition-transform duration-120 ease-standard"})})]}),u&&d.jsxs("div",{className:"compute-row-body border-t border-t-border p-3.5 [&_.settings-card]:mb-0 [&_.settings-card]:mt-3.5",hidden:!i,children:[t&&!n&&d.jsxs("p",{className:"settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5 border border-accent-amber rounded-md bg-accent-amber-subtle text-accent-amber font-medium compute-default-note flex items-center gap-2.5 flex-wrap",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",d.jsx("code",{children:"orx exp run"})," with no ",d.jsx("code",{children:"--backend"})," flag."," ",d.jsx("button",{type:"button",className:ws,onClick:()=>void g(null),disabled:m,children:"Clear default"})]}),t&&!e.configured&&d.jsx("p",{className:_n,children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&V$.includes(e.id)&&d.jsx(Y$,{target:e.id,flavor:r,onSaved:l}),e.id==="local"&&d.jsx(U$,{}),e.id==="hf"&&d.jsx(eP,{}),e.id==="modal"&&d.jsx(B$,{}),e.id==="k8s"&&d.jsx(R$,{}),e.id==="ssh"&&d.jsx(I$,{}),e.id==="slurm"&&d.jsx(F$,{}),e.id==="ray"&&d.jsx($$,{}),e.id==="openresearch"&&d.jsx(q$,{})]})]})}function K$({project:e}){const[t,n]=O.useState(null),[r,i]=O.useState(null),[a,l]=O.useState(null),[c,u]=O.useState(null),h=O.useRef(0);O.useEffect(()=>{h.current++,n(null),l(null),i(null),u(null)},[e==null?void 0:e.id]),O.useEffect(()=>{const k=++h.current;FM().then(S=>{k===h.current&&(n(S),i(null))}).catch(S=>{if(k!==h.current)return;const y=S instanceof Error?S.message:String(S);n(_=>(_===null?i(y):u(y),_))})},[a,e==null?void 0:e.id]);const m=k=>{h.current++,n(k),u(null)},f=t?t.targets:null,g=(t==null?void 0:t.defaultBackend)==="local"&&t.defaultBackend!==null&&t.defaultBackend!==void 0&&t.defaultBackend!=="local",v=k=>d.jsx(X$,{target:k,isDefault:(t==null?void 0:t.defaultBackend)===k.id,isFallbackDefault:!!(g&&k.id==="local"),defaultFlavor:(t==null?void 0:t.defaultFlavor)??null,open:a===k.id,onToggle:()=>l(S=>S===k.id?null:k.id),onSettings:m,onError:u,projectId:e==null?void 0:e.id},`${(e==null?void 0:e.id)??"none"}:${k.id}`);return d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:"Compute"}),d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where ",d.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",d.jsx("code",{children:"--backend "})," always wins)."]}),d.jsx("h2",{className:"compute-section-title mt-0 mx-0 mb-2.5 text-lg",children:"Targets"}),r?d.jsx("div",{className:"error",children:r}):f?d.jsxs(d.Fragment,{children:[c&&d.jsx("div",{className:"error",children:c}),d.jsxs("div",{className:"compute-list flex flex-col gap-2.5 mb-3.5",children:[f.filter(k=>k.id==="local").map(v),f.filter(k=>k.id!=="local").map(v)]}),g&&d.jsxs("p",{className:_n,children:["Using this machine because the saved ",t==null?void 0:t.defaultBackend," default is not currently configured."]}),d.jsxs("p",{className:"compute-footnote flex items-start gap-1.5 mt-0.5 mx-0 mb-0 text-sm text-muted [&_svg]:flex-none [&_svg]:mt-px",children:[d.jsx(QA,{size:14,"aria-hidden":"true"}),d.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Checking compute targets…"]})]})}const Z$={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function Q$({settings:e}){return e.configured?e.valid?d.jsx("span",{className:_i,children:"Connected"}):d.jsx("span",{className:Ir,children:"Invalid token"}):d.jsx("span",{className:rr,children:"Not configured"})}function J$({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?d.jsx("span",{className:_i,children:"Jobs: write OK"}):e.jobsWrite===!1?d.jsx("span",{className:Ir,children:"No job.write permission"}):d.jsx("span",{className:rr,children:"Jobs permission unknown"})}function eP(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[l,c]=O.useState(!1),[u,h]=O.useState(null),m=O.useRef(!1);O.useEffect(()=>{vM().then(g=>{m.current||t(g)}).catch(g=>{m.current||r(g instanceof Error?g.message:String(g))})},[]);async function f(g){if(g.preventDefault(),!(!i.trim()||l)){c(!0),h(null);try{const v=await bM(i.trim());m.current=!0,t(v),r(null),a("")}catch(v){h(v instanceof Error?v.message:String(v))}finally{c(!1)}}}return d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments on your Hugging Face account with"," ",d.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?d.jsx("div",{className:"error",children:n}):e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:xo,children:[d.jsx("span",{className:"k",children:"Status"}),d.jsx("span",{className:"v",children:d.jsx(Q$,{settings:e})}),d.jsx("span",{className:"k",children:"Account"}),d.jsx("span",{className:"v",children:e.username??"—"}),d.jsx("span",{className:"k",children:"Token"}),d.jsx("span",{className:"v",children:e.maskedToken??"—"}),d.jsx("span",{className:"k",children:"Source"}),d.jsx("span",{className:"v",children:e.source?Z$[e.source]:"Not configured"}),d.jsx("span",{className:"k",children:"Jobs"}),d.jsxs("span",{className:"v",children:[d.jsx(J$,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&d.jsx("p",{className:_n,children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&d.jsxs("p",{className:_n,children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",d.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",d.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Loading status…"]}),d.jsxs("form",{className:Ou,onSubmit:f,children:[d.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",d.jsx("input",{type:"password",value:i,onChange:g=>a(g.target.value),placeholder:"hf_…",autoComplete:"off"})]}),u&&d.jsx("div",{className:"error",children:u}),d.jsx("div",{className:"actions",children:d.jsx("button",{type:"submit",className:_o,disabled:!i.trim()||l,children:l?"Validating…":"Save"})})]})]})}const R8=/^hf_[A-Za-z0-9]{10,}$/;function L8(){return d.jsx("tr",{children:d.jsx("td",{colSpan:3,children:d.jsxs("p",{className:_n,children:["This value looks like a Hugging Face token — compute runs only read it from"," ",d.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const m5=["HF_TOKEN","WANDB_API_KEY"];function tP({name:e,entry:t,onVars:n,onError:r}){const[i,a]=O.useState(""),[l,c]=O.useState(!1),u=f=>r(`${e}: ${f instanceof Error?f.message:String(f)}`);async function h(){if(!(!i.trim()||l)){c(!0);try{n(await P7(e,i.trim())),a("")}catch(f){u(f)}finally{c(!1)}}}async function m(){if(!l){c(!0);try{n(await AM(e))}catch(f){u(f)}finally{c(!1)}}}return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{children:[d.jsx("td",{className:Tn,children:e}),d.jsx("td",{className:`${Tn} muted text-muted`,children:t?d.jsxs(d.Fragment,{children:[t.maskedValue,t.inProcessEnv&&d.jsx("span",{className:rr,children:"Overridden by env"})]}):d.jsx("input",{className:Tn,type:"password",value:i,onChange:f=>a(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),h()),f.key==="Escape"&&!l&&a("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:l})}),d.jsx("td",{children:t?d.jsx("button",{className:oo,title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void m(),disabled:l,children:d.jsx(Cd,{size:13})}):i.trim()&&d.jsx("button",{className:ws,onClick:()=>void h(),disabled:l,children:l?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&R8.test(i.trim())&&d.jsx(L8,{})]})}function nP({onVars:e,onError:t,onDone:n}){const[r,i]=O.useState(""),[a,l]=O.useState(""),[c,u]=O.useState(!1);async function h(){if(!(!r.trim()||!a.trim()||c)){u(!0);try{e(await P7(r.trim(),a.trim())),n()}catch(f){t(`${r.trim()}: ${f instanceof Error?f.message:String(f)}`)}finally{u(!1)}}}const m=f=>{f.key==="Enter"&&(f.preventDefault(),h()),f.key==="Escape"&&!c&&n()};return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("input",{autoFocus:!0,className:Tn,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:m,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:c})}),d.jsx("td",{children:d.jsx("input",{className:Tn,type:"password",value:a,onChange:f=>l(f.target.value),onKeyDown:m,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:c})}),d.jsxs("td",{children:[d.jsx("button",{className:ws,onClick:()=>void h(),disabled:c||!r.trim()||!a.trim(),children:c?"Saving…":"Save"}),d.jsx("button",{className:oo,title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:c,children:d.jsx(eo,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&R8.test(a.trim())&&d.jsx(L8,{})]})}function rP(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(!1),[l,c]=O.useState(null);O.useEffect(()=>{NM().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);const u=f=>{t(f),c(null)},h=e===null?[]:e.map(f=>f.key).filter(f=>!m5.includes(f)),m=[...m5,...h];return d.jsxs("div",{className:hu,children:[d.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[d.jsx("h3",{children:"Environment variables"}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsxs("button",{className:ws,onClick:()=>a(!0),disabled:i||e===null,children:[d.jsx(bv,{size:12})," Add variable"]})]}),d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Stored in ",d.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",d.jsx("code",{children:"HF_TOKEN"})," and ",d.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?d.jsx("div",{className:"error",children:n}):e===null?d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Loading…"]}):d.jsx("table",{className:"env-table w-full border-collapse text-md table-fixed [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ml-2 [&_input]:w-full [&_input]:border-0 [&_input]:bg-transparent [&_input]:p-0 [&_input:focus]:shadow-[0_1px_0_0_var(--text)] [&_td]:h-9 [&_td]:pt-0 [&_td]:pr-2.5 [&_td]:pb-0 [&_td]:pl-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-right [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-left [&_.icon-btn]:ml-2 [&_.icon-btn]:align-middle [&_.icon-btn:hover]:text-accent-red",children:d.jsxs("tbody",{children:[m.map(f=>d.jsx(tP,{name:f,entry:e.find(g=>g.key===f),onVars:u,onError:c},f)),i&&d.jsx(nP,{onVars:u,onError:c,onDone:()=>a(!1)})]})}),l&&d.jsx("div",{className:"error",children:l})]})}function iP(){const[e,t]=O.useState(null),[n,r]=O.useState(""),[i,a]=O.useState(""),[l,c]=O.useState(!1),[u,h]=O.useState(null);O.useEffect(()=>{G7().then(g=>{t(g),r(g.userName??""),a(g.userEmail??"")}).catch(()=>{})},[]);const m=e!==null&&n.trim()===(e.userName??"")&&i.trim()===(e.userEmail??"");async function f(g){if(g.preventDefault(),!(l||m)){c(!0),h(null);try{const v=await GM({userName:n.trim(),userEmail:i.trim()});t(v),r(v.userName??""),a(v.userEmail??"")}catch(v){h(v instanceof Error?v.message:String(v))}finally{c(!1)}}}return d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:"Git"}),d.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"settings-card",children:[d.jsx("h3",{children:"Identity"}),d.jsxs("form",{className:"form",onSubmit:f,children:[d.jsxs("div",{className:"row2",children:[d.jsxs("label",{children:["user.name",d.jsx("input",{type:"text",value:n,onChange:g=>r(g.target.value),autoComplete:"off"})]}),d.jsxs("label",{children:["user.email",d.jsx("input",{type:"text",value:i,onChange:g=>a(g.target.value),autoComplete:"off"})]})]}),u&&d.jsx("div",{className:"error",children:u}),d.jsx("div",{className:"actions",children:d.jsx("button",{type:"submit",className:"btn primary",disabled:l||m||!n.trim()&&!i.trim(),children:l?"Saving…":"Save"})})]})]}),d.jsxs("div",{className:"settings-card",children:[d.jsx("h3",{children:"GitHub access"}),d.jsxs("div",{className:"kv",children:[d.jsx("span",{className:"k",children:"git"}),d.jsx("span",{className:"v",children:e.gitVersion??"not found"}),d.jsx("span",{className:"k",children:"Token"}),d.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",d.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),d.jsx(T8,{onSaved:t})]}),e.githubTokenSource==="stored"&&d.jsx("div",{className:"actions",children:d.jsx("button",{className:"btn",onClick:()=>{WM().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):d.jsxs("div",{className:"settings-loading",children:[d.jsx("span",{className:"spinner"})," Loading…"]})]})}const sP={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function aP(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[l,c]=O.useState(!1),[u,h]=O.useState(null),[m,f]=O.useState({kind:"idle"}),[g,v]=O.useState(null),k=()=>TM().then(C=>{t(C),a(T=>T||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));O.useEffect(()=>{k()},[]),O.useEffect(()=>wj(C=>{C.type==="progress"?f(T=>{const N=T.kind==="moving"?T.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(f({kind:"done",oldPathLeft:C.oldPathLeft}),h(null),a(""),k()):C.type==="error"&&f({kind:"error",message:C.error})}),[]);const S=(e==null?void 0:e.source)==="env",y=i.trim(),_=e!==null&&y===e.current;async function x(){if(!(l||!y)){c(!0),v(null),h(null);try{h(await MM(y))}catch(C){v(C instanceof Error?C.message:String(C))}finally{c(!1)}}}async function w(C){if(C.preventDefault(),!(m.kind==="moving"||!y||_)&&(v(null),!!window.confirm(`Move all orx data to: +${y} + +The store is copied to the new location and activated there. Active runs or chats will block the move.`))){f({kind:"moving",phase:"preparing",copied:0,total:(u==null?void 0:u.treeBytes)??0});try{await jM(y)}catch(T){f({kind:"idle"}),v(T instanceof Error?T.message:String(T))}}}return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:"Storage"}),d.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",d.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?d.jsx("div",{className:hu,children:d.jsx("div",{className:"error",children:n})}):e?d.jsxs("div",{className:hu,children:[d.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[d.jsx("h3",{children:"Data directory"}),d.jsx("div",{className:"spacer",style:{flex:1}}),d.jsx("span",{className:rr,children:e.isDefault?"Default":"Custom"})]}),d.jsxs("div",{className:xo,children:[d.jsx("span",{className:"k",children:"Current"}),d.jsx("span",{className:`v ${Tn}`,children:e.current}),d.jsx("span",{className:"k",children:"Source"}),d.jsx("span",{className:"v",children:sP[e.source]}),!e.isDefault&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"k",children:"Default"}),d.jsx("span",{className:`v ${Tn}`,children:e.defaultPath})]})]}),S?d.jsxs("p",{className:_n,children:["The data directory is pinned by the ",d.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):d.jsxs("form",{className:Ou,onSubmit:w,children:[d.jsxs("label",{children:["New location",d.jsx("input",{className:Tn,type:"text",value:i,onChange:C=>{a(C.target.value),h(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:m.kind==="moving"})]}),u&&!u.error&&u.ok&&d.jsxs("p",{className:_n,children:["Ready to move ",fa(u.treeBytes??0),u.freeBytes!=null&&` — ${fa(u.freeBytes)} free at target`,u.sameFilesystem?" (same disk, instant)":"","."]}),u&&u.ok===!1&&u.error&&d.jsx("div",{className:"error",children:u.error}),g&&d.jsx("div",{className:"error",children:g}),m.kind==="moving"&&d.jsx(D8,{value:m.copied,max:m.total,label:`${m.phase.charAt(0).toUpperCase()}${m.phase.slice(1)}…`,caption:m.total>0?d.jsxs("span",{className:Tn,children:[fa(m.copied)," / ",fa(m.total)]}):void 0}),m.kind==="done"&&d.jsxs("p",{className:_n,children:["Moved. orx is now using the new location.",m.oldPathLeft&&d.jsxs(d.Fragment,{children:[" ","The old copy was left at ",d.jsx("code",{children:m.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),m.kind==="error"&&d.jsxs("div",{className:"error",children:["Move failed: ",m.message]}),d.jsxs("div",{className:"actions",children:[d.jsx("button",{type:"button",className:yo,onClick:x,disabled:l||!y||_||m.kind==="moving",children:l?"Checking…":"Check"}),d.jsx("button",{type:"submit",className:_o,disabled:!y||_||m.kind==="moving",children:m.kind==="moving"?"Moving…":"Move data here"})]})]})]}):d.jsxs("div",{className:oi,children:[d.jsx("span",{className:Yn})," Loading…"]})]})}const Lg=e=>e==="running"||e==="starting";function oP(e){return Lg(e.status)?Z0(Date.now()-e.createdAt):e.endedAt?Z0(e.endedAt-e.createdAt):"—"}function lP({watcher:e}){return e==="alive"?d.jsx(Ss,{status:"running",label:"Watching"}):e==="lost"?d.jsx(Ss,{status:"failed",label:"Lost"}):d.jsx(d.Fragment,{children:"—"})}function g5({instances:e,emptyLabel:t,showWatcher:n}){return e.length===0?d.jsx("p",{className:"instances-empty m-0 py-3.5 px-4 border border-border rounded-lg bg-background text-subtext text-md",children:t}):d.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:d.jsxs("table",{className:"runs-table w-full border-collapse text-md bg-background [&_th]:text-left [&_th]:text-text [&_th]:text-xs [&_th]:font-semibold [&_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-[color-mix(in_oklab,_var(--text)_6%,_transparent)] [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Backend"}),d.jsx("th",{children:"Project"}),d.jsx("th",{children:"Status"}),n&&d.jsx("th",{children:"Watcher"}),d.jsx("th",{children:"Started"}),d.jsx("th",{children:"Runtime"})]})}),d.jsx("tbody",{children:e.map(r=>{var a;const i=typeof((a=r.backend)==null?void 0:a.url)=="string"?r.backend.url:void 0;return d.jsxs("tr",{children:[d.jsx("td",{children:d.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5 [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",children:[d.jsx(j8,{backend:r.backend}),i&&d.jsx("a",{className:oo,href:i,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:l=>l.stopPropagation(),children:d.jsx(Eu,{size:12})})]})}),d.jsx("td",{children:r.projectName??Y1(r.projectId)}),d.jsx("td",{children:d.jsx(Ss,{status:wl(r)})}),n&&d.jsx("td",{children:d.jsx(lP,{watcher:r.watcher})}),d.jsx("td",{children:Pi(r.createdAt)}),d.jsx("td",{children:oP(r)})]},r.id)})})]})})}function cP(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(!1),[l,c]=O.useState(!1),[u,h]=O.useState(null),[,m]=O.useState(0);O.useEffect(()=>{const y=setInterval(()=>m(_=>_+1),3e4);return()=>clearInterval(y)},[]);const f=()=>{a(!0),tM().then(y=>{t(y),r(null)}).catch(y=>{r(y instanceof Error?y.message:String(y)),t(_=>_??[])}).finally(()=>a(!1))};O.useEffect(()=>f(),[]);const g=()=>{c(!0),h(null),nM().then(y=>{h(y.length===0?"All watchers are alive — nothing to reattach.":`Reattached ${y.length} watcher${y.length===1?"":"s"} — statuses will settle shortly.`),r(null),f()}).catch(y=>r(y instanceof Error?y.message:String(y))).finally(()=>c(!1))},v=(y,_)=>_.createdAt-y.createdAt,k=e==null?void 0:e.filter(y=>Lg(y.status)).sort(v),S=e==null?void 0:e.filter(y=>!Lg(y.status)).sort(v);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"settings-head-row",children:[d.jsx("h1",{children:"Instances"}),d.jsxs("button",{className:"btn sm",onClick:f,disabled:i,children:[d.jsx(Fi,{size:12,className:i?"spin":""})," Refresh"]}),d.jsxs("button",{className:"btn sm",onClick:g,disabled:l,title:"Respawn watchers for live runs whose supervisor died, so stuck statuses settle",children:[d.jsx(bT,{size:12,className:l?"spin":""})," Reattach watchers"]})]}),d.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),u&&d.jsx("p",{className:"settings-sub",children:u}),n&&d.jsx("div",{className:"error",children:n}),!k||!S?d.jsxs("div",{className:"settings-loading",children:[d.jsx("span",{className:"spinner"})," Loading…"]}):d.jsxs(d.Fragment,{children:[d.jsxs("h2",{className:"instances-section-title",children:["Running",k.length>0&&d.jsx("span",{className:"count-badge",children:k.length})]}),d.jsx(g5,{instances:k,emptyLabel:"Nothing running right now.",showWatcher:!0}),d.jsx("h2",{className:"instances-section-title",children:"Past"}),d.jsx(g5,{instances:S,emptyLabel:"No past instances yet."})]})]})}function uP({persona:e,isActive:t,hasProject:n,open:r,saving:i,onToggle:a,onActivate:l}){const[c,u]=O.useState(null),[h,m]=O.useState(!1);return d.jsxs("div",{className:`compute-row persona-card persona-${e.id}${r?" open":""}`,children:[d.jsxs("div",{className:"compute-row-head",onClick:a,children:[d.jsx("span",{className:`persona-swatch persona-${e.id}`}),d.jsx("span",{className:"compute-row-name",children:e.label}),d.jsx("span",{className:"compute-row-summary",children:e.description}),t?d.jsx("span",{className:`badge persona-active-pill persona-${e.id}`,children:"Active"}):d.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:f=>{f.stopPropagation(),l()},disabled:i||!n,children:"Use for this project"}),d.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${e.label}`,onClick:f=>{f.stopPropagation(),a()},children:d.jsx(Hi,{size:16,className:"compute-chevron"})})]}),r&&d.jsxs("div",{className:"compute-row-body",children:[d.jsx("h3",{className:"persona-section-title",children:"Skills"}),d.jsx("p",{className:"settings-note",children:"Installed fresh into every chat session's worktree — the agent auto-loads them."}),d.jsx("div",{className:"persona-skill-list",children:e.skills.map(f=>{const g=c===f.name;return d.jsxs("div",{className:"persona-skill",children:[d.jsxs("button",{type:"button",className:"persona-skill-head","aria-expanded":g,onClick:()=>u(g?null:f.name),children:[d.jsx(Hi,{size:14,className:"compute-chevron",style:g?{transform:"rotate(180deg)"}:void 0}),d.jsx("span",{className:"persona-skill-name",children:f.name}),d.jsx("span",{className:"persona-skill-desc",children:f.description})]}),g&&d.jsx("div",{className:"persona-doc",children:d.jsx(ao,{text:f.content})})]},f.name)})}),d.jsx("h3",{className:"persona-section-title",children:"System prompt"}),d.jsxs("p",{className:"settings-note",children:["Injected into every chat turn; ",d.jsx("code",{children:"{token}"})," placeholders are filled with project facts at render time."," ",d.jsxs("button",{type:"button",className:"btn sm",onClick:()=>m(!h),children:[h?"Hide":"Show"," system prompt"]})]}),h&&d.jsx("div",{className:"persona-doc",children:d.jsx(ao,{text:e.systemPrompt})})]})]})}function hP({project:e,onProjectUpdated:t}){const[n,r]=O.useState(null),[i,a]=O.useState(null),[l,c]=O.useState(null),[u,h]=O.useState(null),[m,f]=O.useState(!1);O.useEffect(()=>{I7().then(_=>{r(_),a(null)}).catch(_=>a(_ instanceof Error?_.message:String(_)))},[]);const g=(e==null?void 0:e.persona)??"research";async function v(_){if(!(!e||m)){f(!0),c(null);try{t(await V1(e.id,{persona:_}))}catch(x){c(x instanceof Error?x.message:String(x))}finally{f(!1)}}}const k=(e==null?void 0:e.autoPrompts)??{};async function S(_,x){if(!(!e||m)){f(!0),c(null);try{t(await V1(e.id,{autoPrompts:{...k,[_]:x}}))}catch(w){c(w instanceof Error?w.message:String(w))}finally{f(!1)}}}const y=[{key:"playSession",label:"Play session ended",hint:"prompt the agent to ask how it felt and record your verdict"},{key:"playBuildFailed",label:"Play build failed",hint:"prompt the agent to read the log and fix the branch"},{key:"runCompleted",label:"Job / sim run completed",hint:"prompt the agent to analyze the result and continue the loop"}];return d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:"Persona"}),d.jsxs("p",{className:"settings-sub",children:["Who the agent is for"," ",e?d.jsx("strong",{children:e.name}):"this project",": each persona sets the system prompt and the skills injected into every chat session."]}),!e&&d.jsx("p",{className:"settings-note",children:"Open a project to switch its persona."}),i&&d.jsx("div",{className:"error",children:i}),l&&d.jsx("div",{className:"error",children:l}),n&&d.jsx("div",{className:"compute-list",children:n.map(_=>d.jsx(uP,{persona:_,isActive:g===_.id,hasProject:e!==null,open:u===_.id,saving:m,onToggle:()=>h(u===_.id?null:_.id),onActivate:()=>void v(_.id)},_.id))}),e&&d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"persona-section-title",children:"Automatic agent prompts"}),d.jsxs("p",{className:"settings-note",children:["When enabled, the dashboard sends the agent an ",d.jsx("code",{children:"[orx]"})," message as these events finish (only while it's idle). All off by default — the agent only acts when you talk to it."]}),d.jsx("div",{className:"persona-prompt-toggles",children:y.map(_=>d.jsxs("label",{className:"persona-prompt-toggle",children:[d.jsx("input",{type:"checkbox",checked:k[_.key]===!0,disabled:m,onChange:x=>void S(_.key,x.target.checked)}),d.jsxs("span",{children:[d.jsx("span",{className:"persona-prompt-label",children:_.label}),d.jsxs("span",{className:"persona-prompt-hint",children:[" — ",_.hint]})]})]},_.key))})]})]})}function dP(){const[e,t]=O.useState(A8());function n(r){t(r),u$(r)}return d.jsxs("div",{className:"settings-section",children:[d.jsx("h1",{children:"Appearance"}),d.jsxs("p",{className:"settings-sub",children:["Themes from the tradition of Sanzo Wada’s ",d.jsx("em",{children:"A Dictionary of Color Combinations"}),". Pick one to retint the whole workspace — it applies instantly and is remembered on this device."]}),d.jsx("div",{className:"theme-grid",children:Rg.map(r=>d.jsxs("button",{className:`theme-card ${e===r.id?"active":""}`,onClick:()=>n(r.id),title:r.name,children:[d.jsxs("span",{className:"theme-swatches",style:{background:r.tokens["--canvas"]},children:[d.jsx("i",{style:{background:r.primary}}),d.jsx("i",{style:{background:r.tokens["--panel"]}}),d.jsx("i",{style:{background:r.tokens["--surface-bright"]}}),d.jsx("i",{style:{background:r.tokens["--text"]}})]}),d.jsxs("span",{className:"theme-meta",children:[d.jsx("span",{className:"theme-name",children:r.name}),d.jsx("span",{className:"theme-jp",children:r.jp})]}),e===r.id&&d.jsx("span",{className:"theme-check",children:"✓"})]},r.id))})]})}const v5=[{id:"appearance",label:"Appearance",icon:d.jsx(fT,{size:15})},{id:"persona",label:"Persona",icon:d.jsx(OA,{size:15})},{id:"harnesses",label:"Harnesses",icon:d.jsx(E7,{size:15})},{id:"generative-ai",label:"Generative AI",icon:d.jsx(MT,{size:15})},{id:"compute",label:"Compute",icon:d.jsx(jA,{size:15})},{id:"instances",label:"Instances",icon:d.jsx(G1,{size:15})},{id:"environment",label:"Environment",icon:d.jsx(DT,{size:15})},{id:"git",label:"Git",icon:d.jsx(Ol,{size:15})},{id:"storage",label:"Storage",icon:d.jsx(KA,{size:15})}];function fP({tab:e,project:t=null,onProjectUpdated:n=()=>{}}){return d.jsxs("div",{className:"settings-view",children:[e==="appearance"&&d.jsx(dP,{}),e==="persona"&&d.jsx(hP,{project:t,onProjectUpdated:n}),e==="harnesses"&&d.jsx(C$,{}),e==="generative-ai"&&d.jsx(E$,{}),e==="compute"&&d.jsx(K$,{project:t}),e==="environment"&&d.jsxs(d.Fragment,{children:[d.jsx("h1",{children:"Environment"}),d.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Variables available to runs and the research agent (API keys, tokens)."}),d.jsx(rP,{})]}),e==="instances"&&d.jsx(cP,{}),e==="git"&&d.jsx(iP,{}),e==="storage"&&d.jsx(aP,{})]})}function pP({skills:e,activeIndex:t,onPick:n,onHover:r}){return d.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] left-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden",children:e.map((i,a)=>d.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-left py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-md [&_.skill-hint]:text-muted [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${a===t?"active":""}`,onMouseDown:l=>{l.preventDefault(),n(i)},onMouseEnter:()=>r(a),children:[d.jsxs("span",{className:"skill-name",children:["/",i.name," ",d.jsx("span",{className:"skill-hint",children:i.argHint})]}),d.jsx("span",{className:"skill-desc",children:i.description})]},i.name))})}function mP({cmd:e}){const[t,n]=O.useState(!1);return d.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[d.jsx("code",{className:Tn,children:e}),d.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(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})},"aria-label":t?"Copied":`Copy ${e}`,title:t?"Copied":"Copy",children:t?d.jsx(kr,{size:11,strokeWidth:3}):d.jsx(Sd,{size:11})})]})}function L2(e){return e?e.split(/`([^`]+)`/).map((t,n)=>n%2===1?d.jsx(mP,{cmd:t},n):t):null}function b5({harness:e,size:t=16}){const n=`block shrink-0${e==="claude-code"?" text-[#d97757]":""}`;return e==="claude-code"?d.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.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"?d.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):d.jsx("svg",{className:n,width:t,height:t,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:d.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 O8=["model-group flex items-center justify-between gap-2","text-md font-semibold text-text pt-2.5 px-2 pb-1.5"].join(" "),y5=["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-xs text-muted"].join(" "),tu={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function _5(e){var r,i;const t=e.find(a=>a.agentReady);if(!t)return null;const n=((r=t.models[0])==null?void 0:r.id)??null;return{harness:t.id,model:n,permissionMode:((i=t.options)==null?void 0:i.defaultPermissionMode)??null,reasoningLevel:_v(t,n).defaultId}}function Bu(e){const[t,n]=O.useState(!1),r=O.useRef(null);return O.useEffect(()=>{if(!t)return;const i=l=>{var c;(c=r.current)!=null&&c.contains(l.target)||n(!1)},a=l=>{var c;l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),n(!1),(c=e==null?void 0:e.current)==null||c.focus())};return document.addEventListener("mousedown",i,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",i,!0),document.removeEventListener("keydown",a,!0)}},[t,e]),{open:t,setOpen:n,ref:r}}function gP({value:e,onSelect:t,permissionChoices:n=[],defaultPermissionId:r,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:l,onSelectReasoning:c,onHarnesses:u,lockHarness:h=!1}){var L,I,Y,G,se;const[m,f]=O.useState([]),g=O.useRef(null),v=O.useRef(null),{open:k,setOpen:S,ref:y}=Bu(g),[_,x]=O.useState(""),[w,C]=O.useState("root"),T=()=>{S(!1),C("root"),x("")};O.useEffect(()=>{var oe;k&&(w==="reasoning"||w==="permissions")&&((oe=v.current)==null||oe.focus())},[k,w]),O.useEffect(()=>{let oe=!0;const fe=(q=!1)=>Sl(q).then(ne=>{oe&&(f(ne),u==null||u(ne))}).catch(()=>{});fe();const te=wv(()=>void fe(!0));return()=>{oe=!1,te()}},[]);const N=O.useMemo(()=>{const oe=_.trim().toLowerCase();return(h&&e?m.filter(te=>te.id===e.harness):m).map(te=>{let q=te.models;if(oe)q=q.filter(ne=>ne.id.toLowerCase().includes(oe));else if(te.id==="opencode"){const ne=[],le=new Set;for(const ye of te.models){const ve=ye.id.split("/")[0]??ye.id;le.has(ve)||(le.add(ve),ne.push(ye))}for(const ye of te.models){if(ne.length>=6)break;ne.includes(ye)||ne.push(ye)}q=ne}return{harness:te,models:q,hidden:oe?0:te.models.length-q.length}})},[m,_,h,e]),j=(oe,fe)=>{var q;const te=(e==null?void 0:e.harness)===oe.id;t({harness:oe.id,model:fe,permissionMode:te?e.permissionMode:((q=oe.options)==null?void 0:q.defaultPermissionMode)??null,reasoningLevel:V7(oe,fe,te?e.reasoningLevel:null)}),T()},A=(e==null?void 0:e.model)!=null?(L=m.find(oe=>oe.id===e.harness))==null?void 0:L.models.find(oe=>oe.id===e.model):void 0,D=e?e.model?A?X0(A):xv(e.model):"Default model":"Model",B=(e==null?void 0:e.reasoningLevel)??l??((I=a[0])==null?void 0:I.id),H=(Y=a.find(oe=>oe.id===B))==null?void 0:Y.label,V=(e==null?void 0:e.permissionMode)??r??((G=n[0])==null?void 0:G.id),U=(se=n.find(oe=>oe.id===V))==null?void 0:se.label,P=(e==null?void 0:e.harness)==="opencode"?"Variant":"Effort",K=oe=>{c==null||c(oe),T()},W=oe=>{i==null||i(oe),T()},Z=(oe,fe,te)=>d.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-md text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>C(te),children:[d.jsx("span",{className:"flex-1",children:oe}),fe&&d.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:fe}),d.jsx(po,{size:14,className:"shrink-0 text-muted"})]}),ee=oe=>d.jsxs("button",{ref:v,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-left text-sm font-medium text-text hover:bg-surface",onClick:()=>{C("root"),x("")},children:[d.jsx(bA,{size:15}),oe]}),z=(oe,fe,te,q)=>d.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:oe.map(ne=>d.jsxs("button",{className:ml,onClick:()=>q(ne.id),children:[d.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[d.jsxs("span",{children:[ne.label,ne.id===te&&d.jsx("span",{className:"font-normal text-muted",children:" · Default"})]}),ne.description&&d.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:ne.description})]}),ne.id===fe&&d.jsx(kr,{size:13})]},ne.id))});return d.jsxs("div",{className:"model-picker relative inline-flex","data-onboarding":"model-picker",ref:y,children:[d.jsxs("button",{ref:g,type:"button",className:"composer-pill inline-flex items-center gap-[5px] text-md text-text py-[5px] px-2 rounded-sm whitespace-nowrap transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:"Harness + model for this chat","aria-haspopup":"menu","aria-expanded":k,onClick:()=>{k?T():(C("root"),S(!0))},children:[(e==null?void 0:e.harness)&&d.jsx(b5,{harness:e.harness,size:14}),D,H&&d.jsx("span",{className:"model-picker-reasoning ml-0.5 text-muted",children:H}),d.jsx(Hi,{size:14,className:"text-muted"})]}),k&&d.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)] z-50 overflow-hidden w-72 [&.align-right]:left-auto [&.align-right]:right-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:[w==="root"&&d.jsxs("div",{className:"model-root-menu p-1",children:[Z("Model",D,"models"),a.length>0&&Z(P,H,"reasoning"),n.length>0&&Z("Mode",U,"permissions")]}),w==="models"&&d.jsxs(d.Fragment,{children:[ee("Model"),d.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:_,onChange:oe=>x(oe.target.value)}),d.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[N.map(({harness:oe,models:fe,hidden:te})=>d.jsxs("div",{className:"[&_.model-item]:pl-6",children:[d.jsxs("div",{className:O8,children:[d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(b5,{harness:oe.id,size:14}),oe.name]}),!oe.agentReady&&d.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[d.jsx(u3,{size:10})," Unavailable"]})]}),oe.agentReady?d.jsxs(d.Fragment,{children:[oe.models.length===0&&d.jsxs("button",{className:ml,onClick:()=>j(oe,null),children:[d.jsxs("span",{children:["Default model",d.jsx("span",{className:"model-id",children:"CLI configuration"})]}),(e==null?void 0:e.harness)===oe.id&&(e==null?void 0:e.model)===null&&d.jsx(kr,{size:13})]}),fe.map(q=>d.jsxs("button",{className:ml,title:q.id,onClick:()=>j(oe,q.id),children:[d.jsx("span",{children:X0(q)}),(e==null?void 0:e.harness)===oe.id&&(e==null?void 0:e.model)===q.id&&d.jsx(kr,{size:13})]},q.id)),te>0&&d.jsxs("div",{className:y5,children:[te," more — search to find"]}),_.trim().length>0&&!oe.models.some(q=>q.id===_.trim())&&d.jsx("button",{className:ml,onClick:()=>j(oe,_.trim()),children:d.jsxs("span",{children:["Use “",_.trim(),"”",d.jsx("span",{className:"model-id",children:"pass as the model id"})]})})]}):d.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-xs text-muted model-unavailable leading-normal border-b border-b-border-variant",children:oe.agentNote?L2(oe.agentNote):"Not available"})]},oe.id)),m.length===0&&d.jsx("div",{className:y5,children:"Detecting harnesses…"})]}),h&&e&&m.length>1&&d.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-xs text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[d.jsx(u3,{size:11}),"Sessions keep their harness — new chat to switch"]})]}),w==="reasoning"&&d.jsxs(d.Fragment,{children:[ee(P),z(a,B,l,K)]}),w==="permissions"&&d.jsxs(d.Fragment,{children:[ee("Mode"),z(n,V,r,W)]})]})]})}function w1({choices:e,value:t,defaultId:n,header:r,align:i="left",variant:a="pill",title:l,numbered:c=!1,menuDirection:u="up",onSelect:h}){var C,T;const{open:m,setOpen:f,ref:g}=Bu();if(e.length===0)return null;const v=t??n??((C=e[0])==null?void 0:C.id)??null,k=e.find(N=>N.id===v),S=e.find(N=>N.id===n),y=a==="bare"&&(S==null?void 0:S.id)===K0?S:void 0,_=y?e.filter(N=>N.id!==y.id):e,x=(k==null?void 0:k.label)??((T=e[0])==null?void 0:T.label)??"",w=N=>{h(N),f(!1)};return d.jsxs("div",{className:"option-picker relative inline-flex",ref:g,children:[d.jsxs("button",{type:"button",className:a==="pill"?"composer-pill inline-flex items-center gap-[5px] text-md text-text py-[5px] px-2 rounded-sm whitespace-nowrap transition-[background] duration-150 ease-standard [&:hover]:bg-surface":"composer-bare inline-flex items-center gap-[3px] text-md text-text py-[5px] px-1 rounded-sm transition-[background] duration-150 ease-standard [&:hover]:bg-surface [&.context-ring]:inline-flex [&.context-ring]:items-center [&.context-ring]:mr-2",title:l,onClick:()=>f(N=>!N),children:[d.jsx("span",{className:"pill-label",children:x}),d.jsx(Hi,{size:12})]}),m&&d.jsxs("div",{className:`option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(N=>N.description)?"min-w-80":""} ${i==="right"?"align-right":""} ${u==="down"?"drop-down":""}`,children:[r&&d.jsx("div",{className:O8,children:r}),y&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:ml,onClick:()=>w(y.id),children:[d.jsxs("span",{children:[y.label,d.jsx("span",{className:"option-default text-muted font-normal",children:y.label==="Default"?" · CLI configuration":" · Default"})]}),v===y.id&&d.jsx(kr,{size:13})]}),d.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),_.map((N,j)=>d.jsxs("button",{className:ml,onClick:()=>w(N.id),children:[d.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[d.jsxs("span",{children:[N.label,!y&&N.id===n&&d.jsx("span",{className:"option-default text-muted font-normal",children:" · Default"})]}),N.description&&d.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:N.description})]}),v===N.id?d.jsx(kr,{size:13}):c&&d.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:j+1})]},N.id))]})]})}function vP(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const Og=6.5,x5=2*Math.PI*Og;function bP({usage:e}){return!e||e.usedTokens<=0?null:d.jsx(yP,{usage:e})}function yP({usage:e}){const{open:t,setOpen:n,ref:r}=Bu(),{usedTokens:i,contextWindow:a}=e,l=a&&a>0?Math.min(100,Math.round(i/a*100)):null,c=l===null?"var(--accent)":vP(l);return d.jsxs("div",{className:"option-picker relative inline-flex",ref:r,children:[d.jsx("button",{type:"button",className:"composer-bare inline-flex items-center gap-[3px] text-md text-text py-[5px] px-1 rounded-sm transition-[background] duration-150 ease-standard [&:hover]:bg-surface [&.context-ring]:inline-flex [&.context-ring]:items-center [&.context-ring]:mr-2 context-ring",title:"Context window used",onClick:()=>n(u=>!u),children:l===null?e0(i):d.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[d.jsx("circle",{cx:"8",cy:"8",r:Og,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),d.jsx("circle",{cx:"8",cy:"8",r:Og,fill:"none",stroke:c,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${x5*Math.max(l,2)/100} ${x5}`,transform:"rotate(-90 8 8)"})]})}),t&&d.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-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:[d.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[d.jsx("span",{children:"Context window"}),d.jsx("span",{className:"context-meter-value text-text tabular-nums",children:l===null?`${e0(i)} tokens`:`${e0(i)} / ${e0(a)} (${l}%)`})]}),l!==null&&d.jsx(D8,{value:i,max:a,fillColor:c})]})]})}const B8="orx:agent-selection";function z8(e){switch(e){case"game-designer":return"Game designer persona";case"idea-foundry":return"Idea foundry persona";case"analyst":return"Analyst persona";case"producer":return"Producer persona";case"blender":return"Blender artist persona";case"comfyui":return"ComfyUI artist persona";default:return"Research agent persona"}}function _P(){try{const e=localStorage.getItem(B8);return e?JSON.parse(e):null}catch{return null}}const O2="local-";function xP(e,t){const n=e.findIndex(i=>i.id===t.id);if(n>=0){const i=e.slice();return i[n]=t,i}return[...t.role==="user"?e.filter(i=>!i.id.startsWith(O2)):e,t]}function wP(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{}};case"seed":return t.onlyIfAbsent&&t.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages},queuedBySession:{...e.queuedBySession,[t.sessionId]:t.queued??[]}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:xP(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((a,l)=>r.push({id:`img${l}`,type:"image",text:a}));const i={id:`${O2}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,i]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":{const n=new Set(t.sessions),r=new Set(t.known);for(const i of e.busySessions)r.has(i)||n.add(i);return{...e,busySessions:n}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[t.sessionId]:t.items}};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);r.delete(t.sessionId);const i={...e.queuedBySession};return delete i[t.sessionId],{messagesBySession:n,busySessions:r,queuedBySession:i}}}}function SP({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?d.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):d.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Zd(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function kP(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function w5(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function B2(e){var l,c;const t=e.tool??"tool",n=((l=e.state)==null?void 0:l.input)??{},r=typeof n.command=="string"?n.command:null,i=typeof n.filePath=="string"?n.filePath:null,a=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return i?`Read ${w5(i)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return i?`Edited ${w5(i)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebSearch":{if(typeof n.query=="string"&&n.query)return`Searched the web: “${n.query}”`;const u=typeof n.url=="string"?n.url:null;return typeof n.pattern=="string"&&n.pattern&&u?`Searched “${n.pattern}” in ${u}`:u?`Opened ${u}`:n.type==="other"?"Browsed the web":a??"Searched the web"}case"WebFetch":return typeof n.url=="string"?`Fetched ${n.url}`:a??"Fetched a page";case"Task":return a??"Ran a subagent";case"subagent":return CP(n);case"error":return"Error";case"interrupted":return"Interrupted";default:{const u=a??i??r??((c=e.state)==null?void 0:c.title)??"";return u?`${t}: ${u}`:t}}}function CP(e){const t=r=>r.length>60?`${r.slice(0,60)}…`:r,n=typeof e.prompt=="string"&&e.prompt?` — “${t(e.prompt)}”`:"";switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return`Spawned agent${n}`;case"sendInput":return`Sent input to agent${n}`;case"resumeAgent":return"Resumed agent";case"wait":return"Waiting on agent";case"closeAgent":return"Closed agent"}switch(typeof e.kind=="string"?e.kind:""){case"started":return"Sub-agent started";case"interacted":return"Sub-agent activity";case"interrupted":return"Sub-agent interrupted"}return"Sub-agent"}function S5({part:e,onOpenFile:t}){var c,u;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.command)=="string"?n.input.command:null,a=typeof((u=n==null?void 0:n.input)==null?void 0:u.filePath)=="string"?n.input.filePath:null,l=!!(r||i||a);return d.jsxs("details",{className:"tool-row",open:!1,children:[d.jsxs("summary",{children:[d.jsx("span",{className:Zd(n==null?void 0:n.status)}),d.jsx("span",{className:"tool-line",children:B2(e)}),a&&t&&d.jsx("button",{className:"tool-open file-link",title:`Open ${a}`,onClick:h=>{h.preventDefault(),h.stopPropagation(),t(a)},children:"open"})]}),l&&d.jsxs("div",{className:"tool-detail",children:[i&&d.jsx("div",{className:"tool-cmd-full",children:i}),r&&d.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function EP({parts:e,onOpenFile:t}){const n=e.some(u=>{var h;return((h=u.state)==null?void 0:h.status)==="running"}),r=e.some(u=>{var h;return((h=u.state)==null?void 0:h.status)==="error"}),[i,a]=O.useState(!1);if(e.length===1)return d.jsx("div",{className:`tool-group ${r?"has-error":""}`,children:d.jsx(S5,{part:e[0],onOpenFile:t})});const l=i||n,c=`Used ${e.length} tools`;return d.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[d.jsxs("button",{className:"tool-group-summary",onClick:()=>a(u=>!u),children:[d.jsx("span",{className:Zd(n?"running":r?"error":"completed")}),d.jsx("span",{className:"tool-line",children:c}),d.jsx(po,{size:12,className:`tool-chevron ${l?"open":""}`})]}),l&&d.jsx("div",{className:"tool-group-rows",children:e.map(u=>d.jsx(S5,{part:u,onOpenFile:t},u.id))})]})}function NP({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r,fileSrc:i}){var f,g,v;const a=e.prompt,[l,c]=O.useState([]),u=!t,h=k=>t==null?void 0:t({promptId:e.id,...k});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const S=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",y=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return d.jsxs("details",{className:"prompt-collapsed",children:[d.jsxs("summary",{children:[d.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),d.jsx("span",{className:`prompt-outcome ${y}`,children:S})]}),d.jsxs("div",{className:"prompt-collapsed-body",children:[d.jsx(ao,{text:a.plan??"",onOpenFile:n,fileSrc:i}),a.note&&d.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const k=(a.answers??[]).join(", ")||a.note||"";return d.jsxs("details",{className:"prompt-collapsed",children:[d.jsxs("summary",{children:[d.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),d.jsx("span",{className:`prompt-outcome ${k?"chosen":""}`,children:k||"Resolved"})]}),d.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&d.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&d.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(S=>{var y;return d.jsx("li",{className:(y=a.answers)!=null&&y.includes(S.label)?"sel":"",children:S.label},S.label)})}),a.note&&a.note!==k&&d.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const k=!!r;return d.jsxs("div",{className:`prompt-card plan ${u?"readonly":""}`,children:[d.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),d.jsx("div",{className:`prompt-plan ${k?"clamped":""}`,children:d.jsx(ao,{text:a.plan??"",onOpenFile:n,fileSrc:i})}),k&&d.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!u&&!k&&d.jsxs("div",{className:"prompt-actions",children:[d.jsx("button",{className:"btn-primary",onClick:()=>h({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),d.jsx("button",{className:"btn-ghost",onClick:()=>h({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),d.jsx("button",{className:"btn-ghost",onClick:()=>h({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const k=typeof((f=a.toolInput)==null?void 0:f.command)=="string"&&a.toolInput.command||typeof((g=a.toolInput)==null?void 0:g.filePath)=="string"&&a.toolInput.filePath||"",S=typeof((v=a.toolInput)==null?void 0:v.reason)=="string"&&a.toolInput.reason||"";return d.jsxs("div",{className:`prompt-card permission ${u?"readonly":""}`,children:[d.jsxs("div",{className:"prompt-head",children:["Permission needed: ",d.jsx("code",{children:a.tool})]}),k&&d.jsx("div",{className:"prompt-sub",children:k}),S&&d.jsx("div",{className:"prompt-sub",children:S}),!u&&d.jsxs("div",{className:"prompt-actions",children:[d.jsx("button",{className:"btn-primary",onClick:()=>h({approve:!0}),children:"Allow"}),d.jsx("button",{className:"btn-ghost",onClick:()=>h({approve:!1}),children:"Deny"})]})]})}const m=k=>c(S=>a.multiSelect?S.includes(k)?S.filter(y=>y!==k):[...S,k]:[k]);return d.jsxs("div",{className:`prompt-card question ${u?"readonly":""}`,children:[a.header&&d.jsx("div",{className:"prompt-head",children:a.header}),a.question&&d.jsx("div",{className:"prompt-q",children:a.question}),d.jsx("div",{className:"prompt-options",children:(a.options??[]).map(k=>{const S=l.includes(k.label);return d.jsxs("button",{className:`prompt-option ${S?"sel":""}`,disabled:u,onClick:()=>u?void 0:a.multiSelect?m(k.label):h({answers:[k.label]}),children:[d.jsx("span",{className:"prompt-option-label",children:k.label}),k.description&&d.jsx("span",{className:"prompt-option-desc",children:k.description})]},k.label)})}),a.multiSelect&&!u&&d.jsx("div",{className:"prompt-actions",children:d.jsx("button",{className:"btn-primary",disabled:l.length===0,onClick:()=>h({answers:l}),children:"Submit"})})]})}function I8(e){return e.type==="prompt"?!!e.prompt&&!(e.prompt.resolved&&e.prompt.kind==="permission"):e.type==="text"||e.type==="reasoning"?!!e.text:!0}function AP(e){return e.role==="user"?!0:e.parts.some(I8)}const TP=O.memo(function({message:t,onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,skills:l,fileSrc:c}){if(t.role==="user"){const u=t.parts.filter(g=>g.type==="text").map(g=>g.text??"").join(` +`),h=u.match(/^\/(\S+)([\s\S]*)$/),m=h?l==null?void 0:l.find(g=>g.name===h[1]):void 0,f=t.parts.filter(g=>g.type==="image"&&g.text).map(g=>g.text.startsWith("data:")?g.text:lj(g.text));return d.jsxs("div",{className:"msg-user",children:[m?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"skill-chip",children:["/",m.name]}),h[2]]}):u,f.length>0&&d.jsx("div",{className:"msg-images",children:f.map((g,v)=>d.jsx("a",{href:g,target:"_blank",rel:"noreferrer",children:d.jsx("img",{src:g,alt:"attachment"})},v))})]})}return d.jsx("div",{className:"msg-assistant",children:H8(t.parts,{onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,fileSrc:c})})});function H8(e,t){var m;const{onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,fileSrc:l}=t,c=[];let u=[];const h=()=>{u.length!==0&&(c.push(d.jsx(EP,{parts:u,onOpenFile:n},`tg-${u[0].id}`)),u=[])};for(const f of e)if(I8(f)){if(f.type==="tool"&&(f.tool==="subagent"||(((m=f.children)==null?void 0:m.length)??0)>0)){h(),c.push(d.jsx(jP,{part:f,onOpenSubagent:a},f.id));continue}if(f.type==="tool"){u.push(f);continue}h(),f.type==="text"?c.push(d.jsx(ao,{text:f.text,onOpenFile:n,fileSrc:l},f.id)):f.type==="reasoning"?c.push(d.jsxs("details",{className:"reasoning",children:[d.jsx("summary",{children:"thinking…"}),f.text]},f.id)):f.type==="prompt"&&f.prompt&&c.push(d.jsx(NP,{part:f,onRespond:r,onOpenFile:n,onOpenPlan:i,fileSrc:l},f.id))}return h(),c}function F8(e,t){for(const n of e){if(n.id===t)return n;const r=n.children&&F8(n.children,t);if(r)return r}return null}function MP({spawn:e,onOpenFile:t,onOpenSubagent:n}){var l,c;const r=e.children??[],i=((l=e.state)==null?void 0:l.status)==="running",a=H8(r,{onOpenFile:t,onOpenSubagent:n});return d.jsxs("div",{className:"msg-assistant",children:[d.jsxs("div",{className:"subagent-tab-header",children:[d.jsx("span",{className:Zd((c=e.state)==null?void 0:c.status)}),d.jsx("span",{className:"tool-line",children:B2(e)}),i&&d.jsx("span",{className:"subagent-live",children:"live"})]}),a.length===0?d.jsx("div",{className:"subagent-empty",children:i?"Working…":"No activity"}):a]})}function jP({part:e,onOpenSubagent:t}){var r,i;const n=((r=e.state)==null?void 0:r.status)==="error";return d.jsxs("button",{className:`subagent-row ${n?"has-error":""}`,title:"Open sub-agent transcript",onClick:()=>t==null?void 0:t(e.id),disabled:!t,children:[d.jsx(z7,{size:12,className:"subagent-icon"}),d.jsx("span",{className:Zd((i=e.state)==null?void 0:i.status)}),d.jsx("span",{className:"tool-line",children:B2(e)}),d.jsx(po,{size:12,className:"subagent-row-chevron"})]})}const DP=O.memo(function({messages:t,onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,skills:l,fileSrc:c}){return d.jsx(d.Fragment,{children:t.filter(AP).map(u=>d.jsx(TP,{message:u,onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,skills:l,fileSrc:c},u.id))})}),k5=(e,t)=>e==="all"?!0:e==="archived"?t:!t,$8=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function RP({value:e,onChange:t}){const{open:n,setOpen:r,ref:i}=Bu();return d.jsxs("div",{className:"rail-filter",ref:i,children:[d.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(a=>!a),children:d.jsx(AT,{size:13})}),n&&d.jsx("div",{className:"option-menu drop-down align-right",children:$8.map(a=>d.jsxs("button",{className:"model-item",onClick:()=>{t(a.id),r(!1)},children:[d.jsx("span",{children:a.label}),e===a.id&&d.jsx(kr,{size:13})]},a.id))})]})}function LP({proposal:e,personas:t,harnesses:n,onResolved:r}){var j;const[i,a]=O.useState(e.persona??""),[l,c]=O.useState(e.harness??""),[u,h]=O.useState(e.model??""),[m,f]=O.useState(!1),[g,v]=O.useState(null),[k,S]=O.useState(!1),y=io(i||"research"),_=y.Icon,x=n.filter(A=>A.agentReady),w=((j=x.find(A=>A.id===l))==null?void 0:j.models)??[],C=w.some(A=>A.id===u)?u:"",T=u&&!w.some(A=>A.id===u)?u:null;async function N(A){f(!0),v(null);try{await A(),r()}catch(D){v(D instanceof Error?D.message:"failed"),f(!1)}}return d.jsxs("div",{className:`proposal-card ${y.cls}`,style:{"--accent":y.color},children:[d.jsxs("div",{className:"proposal-eyebrow",children:[d.jsx(_,{size:14,style:{color:y.color}}),"Suggested next · ",d.jsx("b",{children:y.label})]}),d.jsx("div",{className:"proposal-task",title:e.task,children:e.task}),e.why&&d.jsx("div",{className:"proposal-why",children:e.why}),k&&d.jsxs("div",{className:"proposal-fields",children:[d.jsxs("label",{children:["Agent",d.jsx("select",{value:i,onChange:A=>a(A.target.value),disabled:m,children:t.map(A=>d.jsx("option",{value:A.id,children:A.label},A.id))})]}),d.jsxs("label",{children:["Provider",d.jsx("select",{value:l,onChange:A=>{c(A.target.value),h("")},disabled:m,children:x.map(A=>d.jsx("option",{value:A.id,children:A.name},A.id))})]}),d.jsxs("label",{children:["Model",d.jsxs("select",{value:C,onChange:A=>h(A.target.value),disabled:m,children:[d.jsx("option",{value:"",children:"(harness default)"}),w.map(A=>d.jsx("option",{value:A.id,children:xv(A.id)},A.id))]})]})]}),T&&d.jsxs("div",{className:"proposal-why",children:[io(i||"research").label," was suggested on"," ",d.jsx("code",{children:T}),", which this provider doesn't offer — it will run on the provider default unless you pick a model."]}),g&&d.jsx("div",{className:"proposal-err",children:g}),d.jsxs("div",{className:"proposal-actions",children:[d.jsx("button",{className:"proposal-approve",disabled:m||!l,onClick:()=>N(()=>XT(e.id,{persona:i||void 0,harness:l||void 0,model:C})),children:"Approve →"}),d.jsx("button",{className:"proposal-secondary",disabled:m,onClick:()=>S(A=>!A),children:k?"Done":"Change agent"}),d.jsx("button",{className:"proposal-secondary",disabled:m,onClick:()=>N(()=>KT(e.id)),children:"Dismiss"})]})]})}const OP=14,BP=500,zP=1200;function P8({title:e,animate:t}){return t?d.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((n,r)=>n===" "?d.jsx("span",{"aria-hidden":!0,children:n},r):d.jsx("span",{"aria-hidden":!0,className:"title-reveal-char",style:{animationDelay:`${Math.min(r*OP,BP)}ms`},children:n},r))}):d.jsx(d.Fragment,{children:e})}function IP({session:e,active:t,busy:n,waiting:r,persona:i,depth:a=0,revealTitle:l,onOpen:c,onRename:u,onSetArchived:h,onDelete:m}){var D;const{open:f,setOpen:g,ref:v}=Bu(),k=((D=e.title)==null?void 0:D.trim())||"Untitled",S=e.persona??i??"research",y=e.model??e.effectiveModel,_=`${tu[e.harness]??e.harness}${y?` · ${y}`:""}`,[x,w]=O.useState(!1),[C,T]=O.useState(""),N=O.useRef(null);function j(){var B;T(((B=e.title)==null?void 0:B.trim())||""),w(!0)}function A(){var H;const B=C.trim();w(!1),B&&B!==(((H=e.title)==null?void 0:H.trim())||"")&&u(B)}return O.useEffect(()=>{var B,H;x&&((B=N.current)==null||B.focus(),(H=N.current)==null||H.select())},[x]),d.jsxs("div",{ref:v,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${f?"menu-open":""} ${x?"editing":""} ${a>0?"nested":""}`,style:a>0?{paddingLeft:10+a*16}:void 0,title:`${tu[e.harness]}${y?` · ${y}`:""}`,onClick:()=>{x||(f?g(!1):c())},onKeyDown:B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),f?g(!1):c())},children:[d.jsx("span",{className:"session-dot",children:n&&d.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),d.jsx("span",{className:`persona-bar sm persona-${S}`,title:z8(S)}),x?d.jsx("input",{ref:N,className:"session-title-input","aria-label":"Session title",value:C,onChange:B=>T(B.target.value),onClick:B=>B.stopPropagation(),onBlur:A,onKeyDown:B=>{B.stopPropagation(),B.key==="Enter"?(B.preventDefault(),A()):B.key==="Escape"&&(B.preventDefault(),w(!1))}}):d.jsxs("span",{className:"session-titlewrap",children:[d.jsx("span",{className:"session-title",children:d.jsx(P8,{title:k,animate:l!==void 0},l??"static")}),d.jsxs("span",{className:"session-sub",title:`${io(S).label} · ${_}`,children:[d.jsx(X7,{persona:S,compact:!0,size:12}),_]})]}),d.jsx("span",{className:"session-time",children:kP(e.updatedAt)}),d.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:B=>{B.stopPropagation(),g(H=>!H)},children:d.jsx(T7,{size:14})}),f&&d.jsxs("div",{className:"option-menu drop-down session-menu",children:[d.jsx("button",{className:"model-item",onClick:B=>{B.stopPropagation(),g(!1),j()},children:d.jsx("span",{children:"Rename"})}),d.jsx("button",{className:"model-item",onClick:B=>{B.stopPropagation(),g(!1),h(!e.archived)},children:d.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),d.jsx("button",{className:"model-item danger",onClick:B=>{B.stopPropagation(),g(!1),m()},children:d.jsx("span",{children:"Delete"})})]})]})}function HP({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:i,mainView:a,onSelectMainView:l,panelOpen:c,onTogglePanel:u,onOpenFile:h,onOpenPlan:m,onOpenSubagent:f,onOpenWorktree:g,onStartTour:v,persona:k,baselineBranch:S,onActiveSessionChange:y,children:_}){var Xn,Ea,Eo;const[x,w]=O.useState([]),[C,T]=O.useState(null),[N,j]=O.useState([]),[A,D]=O.useState([]),B=()=>h3(e).then(j).catch(()=>{});O.useEffect(()=>{I7().then(D).catch(()=>{})},[]),O.useEffect(()=>{j([]);let ce=!0;const Se=()=>h3(e).then(Ie=>{ce&&j(Ie)}).catch(()=>{});Se();const Me=setInterval(Se,4e3);return()=>{ce=!1,clearInterval(Me)}},[e]);const[H,V]=O.useState([]);O.useEffect(()=>{V([]),WT(e).then(ce=>V(ce.branches)).catch(()=>V([]))},[e]);const[U,P]=O.useState("active"),[K,W]=O.useState(""),[Z,ee]=O.useState([]),[z,L]=O.useReducer(wP,{messagesBySession:{},busySessions:new Set,queuedBySession:{}}),[I,Y]=O.useState([]);O.useEffect(()=>{Sl().then(Y).catch(()=>{})},[]);const[G,se]=O.useState(_P),[oe,fe]=O.useState({}),[te,q]=O.useState(new Map),ne=O.useRef(new Map),le=O.useRef(new Set),ye=O.useRef(new Set),ve=O.useRef(0),Ee=O.useRef([]),je=O.useRef(null),Pe=O.useRef(null),$e=O.useRef(!0),Be=O.useRef(null),[Nt,Rt]=O.useState([]),[Lt,Ft]=O.useState(0),[an,wt]=O.useState(!1),[Je,pt]=O.useState(null),_e=O.useRef(null),[Ne,He]=O.useState(0);O.useLayoutEffect(()=>{He(Je&&_e.current?_e.current.offsetWidth+8:0),Qe()},[Je]);function Qe(){var ce;_e.current&&(_e.current.style.transform=`translateY(${-(((ce=Be.current)==null?void 0:ce.scrollTop)??0)}px)`)}const rt=O.useRef(!1);O.useEffect(()=>{ZM(e).then(Rt).catch(()=>{})},[e,a]);const $t=!Je&&K.startsWith("/")&&!/\s/.test(K)?K.slice(1):null,ct=$t!==null&&!an?Nt.filter(ce=>ce.name.startsWith($t.toLowerCase())):[],Fe=ct.length>0,et=Math.min(Lt,Math.max(0,ct.length-1));O.useEffect(()=>Ft(0),[$t]);function _t(ce){var Se;pt(ce),W(""),(Se=Be.current)==null||Se.focus()}function ut(){var ce;pt(null),(ce=Be.current)==null||ce.focus()}function on(ce){for(const Se of ce){if(!/^image\/(png|jpeg|gif|webp)$/.test(Se.type))continue;const Me=new FileReader;Me.onload=()=>{const Ie=Me.result;ee(Ve=>[...Ve,{dataUrl:Ie,mediaType:Se.type}])},Me.readAsDataURL(Se)}}function Gn(ce){const Se=Array.from(ce.clipboardData.items).filter(Me=>Me.kind==="file"&&Me.type.startsWith("image/")).map(Me=>Me.getAsFile()).filter(Me=>Me!==null);Se.length>0&&(ce.preventDefault(),on(Se))}const hn=x.find(ce=>ce.id===C),xn=hn?{harness:hn.harness,model:oe.model??hn.model,permissionMode:oe.permissionMode??hn.permissionMode,reasoningLevel:oe.reasoningLevel??hn.reasoningLevel}:G??_5(I),vt=xn?I.find(ce=>ce.id===xn.harness):void 0,wn=vt==null?void 0:vt.options,At=xn&&{...xn,reasoningLevel:V7(vt,xn.model,xn.reasoningLevel)},Vr=_v(vt,At==null?void 0:At.model),Mn=ce=>{if(!At)return;const Se={...At,...ce};se(Se),localStorage.setItem(B8,JSON.stringify(Se)),hn&&fe(Me=>({...Me,...ce}))},ki=ce=>Mn({permissionMode:ce}),Rs=ce=>Mn({reasoningLevel:ce});Ee.current=x;const Er=O.useCallback(async()=>{const ce=Ee.current.map(Se=>Se.id);try{const Se=(await R0(e)).filter(Ie=>!ye.current.has(Ie.id)),Me=new Set(Se.map(Ie=>Ie.id));for(const Ie of ce)Me.has(Ie)||Yr(Ie);return w(Ie=>{const Ve=new Map(Ie.map(at=>[at.id,at.contextUsage]));return Se.map(at=>({...at,contextUsage:at.contextUsage??Ve.get(at.id)}))}),ne.current=new Map(Se.map(Ie=>[Ie.id,Ie.title])),L({type:"seedBusy",sessions:Se.filter(Ie=>Ie.busy).map(Ie=>Ie.id),known:Se.map(Ie=>Ie.id)}),Se}catch{return null}},[e]);O.useEffect(()=>{w([]),Ee.current=[],T(null),W(""),pt(null),ee([]),L({type:"reset"}),le.current=new Set,q(new Map),ne.current=new Map,Er().then(ce=>{ce&&T(Se=>{var Me;return Se??((Me=ce.find(Ie=>!Ie.archived))==null?void 0:Me.id)??null})})},[e,Er]),O.useEffect(()=>{!C||le.current.has(C)||(le.current.add(C),L0(C).then(({messages:ce,queued:Se})=>L({type:"seed",sessionId:C,messages:ce,queued:Se})).catch(()=>{L({type:"seed",sessionId:C,messages:[],onlyIfAbsent:!0}),le.current.delete(C)}))},[C]),O.useEffect(()=>iu(ce=>{switch(ce.type){case"session":{if(ce.session.projectId!==e||ye.current.has(ce.session.id))return;const Se=ne.current.has(ce.session.id),Me=ne.current.get(ce.session.id)!==ce.session.title;ne.current.set(ce.session.id,ce.session.title),Se&&Me&&ce.session.titleSource==="generated"&&(q(Ie=>{const Ve=new Map(Ie);return Ve.set(ce.session.id,(Ie.get(ce.session.id)??0)+1),Ve}),window.setTimeout(()=>{q(Ie=>{if(!Ie.has(ce.session.id))return Ie;const Ve=new Map(Ie);return Ve.delete(ce.session.id),Ve})},zP)),w(Ie=>{const Ve=Ie.findIndex(Jt=>Jt.id===ce.session.id);if(Ve<0)return[ce.session,...Ie];const at=Ie.slice();return at[Ve]={...ce.session,contextUsage:ce.session.contextUsage??Ie[Ve].contextUsage},at});break}case"sessionDeleted":Yr(ce.sessionId);break;case"message":ve.current++,L({type:"upsertMessage",sessionId:ce.sessionId,message:ce.message});break;case"busy":L({type:"busy",sessionId:ce.sessionId,busy:ce.busy});break;case"queued":L({type:"setQueued",sessionId:ce.sessionId,items:ce.items});break;case"usage":w(Se=>Se.map(Me=>Me.id===ce.sessionId?{...Me,contextUsage:ce.usage}:Me));break}}),[e]),O.useEffect(()=>iu(ce=>{if(ce.type!=="reconnected"||(Er(),!C||!le.current.has(C)))return;const Se=Me=>{const Ie=ve.current;L0(C).then(({messages:Ve,queued:at})=>{L({type:"seed",sessionId:C,messages:Ve,queued:at}),Me&&ve.current!==Ie&&Se(!1)}).catch(()=>{})};Se(!0)}),[C,Er]);const jn=C?z.messagesBySession[C]??[]:[],hr=C?z.busySessions.has(C):!1,li=C?z.queuedBySession[C]??[]:[],ge=!!C&&!(C in z.messagesBySession),De=O.useMemo(()=>{const ce=new Set;for(const Se of z.busySessions)(z.messagesBySession[Se]??[]).some(Me=>Me.parts.some(Ie=>Ie.type==="prompt"&&Ie.prompt&&!Ie.prompt.resolved&&Ie.prompt.nativeId))&&ce.add(Se);return ce},[z.busySessions,z.messagesBySession]),it=C?De.has(C):!1,Ge=hn,zt=Ge?te.get(Ge.id):void 0,Wt=O.useMemo(()=>{var ce;for(let Se=jn.length-1;Se>=0;Se--)for(const Me of jn[Se].parts)if(Me.type==="prompt"&&((ce=Me.prompt)==null?void 0:ce.kind)==="plan"&&!Me.prompt.resolved)return{promptId:Me.id,plan:Me.prompt.plan??"",synthesized:!!Me.prompt.synthesized};return null},[jn]),dn=O.useMemo(()=>{const ce=Ge==null?void 0:Ge.harness;if(!C||ce!=="claude-code"&&ce!=="codex")return null;for(let Se=jn.length-1;Se>=0;Se--)for(const Me of jn[Se].parts)if(!(Me.type!=="prompt"||!Me.prompt||Me.prompt.resolved)&&Me.prompt.kind==="question")return Me.prompt.nativeId&&!z.busySessions.has(C)?null:Me.id;return null},[jn,Ge==null?void 0:Ge.harness,C,z.busySessions]),[Bt,$n]=O.useState(null),Wr=Bt&&Bt.sessionId===C?Bt:null;O.useEffect(()=>{if(!Bt)return;const ce=z.busySessions.has(Bt.sessionId),Se=Bt.sessionId===C&&Wt&&Wt.promptId!==Bt.promptId;(!ce||Se)&&$n(null)},[Bt,Wt,z.busySessions,C]);const ci=O.useMemo(()=>m&&C?(ce,Se)=>m(ce,C,Se):void 0,[m,C]),ko=O.useMemo(()=>f&&C?ce=>f(C,ce):void 0,[f,C]),Gl=O.useMemo(()=>h&&(ce=>h(ce,C??void 0)),[h,C]);O.useEffect(()=>fe({}),[C]),O.useEffect(()=>{y==null||y(C)},[C,y]);const Ls=a==="chat"&&(jn.length>0||hr);O.useLayoutEffect(()=>{$e.current=!0;const ce=je.current;ce&&(ce.scrollTop=ce.scrollHeight)},[C,Ls]),O.useLayoutEffect(()=>{const ce=je.current;ce&&$e.current&&(ce.scrollTop=ce.scrollHeight)},[jn,hr]),O.useEffect(()=>{const ce=je.current,Se=Pe.current;if(!ce||!Se)return;const Me=new ResizeObserver(()=>{$e.current&&(ce.scrollTop=ce.scrollHeight)});return Me.observe(Se),Me.observe(ce),()=>Me.disconnect()},[Ls]);async function Ci(){const ce=K.trim(),Se=Je?`/${Je.name}${ce?` ${ce}`:""}`:ce,Me=Z;if(!Se&&Me.length===0)return;if(Se&&dn&&Me.length===0){W(""),pt(null),Ti({promptId:dn,answers:[],note:Se}).then(at=>{at||W(Jt=>Jt||Se)});return}if(hr){if(!C||!(vt!=null&&vt.agentReady))return;const at=C;W(""),pt(null),ee([]);const Jt=At?{model:At.model,permissionMode:At.permissionMode,reasoningLevel:At.reasoningLevel}:{};fe({});const Pt=Me.map(en=>({mediaType:en.mediaType,dataBase64:en.dataUrl.slice(en.dataUrl.indexOf(",")+1)}));try{await p3(at,Se,Jt,Pt.length?Pt:void 0)}catch{W(en=>en||Se),ee(en=>en.length?en:Me)}return}if(!(vt!=null&&vt.agentReady))return;const Ie=At;if(!Ie&&!C)return;W(""),pt(null),ee([]);let Ve=C;try{if(!Ve){const Pt=await rj(e,Ie.harness,{model:Ie.model,permissionMode:Ie.permissionMode,reasoningLevel:Ie.reasoningLevel,persona:Bs});le.current.add(Pt.id),w(en=>[Pt,...en]),T(Pt.id),Ve=Pt.id}L({type:"optimisticUser",sessionId:Ve,text:Se,imageUrls:Me.map(Pt=>Pt.dataUrl)}),L({type:"busy",sessionId:Ve,busy:!0}),$e.current=!0,U==="archived"&&P("active");const at=Ie?{model:Ie.model,permissionMode:Ie.permissionMode,reasoningLevel:Ie.reasoningLevel}:{};fe({});const Jt=Me.map(Pt=>({mediaType:Pt.mediaType,dataBase64:Pt.dataUrl.slice(Pt.dataUrl.indexOf(",")+1)}));await p3(Ve,Se,at,Jt.length?Jt:void 0)}catch(at){if(W(Pt=>Pt||Se),ee(Pt=>Pt.length?Pt:Me),!Ve)return;const Jt=at instanceof Error?at.message:String(at);if(!/session is busy/i.test(Jt)&&await R0(e).then(en=>{var zs;return!!((zs=en.find(qu=>qu.id===Ve))!=null&&zs.busy)}).catch(()=>!1)){W(en=>en===Se?"":en),ee(en=>en===Me?[]:en);return}L({type:"busy",sessionId:Ve,busy:!1}),L({type:"upsertMessage",sessionId:Ve,message:{id:`${O2}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:`Message not sent: ${Jt}`}}],createdAt:Date.now()}})}}function Os(){C&&cj(C)}function Ei(ce){if(!C)return;const Se=C;L({type:"setQueued",sessionId:Se,items:li.filter(Me=>Me.id!==ce)}),oj(Se,ce).catch(()=>{})}O.useEffect(()=>{if(!hr||a!=="chat")return;function ce(Se){var Me;Se.key!=="Escape"||Se.defaultPrevented||(Se.preventDefault(),Os(),(Me=Be.current)==null||Me.focus())}return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[hr,C,a]);function Yr(ce){ye.current.add(ce),w(Se=>Se.filter(Me=>Me.id!==ce)),T(Se=>Se===ce?null:Se),le.current.delete(ce),ne.current.delete(ce),L({type:"forget",sessionId:ce})}function Ni(ce,Se){const Me=ce.archived;w(Ie=>Ie.map(Ve=>Ve.id===ce.id?{...Ve,archived:Se}:Ve)),k5(U,Se)||T(Ie=>Ie===ce.id?null:Ie),sj(ce.id,Se).catch(()=>{w(Ie=>Ie.map(Ve=>Ve.id===ce.id?{...Ve,archived:Me}:Ve))})}function Ai(ce,Se){const Me=ce.title;w(Ie=>Ie.map(Ve=>Ve.id===ce.id?{...Ve,title:Se}:Ve)),aj(ce.id,Se).catch(()=>{w(Ie=>Ie.map(Ve=>Ve.id===ce.id?{...Ve,title:Me}:Ve))})}async function Sn(ce){var Me;const Se=((Me=ce.title)==null?void 0:Me.trim())||"Untitled";if(window.confirm(`Delete "${Se}"? + +Its transcript is permanently removed.`)){try{await ij(ce.id)}catch(Ie){window.alert(`Failed to delete "${Se}": ${Ie instanceof Error?Ie.message:String(Ie)}`);return}Yr(ce.id)}}const Co=O.useCallback(ce=>mo(e,ce),[e]),Ti=O.useCallback(ce=>{if(!C)return Promise.resolve(!1);const Se=C;return L({type:"busy",sessionId:Se,busy:!0}),uj(Se,ce).then(()=>!0).catch(()=>!1).finally(()=>{L0(Se).then(({messages:Me,queued:Ie})=>L({type:"seed",sessionId:Se,messages:Me,queued:Ie})).catch(()=>{}),R0(e).then(Me=>{var Ie;return L({type:"busy",sessionId:Se,busy:!!((Ie=Me.find(Ve=>Ve.id===Se))!=null&&Ie.busy)})}).catch(()=>{})})},[C,e]),dr=x.filter(ce=>k5(U,ce.archived)),[Xr,Vl]=O.useState(!1),Xi=v5.some(ce=>ce.id===a),[Bs,Wl]=O.useState(Y7),Ki=d.jsxs("aside",{className:"session-rail floating-panel",children:[n,d.jsxs("nav",{className:"rail-nav",children:[d.jsxs("button",{className:"rail-nav-item","data-onboarding":"new-session",onClick:()=>{T(null),l("chat")},children:[d.jsx(bv,{size:15}),"New session"]}),d.jsxs("button",{className:`rail-nav-item ${a==="files"?"active":""}`,"data-onboarding":"nav-files",onClick:()=>l("files"),children:[d.jsx(gv,{size:15}),"Files"]}),d.jsxs("button",{className:`rail-nav-item ${a==="skills"?"active":""}`,onClick:()=>l("skills"),children:[d.jsx(E7,{size:15}),"Skills"]}),d.jsxs("button",{className:`rail-nav-item settings-toggle ${Xi?"active":""}`,"aria-expanded":Xr||Xi,onClick:()=>Vl(ce=>!ce),children:[d.jsx(ET,{size:15}),"Settings",d.jsx(po,{size:14,className:"settings-chev",style:{transform:Xr||Xi?"rotate(90deg)":"none"}})]}),(Xr||Xi)&&v5.map(ce=>d.jsxs("button",{className:`rail-nav-item rail-nav-sub ${a===ce.id?"active":""}`,"data-onboarding":ce.id==="compute"?"nav-compute":void 0,onClick:()=>l(ce.id),children:[ce.icon,ce.label]},ce.id))]}),d.jsxs("div",{className:"rail-body",children:[d.jsxs("div",{className:"rail-section-head",children:[d.jsx("div",{className:"rail-section-label",children:((Xn=$8.find(ce=>ce.id===U))==null?void 0:Xn.railLabel)??"Recents"}),d.jsx(RP,{value:U,onChange:P})]}),(()=>{const ce=new Map;for(const at of dr){const Jt=at.parentSessionId??"";(ce.get(Jt)??ce.set(Jt,[]).get(Jt)).push(at)}const Se=new Set(dr.map(at=>at.id)),Me=dr.filter(at=>!at.parentSessionId||!Se.has(at.parentSessionId)),Ie=(at,Jt)=>d.jsx(IP,{session:at,depth:Jt,active:at.id===C&&a==="chat",busy:z.busySessions.has(at.id),waiting:De.has(at.id),persona:k,revealTitle:te.get(at.id),onOpen:()=>{T(at.id),l("chat")},onRename:Pt=>Ai(at,Pt),onSetArchived:Pt=>Ni(at,Pt),onDelete:()=>void Sn(at)},at.id),Ve=(at,Jt)=>[Ie(at,Jt),...(ce.get(at.id)??[]).flatMap(Pt=>Ve(Pt,Jt+1))];return Me.flatMap(at=>Ve(at,0))})(),dr.length===0&&d.jsx("div",{className:"rail-empty",children:U==="archived"?"No archived sessions":x.length>0?"No active sessions":"No sessions yet"})]})]}),Zi=`chat-header${r?"":" rail-hidden"}`,fr=!r&&d.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:i,children:d.jsx(L7,{size:15})});return a!=="chat"?d.jsxs(d.Fragment,{children:[r&&Ki,d.jsxs("section",{className:"chat-pane",children:[!r&&d.jsx("div",{className:Zi,children:fr}),d.jsx("div",{className:"settings-view-scroll",children:_})]})]}):d.jsxs(d.Fragment,{children:[r&&Ki,d.jsxs("section",{className:"chat-pane",children:[d.jsxs("div",{className:Zi,children:[fr,(()=>{const ce=Ge?Ge.persona??"research":Bs;return d.jsxs(d.Fragment,{children:[d.jsx("span",{className:`persona-bar persona-${ce}`,title:z8(ce),style:{background:io(ce).color}}),d.jsx(dj,{value:ce,onChange:Wl,locked:!!Ge}),d.jsx(w1,{choices:H.map(Se=>({id:Se,label:Se})),value:S??null,header:"Baseline branch",align:"left",variant:"bare",menuDirection:"down",title:"Branch new baselines fork from",onSelect:Se=>{Se!==S&&V1(e,{baselineBranch:Se}).catch(Me=>console.error("baseline branch:",Me))}})]})})(),d.jsx("div",{className:"title",title:Ge?((Ea=Ge.title)==null?void 0:Ea.trim())||"Untitled":"New session",children:Ge?d.jsx(P8,{title:((Eo=Ge.title)==null?void 0:Eo.trim())||"Untitled",animate:zt!==void 0},zt??"static"):"New session"}),v&&d.jsx("button",{className:"icon-btn","data-tip":"Replay tour","aria-label":"Replay tour",onClick:v,children:d.jsx(xA,{size:15})}),g&&C&&d.jsx("button",{className:"icon-btn","data-tip":"View session worktree","aria-label":"View session worktree",onClick:()=>g(C),children:d.jsx(D7,{size:15})}),d.jsx("button",{className:`icon-btn ${c?"active":""}`,title:"Gallery","aria-label":"Gallery",onClick:u,children:d.jsx(R7,{size:15})})]}),ge?d.jsxs("div",{className:"chat-loading","aria-live":"polite","aria-busy":"true",children:[d.jsx("span",{className:"spinner"}),d.jsx("span",{children:"Loading conversation…"})]}):Ls?d.jsx("div",{className:"chat-thread",ref:je,onScroll:ce=>{const Se=ce.currentTarget;$e.current=Se.scrollHeight-Se.scrollTop-Se.clientHeight<60},children:d.jsxs("div",{className:"chat-thread-inner",ref:Pe,children:[d.jsx(DP,{messages:jn,onOpenFile:Gl,onRespond:Ti,onOpenPlan:ci,onOpenSubagent:ko,skills:Nt,fileSrc:Co}),N.filter(ce=>ce.status==="pending"&&ce.parentSessionId===C).map(ce=>d.jsx(LP,{proposal:ce,personas:A,harnesses:I,onResolved:B},ce.id)),hr&&(it?d.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):d.jsxs("div",{className:"working",children:[d.jsx("span",{className:"spinner"})," Working…"]}))]})}):d.jsxs("div",{className:"chat-empty",children:[d.jsx("h2",{children:d.jsx(Yc,{})}),d.jsx("p",{children:"Pitch a game idea — even one vague line. The Producer captures it into a thesis, gets it scored, and leads you to a playable, handing off to the other agents as it goes."}),d.jsx(SP,{harnesses:I,selection:G??_5(I)}),t&&d.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var Se;const ce=Nt.find(Me=>Me.name==="reproduce-paper");ce?(pt(ce),W(`${t} on `)):W(`/reproduce-paper ${t} on `),(Se=Be.current)==null||Se.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),d.jsxs("div",{className:"composer",children:[Wt&&!(Wr&&Wt.promptId===Wr.promptId)&&d.jsx(l$,{synthesized:Wt.synthesized,agentLabel:Ge?tu[Ge.harness]:"The agent",showResumeModes:(Ge==null?void 0:Ge.harness)==="claude-code",onView:()=>ci==null?void 0:ci(Wt.plan,Wt.promptId),onApprove:ce=>Ti({promptId:Wt.promptId,approve:!0,resumeMode:ce}),onReject:()=>Ti({promptId:Wt.promptId,approve:!1}),onRevise:ce=>{C&&$n({sessionId:C,promptId:Wt.promptId}),Ti({promptId:Wt.promptId,approve:!1,note:ce})}}),li.length>0&&d.jsx("div",{className:"composer-queued",children:li.map(ce=>d.jsxs("div",{className:"queued-chip",title:ce.text,children:[d.jsx(EA,{size:13,className:"queued-chip-icon"}),d.jsx("span",{className:"queued-chip-text",children:ce.text}),d.jsx("span",{className:"queued-chip-label",children:"Queued"}),d.jsx("button",{title:"Cancel queued message","aria-label":"Cancel queued message",onClick:()=>Ei(ce.id),className:"queued-chip-cancel",children:d.jsx(eo,{size:11})})]},ce.id))}),d.jsxs("div",{className:"composer-box","data-onboarding":"composer",children:[vt&&!vt.agentReady&&d.jsxs("div",{className:"composer-harness-warning",children:[d.jsxs("strong",{children:[vt.name," is unavailable."]})," ",vt.agentNote?L2(vt.agentNote):"Re-check its setup."]}),Fe&&d.jsx(pP,{skills:ct,activeIndex:et,onPick:_t,onHover:Ft}),Z.length>0&&d.jsx("div",{className:"composer-attachments",children:Z.map((ce,Se)=>d.jsxs("div",{className:"attachment-thumb",children:[d.jsx("img",{src:ce.dataUrl,alt:"pasted"}),d.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>ee(Me=>Me.filter((Ie,Ve)=>Ve!==Se)),children:d.jsx(eo,{size:11})})]},Se))}),d.jsxs("div",{className:"composer-input",children:[Je&&d.jsxs("span",{ref:_e,className:"skill-chip composer-chip",children:["/",Je.name]}),d.jsx("textarea",{ref:Be,value:K,style:Je?{textIndent:Ne}:void 0,onScroll:Qe,placeholder:dn?"Type a custom answer…":Je?["reproduce-paper","paper-to-marimo"].includes(Je.name)&&t?`[paper — optional, defaults to ${t}] on [compute]`:Je.argHint:At?vt!=null&&vt.agentReady?`Message ${tu[At.harness]}… ( / for skills)`:`${tu[At.harness]} is unavailable — open the model picker`:"Ask the research agent… ( / for skills)",rows:2,onPaste:Gn,onDragOver:ce=>{ce.dataTransfer.types.includes("Files")&&ce.preventDefault()},onDrop:ce=>{ce.dataTransfer.files.length!==0&&(ce.preventDefault(),on(Array.from(ce.dataTransfer.files)))},onChange:ce=>{const Se=ce.target.value;if(!Je&&!dn&&!rt.current){const Me=Se.match(/^\/(\S+)\s([\s\S]*)$/),Ie=Me&&Nt.find(Ve=>Ve.name===Me[1].toLowerCase());if(Ie){pt(Ie),W(Me[2]),wt(!1);return}}W(Se),wt(!1)},onCompositionStart:()=>{rt.current=!0},onCompositionEnd:()=>{rt.current=!1},onKeyDown:ce=>{if(Fe){if(ce.key==="ArrowDown"||ce.key==="ArrowUp"){ce.preventDefault();const Se=ce.key==="ArrowDown"?1:-1;Ft((et+Se+ct.length)%ct.length);return}if(ce.key==="Enter"||ce.key==="Tab"){ce.preventDefault(),_t(ct[et]);return}if(ce.key==="Escape"){ce.preventDefault(),wt(!0);return}}if(Je&&ce.key==="Backspace"&&ce.currentTarget.selectionStart===0&&ce.currentTarget.selectionEnd===0){ce.preventDefault(),ut();return}ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),Ci())}})]}),d.jsxs("div",{className:"composer-actions",children:[d.jsx(w1,{choices:vt!=null&&vt.agentReady?(wn==null?void 0:wn.permissionModes)??[]:[],value:(At==null?void 0:At.permissionMode)??null,defaultId:(wn==null?void 0:wn.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:ki}),d.jsx(gP,{value:At,onSelect:Mn,onHarnesses:Y,lockHarness:!!hn}),d.jsx(w1,{choices:vt!=null&&vt.agentReady?Vr.choices:[],value:(At==null?void 0:At.reasoningLevel)??null,defaultId:Vr.defaultId,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat — Default sends no override, so the harness CLI's own configured effort applies",onSelect:Rs}),d.jsx("div",{style:{flex:1}}),d.jsxs("div",{className:"composer-budgets",children:[d.jsx(vj,{harness:I.find(ce=>ce.id===(At==null?void 0:At.harness))}),d.jsx(bP,{usage:hn==null?void 0:hn.contextUsage})]}),hr&&!dn?d.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:Os,children:d.jsx(eo,{size:16})}):d.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void Ci(),disabled:!(vt!=null&&vt.agentReady)||!Je&&!K.trim()&&Z.length===0,children:d.jsx(A7,{size:16})})]})]})]})]})]})}function FP({sessionId:e,spawnPartId:t,onOpenFile:n,onOpenSubagent:r}){const[i,a]=O.useState(null);if(O.useEffect(()=>{let c=!0;L0(e).then(({messages:h})=>c&&a(h)).catch(()=>c&&a([]));const u=iu(h=>{h.type!=="message"||h.sessionId!==e||a(m=>{const f=m?m.slice():[],g=f.findIndex(v=>v.id===h.message.id);return g===-1?f.push(h.message):f[g]=h.message,f})});return()=>{c=!1,u()}},[e]),i===null)return d.jsx("div",{className:"tab-body",children:d.jsx("div",{className:"pane-content subagent-tab-content",children:d.jsx("div",{className:"subagent-empty",children:"Loading…"})})});let l=null;for(const c of i)if(l=F8(c.parts,t),l)break;return d.jsx("div",{className:"tab-body",children:d.jsx("div",{className:"pane-content subagent-tab-content",children:l?d.jsx(MP,{spawn:l,onOpenFile:n,onOpenSubagent:r}):d.jsx("div",{className:"subagent-empty",children:"This sub-agent is no longer available."})})})}function C5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t=0||(m[u]=l[u]);return m})(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dt(e,t){return q8(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,l,c,u,h=[],m=!0,f=!1;try{if(c=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;m=!1}else for(;!(m=(a=c.call(i)).done)&&(h.push(a.value),h.length!==r);m=!0);}catch(g){f=!0,l=g}finally{try{if(!m&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(f)throw l}}return h}})(e,t)||Qd(e,t)||V8()}function U8(e){return q8(e)||G8(e)||Qd(e)||V8()}function Hr(e){return(function(t){if(Array.isArray(t))return zg(t)})(e)||G8(e)||Qd(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 q8(e){if(Array.isArray(e))return e}function G8(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qd(e,t){if(e){if(typeof e=="string")return zg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zg(e,t):void 0}}function zg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}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 a,l=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return l=u.done,u},e:function(u){c=!0,a=u},f:function(){try{l||n.return==null||n.return()}finally{if(c)throw a}}}}var p0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zu(e,t){return e(t={exports:{}},t.exports),t.exports}var Br=zu((function(e){/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i-1?_.slice(0,w):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var T=_.slice(w+1);T.indexOf("file mode")===0&&(l[C==="new"?"newMode":"oldMode"]=T.slice(10));break;case"similarity":l.similarity=parseInt(_.split(" ")[2],10);break;case"index":var N=_.slice(w+1).split(" "),j=N[0].split("..");l.oldRevision=j[0],l.newRevision=j[1],N[1]&&(l.oldMode=l.newMode=N[1]);break;case"copy":case"rename":var A=_.slice(w+1);A.indexOf("from")===0?l.oldPath=A.slice(5):l.newPath=A.slice(3),x=C;break;case"---":var D=_.slice(w+1),B=v[++S].slice(4);D==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(D=D.slice(2),x="delete"):(x="modify",D=D.slice(2),B=B.slice(2)),D&&(l.oldPath=D),B&&(l.newPath=B),g=5;break e}}l.type=x||"modify"}else if(y.indexOf("Binary")===0)l.isBinary=!0,l.type=y.indexOf("/dev/null and")>=0?"add":y.indexOf("and /dev/null")>=0?"delete":"modify",g=2,l=null;else if(g===5)if(y.indexOf("@@")===0){var H=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(y);c={content:y,oldStart:H[1]-0,newStart:H[4]-0,oldLines:H[3]-0||1,newLines:H[6]-0||1,changes:[]},l.hunks.push(c),u=c.oldStart,h=c.newStart}else{var V=y.slice(0,1),U={content:y.slice(1)};switch(V){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=h,h++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=u,u++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=u,U.newLineNumber=h,u++,h++;break;case"\\":var P=c.changes[c.changes.length-1];P.isDelete||(l.newEndingNewLine=!1),P.isInsert||(l.oldEndingNewLine=!1)}U.type&&c.changes.push(U)}S++}return f}};e.exports=i})()}));function Ca(e){return e.type==="insert"}function Fr(e){return e.type==="delete"}function ks(e){return e.type==="normal"}function qP(e,t){var n=t.nearbySequences==="zip"?(function(r){var i=r.reduce((function(a,l,c){var u=Dt(a,3),h=u[0],m=u[1],f=u[2];return m?Ca(l)&&f>=0?(h.splice(f+1,0,l),[h,l,f+2]):(h.push(l),[h,l,Fr(l)&&Fr(m)?f:c]):(h.push(l),[h,l,Fr(l)?c:-1])}),[[],null,-1]);return Dt(i,1)[0]})(e.changes):e.changes;return Gt(Gt({},e),{},{isPlain:!1,changes:n})}function Ig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var i=r.indexOf(` +`),a=r.indexOf(` +`,i+1),l=r.slice(0,i),c=r.slice(i+1,a),u=l.split(" ").slice(1,-3).join(" "),h=c.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(u," b/").concat(h),"index 1111111..2222222 100644","--- a/".concat(u),"+++ b/".concat(h),r.slice(a+1)].join(` +`)})(e.trimStart());return UP.parse(n).map((function(r){return(function(i,a){var l=i.hunks.map((function(c){return qP(c,a)}));return Gt(Gt({},i),{},{hunks:l})})(r,t)}))}function GP(e){return e[0]}function VP(e){return e[e.length-1]}function Hg(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function du(e){return e==="old"?function(t){return Ca(t)?-1:ks(t)?t.oldLineNumber:t.lineNumber}:function(t){return Fr(t)?-1:ks(t)?t.newLineNumber:t.lineNumber}}function Y8(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r=a&&i-1},eU=function(e,t){var n=this.__data__,r=Jd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function hl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tc))return!1;var h=a.get(e),m=a.get(t);if(h&&m)return h==t&&m==e;var f=-1,g=!0,v=2&n?new zU:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},un={};un["[object Float32Array]"]=un["[object Float64Array]"]=un["[object Int8Array]"]=un["[object Int16Array]"]=un["[object Int32Array]"]=un["[object Uint8Array]"]=un["[object Uint8ClampedArray]"]=un["[object Uint16Array]"]=un["[object Uint32Array]"]=!0,un["[object Arguments]"]=un["[object Array]"]=un["[object ArrayBuffer]"]=un["[object Boolean]"]=un["[object DataView]"]=un["[object Date]"]=un["[object Error]"]=un["[object Function]"]=un["[object Map]"]=un["[object Number]"]=un["[object Object]"]=un["[object RegExp]"]=un["[object Set]"]=un["[object String]"]=un["[object WeakMap]"]=!1;var JU=function(e){return Al(e)&&H2(e.length)&&!!un[ql(e)]},eq=function(e){return function(t){return e(t)}},R5=zu((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&Z8.process,a=(function(){try{var l=r&&r.require&&r.require("util").types;return l||i&&i.binding&&i.binding("util")}catch{}})();e.exports=a})),L5=R5&&R5.isTypedArray,F2=L5?eq(L5):JU,tq=Object.prototype.hasOwnProperty,nq=function(e,t){var n=Pr(e),r=!n&&rf(e),i=!n&&!r&&od(e),a=!n&&!r&&!i&&F2(e),l=n||r||i||a,c=l?YU(e.length,String):[],u=c.length;for(var h in e)!tq.call(e,h)||l&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||r9(h,u))||c.push(h);return c},rq=Object.prototype,i9=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||rq)},iq=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),sq=Object.prototype.hasOwnProperty,s9=function(e){if(!i9(e))return iq(e);var t=[];for(var n in Object(e))sq.call(e,n)&&n!="constructor"&&t.push(n);return t},sf=function(e){return e!=null&&H2(e.length)&&!J8(e)},$2=function(e){return sf(e)?nq(e):s9(e)},O5=function(e){return UU(e,$2,WU)},aq=Object.prototype.hasOwnProperty,oq=function(e,t,n,r,i,a){var l=1&n,c=O5(e),u=c.length;if(u!=O5(t).length&&!l)return!1;for(var h=u;h--;){var m=c[h];if(!(l?m in t:aq.call(t,m)))return!1}var f=a.get(e),g=a.get(t);if(f&&g)return f==t&&g==e;var v=!0;a.set(e,t),a.set(t,e);for(var k=l;++h1)return!1;if(e.length===1){var t=Dt(e,1)[0];return t.type==="text"&&!t.value}return!0}function Xq(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=xa(e,Wq),l=i?function(c,u){return i(c,F5,u)}:F5;return d.jsx("td",Gt(Gt({},a),{},{"data-change-key":t,children:r?Yq(r)?" ":r.map(l):n||" "}))}var f9=O.memo(Xq);function p9(e,t){return function(){var n=t==="old"?uf(e):hf(e);return n===-1?void 0:n}}function m9(e,t){return function(n){return e&&n?d.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function ld(e,t){return t?function(n){e(),t(n)}:e}function $5(e,t,n,r){return O.useMemo((function(){var i=d9(e,(function(a){return function(l){return a&&a(t,l)}}));return i.onMouseEnter=ld(n,i.onMouseEnter),i.onMouseLeave=ld(r,i.onMouseLeave),i}),[e,n,r,t])}function P5(e,t,n,r,i,a,l,c,u){var h={change:t,side:r,inHoverState:c,renderDefault:p9(t,r),wrapInAnchor:m9(i,a)};return d.jsx("td",Gt(Gt({className:e},l),{},{"data-change-key":n,children:u(h)}))}function Kq(e){var t,n,r,i=e.change,a=e.selected,l=e.tokens,c=e.className,u=e.generateLineClassName,h=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,v=e.hideGutter,k=e.gutterAnchor,S=e.generateAnchorID,y=e.renderToken,_=e.renderGutter,x=i.type,w=i.content,C=ga(i),T=(t=Dt(O.useState(!1),2),n=t[0],r=t[1],[n,O.useCallback((function(){return r(!0)}),[]),O.useCallback((function(){return r(!1)}),[])]),N=Dt(T,3),j=N[0],A=N[1],D=N[2],B=O.useMemo((function(){return{change:i}}),[i]),H=$5(f,B,A,D),V=$5(g,B,A,D),U=S(i),P=u({changes:[i],defaultGenerate:function(){return c}}),K=Br("diff-gutter","diff-gutter-".concat(x),h,{"diff-gutter-selected":a}),W=Br("diff-code","diff-code-".concat(x),m,{"diff-code-selected":a});return d.jsxs("tr",{id:U,className:Br("diff-line",P),children:[!v&&P5(K,i,C,"old",k,U,H,j,_),!v&&P5(K,i,C,"new",k,U,H,j,_),d.jsx(f9,Gt({className:W,changeKey:C,text:w,tokens:l,renderToken:y},V))]})}var Zq=O.memo(Kq);function Qq(e){var t=e.hideGutter,n=e.element;return d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var Jq=["hideGutter","selectedChanges","tokens","lineClassName"],eG=["hunk","widgets","className"];function tG(e){var t=e.hunk,n=e.widgets,r=e.className,i=xa(e,eG),a=(function(l,c){return l.reduce((function(u,h){var m=ga(h);u.push(["change",m,h]);var f=c[m];return f&&u.push(["widget",m,f]),u}),[])})(t.changes,n);return d.jsx("tbody",{className:Br("diff-hunk",r),children:a.map((function(l){return(function(c,u){var h=Dt(c,3),m=h[0],f=h[1],g=h[2],v=u.hideGutter,k=u.selectedChanges,S=u.tokens,y=u.lineClassName,_=xa(u,Jq);if(m==="change"){var x=Fr(g)?"old":"new",w=Fr(g)?uf(g):hf(g),C=S?S[x][w-1]:null;return d.jsx(Zq,Gt({className:y,change:g,hideGutter:v,selected:k.includes(f),tokens:C},_),"change".concat(f))}return m==="widget"?d.jsx(Qq,{hideGutter:v,element:g},"widget".concat(f)):null})(l,i)}))})}var g9=0;function g0(e,t,n,r){var i=O.useCallback((function(){return t(e)}),[e,t]),a=O.useCallback((function(){return t("")}),[t]);return O.useMemo((function(){var l=d9(r,(function(c){return function(u){return c&&c({side:e,change:n},u)}}));return l.onMouseEnter=ld(i,l.onMouseEnter),l.onMouseLeave=ld(a,l.onMouseLeave),l}),[n,r,i,e,a])}function C1(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,l=e.codeClassName,c=e.gutterEvents,u=e.codeEvents,h=e.anchorID,m=e.gutterAnchor,f=e.gutterAnchorTarget,g=e.hideGutter,v=e.hover,k=e.renderToken,S=e.renderGutter;if(!t){var y=Br("diff-gutter","diff-gutter-omit",a),_=Br("diff-code","diff-code-omit",l);return[!g&&d.jsx("td",{className:y},"gutter"),d.jsx("td",{className:_},"code")]}var x=t.type,w=t.content,C=ga(t),T=n===g9?"old":"new",N=Gt({id:h||void 0,className:Br("diff-gutter","diff-gutter-".concat(x),Bg({"diff-gutter-selected":r},"diff-line-hover-"+T,v),a),children:S({change:t,side:T,inHoverState:v,renderDefault:p9(t,T),wrapInAnchor:m9(m,f)})},c),j=Br("diff-code","diff-code-".concat(x),Bg({"diff-code-selected":r},"diff-line-hover-"+T,v),l);return[!g&&d.jsx("td",Gt(Gt({},N),{},{"data-change-key":C}),"gutter"),d.jsx(f9,Gt({className:j,changeKey:C,text:w,tokens:i,renderToken:k},u),"code")]}function nG(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,l=e.oldTokens,c=e.newTokens,u=e.monotonous,h=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,v=e.hideGutter,k=e.generateAnchorID,S=e.generateLineClassName,y=e.gutterAnchor,_=e.renderToken,x=e.renderGutter,w=Dt(O.useState(""),2),C=w[0],T=w[1],N=g0("old",T,n,f),j=g0("new",T,r,f),A=g0("old",T,n,g),D=g0("new",T,r,g),B=n&&k(n),H=r&&k(r),V=S({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:u,hideGutter:v,gutterClassName:h,codeClassName:m,gutterEvents:f,codeEvents:g,renderToken:_,renderGutter:x},P=Gt(Gt({},U),{},{change:n,side:g9,selected:i,tokens:l,gutterEvents:N,codeEvents:A,anchorID:B,gutterAnchor:y,gutterAnchorTarget:B,hover:C==="old"}),K=Gt(Gt({},U),{},{change:r,side:1,selected:a,tokens:c,gutterEvents:j,codeEvents:D,anchorID:n===r?null:H,gutterAnchor:y,gutterAnchorTarget:n===r?B:H,hover:C==="new"});if(u)return d.jsx("tr",{className:Br("diff-line",V),children:C1(n?P:K)});var W=(function(Z,ee){return Z&&!ee?"diff-line-old-only":!Z&&ee?"diff-line-new-only":Z===ee?"diff-line-normal":"diff-line-compare"})(n,r);return d.jsxs("tr",{className:Br("diff-line",W,V),children:[C1(P),C1(K)]})}var rG=O.memo(nG);function iG(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):d.jsxs("tr",{className:"diff-widget",children:[d.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),d.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var sG=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],aG=["hunk","widgets","className"];function v0(e,t){return(e?ga(e):"00")+(t?ga(t):"00")}function oG(e){var t=e.hunk,n=e.widgets,r=e.className,i=xa(e,aG),a=(function(l,c){for(var u=function(_){if(!_)return null;var x=ga(_);return c[x]||null},h=[],m=0;m=(a==null?void 0:a.value.length))return[e];var c=function(f,g){var v=a.value.slice(f,g);return[].concat(Hr(i),[Gt(Gt({},a),{},{value:v})])};if(t>0){var u=c(0,t);l.push(gl(u))}var h=c(Math.max(t,0),n);if(l.push(r?(function(f,g){return[g].concat(Hr(gl(f)))})(h,r):gl(h)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=xa(e,NG);n.push(i);var a,l=z2(r);try{for(l.s();!(a=l.n()).done;)_9(a.value,t,n)}catch(c){l.e(c)}finally{l.f()}n.pop()}else t.push(gl([].concat(Hr(n.slice(1)),[e])));return t}function AG(e){return e.reduce((function(t,n){var r=t[t.length-1],i=(function(u){var h=V2(u);return h.value.includes(` +`)?h.value.split(` +`).map((function(m){return kG(u,Gt(Gt({},h),{},{value:m}))})):[u]})(n),a=U8(i),l=a[0],c=a.slice(1);return[].concat(Hr(t.slice(0,-1)),[[].concat(Hr(r),[l])],Hr(c.map((function(u){return[u]}))))}),[[]])}function V5(e){return AG(_9(e))}var TG=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?af(e,t,void 0,n):!!r},MG=function(e,t){return af(e,t)},jG=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function DG(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,i=jG(e.children);return i&&(r=t,(n=i).type===r.type&&(n.type==="text"||n.children&&r.children&&TG(n,r,(function(a,l,c){return c==="chlidren"||MG(a,l)}))))?e.children[e.children.length-1]=(function(a,l){return"value"in a&&"value"in l?Gt(Gt({},a),{},{value:"".concat(a.value).concat(l.value)}):a})(i,t):e.children.push(t),e.children[e.children.length-1]}function W5(e){var t,n={type:"root",children:[]},r=z2(e);try{var i=function(){var a=t.value;a.reduce((function(l,c,u){return DG(l,u===a.length-1?Gt({},c):Gt(Gt({},c),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}return n}var RG=Object.prototype.hasOwnProperty,LG=b9((function(e,t,n){RG.call(e,n)?e[n].push(t):q2(e,n,[t])})),OG=Object.prototype.hasOwnProperty,BG=function(e){if(e==null)return!0;if(sf(e)&&(Pr(e)||typeof e=="string"||typeof e.splice=="function"||od(e)||F2(e)||rf(e)))return!e.length;var t=qg(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(i9(e))return!s9(e).length;for(var n in e)if(OG.call(e,n))return!1;return!0},zG=function(e,t){var n=t.start,r=t.length,i=n+r,a=e.reduce((function(l,c){var u=Dt(l,2),h=u[0],m=u[1],f=m+V2(c).value.length;if(m>i||fr.length?n:r,u=n.length>r.length?r:n,h=c.indexOf(u);if(h!=-1)return l=[new t.Diff(1,c.substring(0,h)),new t.Diff(0,u),new t.Diff(1,c.substring(h+u.length))],n.length>r.length&&(l[0][0]=l[2][0]=-1),l;if(u.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var m=this.diff_halfMatch_(n,r);if(m){var f=m[0],g=m[1],v=m[2],k=m[3],S=m[4],y=this.diff_main(f,v,i,a),_=this.diff_main(g,k,i,a);return y.concat([new t.Diff(0,S)],_)}return i&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,a):this.diff_bisect_(n,r,a)},t.prototype.diff_lineMode_=function(n,r,i){var a=this.diff_linesToChars_(n,r);n=a.chars1,r=a.chars2;var l=a.lineArray,c=this.diff_main(n,r,!1,i);this.diff_charsToLines_(c,l),this.diff_cleanupSemantic(c),c.push(new t.Diff(0,""));for(var u=0,h=0,m=0,f="",g="";u=1&&m>=1){c.splice(u-h-m,h+m),u=u-h-m;for(var v=this.diff_main(f,g,!1,i),k=v.length-1;k>=0;k--)c.splice(u,0,v[k]);u+=v.length}m=0,h=0,f="",g=""}u++}return c.pop(),c},t.prototype.diff_bisect_=function(n,r,i){for(var a=n.length,l=r.length,c=Math.ceil((a+l)/2),u=c,h=2*c,m=new Array(h),f=new Array(h),g=0;gi);w++){for(var C=-w+S;C<=w-y;C+=2){for(var T=u+C,N=(H=C==-w||C!=w&&m[T-1]a)y+=2;else if(N>l)S+=2;else if(k&&(D=u+v-C)>=0&&D=(A=a-f[D]))return this.diff_bisectSplit_(n,r,H,N,i)}for(var j=-w+_;j<=w-x;j+=2){for(var A,D=u+j,B=(A=j==-w||j!=w&&f[D-1]a)x+=2;else if(B>l)_+=2;else if(!k&&(T=u+v-j)>=0&&T=(A=a-A))return this.diff_bisectSplit_(n,r,H,N,i)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,i,a,l){var c=n.substring(0,i),u=r.substring(0,a),h=n.substring(i),m=r.substring(a),f=this.diff_main(c,u,!1,l),g=this.diff_main(h,m,!1,l);return f.concat(g)},t.prototype.diff_linesToChars_=function(n,r){var i=[],a={};function l(h){for(var m="",f=0,g=-1,v=i.length;ga?n=n.substring(i-a):ir.length?n:r,a=n.length>r.length?r:n;if(i.length<4||2*a.length=S.length?[x,w,C,T,A]:null}var u,h,m,f,g,v=c(i,a,Math.ceil(i.length/4)),k=c(i,a,Math.ceil(i.length/2));return v||k?(u=k?v&&v[4].length>k[4].length?v:k:v,n.length>r.length?(h=u[0],m=u[1],f=u[2],g=u[3]):(f=u[0],g=u[1],h=u[2],m=u[3]),[h,m,f,g,u[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,i=[],a=0,l=null,c=0,u=0,h=0,m=0,f=0;c0?i[a-1]:-1,u=0,h=0,m=0,f=0,l=null,r=!0)),c++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),c=1;c=S?(k>=g.length/2||k>=v.length/2)&&(n.splice(c,0,new t.Diff(0,v.substring(0,k))),n[c-1][1]=g.substring(0,g.length-k),n[c+1][1]=v.substring(k),c++):(S>=g.length/2||S>=v.length/2)&&(n.splice(c,0,new t.Diff(0,g.substring(0,S))),n[c-1][0]=1,n[c-1][1]=v.substring(0,v.length-S),n[c+1][0]=-1,n[c+1][1]=g.substring(S),c++),c++}c++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(S,y){if(!S||!y)return 6;var _=S.charAt(S.length-1),x=y.charAt(0),w=_.match(t.nonAlphaNumericRegex_),C=x.match(t.nonAlphaNumericRegex_),T=w&&_.match(t.whitespaceRegex_),N=C&&x.match(t.whitespaceRegex_),j=T&&_.match(t.linebreakRegex_),A=N&&x.match(t.linebreakRegex_),D=j&&S.match(t.blanklineEndRegex_),B=A&&y.match(t.blanklineStartRegex_);return D||B?5:j||A?4:w&&!T&&N?3:T||N?2:w||C?1:0}for(var i=1;i=v&&(v=k,m=a,f=l,g=c)}n[i-1][1]!=m&&(m?n[i-1][1]=m:(n.splice(i-1,1),i--),n[i][1]=f,g?n[i+1][1]=g:(n.splice(i+1,1),i--))}i++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(n){for(var r=!1,i=[],a=0,l=null,c=0,u=!1,h=!1,m=!1,f=!1;c0?i[a-1]:-1,m=f=!1),r=!0)),c++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,i=0,a=0,l=0,c="",u="";i1?(a!==0&&l!==0&&((r=this.diff_commonPrefix(u,c))!==0&&(i-a-l>0&&n[i-a-l-1][0]==0?n[i-a-l-1][1]+=u.substring(0,r):(n.splice(0,0,new t.Diff(0,u.substring(0,r))),i++),u=u.substring(r),c=c.substring(r)),(r=this.diff_commonSuffix(u,c))!==0&&(n[i][1]=u.substring(u.length-r)+n[i][1],u=u.substring(0,u.length-r),c=c.substring(0,c.length-r))),i-=a+l,n.splice(i,a+l),c.length&&(n.splice(i,0,new t.Diff(-1,c)),i++),u.length&&(n.splice(i,0,new t.Diff(1,u)),i++),i++):i!==0&&n[i-1][0]==0?(n[i-1][1]+=n[i][1],n.splice(i,1)):i++,l=0,a=0,c="",u=""}n[n.length-1][1]===""&&n.pop();var h=!1;for(i=1;ir));i++)c=a,u=l;return n.length!=i&&n[i][0]===-1?u:u+(r-c)},t.prototype.diff_prettyHtml=function(n){for(var r=[],i=/&/g,a=//g,c=/\n/g,u=0;u");switch(h){case 1:r[u]=''+m+"";break;case-1:r[u]=''+m+"";break;case 0:r[u]=""+m+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],i=0;ithis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(r),l=this;function c(N,j){var A=N/r.length,D=Math.abs(i-j);return l.Match_Distance?A+D/l.Match_Distance:D?1:A}var u=this.Match_Threshold,h=n.indexOf(r,i);h!=-1&&(u=Math.min(c(0,h),u),(h=n.lastIndexOf(r,i+r.length))!=-1&&(u=Math.min(c(0,h),u)));var m,f,g=1<=y;w--){var C=a[n.charAt(w-1)];if(x[w]=S===0?(x[w+1]<<1|1)&C:(x[w+1]<<1|1)&C|(v[w+1]|v[w])<<1|1|v[w+1],x[w]&g){var T=c(S,w-1);if(T<=u){if(u=T,!((h=w-1)>i))break;y=Math.max(1,2*i-h)}}}if(c(S+1,i)>u)break;v=x}return h},t.prototype.match_alphabet_=function(n){for(var r={},i=0;i2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(n&&typeof n=="object"&&r===void 0&&i===void 0)l=n,a=this.diff_text1(l);else if(typeof n=="string"&&r&&typeof r=="object"&&i===void 0)a=n,l=r;else{if(typeof n!="string"||typeof r!="string"||!i||typeof i!="object")throw new Error("Unknown call format to patch_make.");a=n,l=i}if(l.length===0)return[];for(var c=[],u=new t.patch_obj,h=0,m=0,f=0,g=a,v=a,k=0;k=2*this.Patch_Margin&&h&&(this.patch_addContext_(u,g),c.push(u),u=new t.patch_obj,h=0,g=v,m=f)}S!==1&&(m+=y.length),S!==-1&&(f+=y.length)}return h&&(this.patch_addContext_(u,g),c.push(u)),c},t.prototype.patch_deepCopy=function(n){for(var r=[],i=0;ithis.Match_MaxBits?(u=this.match_main(r,f.substring(0,this.Match_MaxBits),m))!=-1&&((g=this.match_main(r,f.substring(f.length-this.Match_MaxBits),m+f.length-this.Match_MaxBits))==-1||u>=g)&&(u=-1):u=this.match_main(r,f,m),u==-1)l[c]=!1,a-=n[c].length2-n[c].length1;else if(l[c]=!0,a=u-m,f==(h=g==-1?r.substring(u,u+f.length):r.substring(u,g+this.Match_MaxBits)))r=r.substring(0,u)+this.diff_text2(n[c].diffs)+r.substring(u+f.length);else{var v=this.diff_main(f,h,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(v)/f.length>this.Patch_DeleteThreshold)l[c]=!1;else{this.diff_cleanupSemanticLossless(v);for(var k,S=0,y=0;yc[0][1].length){var u=r-c[0][1].length;c[0][1]=i.substring(c[0][1].length)+c[0][1],l.start1-=u,l.start2-=u,l.length1+=u,l.length2+=u}return(c=(l=n[n.length-1]).diffs).length==0||c[c.length-1][0]!=0?(c.push(new t.Diff(0,i)),l.length1+=r,l.length2+=r):r>c[c.length-1][1].length&&(u=r-c[c.length-1][1].length,c[c.length-1][1]+=i.substring(0,u),l.length1+=u,l.length2+=u),i},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,i=0;i2*r?(h.length1+=g.length,l+=g.length,m=!1,h.diffs.push(new t.Diff(f,g)),a.diffs.shift()):(g=g.substring(0,r-h.length1-this.Patch_Margin),h.length1+=g.length,l+=g.length,f===0?(h.length2+=g.length,c+=g.length):m=!1,h.diffs.push(new t.Diff(f,g)),g==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(g.length))}u=(u=this.diff_text2(h.diffs)).substring(u.length-this.Patch_Margin);var v=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);v!==""&&(h.length1+=v.length,h.length2+=v.length,h.diffs.length!==0&&h.diffs[h.diffs.length-1][0]===0?h.diffs[h.diffs.length-1][1]+=v:h.diffs.push(new t.Diff(0,v))),m||n.splice(++i,0,h)}}},t.prototype.patch_toText=function(n){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?UG:qG,r=G2(e.map((function(c){return c.changes})),x9).map(n).reduce((function(c,u){var h=Dt(c,2),m=h[0],f=h[1],g=Dt(u,2),v=g[0],k=g[1];return[m.concat(v),f.concat(k)]}),[[],[]]),i=Dt(r,2),a=i[0],l=i[1];return IG(X5(a),X5(l))}var VG=["enhancers"],J5=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=Dt(SG(e,xa(n,VG)),2),l=a[0],c=a[1],u=[V5(l),V5(c)],h=(t=[u[0],u[1]],i.reduce((function(S,y){return y(S)}),t)),m=Dt(h,2),f=m[0],g=m[1],v=[f.map(W5),g.map(W5)],k=v[1];return{old:v[0].map((function(S){var y;return(y=S.children)!==null&&y!==void 0?y:[]})),new:k.map((function(S){var y;return(y=S.children)!==null&&y!==void 0?y:[]}))}};const Vg=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--openresearch-diff-selection-background-color:color-mix(_in_oklab,_var(--surface)_76%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-gutter-selection-background-color:color-mix(_in_oklab,_var(--surface)_68%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-gutter-background-color:color-mix(_in_oklab,_var(--base)_84%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-gutter-background-color:color-mix(_in_oklab,_var(--base)_86%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-code-background-color:color-mix(_in_oklab,_var(--base)_91%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-code-background-color:color-mix(_in_oklab,_var(--base)_92%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-edit-background-color:color-mix(_in_oklab,_var(--base)_72%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-edit-background-color:color-mix(_in_oklab,_var(--base)_78%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-divider-color:var(--border)]","[&_.openresearch-diff-file]:[--openresearch-diff-omit-gutter-line-color:color-mix(in_oklab,_var(--base)_86%,_var(--text))]","[&_.openresearch-diff-file]:[--openresearch-diff-unified-gutter-text-color:color-mix(in_oklab,_var(--text)_45%,_var(--base))]","[&_.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(--openresearch-diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)]","[&_.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(--openresearch-diff-insert-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)]","[&_.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)]:left-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)]:pr-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)]:pl-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-right","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-[var(--openresearch-diff-unified-gutter-text-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r-[var(--openresearch-diff-divider-color)]","[&_.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-[var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-[var(--openresearch-diff-delete-code-background-color)]","[&_.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-[var(--openresearch-diff-divider-color)]"].join(" "),WG=2e3,YG={highlight(e,t){return tt.highlight(e,t).children}};function XG(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function W2(e){let t=0,n=0;for(const r of e.hunks)for(const i of r.changes)i.type==="insert"?t++:i.type==="delete"&&n++;return{additions:t,deletions:n}}function KG(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function Wg(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 ZG(e){const t=[GG(e.hunks,{type:"line"})],n=p8(KG(e));return n&&tt.registered(n)?J5(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:YG}):J5(e.hunks,{enhancers:t,highlight:!1})}function S9(e,t){if(!e.trim())return{files:[],failed:!1};try{return{files:Ig(e,{nearbySequences:"zip"}),failed:!1}}catch{if(t){const n=Array.from(e.matchAll(/^diff --git /gm),i=>i.index),r=n[n.length-1];if(n.length>1&&r!==void 0)try{return{files:Ig(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const QG=({change:e,side:t})=>t==="old"?null:XG(e);function e6(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function Y2({bytesRead:e,byteLimit:t}){return d.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-md [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-md [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[d.jsx("h4",{children:"Diff preview truncated"}),d.jsxs("p",{children:["Showing the first ",e6(t)," (",e6(e)," read). View the complete diff locally with git."]})]})}function k9({file:e,defaultExpanded:t}){const[n,r]=O.useState(t),{additions:i,deletions:a}=O.useMemo(()=>W2(e),[e]),l=n&&i+a<=WG,c=O.useMemo(()=>{if(l)try{return ZG(e)}catch{return}},[e,l]);return d.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 ${n?"expanded":""}`,children:[d.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-left py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-2xs [&_.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-2xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":n,onClick:()=>r(u=>!u),children:[d.jsx("span",{className:"chev",children:n?d.jsx(Hi,{size:14}):d.jsx(po,{size:14})}),d.jsx("span",{className:"path",children:d.jsx("code",{children:Wg(e)})}),d.jsxs("span",{className:"stats",children:[d.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",i]}),d.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",a]})]})]}),n&&(e.hunks.length===0?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No textual diff for this file."}):d.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:d.jsx(fG,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:QG,tokens:c,viewType:"unified"})}))]})}function C9({files:e,className:t}){return d.jsx("div",{className:t?`${Vg} ${t}`:Vg,children:e.map((n,r)=>d.jsx(k9,{file:n,defaultExpanded:r===0},`${n.oldPath}→${n.newPath}#${r}`))})}function E9({diff:e,className:t}){const n=O.useMemo(()=>S9(e,!1),[e]);return n.failed?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"Unable to parse this diff."}):n.files.length===0?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No changes."}):d.jsx(C9,{files:n.files,className:t})}function JG(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 N9({diff:e,partial:t=!1}){var g;const n=O.useMemo(()=>S9(e,t),[e,t]),r=n.files,i=O.useMemo(()=>r.map((v,k)=>({file:v,key:`${v.oldPath}→${v.newPath}#${k}`,changes:W2(v)})),[r]),[a,l]=O.useState(null),[c,u]=O.useState(!1),h=c&&!t,m=i.some(v=>v.key===a)?a:((g=i[0])==null?void 0:g.key)??null,f=i.find(v=>v.key===m)??null;return n.failed?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:t?"No complete file preview was available before the cutoff.":"Unable to parse this diff."}):i.length===0?d.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No changes."}):d.jsxs("div",{className:"diff-explorer @container",children:[d.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-xs [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[d.jsx("strong",{children:t?`${i.length} ${i.length===1?"file":"files"} shown (partial)`:i.length===1?"1 changed file":`${i.length} changed files`}),!t&&d.jsx("button",{type:"button",onClick:()=>u(v=>!v),children:h?"Back to preview":"View full diff"})]}),h?d.jsx(C9,{files:r}):d.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:[d.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-left [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-[inset_2px_0_0_var(--text)] [&_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":"Changed files",children:i.map(v=>d.jsxs("button",{type:"button",className:v.key===m?"active":"","aria-pressed":v.key===m,onClick:()=>l(v.key),children:[d.jsx("span",{className:`diff-file-status font-mono text-xs font-semibold text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${v.file.type}`,children:JG(v.file)}),d.jsx("code",{title:Wg(v.file),children:Wg(v.file)}),d.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-add text-accent-green",children:["+",v.changes.additions]}),d.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-del text-accent-red",children:["−",v.changes.deletions]})]},v.key))}),d.jsx("div",{className:`${Vg} diff-explorer-preview min-w-0`,children:f&&d.jsx(k9,{file:f.file,defaultExpanded:!0},f.key)})]})]})}function eV({experiment:e,refreshKey:t,onLoadingChange:n}){const[r,i]=O.useState(null),[a,l]=O.useState(null);return O.useEffect(()=>{let c=!1;return n(!0),l(null),i(null),dM(e.id).then(u=>{c||i(u)}).catch(u=>{c||l(u.message)}).finally(()=>{c||n(!1)}),()=>{c=!0}},[e.id,t,n]),d.jsx("div",{className:`${eu} branch-changes [&_>_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`,children:a?d.jsxs("div",{className:pi,children:["Failed to load changes: ",a]}):r?r.diff.trim()?d.jsxs(d.Fragment,{children:[r.truncated&&d.jsx(Y2,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),d.jsx(N9,{diff:r.diff,partial:r.truncated})]}):d.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?"No committed changes from the parent branch.":"This is the baseline branch, so there is no parent comparison."}):d.jsx("div",{className:pi,children:"Loading changes…"})})}function A9({view:e,onViewChange:t,showViewToggle:n=!0,branchLabel:r,branchTitle:i,githubHref:a,githubTitle:l,refreshing:c,onRefresh:u}){return d.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:[n&&d.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":"Code browser view",children:[d.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>t("files"),children:"Files"}),d.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>t("changes"),children:"Changes"})]}),r&&d.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-[color-mix(in_oklab,_var(--text)_8%,_transparent)] text-subtext text-xs [&_>_svg]:shrink-0",title:i,children:[d.jsx(Ol,{size:12}),d.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:r})]}),a&&d.jsx("a",{className:oo,href:a,target:"_blank",rel:"noopener noreferrer",title:l,"aria-label":l,children:d.jsx(R2,{size:13})}),d.jsx("span",{style:{flex:1}}),d.jsx("button",{className:oo,title:"Refresh","aria-label":"Refresh",onClick:u,children:c?d.jsx("span",{className:Yn}):d.jsx(kd,{size:13})})]})}const tV=/\.(md|mdx|markdown)$/i,nV=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,rV=/\.(csv|tsv|xlsx?|ods)$/i,iV=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sV=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,aV=/\.pdf$/i,oV=/\.(docx?|log|rtf|txt)$/i;function lV(e){return nV.test(e)}function cV(e){return tV.test(e)}function uV({name:e}){const t=cV(e)?"markdown":lV(e)?"image":rV.test(e)?"spreadsheet":iV.test(e)?"code":sV.test(e)?"archive":aV.test(e)?"pdf":oV.test(e)?"document":"file";let n;return t==="markdown"?n=d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),d.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"})]}):t==="image"?n=d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),d.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),d.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):t==="spreadsheet"?n=d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),d.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):t==="code"?n=d.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"}):t==="archive"?n=d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),d.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):n=d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),d.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),d.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 ${t}`,viewBox:"0 0 16 16","aria-hidden":"true",children:n})}const T9=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-left cursor-pointer font-[inherit]","text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),t6=["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 n6(){return{dirs:new Map,files:[]}}function M9(e){const t=n6();for(const n of e){const r=n.split("/");let i=t;for(let a=0;aa(n),title:n,children:[u?d.jsx(Hi,{size:13,className:t6}):d.jsx(po,{size:13,className:t6}),d.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),u&&d.jsx(X2,{node:t,parentPath:n,depth:r+1,toggled:i,onToggle:a,onOpenFile:l})]})}function X2({node:e,parentPath:t,depth:n,toggled:r,onToggle:i,onOpenFile:a}){const l=[...e.dirs.keys()].sort((u,h)=>u.localeCompare(h)),c=[...e.files].sort((u,h)=>u.localeCompare(h));return d.jsxs(d.Fragment,{children:[l.map(u=>{const h=t?`${t}/${u}`:u;return d.jsx(hV,{name:u,node:e.dirs.get(u),path:h,depth:n,toggled:r,onToggle:i,onOpenFile:a},`d:${h}`)}),c.map(u=>{const h=t?`${t}/${u}`:u;return d.jsxs("button",{type:"button",className:T9,style:{paddingLeft:8+n*14},onClick:()=>a(h),title:h,children:[d.jsx(uV,{name:u}),d.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u})]},`f:${h}`)})]})}function dV({projectId:e,project:t,experiment:n,view:r,toggled:i,onViewChange:a,onToggledChange:l,onOpenFile:c}){const u=n.branchName,h=`${e}:${u}`,[m,f]=O.useState(null),[g,v]=O.useState(null),[k,S]=O.useState(!1),[y,_]=O.useState(!1),[x,w]=O.useState(0),C=O.useRef(0),T=O.useRef(null),N=O.useCallback(()=>{T.current=h;const B=++C.current;S(!0),W1(e,{ref:u}).then(H=>{B===C.current&&(f(H),v(null))}).catch(H=>{B===C.current&&v(H.message)}).finally(()=>{B===C.current&&S(!1)})},[e,u,h]);O.useEffect(()=>(C.current++,T.current=null,f(null),v(null),S(!1),()=>{C.current++}),[h]),O.useEffect(()=>{r==="files"&&T.current!==h&&N()},[r,h,N]);const j=O.useMemo(()=>m?M9(m.entries):null,[m]),A=r==="files"?k:y,D=O.useCallback(B=>{const H=new Set(i);H.has(B)?H.delete(B):H.add(B),l(H)},[i,l]);return d.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[d.jsx(A9,{view:r,onViewChange:a,branchLabel:u,branchTitle:`Committed branch ${u}`,githubHref:t.githubOwner&&t.githubRepo?Nd(t.githubOwner,t.githubRepo,u):void 0,githubTitle:`Open ${u} on GitHub`,refreshing:A,onRefresh:()=>r==="files"?N():w(B=>B+1)}),r==="changes"?d.jsx(eV,{experiment:n,refreshKey:x,onLoadingChange:_},n.id):d.jsxs(d.Fragment,{children:[(m==null?void 0:m.truncated)&&d.jsx("div",{className:pi,children:"listing truncated"}),g&&j&&d.jsxs("div",{className:pi,children:["Refresh failed: ",g]}),d.jsx("div",{className:eu,children:j?j.dirs.size===0&&j.files.length===0?d.jsx("div",{className:pi,children:"No files."}):d.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:d.jsx(X2,{node:j,parentPath:"",depth:0,toggled:i,onToggle:D,onOpenFile:B=>c(B,void 0,u)})}):d.jsx("div",{className:pi,children:g?`Failed to load: ${g}`:"Loading…"})})]})]})}const fV=5e3;function pV({sessionId:e,project:t,view:n,toggled:r,onViewChange:i,onToggledChange:a,onOpenFile:l}){var D;const c=t.id,[u,h]=O.useState(null),[m,f]=O.useState(null),[g,v]=O.useState(null),[k,S]=O.useState(!0),y=O.useRef(0),_=O.useCallback(()=>{const B=++y.current;S(!0),(async()=>{if(!e)return[null,await W1(c,{ref:t.baselineBranch})];const V=await gM(e),U=V.exists?{sessionId:e}:{ref:t.baselineBranch};return[V,await W1(c,U)]})().then(([V,U])=>{B===y.current&&(h(V),f(U),v(null))}).catch(V=>{B===y.current&&v(V.message)}).finally(()=>{B===y.current&&S(!1)})},[e,c,t.baselineBranch]);O.useEffect(()=>(h(null),f(null),v(null),_(),()=>{y.current++}),[_]),O.useEffect(()=>{if(!e)return;let B=!1,H=!1,V=!1,U=null;const P=()=>{U||(U=setInterval(_,fV))},K=()=>{U&&(clearInterval(U),U=null)},W=iu(Z=>{Z.type!=="busy"||Z.sessionId!==e||(H=!0,Z.busy&&!B?(B=!0,P()):!Z.busy&&B&&(B=!1,K(),_()))});return R0(c).then(Z=>{var ee;V||H||B||(ee=Z.find(z=>z.id===e))!=null&&ee.busy&&(B=!0,P())}).catch(()=>{}),()=>{V=!0,W(),K()}},[e,c,_]);const x=O.useMemo(()=>m?M9(m.entries):null,[m]),w=O.useCallback(B=>{const H=new Set(r);H.has(B)?H.delete(B):H.add(B),a(H)},[r,a]),C=e&&(u!=null&&u.exists)?u:null,T=(C==null?void 0:C.branch)??(C!=null&&C.baselineBranch?`detached @ ${C.baselineBranch}`:"detached"),N=((D=C==null?void 0:C.files)==null?void 0:D.length)??0,j=C?`Current worktree · ${T}${N>0?"*":""}`:`Default branch · ${t.baselineBranch}`,A=C?C.branch:t.baselineBranch;return d.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[d.jsx(A9,{view:C?n:"files",onViewChange:i,showViewToggle:!!C,branchLabel:j,branchTitle:j,githubHref:t.githubOwner&&t.githubRepo&&A?Nd(t.githubOwner,t.githubRepo,A):void 0,githubTitle:A?`Open ${A} on GitHub`:void 0,refreshing:k,onRefresh:_}),g&&(u||m)&&d.jsxs("div",{className:pi,children:["Refresh failed: ",g]}),!m||e&&!u?d.jsx("div",{className:eu,children:d.jsx("div",{className:pi,children:g?`Failed to load: ${g}`:"Loading…"})}):C&&n==="changes"?d.jsx("div",{className:`${eu} wt-changes pt-0 px-4 pb-6 [&_>_:first-child]:mt-3.5`,children:N===0||!C.diff?d.jsx("div",{className:"changes-note text-sm text-muted",children:"No changes yet."}):d.jsxs(d.Fragment,{children:[C.diff.truncated&&d.jsx(Y2,{bytesRead:C.diff.bytesRead,byteLimit:C.diff.byteLimit}),d.jsx(N9,{diff:C.diff.diff,partial:C.diff.truncated})]})}):d.jsxs("div",{className:eu,children:[m.truncated&&d.jsx("div",{className:pi,children:"Listing truncated."}),x?x.dirs.size===0&&x.files.length===0?d.jsx("div",{className:pi,children:"No files."}):d.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:d.jsx(X2,{node:x,parentPath:"",depth:0,toggled:r,onToggle:w,onOpenFile:B=>C?l(B,e):l(B,void 0,t.baselineBranch)})}):d.jsx("div",{className:pi,children:"Loading…"})]})]})}const mV="modulepreload",gV=function(e){return"/"+e},r6={},ff=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=l(n.map(h=>{if(h=gV(h),h in r6)return;r6[h]=!0;const m=h.endsWith(".css"),f=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":mV,m||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),m)return new Promise((v,k)=>{g.addEventListener("load",v),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};function j9({text:e,path:t,highlightLine:n,scrollRequest:r,onScrollRequestHandled:i}){const a=O.useMemo(()=>_8(e,p8(t)),[e,t]),l=e?e.split(` +`).length-(e.endsWith(` +`)?1:0):0,c=n&&l>0?Math.min(Math.max(Math.trunc(n),1),l):void 0,u=O.useRef(null),h=O.useRef(null),[m,f]=O.useState(null);return O.useLayoutEffect(()=>{const g=u.current;if(!c||!g){f(null);return}const v=getComputedStyle(g),k=Number.parseFloat(v.paddingTop)||0,S=Number.parseFloat(v.lineHeight)||0;if(!S){f(null);return}f({line:c,top:k+(c-1)*S,height:S})},[a,c]),O.useLayoutEffect(()=>{var g;r!==void 0&&(m&&m.line===c?((g=h.current)==null||g.scrollIntoView({block:"center"}),i==null||i()):l===0&&(i==null||i()))},[m,l,i,r,c]),d.jsxs("div",{className:"file-view-codewrap flex items-start min-w-max relative",children:[l>0&&d.jsx("pre",{className:"file-view-gutter m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-3.5 pr-2.5 text-right text-muted select-none sticky left-0 bg-background border-r border-r-border-variant shrink-0","aria-hidden":"true",children:Array.from({length:l},(g,v)=>v+1).join(` +`)}),d.jsx("pre",{className:"file-view-code m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-4 pr-4 [tab-size:4] min-w-max",ref:u,children:d.jsx("code",{children:a})}),m&&d.jsx("div",{ref:h,className:"file-view-line-highlight absolute left-0 right-0 pointer-events-none bg-[color-mix(in_srgb,_var(--primary)_16%,_transparent)] shadow-[inset_2px_0_0_var(--primary)]",style:{top:m.top,height:m.height},"aria-hidden":"true"})]})}const vV="project";function bV(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function yV(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` +---`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const _V=512*1024,D9="orx:files-tree-width",R9=180,L9=560,xV=280;function wV(){try{const e=Number(localStorage.getItem(D9));if(Number.isFinite(e)&&e>=R9&&e<=L9)return e}catch{}return xV}function Yg(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Yg(n.children??[],t);if(r)return r}}return null}function O9(e){const t=[];for(const n of e)n.isDir&&(n.reportTitle!==void 0&&t.push(n),t.push(...O9(n.children??[])));return t}function B9({projectId:e,folder:t,markdown:n}){const r=i=>{if(bV(i))return i;const a=i.replace(/^\.?\//,"");return mo(e,t?`${t}/${a}`:a)};return d.jsx("div",{className:"md report-md",children:d.jsx(Ow,{remarkPlugins:[d8,[f8,S8]],rehypePlugins:[$S],components:{a:({href:i,children:a,...l})=>{const c=!i||i.startsWith("#");return d.jsx("a",{...l,href:c?i:r(i),...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const l=r(i);return d.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[d.jsx("img",{src:l,alt:a??"",loading:"lazy"}),a&&d.jsx("span",{className:"report-img-caption",children:a})]})},...C8},children:k8(yV(n))})})}const SV=O.lazy(()=>ff(()=>import("./ModelViewer-C_2Z847L.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ModelViewer}))),kV=O.lazy(()=>ff(()=>import("./SplatViewer-DWpiLLqa.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SplatViewer})));function CV(e){return e.isDir?"report":e$.test(e.name)?"markdown":j2(e.name)??"text"}function EV(e,t,n){const[r,i]=O.useState(null),[a,l]=O.useState(!1),[c,u]=O.useState(null),h=n==="report"||n==="markdown"||n==="text"&&t.size<=_V;return O.useEffect(()=>{if(i(null),l(!1),u(null),!h)return;let m=!1;return(n==="report"?q7(e,t.path).then(g=>g.markdown):fetch(mo(e,t.path)).then(g=>{if(!g.ok)throw new Error(`Failed to load file (${g.status})`);return g.text()})).then(g=>{m||(g.includes("\0")?l(!0):i(g))}).catch(g=>{m||u(g instanceof Error?g.message:String(g))}),()=>{m=!0}},[e,t.path,t.modifiedAt,n,h]),{text:r,binary:a,error:c,wantsText:h}}function NV({projectId:e,entry:t,onDelete:n}){const r=CV(t),{text:i,binary:a,error:l,wantsText:c}=EV(e,t,r),[u,h]=O.useState(!1),m=r==="report"||r==="markdown",f=t.isDir?t.path:t.path.split("/").slice(0,-1).join("/"),g=mo(e,t.isDir?`${t.path}/report.md`:t.path);let v;return r==="image"?v=d.jsx("a",{className:"fpreview-image",href:g,target:"_blank",rel:"noopener noreferrer",children:d.jsx("img",{src:g,alt:t.name})}):r==="video"?v=d.jsx("video",{className:"fpreview-video",src:g,controls:!0,loop:!0,playsInline:!0}):r==="audio"?v=d.jsx("audio",{className:"fpreview-audio",src:g,controls:!0}):r==="model"?v=d.jsx(O.Suspense,{fallback:d.jsx("div",{className:"file-view-note",children:"Loading 3D viewer…"}),children:d.jsx(SV,{src:g,name:t.name})}):r==="splat"?v=d.jsx(O.Suspense,{fallback:d.jsx("div",{className:"file-view-note",children:"Loading splat viewer…"}),children:d.jsx(kV,{src:g,name:t.name})}):r==="pdf"?v=d.jsx("iframe",{className:"fpreview-pdf",title:t.name,src:g}):!c||a?v=d.jsxs("div",{className:"file-view-note",children:[a?"Binary file — no inline preview.":"File too large to preview inline."," ",d.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:"Open raw"})]}):l?v=d.jsxs("div",{className:"file-view-note",children:["Failed to load: ",l]}):i===null?v=d.jsxs("div",{className:"settings-loading",children:[d.jsx("span",{className:"spinner"})," Loading…"]}):m&&!u?v=d.jsx(B9,{projectId:e,folder:f,markdown:i}):v=d.jsx(j9,{text:i,path:t.isDir?"report.md":t.path}),d.jsxs("div",{className:"fpreview file-view",children:[d.jsxs("div",{className:"fpreview-head",children:[d.jsx(j7,{size:13,style:{flexShrink:0}}),d.jsx("code",{className:"fpreview-path",title:t.path,children:t.isDir?`${t.path}/report.md`:t.path}),d.jsxs("span",{className:"fpreview-date",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),!t.isDir&&r==="text"&&d.jsx("span",{className:"fpreview-size",children:fa(t.size)}),m&&d.jsx("button",{className:`icon-btn ${u?"active":""}`,"data-tip":u?"Rendered view":"View source","aria-label":u?"Rendered view":"View source",onClick:()=>h(k=>!k),children:d.jsx(N7,{size:13})}),d.jsx("a",{className:"icon-btn",href:g,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","aria-label":"Open raw in new tab",children:d.jsx(Eu,{size:13})}),d.jsx("button",{className:"icon-btn","data-tip":t.isDir?"Delete report folder":"Delete file","aria-label":t.isDir?"Delete report folder":"Delete file",onClick:()=>{window.confirm(`Delete "${t.path}" from the files dir?`)&&n(t.path)},children:d.jsx(Cd,{size:13})})]}),d.jsx("div",{className:`fpreview-body ${m&&!u?"doc":""}`,children:v})]})}function z9({projectId:e,entries:t,depth:n,collapsed:r,selected:i,onToggle:a,onSelect:l}){return d.jsx(d.Fragment,{children:t.map(c=>{var h,m;const u={paddingLeft:8+n*14};if(c.isDir){const f=c.reportTitle!==void 0,g=!r.has(c.path),v=f?c.reportTitle:`${c.name}/`,k=f?[c.name,(h=c.experiment)==null?void 0:h.latestRunStatus].filter(Boolean).join(" — "):void 0;return d.jsxs("div",{children:[d.jsxs("div",{className:`ft-row ${i===c.path?"selected":""}`,style:u,title:k,onClick:()=>f?l(c.path):a(c.path),children:[d.jsx("button",{className:`ft-chevron ${g?"open":""}`,"aria-label":g?`Collapse ${c.name}`:`Expand ${c.name}`,onClick:S=>{S.stopPropagation(),a(c.path)},children:d.jsx(po,{size:12})}),d.jsx("span",{className:f?"ft-title":"ft-dirname",children:v})]}),g&&(((m=c.children)==null?void 0:m.length)??0)>0&&d.jsx(z9,{projectId:e,entries:c.children??[],depth:n+1,collapsed:r,selected:i,onToggle:a,onSelect:l})]},c.path)}return d.jsxs("div",{className:`ft-row file ${i===c.path?"selected":""}`,style:u,title:c.path,onClick:()=>l(c.path),children:[d.jsx("span",{className:"ft-chevron spacer"}),x8.test(c.name)&&d.jsx("img",{className:"ft-thumb",src:mo(e,c.path),alt:"",loading:"lazy"}),d.jsx("span",{className:"ft-name",children:c.name})]},c.path)})})}function AV(e){const t=[],n=[],r=[];for(const i of e)i.isDir&&i.name===vV?t.push(i):i.isDir&&i.experiment?n.push(i):r.push(i);return{project:t,experiments:n,other:r}}function i6({dir:e,onOpenStorage:t}){const[n,r]=O.useState(!1);return d.jsxs("div",{className:"ftree-footer",title:e,children:[d.jsx("code",{children:e}),d.jsx("button",{className:"icon-btn tip-up","data-tip":n?"Copied!":"Copy path","aria-label":"Copy files directory path",onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?d.jsx(kr,{size:12}):d.jsx(Sd,{size:12})}),d.jsx("button",{className:"icon-btn tip-up","data-tip":"Storage settings","aria-label":"Storage settings",onClick:t,children:d.jsx(kT,{size:12})})]})}function TV({project:e,files:t,onChanged:n,onOpenStorage:r}){const[i,a]=O.useState(null),[l,c]=O.useState(new Set),[u,h]=O.useState(!1),[m,f]=O.useState(wV),g=O.useRef(null),v=T=>{var B;T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId);const N=((B=g.current)==null?void 0:B.getBoundingClientRect().left)??0,j=document.body.style.userSelect;document.body.style.userSelect="none";const A=H=>{const V=Math.round(H.clientX-N),U=Math.min(Math.max(V,R9),L9);f(U);try{localStorage.setItem(D9,String(U))}catch{}},D=()=>{window.removeEventListener("pointermove",A),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",A),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};O.useEffect(()=>{if(!t||u||(h(!0),i))return;const T=O9(t.entries);if(T.length===0)return;const N=T.reduce((j,A)=>A.modifiedAt>j.modifiedAt?A:j);a(N.path)},[t,u,i]),O.useEffect(()=>{i&&t&&!Yg(t.entries,i)&&a(null)},[i,t]);const k=T=>c(N=>{const j=new Set(N);return j.has(T)?j.delete(T):j.add(T),j}),S=T=>{(i===T||i!=null&&i.startsWith(T+"/"))&&a(null),UM(e.id,T).catch(()=>{}).finally(n)};if(!t)return d.jsx("div",{className:"files-tab",children:d.jsxs("div",{className:"settings-loading",style:{padding:20},children:[d.jsx("span",{className:"spinner"})," Loading files…"]})});const{project:y,experiments:_,other:x}=AV(t.entries),w=T=>d.jsx(z9,{projectId:e.id,entries:T,depth:0,collapsed:l,selected:i,onToggle:k,onSelect:a}),C=i?Yg(t.entries,i):null;return t.entries.length===0?d.jsx("div",{className:"files-tab",children:d.jsxs("div",{className:"files-empty-state",children:[d.jsx(gv,{size:28,strokeWidth:1.5}),d.jsx("h3",{children:"No files yet"}),d.jsx("p",{children:"This is where the agent saves the project's files — experiment reports, figures, and other artifacts. Ask it for a write-up of its findings and the report will land here. You can also drop your own files into the folder:"}),d.jsx(i6,{dir:t.dir,onOpenStorage:r})]})}):d.jsxs("div",{className:"files-tab",children:[d.jsxs("div",{className:"ftree-pane",ref:g,style:{width:m},children:[d.jsx("div",{className:"ftree-resizer",onPointerDown:v}),d.jsxs("div",{className:"ftree-scroll",children:[w(y),w(_),x.length>0&&(_.length>0||y.length>0)&&d.jsx("div",{className:"ft-divider",children:"Other files"}),w(x),t.truncated&&d.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]}),d.jsx(i6,{dir:t.dir,onOpenStorage:r})]}),C?d.jsx(NV,{projectId:e.id,entry:C,onDelete:S},C.path):d.jsxs("div",{className:"fpreview fpreview-none",children:[d.jsx(cT,{size:22,strokeWidth:1.5}),d.jsx("span",{children:"Click a file to view it"})]})]})}const MV=20*1024*1024,Xg="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-sm [&_h3]:font-semibold [&_h3]:text-text",I9="mt-0 mx-0 mb-3 text-muted text-md leading-normal",H9="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",F9="font-mono text-sm font-medium text-text",$9="mt-0.5 mb-0 text-xs leading-relaxed text-muted";function jV(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const i=r.result;if(typeof i!="string"){n(new Error("could not read file"));return}const a=i.indexOf(",");t(a>=0?i.slice(a+1):i)},r.onerror=()=>n(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function DV(e){const t=e.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")||t.endsWith(".zip")}function RV({skill:e,projectId:t,onDeleted:n,onError:r}){const[i,a]=O.useState(!1);return d.jsxs("div",{className:H9,children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("code",{className:F9,children:["/",e.name]}),d.jsx("p",{className:$9,children:e.description})]}),d.jsxs("div",{className:"shrink-0 text-right whitespace-nowrap pt-0.5",children:[d.jsx("div",{className:"text-2xs text-subtext",children:fa(e.bytes)}),e.updatedAt>0&&d.jsx("div",{className:"text-2xs text-muted",children:Pi(e.updatedAt)})]}),d.jsx("button",{className:oo,"data-tip":"Delete skill","data-tip-align":"end","aria-label":`Delete skill ${e.name}`,disabled:i,onClick:()=>{window.confirm(`Delete the "${e.name}" skill?`)&&(a(!0),ej({scope:e.scope,name:e.name,projectId:e.scope==="project"?t:void 0}).then(n).catch(l=>{a(!1),r(l instanceof Error?l.message:String(l))}))},children:d.jsx(Cd,{size:13})})]})}function s6({title:e,hint:t,skills:n,projectId:r,onChanged:i,onError:a}){return d.jsxs("section",{className:Xg,children:[d.jsx("h3",{children:e}),d.jsx("p",{className:I9,children:t}),n.length===0?d.jsx("div",{className:"text-muted text-sm",children:"No skills yet."}):d.jsx("div",{className:"flex flex-col",children:n.map(l=>d.jsx(RV,{skill:l,projectId:r,onDeleted:i,onError:a},l.name))})]})}function LV({skill:e,scopeLabel:t,alreadyImported:n,onImport:r}){const[i,a]=O.useState(!1);return d.jsxs("div",{className:H9,children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("code",{className:F9,children:["/",e.name]}),d.jsx("span",{className:rr,children:e.harnessName})]}),d.jsx("p",{className:$9,children:e.description})]}),d.jsxs("button",{className:ws,disabled:i,title:`Import into ${t}`,onClick:async()=>{a(!0);try{await r(e)}finally{a(!1)}},children:[i?d.jsx("span",{className:Yn}):d.jsx(RA,{size:13}),n?"Re-import":"Import"]})]})}function OV({project:e}){const[t,n]=O.useState(null),[r,i]=O.useState([]),[a,l]=O.useState("global"),[c,u]=O.useState(!1),[h,m]=O.useState(null),[f,g]=O.useState(!1),v=O.useRef(null),k=O.useCallback(()=>{QM(e==null?void 0:e.id).then(n).catch(()=>n([]))},[e==null?void 0:e.id]);O.useEffect(()=>{k()},[k]),O.useEffect(()=>{tj().then(i).catch(()=>i([]))},[]),O.useEffect(()=>{!e&&a==="project"&&l("global")},[e,a]);const S=O.useRef(!1),y=O.useCallback(async A=>{if(!S.current){if(m(null),!DV(A.name)){m("Upload a SKILL.md file or a .zip of a skill folder.");return}if(A.size>MV){m("File too large (max 20 MB).");return}S.current=!0,u(!0);try{const D=await jV(A);await JM({scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0,filename:A.name,contentBase64:D}),k()}catch(D){m(D instanceof Error?D.message:String(D))}finally{S.current=!1,u(!1)}}},[a,e==null?void 0:e.id,k]),_=A=>{var B;A.preventDefault(),g(!1);const D=(B=A.dataTransfer.files)==null?void 0:B[0];D&&y(D)},x=O.useCallback(async A=>{m(null);try{await nj({harness:A.harnessId,name:A.name,scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0}),k()}catch(D){m(D instanceof Error?D.message:String(D))}},[a,e==null?void 0:e.id,k]),w=(t??[]).filter(A=>A.scope==="global"),C=(t??[]).filter(A=>A.scope==="project"),T=a==="global"?"Global":(e==null?void 0:e.name)??"this project",N=new Set((t??[]).filter(A=>A.scope===a).map(A=>A.name)),j=A=>`flex-1 flex flex-col gap-0.5 py-2.5 px-3 border rounded-md text-left text-sm font-medium cursor-pointer transition-[border-color,background] duration-120 disabled:opacity-50 disabled:cursor-not-allowed ${A?"border-primary bg-surface":"border-border bg-background text-text [&:hover:not(:disabled)]:border-border-variant"}`;return d.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:[d.jsx("h1",{children:"Skills"}),d.jsxs("p",{className:"mt-0 mx-0 mb-5 text-muted text-md leading-normal [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text",children:["Upload ",d.jsx("code",{children:"SKILL.md"})," skills your agent discovers automatically in every session and you can invoke with ",d.jsx("code",{children:"/name"})," in chat. Add a single ",d.jsx("code",{children:"SKILL.md"})," or a"," ",d.jsx("code",{children:".zip"})," of a skill folder (with supporting scripts and resources)."]}),d.jsxs("section",{className:Xg,children:[d.jsx("h3",{children:"Add a skill"}),d.jsxs("div",{className:"flex gap-2 mb-3.5",role:"group","aria-label":"Skill scope",children:[d.jsxs("button",{type:"button","aria-pressed":a==="global",className:j(a==="global"),onClick:()=>l("global"),children:["Global",d.jsx("span",{className:"text-2xs font-normal text-muted",children:"Every project"})]}),d.jsxs("button",{type:"button","aria-pressed":a==="project",className:j(a==="project"),disabled:!e,title:e?void 0:"Open a project to add a project skill",onClick:()=>l("project"),children:["This project",d.jsx("span",{className:"text-2xs font-normal text-muted",children:e?e.name:"No project open"})]})]}),d.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 transition-[border-color,background] duration-120 [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text ${c?"cursor-default":"cursor-pointer"} ${f?"border-primary bg-surface text-text":"border-border-variant bg-surface text-muted [&:hover]:border-primary [&:hover]:text-text"}`,onDragOver:A=>{A.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:_,onClick:()=>{var A;return(A=v.current)==null?void 0:A.click()},role:"button",tabIndex:0,onKeyDown:A=>{var D;(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),(D=v.current)==null||D.click())},children:[d.jsx("input",{ref:v,type:"file",accept:".md,.markdown,.zip",hidden:!0,onChange:A=>{var B;const D=(B=A.target.files)==null?void 0:B[0];D&&y(D),A.target.value=""}}),c?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Yn}),d.jsx("span",{children:"Uploading…"})]}):d.jsxs(d.Fragment,{children:[d.jsx(BT,{size:20,strokeWidth:1.5}),d.jsxs("span",{children:["Drop a ",d.jsx("code",{children:"SKILL.md"})," or ",d.jsx("code",{children:".zip"})," here, or click to choose"]}),d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-subtext",children:[d.jsx($A,{size:12})," Adding to"," ",d.jsx("strong",{className:"text-text font-semibold",children:a==="global"?"Global":e==null?void 0:e.name})]})]})]}),h&&d.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:h})]}),r.length>0&&d.jsxs("section",{className:Xg,children:[d.jsx("h3",{children:"Import from your agent"}),d.jsxs("p",{className:`${I9} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text [&_strong]:text-text [&_strong]:font-semibold`,children:["Skills already installed in your coding agents. Import a copy into"," ",d.jsx("strong",{children:T})," so it's managed here and invocable with ",d.jsx("code",{children:"/name"}),"."]}),d.jsx("div",{className:"flex flex-col",children:r.map(A=>d.jsx(LV,{skill:A,scopeLabel:T,alreadyImported:N.has(A.name),onImport:x},`${A.harnessId}:${A.name}`))})]}),t===null?d.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md p-3",children:[d.jsx("span",{className:Yn})," Loading skills…"]}):d.jsxs(d.Fragment,{children:[d.jsx(s6,{title:"Global skills",hint:"Available to the agent in every project.",skills:w,onChanged:k,onError:m}),e&&d.jsx(s6,{title:`${e.name} skills`,hint:"Available only in this project's sessions. Shadows a global skill of the same name.",skills:C,projectId:e.id,onChanged:k,onError:m})]})]})}function ol({active:e,label:t,icon:n,onSelect:r,onClose:i}){return d.jsxs("button",{className:`tab [&.closable]:max-w-37.5 [&.closable]:pr-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-[color-mix(in_oklab,_var(--text)_15%,_transparent)] [&_.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 shrink-0 [&: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]:-left-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]:right-0 [&.active::after]:-bottom-px [&.active::after]:left-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""}`,onClick:r,title:t,children:[n,d.jsx("span",{className:"tab-label","data-label":t,children:d.jsx("span",{children:t})}),d.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:a=>{a.stopPropagation(),i()},children:d.jsx(eo,{size:12})})]})}const a6=["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 BV({owner:e,repo:t,branch:n}){return!e||!t?d.jsx("span",{className:a6,children:d.jsx("code",{children:n})}):d.jsxs("a",{className:a6,href:Nd(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[d.jsx("code",{children:n}),d.jsx(R2,{size:12})]})}var E1={exports:{}},o6;function zV(){return o6||(o6=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),f=u-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(f/a.css.cell.height))}}}})(),n})()))})(E1)),E1.exports}var IV=zV(),N1={exports:{}},l6;function HV(){return l6||(l6=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(l,c,u){var h=this&&this.__decorate||function(x,w,C,T){var N,j=arguments.length,A=j<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,w,C,T);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(A=(j<3?N(A):j>3?N(w,C,A):N(w,C))||A);return j>3&&A&&Object.defineProperty(w,C,A),A},m=this&&this.__param||function(x,w){return function(C,T){w(C,T,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const f=u(9042),g=u(9924),v=u(844),k=u(4725),S=u(2585),y=u(3656);let _=c.AccessibilityManager=class extends v.Disposable{constructor(x,w,C,T){super(),this._terminal=x,this._coreBrowserService=C,this._renderService=T,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 g.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,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let w=0;w0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.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,w){this._liveRegionDebouncer.refresh(x,w,this._terminal.rows)}_renderRows(x,w){const C=this._terminal.buffer,T=C.lines.length.toString();for(let N=x;N<=w;N++){const j=C.lines.get(C.ydisp+N),A=[],D=(j==null?void 0:j.translateToString(!0,void 0,void 0,A))||"",B=(C.ydisp+N+1).toString(),H=this._rowElements[N];H&&(D.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=D,this._rowColumns.set(H,A)),H.setAttribute("aria-posinset",B),H.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,w){const C=x.target,T=this._rowElements[w===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(w===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==T)return;let N,j;if(w===0?(N=C,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(N=this._rowElements.shift(),j=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),j.removeEventListener("focus",this._bottomBoundaryFocusListener),w===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}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(),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 w={node:x.anchorNode,offset:x.anchorOffset},C={node:x.focusNode,offset:x.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 T=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:T,offset:((D=T.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:B,offset:H})=>{const V=B instanceof Text?B.parentNode:B;let U=parseInt(V==null?void 0:V.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const P=this._rowColumns.get(V);if(!P)return console.warn("columns is null. Race condition?"),null;let K=H=this._terminal.cols&&(++U,K=0),{row:U,column:K}},j=N(w),A=N(C);if(j&&A){if(j.row>A.row||j.row===A.row&&j.column>=A.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(A.row-j.row)*this._terminal.cols-j.column+A.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let w=this._rowContainer.children.length;wx;)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 u(g){return g.replace(/\r?\n/g,"\r")}function h(g,v){return v?"\x1B[200~"+g+"\x1B[201~":g}function m(g,v,k,S){g=h(g=u(g),k.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(g,!0),v.value=""}function f(g,v,k){const S=k.getBoundingClientRect(),y=g.clientX-S.left-10,_=g.clientY-S.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${y}px`,v.style.top=`${_}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(g,v){g.clipboardData&&g.clipboardData.setData("text/plain",v.selectionText),g.preventDefault()},c.handlePasteEvent=function(g,v,k,S){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),v,k,S)},c.paste=m,c.moveTextAreaUnderMouseCursor=f,c.rightClickHandler=function(g,v,k,S,y){f(g,v,k),y&&S.rightClickSelect(g),v.value=S.selectionText,v.select()}},7239:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const h=u(1505);c.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,f,g){this._css.set(m,f,g)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,g){this._color.set(m,f,g)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,m,f){u.addEventListener(h,m,f);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(h,m,f))}}}},3551:function(l,c,u){var h=this&&this.__decorate||function(_,x,w,C){var T,N=arguments.length,j=N<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,x,w,C);else for(var A=_.length-1;A>=0;A--)(T=_[A])&&(j=(N<3?T(j):N>3?T(x,w,j):T(x,w))||j);return N>3&&j&&Object.defineProperty(x,w,j),j},m=this&&this.__param||function(_,x){return function(w,C){x(w,C,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const f=u(3656),g=u(8460),v=u(844),k=u(2585),S=u(4725);let y=c.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(_,x,w,C,T){super(),this._element=_,this._mouseService=x,this._renderService=w,this._bufferService=C,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.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,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(_){this._lastMouseEvent=_;const x=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const w=_.composedPath();for(let C=0;C{N==null||N.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let w=!1;for(const[N,j]of this._linkProviderService.linkProviders.entries())x?(T=this._activeProviderReplies)!=null&&T.get(N)&&(w=this._checkLinkProviderResult(N,_,w)):j.provideLinks(_.y,(A=>{var B,H;if(this._isMouseOut)return;const D=A==null?void 0:A.map((V=>({link:V})));(B=this._activeProviderReplies)==null||B.set(N,D),w=this._checkLinkProviderResult(N,_,w),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,x){const w=new Set;for(let C=0;C_?this._bufferService.cols:j.link.range.end.x;for(let B=A;B<=D;B++){if(w.has(B)){T.splice(N--,1);break}w.add(B)}}}}_checkLinkProviderResult(_,x,w){var N;if(!this._activeProviderReplies)return w;const C=this._activeProviderReplies.get(_);let T=!1;for(let j=0;j<_;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(T=!0);if(!T&&C){const j=C.find((A=>this._linkAtPosition(A.link,x)));j&&(w=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!w)for(let j=0;jthis._linkAtPosition(D.link,x)));if(A){w=!0,this._handleNewLink(A);break}}return w}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const x=this._positionFromMouseEvent(_,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,x){this._currentLink&&this._lastMouseEvent&&(!_||!x||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(_.link,x)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.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,T,N;(C=this._currentLink)!=null&&C.state&&((N=(T=this._currentLink)==null?void 0:T.state)==null?void 0:N.decorations.underline)!==w&&(this._currentLink.state.decorations.underline=w,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.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,T=this._bufferService.buffer.ydisp+1+w.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(C,T),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(_,x,w){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&&_.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(w,x.text)}_fireUnderlineEvent(_,x){const w=_.range,C=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(w.start.x-1,w.start.y-C-1,w.end.x,w.end.y-C-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(_,x,w){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&&_.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(w,x.text)}_linkAtPosition(_,x){const w=_.range.start.y*this._bufferService.cols+_.range.start.x,C=_.range.end.y*this._bufferService.cols+_.range.end.x,T=x.y*this._bufferService.cols+x.x;return w<=T&&T<=C}_positionFromMouseEvent(_,x,w){const C=w.getCoords(_,x,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,x,w,C,T){return{x1:_,y1:x,x2:w,y2:C,cols:this._bufferService.cols,fg:T}}};c.Linkifier=y=h([m(1,S.IMouseService),m(2,S.IRenderService),m(3,k.IBufferService),m(4,S.ILinkProviderService)],y)},9042:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,c,u){var h=this&&this.__decorate||function(S,y,_,x){var w,C=arguments.length,T=C<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,y,_,x);else for(var N=S.length-1;N>=0;N--)(w=S[N])&&(T=(C<3?w(T):C>3?w(y,_,T):w(y,_))||T);return C>3&&T&&Object.defineProperty(y,_,T),T},m=this&&this.__param||function(S,y){return function(_,x){y(_,x,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const f=u(511),g=u(2585);let v=c.OscLinkProvider=class{constructor(S,y,_){this._bufferService=S,this._optionsService=y,this._oscLinkService=_}provideLinks(S,y){var D;const _=this._bufferService.buffer.lines.get(S-1);if(!_)return void y(void 0);const x=[],w=this._optionsService.rawOptions.linkHandler,C=new f.CellData,T=_.getTrimmedLength();let N=-1,j=-1,A=!1;for(let B=0;Bw?w.activate(P,K,V):k(0,K),hover:(P,K)=>{var W;return(W=w==null?void 0:w.hover)==null?void 0:W.call(w,P,K,V)},leave:(P,K)=>{var W;return(W=w==null?void 0:w.leave)==null?void 0:W.call(w,P,K,V)}})}A=!1,C.hasExtendedAttrs()&&C.extended.urlId?(j=B,N=C.extended.urlId):(j=-1,N=-1)}}y(x)}};function k(S,y){if(confirm(`Do you want to navigate to ${y}? + +WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=v=h([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],v)},6193:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,m){this._rowCount=m,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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 u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),m=u(3656),f=u(3551),g=u(9042),v=u(3730),k=u(1680),S=u(3107),y=u(5744),_=u(2950),x=u(1296),w=u(428),C=u(4269),T=u(5114),N=u(8934),j=u(3230),A=u(9312),D=u(4725),B=u(6731),H=u(8055),V=u(8969),U=u(8460),P=u(844),K=u(6114),W=u(8437),Z=u(2584),ee=u(7399),z=u(5941),L=u(9074),I=u(2585),Y=u(5435),G=u(4567),se=u(779);class oe extends V.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(te={}){super(te),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new P.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(L.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(se.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,ne)=>this.refresh(q,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),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((q=>this._afterResize(q.cols,q.rows)))),this.register((0,P.toDisposable)((()=>{var q,ne;this._customKeyEventHandler=void 0,(ne=(q=this.element)==null?void 0:q.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(te){if(this._themeService)for(const q of te){let ne,le="";switch(q.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;"+q.index}switch(q.type){case 0:const ye=H.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${Z.C0.ESC}]${le};${(0,z.toRgbString)(ye)}${Z.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((ve=>ve.ansi[q.index]=H.channels.toColor(...q.color)));else{const ve=ne;this._themeService.modifyColors((Ee=>Ee[ve]=H.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(te){te?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(te){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var te;return(te=this.textarea)==null?void 0:te.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.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 te=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(te);if(!q)return;const ne=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,ye=q.getWidth(ne),ve=this._renderService.dimensions.css.cell.width*ye,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=ve+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const te=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",te)),this.register((0,m.addDisposableDomListener)(this.element,"paste",te)),K.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(te=>this._keyUp(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(te=>this._keyDown(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(te=>this._keyPress(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(te=>this._compositionHelper.compositionupdate(te)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(te=>this._inputEvent(te)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(te){var ne;if(!te)throw new Error("Terminal requires a parent element.");if(te.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=te.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"),te.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.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,m.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),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),K.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(T.CoreBrowserService,this.textarea,te.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,m.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(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.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(j.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(_.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(f.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.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(A.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,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,m.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(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.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 te=this,q=this.element;function ne(ve){const Ee=te._mouseService.getMouseReportCoords(ve,te.screenElement);if(!Ee)return!1;let je,Pe;switch(ve.overrideType||ve.type){case"mousemove":Pe=32,ve.buttons===void 0?(je=3,ve.button!==void 0&&(je=ve.button<3?ve.button:3)):je=1&ve.buttons?0:4&ve.buttons?1:2&ve.buttons?2:3;break;case"mouseup":Pe=0,je=ve.button<3?ve.button:3;break;case"mousedown":Pe=1,je=ve.button<3?ve.button:3;break;case"wheel":if(te._customWheelEventHandler&&te._customWheelEventHandler(ve)===!1||te.viewport.getLinesScrolled(ve)===0)return!1;Pe=ve.deltaY<0?0:1,je=4;break;default:return!1}return!(Pe===void 0||je===void 0||je>4)&&te.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:je,action:Pe,ctrl:ve.ctrlKey,alt:ve.altKey,shift:ve.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ye={mouseup:ve=>(ne(ve),ve.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(ve)),wheel:ve=>(ne(ve),this.cancel(ve,!0)),mousedrag:ve=>{ve.buttons&&ne(ve)},mousemove:ve=>{ve.buttons||ne(ve)}};this.register(this.coreMouseService.onProtocolChange((ve=>{ve?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ve)),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&ve?le.mousemove||(q.addEventListener("mousemove",ye.mousemove),le.mousemove=ye.mousemove):(q.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&ve?le.wheel||(q.addEventListener("wheel",ye.wheel,{passive:!1}),le.wheel=ye.wheel):(q.removeEventListener("wheel",le.wheel),le.wheel=null),2&ve?le.mouseup||(le.mouseup=ye.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&ve?le.mousedrag||(le.mousedrag=ye.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(q,"mousedown",(ve=>{if(ve.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ve))return ne(ve),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(ve)}))),this.register((0,m.addDisposableDomListener)(q,"wheel",(ve=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ve)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(ve);if(Ee===0)return;const je=Z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ve.deltaY<0?"A":"B");let Pe="";for(let $e=0;$e{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ve),this.cancel(ve)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(q,"touchmove",(ve=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ve)?void 0:this.cancel(ve)}),{passive:!1}))}refresh(te,q){var ne;(ne=this._renderService)==null||ne.refreshRows(te,q)}updateCursorStyle(te){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(te)?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(te,q,ne=0){var le;ne===1?(super.scrollLines(te,q,ne),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(te)}paste(te){(0,h.paste)(te,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(te){this._customKeyEventHandler=te}attachCustomWheelEventHandler(te){this._customWheelEventHandler=te}registerLinkProvider(te){return this._linkProviderService.registerLinkProvider(te)}registerCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(te);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(te)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(te){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+te)}registerDecoration(te){return this._decorationService.registerDecoration(te)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(te,q,ne){this._selectionService.setSelection(te,q,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 te;(te=this._selectionService)==null||te.clearSelection()}selectAll(){var te;(te=this._selectionService)==null||te.selectAll()}selectLines(te,q){var ne;(ne=this._selectionService)==null||ne.selectLines(te,q)}_keyDown(te){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&te.altKey;if(!q&&!this._compositionHelper.keydown(te))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||te.key!=="Dead"&&te.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,ee.evaluateKeyboardEvent)(te,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(te),ne.type===3||ne.type===2){const le=this.rows-1;return this.scrollLines(ne.type===2?-le:le),this.cancel(te,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,te)||(ne.cancel&&this.cancel(te,!0),!ne.key||!!(te.key&&!te.ctrlKey&&!te.altKey&&!te.metaKey&&te.key.length===1&&te.key.charCodeAt(0)>=65&&te.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==Z.C0.ETX&&ne.key!==Z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||te.altKey||te.ctrlKey?this.cancel(te,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(te,q){const ne=te.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||te.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||te.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?ne:ne&&(!q.keyCode||q.keyCode>47)}_keyUp(te){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(te)||this.focus(),this.updateCursorStyle(te),this._keyPressHandled=!1)}_keyPress(te){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;if(this.cancel(te),te.charCode)q=te.charCode;else if(te.which===null||te.which===void 0)q=te.keyCode;else{if(te.which===0||te.charCode===0)return!1;q=te.which}return!(!q||(te.altKey||te.ctrlKey||te.metaKey)&&!this._isThirdLevelShift(this.browser,te)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(te){if(te.data&&te.inputType==="insertText"&&(!te.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=te.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(te),!0}return!1}resize(te,q){te!==this.cols||q!==this.rows?super.resize(te,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(te,q){var ne,le;(ne=this._charSizeService)==null||ne.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var te;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 q=1;q{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,m){this._rowCount=m,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,v=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(l,c,u){var h=this&&this.__decorate||function(_,x,w,C){var T,N=arguments.length,j=N<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,x,w,C);else for(var A=_.length-1;A>=0;A--)(T=_[A])&&(j=(N<3?T(j):N>3?T(x,w,j):T(x,w))||j);return N>3&&j&&Object.defineProperty(x,w,j),j},m=this&&this.__param||function(_,x){return function(w,C){x(w,C,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const f=u(3656),g=u(4725),v=u(8460),k=u(844),S=u(2585);let y=c.Viewport=class extends k.Disposable{constructor(_,x,w,C,T,N,j,A){super(),this._viewportElement=_,this._scrollArea=x,this._bufferService=w,this._optionsService=C,this._charSizeService=T,this._renderService=N,this._coreBrowserService=j,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 v.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((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.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(_){if(_)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 _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){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 _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<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(_,x){const w=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&w0&&(w=V),C=""}}return{bufferElements:T,cursorElement:w}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let x=this._applyScrollModifier(_.deltaY,_);return _.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):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(_,x){const w=this._optionsService.rawOptions.fastScrollModifier;return w==="alt"&&x.altKey||w==="ctrl"&&x.ctrlKey||w==="shift"&&x.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const x=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(_,x))}};c.Viewport=y=h([m(2,S.IBufferService),m(3,S.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],y)},3107:function(l,c,u){var h=this&&this.__decorate||function(S,y,_,x){var w,C=arguments.length,T=C<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,y,_,x);else for(var N=S.length-1;N>=0;N--)(w=S[N])&&(T=(C<3?w(T):C>3?w(y,_,T):w(y,_))||T);return C>3&&T&&Object.defineProperty(y,_,T),T},m=this&&this.__param||function(S,y){return function(_,x){y(_,x,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const f=u(4725),g=u(844),v=u(2585);let k=c.BufferDecorationRenderer=class extends g.Disposable{constructor(S,y,_,x,w){super(),this._screenElement=S,this._bufferService=y,this._coreBrowserService=_,this._decorationService=x,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,g.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 x;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((x=S==null?void 0:S.options)==null?void 0:x.layer)==="top"),y.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=S.options.x??0;return _&&_>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(S,y),y}_refreshStyle(S){const y=S.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let _=this._decorationElements.get(S);_||(_=this._createElement(S),S.element=_,this._decorationElements.set(S,_),this._container.appendChild(_),S.onDispose((()=>{this._decorationElements.delete(S),_.remove()}))),_.style.top=y*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(_)}}_refreshXPosition(S,y=S.element){if(!y)return;const _=S.options.x??0;(S.options.anchor||"left")==="right"?y.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var y;(y=this._decorationElements.get(S))==null||y.remove(),this._decorationElements.delete(S),S.dispose()}};c.BufferDecorationRenderer=k=h([m(1,v.IBufferService),m(2,f.ICoreBrowserService),m(3,v.IDecorationService),m(4,f.IRenderService)],k)},5871:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.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(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,m){return h>=u.startBufferLine-this._linePadding[m||"full"]&&h<=u.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(l,c,u){var h=this&&this.__decorate||function(w,C,T,N){var j,A=arguments.length,D=A<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,T):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,C,T,N);else for(var B=w.length-1;B>=0;B--)(j=w[B])&&(D=(A<3?j(D):A>3?j(C,T,D):j(C,T))||D);return A>3&&D&&Object.defineProperty(C,T,D),D},m=this&&this.__param||function(w,C){return function(T,N){C(T,N,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const f=u(5871),g=u(4725),v=u(844),k=u(2585),S={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let x=c.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(w,C,T,N,j,A,D){var H;super(),this._viewportElement=w,this._screenElement=C,this._bufferService=T,this._decorationService=N,this._renderService=j,this._optionsService=A,this._coreBrowserService=D,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(),(H=this._viewportElement.parentElement)==null||H.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)((()=>{var V;(V=this._canvas)==null||V.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);y.full=this._canvas.width,y.left=w,y.center=C,y.right=w,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=y.left,_.right=y.left+y.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(_[w.position||"full"],Math.round((this._canvas.height-1)*(w.startBufferLine/this._bufferService.buffers.active.lines.length)-S[w.position||"full"]/2),y[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})))}};c.OverviewRulerRenderer=x=h([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,g.IRenderService),m(5,k.IOptionsService),m(6,g.ICoreBrowserService)],x)},2950:function(l,c,u){var h=this&&this.__decorate||function(S,y,_,x){var w,C=arguments.length,T=C<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,y,_,x);else for(var N=S.length-1;N>=0;N--)(w=S[N])&&(T=(C<3?w(T):C>3?w(y,_,T):w(y,_))||T);return C>3&&T&&Object.defineProperty(y,_,T),T},m=this&&this.__param||function(S,y){return function(_,x){y(_,x,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const f=u(4725),g=u(2585),v=u(2584);let k=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,y,_,x,w,C){this._textarea=S,this._compositionView=y,this._bufferService=_,this._optionsService=x,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 y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,_=y.replace(S,"");this._dataAlreadySent=_,y.length>S.length?this._coreService.triggerDataEvent(_,!0):y.lengththis.updateCompositionElements(!0)),0)}}};c.CompositionHelper=k=h([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,f.IRenderService)],k)},9806:(l,c)=>{function u(h,m,f){const g=f.getBoundingClientRect(),v=h.getComputedStyle(f),k=parseInt(v.getPropertyValue("padding-left")),S=parseInt(v.getPropertyValue("padding-top"));return[m.clientX-g.left-k,m.clientY-g.top-S]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,m,f,g,v,k,S,y,_){if(!k)return;const x=u(h,m,f);return x?(x[0]=Math.ceil((x[0]+(_?S/2:0))/S),x[1]=Math.ceil(x[1]/y),x[0]=Math.min(Math.max(x[0],1),g+(_?1:0)),x[1]=Math.min(Math.max(x[1],1),v),x):void 0}},9504:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function m(y,_,x,w){const C=y-f(y,x),T=_-f(_,x),N=Math.abs(C-T)-(function(j,A,D){let B=0;const H=j-f(j,D),V=A-f(A,D);for(let U=0;U=0&&y<_.rows;)x++,w=_.buffer.lines.get(--y),C=w==null?void 0:w.isWrapped;return x}function g(y,_){return y>_?"A":"B"}function v(y,_,x,w,C,T){let N=y,j=_,A="";for(;N!==x||j!==w;)N+=C?1:-1,C&&N>T.cols-1?(A+=T.buffer.translateBufferLineToString(j,!1,y,N),N=0,y=0,j++):!C&&N<0&&(A+=T.buffer.translateBufferLineToString(j,!1,0,y+1),N=T.cols-1,y=N,j--);return A+T.buffer.translateBufferLineToString(j,!1,y,N)}function k(y,_){const x=_?"O":"[";return h.C0.ESC+x+y}function S(y,_){y=Math.floor(y);let x="";for(let w=0;w0?H-f(H,V):D;const K=H,W=(function(Z,ee,z,L,I,Y){let G;return G=m(z,L,I,Y).length>0?L-f(L,I):ee,Z=z&&Gy?"D":"C",S(Math.abs(C-y),k(N,w));N=T>_?"D":"C";const j=Math.abs(T-_);return S((function(A,D){return D.cols-A})(T>_?y:C,x)+(j-1)*x.cols+1+((T>_?C:y)-1),k(N,w))}},1296:function(l,c,u){var h=this&&this.__decorate||function(U,P,K,W){var Z,ee=arguments.length,z=ee<3?P:W===null?W=Object.getOwnPropertyDescriptor(P,K):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,P,K,W);else for(var L=U.length-1;L>=0;L--)(Z=U[L])&&(z=(ee<3?Z(z):ee>3?Z(P,K,z):Z(P,K))||z);return ee>3&&z&&Object.defineProperty(P,K,z),z},m=this&&this.__param||function(U,P){return function(K,W){P(K,W,U)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const f=u(3787),g=u(2550),v=u(2223),k=u(6171),S=u(6052),y=u(4725),_=u(8055),x=u(8460),w=u(844),C=u(2585),T="xterm-dom-renderer-owner-",N="xterm-rows",j="xterm-fg-",A="xterm-bg-",D="xterm-focus",B="xterm-selection";let H=1,V=c.DomRenderer=class extends w.Disposable{constructor(U,P,K,W,Z,ee,z,L,I,Y,G,se,oe){super(),this._terminal=U,this._document=P,this._element=K,this._screenElement=W,this._viewportElement=Z,this._helperContainer=ee,this._linkifier2=z,this._charSizeService=I,this._optionsService=Y,this._bufferService=G,this._coreBrowserService=se,this._themeService=oe,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,S.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(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((fe=>this._injectCss(fe)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((fe=>this._handleLinkHover(fe)))),this.register(this._linkifier2.onHideLinkUnderline((fe=>this._handleLinkLeave(fe)))),this.register((0,w.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const P=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=P,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 P=`${this._terminalSelector} .${N} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;P+=`${this._terminalSelector} .${N} .xterm-dim { color: ${_.color.multiplyOpacity(U.foreground,.5).css};}`,P+=`${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 K=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,Z=`blink_block_${this._terminalClass}`;P+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,P+=`@keyframes ${W} { 50% { box-shadow: none; }}`,P+=`@keyframes ${Z} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,P+=`${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,P+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,z]of U.ansi.entries())P+=`${this._terminalSelector} .${j}${ee} { color: ${z.css}; }${this._terminalSelector} .${j}${ee}.xterm-dim { color: ${_.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${A}${ee} { background-color: ${z.css}; }`;P+=`${this._terminalSelector} .${j}${v.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(U.background).css}; }${this._terminalSelector} .${j}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${A}${v.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=P}_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,P){for(let K=this._rowElements.length;K<=P;K++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>P;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,P){this._refreshRowElements(U,P),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(U,P,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,P,K),this.renderRows(0,this._bufferService.rows-1),!U||!P)return;this._selectionRenderModel.update(this._terminal,U,P,K);const W=this._selectionRenderModel.viewportStartRow,Z=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||z<0)return;const L=this._document.createDocumentFragment();if(K){const I=U[0]>P[0];L.appendChild(this._createSelectionElement(ee,I?P[0]:U[0],I?U[0]:P[0],z-ee+1))}else{const I=W===ee?U[0]:0,Y=ee===Z?P[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(ee,I,Y));const G=z-ee-1;if(L.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,G)),ee!==z){const se=Z===z?P[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(z,0,se))}}this._selectionContainer.appendChild(L)}_createSelectionElement(U,P,K,W=1){const Z=this._document.createElement("div"),ee=P*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(K-P);return ee+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-ee),Z.style.height=W*this.dimensions.css.cell.height+"px",Z.style.top=U*this.dimensions.css.cell.height+"px",Z.style.left=`${ee}px`,Z.style.width=`${z}px`,Z}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,P){const K=this._bufferService.buffer,W=K.ybase+K.y,Z=Math.min(K.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=U;I<=P;I++){const Y=I+K.ydisp,G=this._rowElements[I],se=K.lines.get(Y);if(!G||!se)break;G.replaceChildren(...this._rowFactory.createRow(se,Y,Y===W,z,L,Z,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${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,P,K,W,Z,ee){K<0&&(U=0),W<0&&(P=0);const z=this._bufferService.rows-1;K=Math.max(Math.min(K,z),0),W=Math.max(Math.min(W,z),0),Z=Math.min(Z,this._bufferService.cols);const L=this._bufferService.buffer,I=L.ybase+L.y,Y=Math.min(L.x,Z-1),G=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,oe=this._optionsService.rawOptions.cursorInactiveStyle;for(let fe=K;fe<=W;++fe){const te=fe+L.ydisp,q=this._rowElements[fe],ne=L.lines.get(te);if(!q||!ne)break;q.replaceChildren(...this._rowFactory.createRow(ne,te,te===I,se,oe,Y,G,this.dimensions.css.cell.width,this._widthCache,ee?fe===K?U:0:-1,ee?(fe===W?P:Z)-1:-1))}}};c.DomRenderer=V=h([m(7,C.IInstantiationService),m(8,y.ICharSizeService),m(9,C.IOptionsService),m(10,C.IBufferService),m(11,y.ICoreBrowserService),m(12,y.IThemeService)],V)},3787:function(l,c,u){var h=this&&this.__decorate||function(N,j,A,D){var B,H=arguments.length,V=H<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,A):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(N,j,A,D);else for(var U=N.length-1;U>=0;U--)(B=N[U])&&(V=(H<3?B(V):H>3?B(j,A,V):B(j,A))||V);return H>3&&V&&Object.defineProperty(j,A,V),V},m=this&&this.__param||function(N,j){return function(A,D){j(A,D,N)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const f=u(2223),g=u(643),v=u(511),k=u(2585),S=u(8055),y=u(4725),_=u(4269),x=u(6171),w=u(3734);let C=c.DomRendererRowFactory=class{constructor(N,j,A,D,B,H,V){this._document=N,this._characterJoinerService=j,this._optionsService=A,this._coreBrowserService=D,this._coreService=B,this._decorationService=H,this._themeService=V,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,j,A){this._selectionStart=N,this._selectionEnd=j,this._columnSelectMode=A}createRow(N,j,A,D,B,H,V,U,P,K,W){const Z=[],ee=this._characterJoinerService.getJoinedCharacters(j),z=this._themeService.colors;let L,I=N.getNoBgTrimmedLength();A&&I0&&Ee===ee[0][0]){Pe=!0;const ct=ee.shift();Be=new _.JoinedCellData(this._workCell,N.translateToString(!0,ct[0],ct[1]),ct[1]-ct[0]),$e=ct[1]-1,je=Be.getWidth()}const Nt=this._isCellInSelection(Ee,j),Rt=A&&Ee===H,Lt=ve&&Ee>=K&&Ee<=W;let Ft=!1;this._decorationService.forEachDecorationAtCell(Ee,j,void 0,(ct=>{Ft=!0}));let an=Be.getChars()||g.WHITESPACE_CELL_CHAR;if(an===" "&&(Be.isUnderline()||Be.isOverline())&&(an=" "),le=je*U-P.get(an,Be.isBold(),Be.isItalic()),L){if(Y&&(Nt&&ne||!Nt&&!ne&&Be.bg===se)&&(Nt&&ne&&z.selectionForeground||Be.fg===oe)&&Be.extended.ext===fe&&Lt===te&&le===q&&!Rt&&!Pe&&!Ft){Be.isInvisible()?G+=g.WHITESPACE_CELL_CHAR:G+=an,Y++;continue}Y&&(L.textContent=G),L=this._document.createElement("span"),Y=0,G=""}else L=this._document.createElement("span");if(se=Be.bg,oe=Be.fg,fe=Be.extended.ext,te=Lt,q=le,ne=Nt,Pe&&H>=Ee&&H<=$e&&(H=Ee),!this._coreService.isCursorHidden&&Rt&&this._coreService.isCursorInitialized){if(ye.push("xterm-cursor"),this._coreBrowserService.isFocused)V&&ye.push("xterm-cursor-blink"),ye.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":ye.push("xterm-cursor-outline");break;case"block":ye.push("xterm-cursor-block");break;case"bar":ye.push("xterm-cursor-bar");break;case"underline":ye.push("xterm-cursor-underline")}}if(Be.isBold()&&ye.push("xterm-bold"),Be.isItalic()&&ye.push("xterm-italic"),Be.isDim()&&ye.push("xterm-dim"),G=Be.isInvisible()?g.WHITESPACE_CELL_CHAR:Be.getChars()||g.WHITESPACE_CELL_CHAR,Be.isUnderline()&&(ye.push(`xterm-underline-${Be.extended.underlineStyle}`),G===" "&&(G=" "),!Be.isUnderlineColorDefault()))if(Be.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${w.AttributeData.toColorRGB(Be.getUnderlineColor()).join(",")})`;else{let ct=Be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Be.isBold()&&ct<8&&(ct+=8),L.style.textDecorationColor=z.ansi[ct].css}Be.isOverline()&&(ye.push("xterm-overline"),G===" "&&(G=" ")),Be.isStrikethrough()&&ye.push("xterm-strikethrough"),Lt&&(L.style.textDecoration="underline");let wt=Be.getFgColor(),Je=Be.getFgColorMode(),pt=Be.getBgColor(),_e=Be.getBgColorMode();const Ne=!!Be.isInverse();if(Ne){const ct=wt;wt=pt,pt=ct;const Fe=Je;Je=_e,_e=Fe}let He,Qe,rt,$t=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,j,void 0,(ct=>{ct.options.layer!=="top"&&$t||(ct.backgroundColorRGB&&(_e=50331648,pt=ct.backgroundColorRGB.rgba>>8&16777215,He=ct.backgroundColorRGB),ct.foregroundColorRGB&&(Je=50331648,wt=ct.foregroundColorRGB.rgba>>8&16777215,Qe=ct.foregroundColorRGB),$t=ct.options.layer==="top")})),!$t&&Nt&&(He=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,pt=He.rgba>>8&16777215,_e=50331648,$t=!0,z.selectionForeground&&(Je=50331648,wt=z.selectionForeground.rgba>>8&16777215,Qe=z.selectionForeground)),$t&&ye.push("xterm-decoration-top"),_e){case 16777216:case 33554432:rt=z.ansi[pt],ye.push(`xterm-bg-${pt}`);break;case 50331648:rt=S.channels.toColor(pt>>16,pt>>8&255,255&pt),this._addStyle(L,`background-color:#${T((pt>>>0).toString(16),"0",6)}`);break;default:Ne?(rt=z.foreground,ye.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):rt=z.background}switch(He||Be.isDim()&&(He=S.color.multiplyOpacity(rt,.5)),Je){case 16777216:case 33554432:Be.isBold()&&wt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(wt+=8),this._applyMinimumContrast(L,rt,z.ansi[wt],Be,He,void 0)||ye.push(`xterm-fg-${wt}`);break;case 50331648:const ct=S.channels.toColor(wt>>16&255,wt>>8&255,255&wt);this._applyMinimumContrast(L,rt,ct,Be,He,Qe)||this._addStyle(L,`color:#${T(wt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,rt,z.foreground,Be,He,Qe)||Ne&&ye.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ye.length&&(L.className=ye.join(" "),ye.length=0),Rt||Pe||Ft?L.textContent=G:Y++,le!==this.defaultSpacing&&(L.style.letterSpacing=`${le}px`),Z.push(L),Ee=$e}return L&&Y&&(L.textContent=G),Z}_applyMinimumContrast(N,j,A,D,B,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const V=this._getContrastCache(D);let U;if(B||H||(U=V.getColor(j.rgba,A.rgba)),U===void 0){const P=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);U=S.color.ensureContrastRatio(B||j,H||A,P),V.setColor((B||j).rgba,(H||A).rgba,U??null)}return!!U&&(this._addStyle(N,`color:${U.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,j){N.setAttribute("style",`${N.getAttribute("style")||""}${j};`)}_isCellInSelection(N,j){const A=this._selectionStart,D=this._selectionEnd;return!(!A||!D)&&(this._columnSelectMode?A[0]<=D[0]?N>=A[0]&&j>=A[1]&&N=A[1]&&N>=D[0]&&j<=D[1]:j>A[1]&&j=A[0]&&N=A[0])}};function T(N,j,A){for(;N.length{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 m=u.createElement("span");m.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const v=u.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[m,f,g,v],this._container.appendChild(m),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(v),h.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(u,h,m,f){u===this._font&&h===this._fontSize&&m===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=h,this._weight=m,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,h,m){let f=0;if(!h&&!m&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(u,0);return k>0&&(this._flat[f]=k),k}let g=u;h&&(g+="B"),m&&(g+="I");let v=this._holey.get(g);if(v===void 0){let k=0;h&&(k|=1),m&&(k|=2),v=this._measure(u,k),v>0&&this._holey.set(g,v)}return v}_measure(u,h){const m=this._measureElements[h];return m.textContent=u.repeat(32),m.offsetWidth/32}}},2223:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(l,c)=>{function u(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},c.isEmoji=h,c.allowRescaling=function(m,f,g,v){return f===1&&g>Math.ceil(1.5*v)&&m!==void 0&&m>255&&!h(m)&&!u(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},c.treatGlyphAsBackgroundColor=function(m){return u(m)||(function(f){return 9472<=f&&f<=9631})(m)},c.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}}}},c.computeNextVariantOffset=function(m,f,g=0){return(m-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{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(m,f,g,v=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const k=m.buffers.active.ydisp,S=f[1]-k,y=g[1]-k,_=Math.max(S,0),x=Math.min(y,m.rows-1);_>=m.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=S,this.viewportEndRow=y,this.viewportCappedStartRow=_,this.viewportCappedEndRow=x,this.startCol=f[0],this.endCol=g[0])}isCellSelected(m,f,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&f=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,c,u){var h=this&&this.__decorate||function(x,w,C,T){var N,j=arguments.length,A=j<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,w,C,T);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(A=(j<3?N(A):j>3?N(w,C,A):N(w,C))||A);return j>3&&A&&Object.defineProperty(w,C,A),A},m=this&&this.__param||function(x,w){return function(C,T){w(C,T,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const f=u(2585),g=u(8460),v=u(844);let k=c.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,w,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new y(x,w,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())}};c.CharSizeService=k=h([m(2,f.IOptionsService)],k);class S extends v.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 y extends S{constructor(w,C,T){super(),this._document=w,this._parentElement=C,this._optionsService=T,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 _ 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(l,c,u){var h=this&&this.__decorate||function(_,x,w,C){var T,N=arguments.length,j=N<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,x,w,C);else for(var A=_.length-1;A>=0;A--)(T=_[A])&&(j=(N<3?T(j):N>3?T(x,w,j):T(x,w))||j);return N>3&&j&&Object.defineProperty(x,w,j),j},m=this&&this.__param||function(_,x){return function(w,C){x(w,C,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const f=u(3734),g=u(643),v=u(511),k=u(2585);class S extends f.AttributeData{constructor(x,w,C){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=w,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()]}}c.JoinedCellData=S;let y=c.CharacterJoinerService=class P9{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(x){const w={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(w),w.id}deregister(x){for(let w=0;w1){const V=this._getJoinedRanges(T,A,j,w,N);for(let U=0;U1){const H=this._getJoinedRanges(T,A,j,w,N);for(let V=0;V{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),m=u(8460),f=u(3656);class g extends h.Disposable{constructor(S,y,_){super(),this._textarea=S,this._window=y,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,m.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}}c.CoreBrowserService=g;class v extends h.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.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:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const v=this.linkProviders.indexOf(g);v!==-1&&this.linkProviders.splice(v,1)}}}}c.LinkProviderService=m},8934:function(l,c,u){var h=this&&this.__decorate||function(k,S,y,_){var x,w=arguments.length,C=w<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(k,S,y,_);else for(var T=k.length-1;T>=0;T--)(x=k[T])&&(C=(w<3?x(C):w>3?x(S,y,C):x(S,y))||C);return w>3&&C&&Object.defineProperty(S,y,C),C},m=this&&this.__param||function(k,S){return function(y,_){S(y,_,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const f=u(4725),g=u(9806);let v=c.MouseService=class{constructor(k,S){this._renderService=k,this._charSizeService=S}getCoords(k,S,y,_,x){return(0,g.getCoords)(window,k,S,y,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(k,S){const y=(0,g.getCoordsRelativeToElement)(window,k,S);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};c.MouseService=v=h([m(0,f.IRenderService),m(1,f.ICharSizeService)],v)},3230:function(l,c,u){var h=this&&this.__decorate||function(x,w,C,T){var N,j=arguments.length,A=j<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,w,C,T);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(A=(j<3?N(A):j>3?N(w,C,A):N(w,C))||A);return j>3&&A&&Object.defineProperty(w,C,A),A},m=this&&this.__param||function(x,w){return function(C,T){w(C,T,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const f=u(6193),g=u(4725),v=u(8460),k=u(844),S=u(7226),y=u(2585);let _=c.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,w,C,T,N,j,A,D){super(),this._rowCount=x,this._charSizeService=T,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((B,H)=>this._renderRows(B,H)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.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(j.cols,j.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,w),this.register(A.onWindowChange((B=>this._registerIntersectionObserver(B,w))))}_registerIntersectionObserver(x,w){if("IntersectionObserver"in x){const C=new x.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});C.observe(w),this._observerDisposable.value=(0,k.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,w,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,w,this._rowCount))}_renderRows(x,w){this._renderer.value&&(x=Math.min(x,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(x,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:x,end:w}),this._onRender.fire({start:x,end:w}),this._isNextRenderRedrawOnly=!0)}resize(x,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(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((w=>this.refreshRows(w.start,w.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,w;this._renderer.value&&((w=(x=this._renderer.value).clearTextureAtlas)==null||w.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(x,w)})):this._renderer.value.handleResize(x,w),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,w,C){var T;this._selectionState.start=x,this._selectionState.end=w,this._selectionState.columnSelectMode=C,(T=this._renderer.value)==null||T.handleSelectionChanged(x,w,C)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};c.RenderService=_=h([m(2,y.IOptionsService),m(3,g.ICharSizeService),m(4,y.IDecorationService),m(5,y.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],_)},9312:function(l,c,u){var h=this&&this.__decorate||function(A,D,B,H){var V,U=arguments.length,P=U<3?D:H===null?H=Object.getOwnPropertyDescriptor(D,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(A,D,B,H);else for(var K=A.length-1;K>=0;K--)(V=A[K])&&(P=(U<3?V(P):U>3?V(D,B,P):V(D,B))||P);return U>3&&P&&Object.defineProperty(D,B,P),P},m=this&&this.__param||function(A,D){return function(B,H){D(B,H,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const f=u(9806),g=u(9504),v=u(456),k=u(4725),S=u(8460),y=u(844),_=u(6114),x=u(4841),w=u(511),C=u(2585),T=" ",N=new RegExp(T,"g");let j=c.SelectionService=class extends y.Disposable{constructor(A,D,B,H,V,U,P,K,W){super(),this._element=A,this._screenElement=D,this._linkifier=B,this._bufferService=H,this._coreService=V,this._mouseService=U,this._optionsService=P,this._renderService=K,this._coreBrowserService=W,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=Z=>this._handleMouseMove(Z),this._mouseUpListener=Z=>this._handleMouseUp(Z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Z=>this._handleTrim(Z))),this.register(this._bufferService.buffers.onBufferActivate((Z=>this._handleBufferActivate(Z)))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.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 A=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!A||!D||A[0]===D[0]&&A[1]===D[1])}get selectionText(){const A=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!A||!D)return"";const B=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(A[0]===D[0])return"";const V=A[0]V.replace(N," "))).join(_.isWindows?`\r +`:` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&A&&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(A){const D=this._getMouseBufferCoords(A),B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(B&&H&&D)&&this._areCoordsInSelection(D,B,H)}isCellInSelection(A,D){const B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!B||!H)&&this._areCoordsInSelection([A,D],B,H)}_areCoordsInSelection(A,D,B){return A[1]>D[1]&&A[1]=D[0]&&A[0]=D[0]}_selectWordAtCursor(A,D){var V,U;const B=(U=(V=this._linkifier.currentLink)==null?void 0:V.link)==null?void 0:U.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(A);return!!H&&(this._selectWordAt(H,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,D){this._model.clearSelection(),A=Math.max(A,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const D=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(A){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=B?0:(D>B&&(D-=B),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(A){return _.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!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(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const D=this._getMouseBufferCoords(A);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(A){return A.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.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(A),!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 B=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(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const D=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const H=(0,g.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,B=!(!A||!D||A[0]===D[0]&&A[1]===D[1]);B?A&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,D,B)):this._oldHasSelection&&this._fireOnSelectionChange(A,D,B)}_fireOnSelectionChange(A,D,B){this._oldSelectionStart=A,this._oldSelectionEnd=D,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(A,D){let B=D;for(let H=0;D>=H;H++){const V=A.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:V>1&&D!==H&&(B+=V-1)}return B}setSelection(A,D,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,D],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,D,B=!0,H=!0){if(A[0]>=this._bufferService.cols)return;const V=this._bufferService.buffer,U=V.lines.get(A[1]);if(!U)return;const P=V.translateBufferLineToString(A[1],!1);let K=this._convertViewportColToCharacterIndex(U,A[0]),W=K;const Z=A[0]-K;let ee=0,z=0,L=0,I=0;if(P.charAt(K)===" "){for(;K>0&&P.charAt(K-1)===" ";)K--;for(;W1&&(I+=fe-1,W+=fe-1);se>0&&K>0&&!this._isCharWordSeparator(U.loadCell(se-1,this._workCell));){U.loadCell(se-1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,se--):te>1&&(L+=te-1,K-=te-1),K--,se--}for(;oe1&&(I+=te-1,W+=te-1),W++,oe++}}W++;let Y=K+Z-ee+L,G=Math.min(this._bufferService.cols,W-K+ee+z-L-I);if(D||P.slice(K,W).trim()!==""){if(B&&Y===0&&U.getCodePoint(0)!==32){const se=V.lines.get(A[1]-1);if(se&&U.isWrapped&&se.getCodePoint(this._bufferService.cols-1)!==32){const oe=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(oe){const fe=this._bufferService.cols-oe.start;Y-=fe,G+=fe}}}if(H&&Y+G===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const se=V.lines.get(A[1]+1);if(se!=null&&se.isWrapped&&se.getCodePoint(0)!==32){const oe=this._getWordAt([0,A[1]+1],!1,!1,!0);oe&&(G+=oe.length)}}return{start:Y,length:G}}}_selectWordAt(A,D){const B=this._getWordAt(A,D);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[B.start,A[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(A){const D=this._getWordAt(A,!0);if(D){let B=A[1];for(;D.start<0;)D.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,B]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const D=this._bufferService.buffer.getWrappedRangeForLine(A),B={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)(B,this._bufferService.cols)}};c.SelectionService=j=h([m(3,C.IBufferService),m(4,C.ICoreService),m(5,k.IMouseService),m(6,C.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],j)},4725:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const h=u(8343);c.ICharSizeService=(0,h.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),c.IMouseService=(0,h.createDecorator)("MouseService"),c.IRenderService=(0,h.createDecorator)("RenderService"),c.ISelectionService=(0,h.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,h.createDecorator)("ThemeService"),c.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(l,c,u){var h=this&&this.__decorate||function(j,A,D,B){var H,V=arguments.length,U=V<3?A:B===null?B=Object.getOwnPropertyDescriptor(A,D):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(j,A,D,B);else for(var P=j.length-1;P>=0;P--)(H=j[P])&&(U=(V<3?H(U):V>3?H(A,D,U):H(A,D))||U);return V>3&&U&&Object.defineProperty(A,D,U),U},m=this&&this.__param||function(j,A){return function(D,B){A(D,B,j)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),g=u(8055),v=u(8460),k=u(844),S=u(2585),y=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),x=g.css.toColor("#ffffff"),w=g.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let D=0;D<216;D++){const B=A[D/36%6|0],H=A[D/6%6|0],V=A[D%6];j.push({css:g.channels.toCss(B,H,V),rgba:g.channels.toRgba(B,H,V)})}for(let D=0;D<24;D++){const B=8+10*D;j.push({css:g.channels.toCss(B,B,B),rgba:g.channels.toRgba(B,B,B)})}return j})());let T=c.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:_,cursor:x,cursorAccent:w,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:g.color.blend(_,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:g.color.blend(_,C),ansi:c.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(j={}){const A=this._colors;if(A.foreground=N(j.foreground,y),A.background=N(j.background,_),A.cursor=N(j.cursor,x),A.cursorAccent=N(j.cursorAccent,w),A.selectionBackgroundTransparent=N(j.selectionBackground,C),A.selectionBackgroundOpaque=g.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=N(j.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=g.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=j.selectionForeground?N(j.selectionForeground,g.NULL_COLOR):void 0,A.selectionForeground===g.NULL_COLOR&&(A.selectionForeground=void 0),g.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=g.color.opacity(A.selectionBackgroundTransparent,.3)),g.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=g.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=c.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=N(j.black,c.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=N(j.red,c.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=N(j.green,c.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=N(j.yellow,c.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=N(j.blue,c.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=N(j.magenta,c.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=N(j.cyan,c.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=N(j.white,c.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=N(j.brightBlack,c.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=N(j.brightRed,c.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=N(j.brightGreen,c.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=N(j.brightYellow,c.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=N(j.brightBlue,c.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=N(j.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=N(j.brightCyan,c.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=N(j.brightWhite,c.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const D=Math.min(A.ansi.length-16,j.extendedAnsi.length);for(let B=0;B{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),m=u(844);class f extends m.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(v){if(this._maxLength===v)return;const k=new Array(v);for(let S=0;Sthis._length)for(let k=this._length;k=v;y--)this._array[this._getCyclicIndex(y+S.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;ythis._maxLength){const y=this._length+S.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=S.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,k,S){if(!(k<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let _=k-1;_>=0;_--)this.set(v+_+S,this.get(v+_));const y=v+k+S-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,m=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const g in h)f[g]=m<=1?h[g]:h[g]&&u(h[g],m-1);return f}},8055:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,h=0,m=0,f=0;var g,v,k,S,y;function _(w){const C=w.toString(16);return C.length<2?"0"+C:C}function x(w,C){return w>>0},w.toColor=function(C,T,N,j){return{css:w.toCss(C,T,N,j),rgba:w.toRgba(C,T,N,j)}}})(g||(c.channels=g={})),(function(w){function C(T,N){return f=Math.round(255*N),[u,h,m]=y.toChannels(T.rgba),{css:g.toCss(u,h,m,f),rgba:g.toRgba(u,h,m,f)}}w.blend=function(T,N){if(f=(255&N.rgba)/255,f===1)return{css:N.css,rgba:N.rgba};const j=N.rgba>>24&255,A=N.rgba>>16&255,D=N.rgba>>8&255,B=T.rgba>>24&255,H=T.rgba>>16&255,V=T.rgba>>8&255;return u=B+Math.round((j-B)*f),h=H+Math.round((A-H)*f),m=V+Math.round((D-V)*f),{css:g.toCss(u,h,m),rgba:g.toRgba(u,h,m)}},w.isOpaque=function(T){return(255&T.rgba)==255},w.ensureContrastRatio=function(T,N,j){const A=y.ensureContrastRatio(T.rgba,N.rgba,j);if(A)return g.toColor(A>>24&255,A>>16&255,A>>8&255)},w.opaque=function(T){const N=(255|T.rgba)>>>0;return[u,h,m]=y.toChannels(N),{css:g.toCss(u,h,m),rgba:N}},w.opacity=C,w.multiplyOpacity=function(T,N){return f=255&T.rgba,C(T,f*N/255)},w.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(v||(c.color=v={})),(function(w){let C,T;try{const N=document.createElement("canvas");N.width=1,N.height=1;const j=N.getContext("2d",{willReadFrequently:!0});j&&(C=j,C.globalCompositeOperation="copy",T=C.createLinearGradient(0,0,1,1))}catch{}w.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return u=parseInt(N.slice(1,2).repeat(2),16),h=parseInt(N.slice(2,3).repeat(2),16),m=parseInt(N.slice(3,4).repeat(2),16),g.toColor(u,h,m);case 5:return u=parseInt(N.slice(1,2).repeat(2),16),h=parseInt(N.slice(2,3).repeat(2),16),m=parseInt(N.slice(3,4).repeat(2),16),f=parseInt(N.slice(4,5).repeat(2),16),g.toColor(u,h,m,f);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 j=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(j)return u=parseInt(j[1]),h=parseInt(j[2]),m=parseInt(j[3]),f=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),g.toColor(u,h,m,f);if(!C||!T)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=T,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[u,h,m,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,h,m,f),css:N}}})(k||(c.css=k={})),(function(w){function C(T,N,j){const A=T/255,D=N/255,B=j/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}w.relativeLuminance=function(T){return C(T>>16&255,T>>8&255,255&T)},w.relativeLuminance2=C})(S||(c.rgb=S={})),(function(w){function C(N,j,A){const D=N>>24&255,B=N>>16&255,H=N>>8&255;let V=j>>24&255,U=j>>16&255,P=j>>8&255,K=x(S.relativeLuminance2(V,U,P),S.relativeLuminance2(D,B,H));for(;K0||U>0||P>0);)V-=Math.max(0,Math.ceil(.1*V)),U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),K=x(S.relativeLuminance2(V,U,P),S.relativeLuminance2(D,B,H));return(V<<24|U<<16|P<<8|255)>>>0}function T(N,j,A){const D=N>>24&255,B=N>>16&255,H=N>>8&255;let V=j>>24&255,U=j>>16&255,P=j>>8&255,K=x(S.relativeLuminance2(V,U,P),S.relativeLuminance2(D,B,H));for(;K>>0}w.blend=function(N,j){if(f=(255&j)/255,f===1)return j;const A=j>>24&255,D=j>>16&255,B=j>>8&255,H=N>>24&255,V=N>>16&255,U=N>>8&255;return u=H+Math.round((A-H)*f),h=V+Math.round((D-V)*f),m=U+Math.round((B-U)*f),g.toRgba(u,h,m)},w.ensureContrastRatio=function(N,j,A){const D=S.relativeLuminance(N>>8),B=S.relativeLuminance(j>>8);if(x(D,B)>8));if(Px(D,S.relativeLuminance(K>>8))?U:K}return U}const H=T(N,j,A),V=x(D,S.relativeLuminance(H>>8));if(Vx(D,S.relativeLuminance(U>>8))?H:U}return H}},w.reduceLuminance=C,w.increaseLuminance=T,w.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(y||(c.rgba=y={})),c.toPaddedHex=_,c.contrastRatio=x},8969:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),m=u(2585),f=u(4348),g=u(7866),v=u(744),k=u(7302),S=u(6975),y=u(8460),_=u(1753),x=u(1480),w=u(7994),C=u(9282),T=u(5435),N=u(5981),j=u(2660);let A=!1;class D extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((H=>{var V;(V=this._onScrollApi)==null||V.fire(H.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(H){for(const V in H)this.optionsService.options[V]=H[V]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService(H)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(w.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.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((V=>{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((V=>{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(((V,U)=>this._inputHandler.parse(V,U)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,V){this._writeBuffer.write(H,V)}writeSync(H,V){this._logService.logLevel<=m.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(H,V)}input(H,V=!0){this.coreService.triggerDataEvent(H,V)}resize(H,V){isNaN(H)||isNaN(V)||(H=Math.max(H,v.MINIMUM_COLS),V=Math.max(V,v.MINIMUM_ROWS),this._bufferService.resize(H,V))}scroll(H,V=!1){this._bufferService.scroll(H,V)}scrollLines(H,V,U){this._bufferService.scrollLines(H,V,U)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const V=H-this._bufferService.buffer.ydisp;V!==0&&this.scrollLines(V)}registerEscHandler(H,V){return this._inputHandler.registerEscHandler(H,V)}registerDcsHandler(H,V){return this._inputHandler.registerDcsHandler(H,V)}registerCsiHandler(H,V){return this._inputHandler.registerCsiHandler(H,V)}registerOscHandler(H,V){return this._inputHandler.registerOscHandler(H,V)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const V=this.optionsService.rawOptions.windowsPty;V&&V.buildNumber!==void 0&&V.buildNumber!==void 0?H=V.backend==="conpty"&&V.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const V of H)V.dispose()}))}}}c.CoreTerminal=D},8460:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;hh.fire(m)))},c.runAndSubscribe=function(u,h){return h(void 0),u((m=>h(m)))}},5435:function(l,c,u){var h=this&&this.__decorate||function(ee,z,L,I){var Y,G=arguments.length,se=G<3?z:I===null?I=Object.getOwnPropertyDescriptor(z,L):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(ee,z,L,I);else for(var oe=ee.length-1;oe>=0;oe--)(Y=ee[oe])&&(se=(G<3?Y(se):G>3?Y(z,L,se):Y(z,L))||se);return G>3&&se&&Object.defineProperty(z,L,se),se},m=this&&this.__param||function(ee,z){return function(L,I){z(L,I,ee)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const f=u(2584),g=u(7116),v=u(2015),k=u(844),S=u(482),y=u(8437),_=u(8460),x=u(643),w=u(511),C=u(3734),T=u(2585),N=u(1480),j=u(6242),A=u(6351),D=u(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function V(ee,z){if(ee>24)return z.setWinLines||!1;switch(ee){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var U;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(c.WindowsOptionsReportType=U={}));let P=0;class K extends k.Disposable{getAttrData(){return this._curAttrData}constructor(z,L,I,Y,G,se,oe,fe,te=new v.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=L,this._coreService=I,this._logService=Y,this._optionsService=G,this._oscLinkService=se,this._coreMouseService=oe,this._unicodeService=fe,this._parser=te,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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.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 W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ne.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,ne,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ne,data:le})})),this._parser.setDcsHandlerFallback(((q,ne,le)=>{ne==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ne,payload:le})})),this._parser.setPrintHandler(((q,ne,le)=>this.print(q,ne,le))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!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 j.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new j.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new j.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new j.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new j.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new j.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new j.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new j.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new j.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new j.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new j.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new j.OscHandler((q=>this.restoreCursorColor(q)))),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 q in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((q,ne)=>this.requestStatusString(q,ne))))}_preserveStack(z,L,I,Y){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=I,this._parseStack.position=Y}_logSlowResolvingAsync(z){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([z,new Promise(((L,I)=>setTimeout((()=>I("#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(z,L){let I,Y=this._activeBuffer.x,G=this._activeBuffer.y,se=0;const oe=this._parseStack.paused;if(oe){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(I),I;Y=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(se=this._parseStack.position+H)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(q=>String.fromCharCode(q))).join("")}"`),typeof z=="string"?z.split("").map((q=>q.charCodeAt(0))):z),this._parseBuffer.lengthH)for(let q=se;q0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let ye=this._parser.precedingJoinState;for(let ve=L;vefe){if(te){const $e=le;let Be=this._activeBuffer.x-Pe;for(this._activeBuffer.x=Pe,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),Pe>0&&le instanceof y.BufferLine&&le.copyCellsFrom($e,Be,0,Pe,!1);Be=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(q&&(le.insertCells(this._activeBuffer.x,G-Pe,this._activeBuffer.getNullCell(ne)),le.getWidth(fe-1)===2&&le.setCellFromCodepoint(fe-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ne)),le.setCellFromCodepoint(this._activeBuffer.x++,Y,G,ne),G>0)for(;--G;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=ye,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(z,L){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,L):this._parser.registerCsiHandler(z,(I=>!V(I.params[0],this._optionsService.rawOptions.windowOptions)||L(I)))}registerDcsHandler(z,L){return this._parser.registerDcsHandler(z,new A.DcsHandler(L))}registerEscHandler(z,L){return this._parser.registerEscHandler(z,L)}registerOscHandler(z,L){return this._parser.registerOscHandler(z,new j.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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.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 z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=z,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+L)}cursorUp(z){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const L=z.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=z.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=z.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const L=z.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,L,I,Y=!1,G=!1){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);se.replaceCells(L,I,this._activeBuffer.getNullCell(this._eraseAttrData()),G),Y&&(se.isWrapped=!1)}_resetBufferLine(z,L=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),I.isWrapped=!1)}eraseInDisplay(z,L=!1){let I;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);I=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,L);this._dirtyRowTracker.markDirty(0);break;case 3:const Y=this._activeBuffer.lines.length-this._bufferService.rows;Y>0&&(this._activeBuffer.lines.trimStart(Y),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Y,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Y,0),this._onScroll.fire(0))}return!0}eraseInLine(z,L=!1){switch(this._restrictCursor(this._bufferService.cols),z.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(z){this._restrictCursor();let L=z.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 te=fe;for(let q=1;q0||(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(z){return z.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(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let L=0;Lje?1:2,ye=z.params[0];return ve=ye,Ee=L?ye===2?4:ye===4?le(se.modes.insertMode):ye===12?3:ye===20?le(ne.convertEol):0:ye===1?le(I.applicationCursorKeys):ye===3?ne.windowOptions.setWinLines?fe===80?2:fe===132?1:0:0:ye===6?le(I.origin):ye===7?le(I.wraparound):ye===8?3:ye===9?le(Y==="X10"):ye===12?le(ne.cursorBlink):ye===25?le(!se.isCursorHidden):ye===45?le(I.reverseWraparound):ye===66?le(I.applicationKeypad):ye===67?4:ye===1e3?le(Y==="VT200"):ye===1002?le(Y==="DRAG"):ye===1003?le(Y==="ANY"):ye===1004?le(I.sendFocus):ye===1005?4:ye===1006?le(G==="SGR"):ye===1015?4:ye===1016?le(G==="SGR_PIXELS"):ye===1048?1:ye===47||ye===1047||ye===1049?le(te===q):ye===2004?le(I.bracketedPasteMode):0,se.triggerDataEvent(`${f.C0.ESC}[${L?"":"?"}${ve};${Ee}$y`),!0;var ve,Ee}_updateAttrColor(z,L,I,Y,G){return L===2?(z|=50331648,z&=-16777216,z|=C.AttributeData.fromColorRGB([I,Y,G])):L===5&&(z&=-50331904,z|=33554432|255&I),z}_extractColor(z,L,I){const Y=[0,0,-1,0,0,0];let G=0,se=0;do{if(Y[se+G]=z.params[L+se],z.hasSubParams(L+se)){const oe=z.getSubParams(L+se);let fe=0;do Y[1]===5&&(G=1),Y[se+fe+1+G]=oe[fe];while(++fe=2||Y[1]===2&&se+G>=5)break;Y[1]&&(G=1)}while(++se+L5)&&(z=1),L.extended.underlineStyle=z,L.fg|=268435456,z===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(z){z.fg=y.DEFAULT_ATTR_DATA.fg,z.bg=y.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=z.length;let I;const Y=this._curAttrData;for(let G=0;G=30&&I<=37?(Y.fg&=-50331904,Y.fg|=16777216|I-30):I>=40&&I<=47?(Y.bg&=-50331904,Y.bg|=16777216|I-40):I>=90&&I<=97?(Y.fg&=-50331904,Y.fg|=16777224|I-90):I>=100&&I<=107?(Y.bg&=-50331904,Y.bg|=16777224|I-100):I===0?this._processSGR0(Y):I===1?Y.fg|=134217728:I===3?Y.bg|=67108864:I===4?(Y.fg|=268435456,this._processUnderline(z.hasSubParams(G)?z.getSubParams(G)[0]:1,Y)):I===5?Y.fg|=536870912:I===7?Y.fg|=67108864:I===8?Y.fg|=1073741824:I===9?Y.fg|=2147483648:I===2?Y.bg|=134217728:I===21?this._processUnderline(2,Y):I===22?(Y.fg&=-134217729,Y.bg&=-134217729):I===23?Y.bg&=-67108865:I===24?(Y.fg&=-268435457,this._processUnderline(0,Y)):I===25?Y.fg&=-536870913:I===27?Y.fg&=-67108865:I===28?Y.fg&=-1073741825:I===29?Y.fg&=2147483647:I===39?(Y.fg&=-67108864,Y.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):I===49?(Y.bg&=-67108864,Y.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?G+=this._extractColor(z,G,Y):I===53?Y.bg|=1073741824:I===55?Y.bg&=-1073741825:I===59?(Y.extended=Y.extended.clone(),Y.extended.underlineColor=-1,Y.updateExtended()):I===100?(Y.fg&=-67108864,Y.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,Y.bg&=-67108864,Y.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${L};${I}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const L=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${L};${I}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.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(z){const L=z.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 I=L%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(z){const L=z.params[0]||1;let I;return(z.length<2||(I=z.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(z){if(!V(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:L!==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: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(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const L=[],I=z.split(";");for(;I.length>1;){const Y=I.shift(),G=I.shift();if(/^\d+$/.exec(Y)){const se=parseInt(Y);if(Z(se))if(G==="?")L.push({type:0,index:se});else{const oe=(0,D.parseColor)(G);oe&&L.push({type:1,index:se,color:oe})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(z){const L=z.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(z,L){this._getCurrentLinkId()&&this._finishHyperlink();const I=z.split(":");let Y;const G=I.findIndex((se=>se.startsWith("id=")));return G!==-1&&(Y=I[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Y,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(z,L){const I=z.split(";");for(let Y=0;Y=this._specialColors.length);++Y,++L)if(I[Y]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const G=(0,D.parseColor)(I[Y]);G&&this._onColor.fire([{type:1,index:this._specialColors[L],color:G}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const L=[],I=z.split(";");for(let Y=0;Y=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 z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new w.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${f.C0.ESC}${G}${f.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[Y.cursorStyle]-(Y.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,L){this._dirtyRowTracker.markRangeDirty(z,L)}}c.InputHandler=K;let W=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){eethis.end&&(this.end=ee)}markRangeDirty(ee,z){ee>z&&(P=ee,ee=z,z=P),eethis.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(ee){return 0<=ee&&ee<256}W=h([m(0,T.IBufferService)],W)},844:(l,c)=>{function u(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},c.toDisposable=function(h){return{dispose:h}},c.disposeArray=u,c.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(m,f,g){this._data[m]||(this._data[m]={}),this._data[m][f]=g}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,m,f,g,v){this._data.get(h,m)||this._data.set(h,m,new u),this._data.get(h,m).set(f,g,v)}get(h,m,f,g){var v;return(v=this._data.get(h,m))==null?void 0:v.get(f,g)}clear(){this._data.clear()}}},6114:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,h=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const m=u.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),c.isLinux=h.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(u=this._search(m),u===-1)||this._getKey(this._array[u])!==m)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u=this._array.length)&&this._getKey(this._array[u])===h))do m(this._array[u]);while(++u=m;){let g=m+f>>1;const v=this._getKey(this._array[g]);if(v>h)f=g-1;else{if(!(v0&&this._getKey(this._array[g-1])===h;)g--;return g}m=g+1}}return m}}},7226:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i_)return y-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-k))}ms`),void this._start();y=_}this.clear()}}class f extends m{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const k=Date.now()+v;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}c.PriorityTaskQueue=f,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(m){const f=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=f==null?void 0:f.get(m.cols-1),v=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);v&&g&&(v.isWrapped=g[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&g[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}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 u;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}}c.AttributeData=u;class h{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,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=h},9092:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),m=u(7226),f=u(3734),g=u(8437),v=u(4634),k=u(511),S=u(643),y=u(4863),_=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(x,w,C){this._hasScrollback=x,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=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.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 f.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 f.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,w){return new g.BufferLine(this._bufferService.cols,this.getNullCell(x),w)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&xc.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:w}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=g.DEFAULT_ATTR_DATA);let w=this._rows;for(;w--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,w){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const N=this._getCorrectBufferLength(w);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(x,C)));else for(let A=this._rows;A>w;A--)this.lines.length>w+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,w-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=w-1,this._isReflowEnabled&&(this._reflow(x,w),this._cols>x))for(let j=0;j.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 w=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,w){this._cols!==x&&(x>this._cols?this._reflowLarger(x,w):this._reflowSmaller(x,w))}_reflowLarger(x,w){const C=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(C.length>0){const T=(0,v.reflowLargerCreateNewLayout)(this.lines,C);(0,v.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(x,w,T.countRemoved)}}_reflowLargerAdjustViewport(x,w,C){const T=this.getNullCell(g.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;j--){let A=this.lines.get(j);if(!A||!A.isWrapped&&A.getTrimmedLength()<=x)continue;const D=[A];for(;A.isWrapped&&j>0;)A=this.lines.get(--j),D.unshift(A);const B=this.ybase+this.y;if(B>=j&&B0&&(T.push({start:j+D.length+N,newLines:K}),N+=K.length),D.push(...K);let W=V.length-1,Z=V[W];Z===0&&(W--,Z=V[W]);let ee=D.length-U-1,z=H;for(;ee>=0;){const I=Math.min(z,Z);if(D[W]===void 0)break;if(D[W].copyCellsFrom(D[ee],z-I,Z-I,I,!0),Z-=I,Z===0&&(W--,Z=V[W]),z-=I,z===0){ee--;const Y=Math.max(ee,0);z=(0,v.getWrappedLineTrimmedLength)(D,Y,this._cols)}}for(let I=0;I0;)this.ybase===0?this.y0){const j=[],A=[];for(let W=0;W=0;W--)if(V&&V.start>B+U){for(let Z=V.newLines.length-1;Z>=0;Z--)this.lines.set(W--,V.newLines[Z]);W++,j.push({index:B+1,amount:V.newLines.length}),U+=V.newLines.length,V=T[++H]}else this.lines.set(W,A[B--]);let P=0;for(let W=j.length-1;W>=0;W--)j[W].index+=P,this.lines.onInsertEmitter.fire(j[W]),P+=j[W].amount;const K=Math.max(0,D+N-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(x,w,C=0,T){const N=this.lines.get(x);return N?N.translateToString(w,C,T):""}getWrappedRangeForLine(x){let w=x,C=x;for(;w>0&&this.lines.get(w).isWrapped;)w--;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 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(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),m=u(511),f=u(643),g=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let v=0;class k{constructor(y,_,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const w=_||m.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C>22,2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):x]}set(y,_){this._data[3*y+1]=_[f.CHAR_DATA_ATTR_INDEX],_[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=_[1],this._data[3*y+0]=2097152|y|_[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=_[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&_}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y]:2097151&_?(0,g.stringFromCodePoint)(2097151&_):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,_){return v=3*y,_.content=this._data[v+0],_.fg=this._data[v+1],_.bg=this._data[v+2],2097152&_.content&&(_.combinedData=this._combined[y]),268435456&_.bg&&(_.extended=this._extendedAttrs[y]),_}setCell(y,_){2097152&_.content&&(this._combined[y]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[y]=_.extended),this._data[3*y+0]=_.content,this._data[3*y+1]=_.fg,this._data[3*y+2]=_.bg}setCellFromCodepoint(y,_,x,w){268435456&w.bg&&(this._extendedAttrs[y]=w.extended),this._data[3*y+0]=_|x<<22,this._data[3*y+1]=w.fg,this._data[3*y+2]=w.bg}addCodepointToCell(y,_,x){let w=this._data[3*y+0];2097152&w?this._combined[y]+=(0,g.stringFromCodePoint)(_):2097151&w?(this._combined[y]=(0,g.stringFromCodePoint)(2097151&w)+(0,g.stringFromCodePoint)(_),w&=-2097152,w|=2097152):w=_|4194304,x&&(w&=-12582913,w|=x<<22),this._data[3*y+0]=w}insertCells(y,_,x){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,x),_=0;--C)this.setCell(y+_+C,this.loadCell(y+C,w));for(let C=0;C<_;++C)this.setCell(y+C,x)}else for(let w=y;wthis.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const w=new Uint32Array(x);w.set(this._data),this._data=w}for(let w=this.length;w=y&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let T=0;T=y&&delete this._extendedAttrs[N]}}return this.length=y,4*x*2=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,_,x,w,C){const T=y._data;if(C)for(let j=w-1;j>=0;j--){for(let A=0;A<3;A++)this._data[3*(x+j)+A]=T[3*(_+j)+A];268435456&T[3*(_+j)+2]&&(this._extendedAttrs[x+j]=y._extendedAttrs[_+j])}else for(let j=0;j=_&&(this._combined[A-_+x]=y._combined[A])}}translateToString(y,_,x,w){_=_??0,x=x??this.length,y&&(x=Math.min(x,this.getTrimmedLength())),w&&(w.length=0);let C="";for(;_>22||1}return w&&w.push(_),C}}c.BufferLine=k},4841:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(l,c)=>{function u(h,m,f){if(m===h.length-1)return h[m].getTrimmedLength();const g=!h[m].hasContent(f-1)&&h[m].getWidth(f-1)===1,v=h[m+1].getWidth(0)===2;return g&&v?f-1:f}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,m,f,g,v){const k=[];for(let S=0;S=S&&g0&&(A>w||x[A].getTrimmedLength()===0);A--)j++;j>0&&(k.push(S+x.length-j),k.push(j)),S+=x.length-1}return k},c.reflowLargerCreateNewLayout=function(h,m){const f=[];let g=0,v=m[g],k=0;for(let S=0;Su(h,x,m))).reduce(((_,x)=>_+x));let k=0,S=0,y=0;for(;y_&&(k-=_,S++);const x=h[S].getWidth(k-1)===2;x&&k--;const w=x?f-1:f;g.push(w),y+=w}return g},c.getWrappedLineTrimmedLength=u},5295:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),m=u(844),f=u(9092);class g extends m.Disposable{constructor(k,S){super(),this._optionsService=k,this._bufferService=S,this._onBufferActivate=this.register(new h.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,S){this._normal.resize(k,S),this._alt.resize(k,S),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}c.BufferSet=g},511:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),m=u(643),f=u(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const S=new g;return S.setFromCharData(k),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const y=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const _=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(y-55296)+_-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=g},643:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),m=u(844);class f{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}c.Marker=f,f._nextId=1},7116:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.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:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,c)=>{var u,h,m;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.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=""})(u||(c.C0=u={})),(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="Ÿ"})(h||(c.C1=h={})),(function(f){f.ST=`${u.ESC}\\`})(m||(c.C1_ESCAPED=m={}))},7399:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),m={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:["'",'"']};c.evaluateKeyboardEvent=function(f,g,v,k){const S={type:0,cancel:!1,key:void 0},y=(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=g?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?S.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?S.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(S.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:S.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(S.key=h.C0.ESC+S.key);break;case 9:if(f.shiftKey){S.key=h.C0.ESC+"[Z";break}S.key=h.C0.HT,S.cancel=!0;break;case 13:S.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,S.cancel=!0;break;case 27:S.key=h.C0.ESC,f.altKey&&(S.key=h.C0.ESC+h.C0.ESC),S.cancel=!0;break;case 37:if(f.metaKey)break;y?(S.key=h.C0.ESC+"[1;"+(y+1)+"D",S.key===h.C0.ESC+"[1;3D"&&(S.key=h.C0.ESC+(v?"b":"[1;5D"))):S.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;y?(S.key=h.C0.ESC+"[1;"+(y+1)+"C",S.key===h.C0.ESC+"[1;3C"&&(S.key=h.C0.ESC+(v?"f":"[1;5C"))):S.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;y?(S.key=h.C0.ESC+"[1;"+(y+1)+"A",v||S.key!==h.C0.ESC+"[1;3A"||(S.key=h.C0.ESC+"[1;5A")):S.key=g?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(f.metaKey)break;y?(S.key=h.C0.ESC+"[1;"+(y+1)+"B",v||S.key!==h.C0.ESC+"[1;3B"||(S.key=h.C0.ESC+"[1;5B")):S.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(S.key=h.C0.ESC+"[2~");break;case 46:S.key=y?h.C0.ESC+"[3;"+(y+1)+"~":h.C0.ESC+"[3~";break;case 36:S.key=y?h.C0.ESC+"[1;"+(y+1)+"H":g?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:S.key=y?h.C0.ESC+"[1;"+(y+1)+"F":g?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?S.type=2:f.ctrlKey?S.key=h.C0.ESC+"[5;"+(y+1)+"~":S.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=h.C0.ESC+"[6;"+(y+1)+"~":S.key=h.C0.ESC+"[6~";break;case 112:S.key=y?h.C0.ESC+"[1;"+(y+1)+"P":h.C0.ESC+"OP";break;case 113:S.key=y?h.C0.ESC+"[1;"+(y+1)+"Q":h.C0.ESC+"OQ";break;case 114:S.key=y?h.C0.ESC+"[1;"+(y+1)+"R":h.C0.ESC+"OR";break;case 115:S.key=y?h.C0.ESC+"[1;"+(y+1)+"S":h.C0.ESC+"OS";break;case 116:S.key=y?h.C0.ESC+"[15;"+(y+1)+"~":h.C0.ESC+"[15~";break;case 117:S.key=y?h.C0.ESC+"[17;"+(y+1)+"~":h.C0.ESC+"[17~";break;case 118:S.key=y?h.C0.ESC+"[18;"+(y+1)+"~":h.C0.ESC+"[18~";break;case 119:S.key=y?h.C0.ESC+"[19;"+(y+1)+"~":h.C0.ESC+"[19~";break;case 120:S.key=y?h.C0.ESC+"[20;"+(y+1)+"~":h.C0.ESC+"[20~";break;case 121:S.key=y?h.C0.ESC+"[21;"+(y+1)+"~":h.C0.ESC+"[21~";break;case 122:S.key=y?h.C0.ESC+"[23;"+(y+1)+"~":h.C0.ESC+"[23~";break;case 123:S.key=y?h.C0.ESC+"[24;"+(y+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(v&&!k||!f.altKey||f.metaKey)!v||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=h.C0.US),f.key==="@"&&(S.key=h.C0.NUL)):f.keyCode===65&&(S.type=1);else{const _=m[f.keyCode],x=_==null?void 0:_[f.shiftKey?1:0];if(x)S.key=h.C0.ESC+x;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=h.C0.ESC+C}else if(f.keyCode===32)S.key=h.C0.ESC+(f.ctrlKey?h.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=h.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=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?S.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?S.key=h.C0.DEL:f.keyCode===219?S.key=h.C0.ESC:f.keyCode===220?S.key=h.C0.FS:f.keyCode===221&&(S.key=h.C0.GS)}return S}},482:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,h=0,m=u.length){let f="";for(let g=h;g65535?(v-=65536,f+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):f+=String.fromCharCode(v)}return f},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const m=u.length;if(!m)return 0;let f=0,g=0;if(this._interim){const v=u.charCodeAt(g++);56320<=v&&v<=57343?h[f++]=1024*(this._interim-55296)+v-56320+65536:(h[f++]=this._interim,h[f++]=v),this._interim=0}for(let v=g;v=m)return this._interim=k,f;const S=u.charCodeAt(v);56320<=S&&S<=57343?h[f++]=1024*(k-55296)+S-56320+65536:(h[f++]=k,h[f++]=S)}else k!==65279&&(h[f++]=k)}return f}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const m=u.length;if(!m)return 0;let f,g,v,k,S=0,y=0,_=0;if(this.interim[0]){let C=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let N,j=0;for(;(N=63&this.interim[++j])&&j<4;)T<<=6,T|=N;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=A-j;for(;_=m)return 0;if(N=u[_++],(192&N)!=128){_--,C=!0;break}this.interim[j++]=N,T<<=6,T|=63&N}C||(A===2?T<128?_--:h[S++]=T:A===3?T<2048||T>=55296&&T<=57343||T===65279||(h[S++]=T):T<65536||T>1114111||(h[S++]=T)),this.interim.fill(0)}const x=m-4;let w=_;for(;w=m)return this.interim[0]=f,S;if(g=u[w++],(192&g)!=128){w--;continue}if(y=(31&f)<<6|63&g,y<128){w--;continue}h[S++]=y}else if((240&f)==224){if(w>=m)return this.interim[0]=f,S;if(g=u[w++],(192&g)!=128){w--;continue}if(w>=m)return this.interim[0]=f,this.interim[1]=g,S;if(v=u[w++],(192&v)!=128){w--;continue}if(y=(15&f)<<12|(63&g)<<6|63&v,y<2048||y>=55296&&y<=57343||y===65279)continue;h[S++]=y}else if((248&f)==240){if(w>=m)return this.interim[0]=f,S;if(g=u[w++],(192&g)!=128){w--;continue}if(w>=m)return this.interim[0]=f,this.interim[1]=g,S;if(v=u[w++],(192&v)!=128){w--;continue}if(w>=m)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=v,S;if(k=u[w++],(192&k)!=128){w--;continue}if(y=(7&f)<<18|(63&g)<<12|(63&v)<<6|63&k,y<65536||y>1114111)continue;h[S++]=y}}return S}}},225:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),m=[[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 g;c.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let v=0;vS[x][1])return!1;for(;x>=_;)if(y=_+x>>1,k>S[y][1])_=y+1;else{if(!(k=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,k){let S=this.wcwidth(v),y=S===0&&k!==0;if(y){const _=h.UnicodeService.extractWidth(k);_===0?y=!1:_>S&&(S=_)}return h.UnicodeService.createPropertyValue(0,S,y)}}},5981:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),m=u(844);class f extends m.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,k){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+=v.length,this._writeBuffer.push(v),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(k)}_innerWrite(v=0,k=!0){const S=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],_=this._action(y,k);if(_){const w=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void _.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(w)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=y.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()}}c.WriteBuffer=f},5941:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\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})$/,h=/^[\da-f]+$/;function m(f,g){const v=f.toString(16),k=v.length<2?"0"+v:v;switch(g){case 4:return v[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}c.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const v=u.exec(g);if(v){const k=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/k*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/k*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/k*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),h.exec(g)&&[3,6,9,12].includes(g.length))){const v=g.length/3,k=[0,0,0];for(let S=0;S<3;++S){const y=parseInt(g.slice(v*S,v*S+v),16);k[S]=v===1?y<<4:v===2?y:v===3?y>>4:y>>8}return k}},c.toRgbString=function(f,g=16){const[v,k,S]=f;return`rgb:${m(v,g)}/${m(k,g)}/${m(S,g)}`}},5770:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),m=u(8742),f=u(5770),g=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(k,S){this._handlers[k]===void 0&&(this._handlers[k]=[]);const y=this._handlers[k];return y.push(S),{dispose:()=>{const _=y.indexOf(S);_!==-1&&y.splice(_,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(k,S){if(this.reset(),this._ident=k,this._active=this._handlers[k]||g,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(k,S,y){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(k,S,y);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(k,S,y))}unhook(k,S=!0){if(this._active.length){let y=!1,_=this._active.length-1,x=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,y=S,x=this._stack.fallThrough,this._stack.paused=!1),!x&&y===!1){for(;_>=0&&(y=this._active[_].unhook(k),y!==!0);_--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,y;_--}for(;_>=0;_--)if(y=this._active[_].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",k);this._active=g,this._ident=0}};const v=new m.Params;v.addParam(0),c.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=v,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():v,this._data="",this._hitLimit=!1}put(k,S,y){this._hitLimit||(this._data+=(0,h.utf32ToString)(k,S,y),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let S=!1;if(this._hitLimit)S=!1;else if(k&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((y=>(this._params=v,this._data="",this._hitLimit=!1,y)));return this._params=v,this._data="",this._hitLimit=!1,S}}},2015:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),m=u(8742),f=u(6242),g=u(6351);class v{constructor(_){this.table=new Uint8Array(_)}setDefault(_,x){this.table.fill(_<<4|x)}add(_,x,w,C){this.table[x<<8|_]=w<<4|C}addMany(_,x,w,C){for(let T=0;T<_.length;T++)this.table[x<<8|_[T]]=w<<4|C}}c.TransitionTable=v;const k=160;c.VT500_TRANSITION_TABLE=(function(){const y=new v(4095),_=Array.apply(null,Array(256)).map(((j,A)=>A)),x=(j,A)=>_.slice(j,A),w=x(32,127),C=x(0,24);C.push(25),C.push.apply(C,x(28,32));const T=x(0,14);let N;for(N in y.setDefault(1,0),y.addMany(w,0,2,0),T)y.addMany([24,26,153,154],N,3,0),y.addMany(x(128,144),N,3,0),y.addMany(x(144,152),N,3,0),y.add(156,N,0,0),y.add(27,N,11,1),y.add(157,N,4,8),y.addMany([152,158,159],N,0,7),y.add(155,N,11,3),y.add(144,N,11,9);return y.addMany(C,0,3,0),y.addMany(C,1,3,1),y.add(127,1,0,1),y.addMany(C,8,0,8),y.addMany(C,3,3,3),y.add(127,3,0,3),y.addMany(C,4,3,4),y.add(127,4,0,4),y.addMany(C,6,3,6),y.addMany(C,5,3,5),y.add(127,5,0,5),y.addMany(C,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(w,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(x(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(w,7,0,7),y.addMany(C,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(x(64,127),3,7,0),y.addMany(x(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(x(48,60),4,8,4),y.addMany(x(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(x(32,64),6,0,6),y.add(127,6,0,6),y.addMany(x(64,127),6,0,0),y.addMany(x(32,48),3,9,5),y.addMany(x(32,48),5,9,5),y.addMany(x(48,64),5,0,6),y.addMany(x(64,127),5,7,0),y.addMany(x(32,48),4,9,5),y.addMany(x(32,48),1,9,2),y.addMany(x(32,48),2,9,2),y.addMany(x(48,127),2,10,0),y.addMany(x(48,80),1,10,0),y.addMany(x(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(x(96,127),1,10,0),y.add(80,1,11,9),y.addMany(C,9,0,9),y.add(127,9,0,9),y.addMany(x(28,32),9,0,9),y.addMany(x(32,48),9,9,12),y.addMany(x(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(C,11,0,11),y.addMany(x(32,128),11,0,11),y.addMany(x(28,32),11,0,11),y.addMany(C,10,0,10),y.add(127,10,0,10),y.addMany(x(28,32),10,0,10),y.addMany(x(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(x(32,48),10,9,12),y.addMany(C,12,0,12),y.add(127,12,0,12),y.addMany(x(28,32),12,0,12),y.addMany(x(32,48),12,9,12),y.addMany(x(48,64),12,0,11),y.addMany(x(64,127),12,12,13),y.addMany(x(64,127),10,12,13),y.addMany(x(64,127),9,12,13),y.addMany(C,13,13,13),y.addMany(w,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(k,0,2,0),y.add(k,8,5,8),y.add(k,6,0,6),y.add(k,11,0,11),y.add(k,13,13,13),y})();class S extends h.Disposable{constructor(_=c.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,w,C)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,w)=>{},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,h.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 g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,x=[64,126]){let w=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(w=_.prefix.charCodeAt(0),w&&60>w||w>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<_.intermediates.length;++T){const N=_.intermediates.charCodeAt(T);if(32>N||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");w<<=8,w|=N}}if(_.final.length!==1)throw new Error("final must be a single byte");const C=_.final.charCodeAt(0);if(x[0]>C||C>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return w<<=8,w|=C,w}identToString(_){const x=[];for(;_;)x.push(String.fromCharCode(255&_)),_>>=8;return x.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,x){const w=this._identifier(_,[48,126]);this._escHandlers[w]===void 0&&(this._escHandlers[w]=[]);const C=this._escHandlers[w];return C.push(x),{dispose:()=>{const T=C.indexOf(x);T!==-1&&C.splice(T,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,x){this._executeHandlers[_.charCodeAt(0)]=x}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,x){const w=this._identifier(_);this._csiHandlers[w]===void 0&&(this._csiHandlers[w]=[]);const C=this._csiHandlers[w];return C.push(x),{dispose:()=>{const T=C.indexOf(x);T!==-1&&C.splice(T,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,x){return this._dcsParser.registerHandler(this._identifier(_),x)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,x){return this._oscParser.registerHandler(_,x)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,x,w,C,T){this._parseStack.state=_,this._parseStack.handlers=x,this._parseStack.handlerPos=w,this._parseStack.transition=C,this._parseStack.chunkPos=T}parse(_,x,w){let C,T=0,N=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=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 A=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(w===!1&&D>-1){for(;D>=0&&(C=A[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(w===!1&&D>-1){for(;D>=0&&(C=A[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 6:if(T=_[this._parseStack.chunkPos],C=this._dcsParser.unhook(T!==24&&T!==26,w),C)return C;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=_[this._parseStack.chunkPos],C=this._oscParser.end(T!==24&&T!==26,w),C)return C;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=j;A>4){case 2:for(let U=A+1;;++U){if(U>=x||(T=_[U])<32||T>126&&T=x||(T=_[U])<32||T>126&&T=x||(T=_[U])<32||T>126&&T=x||(T=_[U])<32||T>126&&T=0&&(C=D[B](this._params),C!==!0);B--)if(C instanceof Promise)return this._preserveStack(3,D,B,N,A),C;B<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++A47&&T<60);A--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const H=this._escHandlers[this._collect<<8|T];let V=H?H.length-1:-1;for(;V>=0&&(C=H[V](),C!==!0);V--)if(C instanceof Promise)return this._preserveStack(4,H,V,N,A),C;V<0&&this._escHandlerFb(this._collect<<8|T),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|T,this._params);break;case 13:for(let U=A+1;;++U)if(U>=x||(T=_[U])===24||T===26||T===27||T>127&&T=x||(T=_[U])<32||T>127&&T{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),m=u(482),f=[];c.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(g,v){this._handlers[g]===void 0&&(this._handlers[g]=[]);const k=this._handlers[g];return k.push(v),{dispose:()=>{const S=k.indexOf(v);S!==-1&&k.splice(S,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].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 g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,v,k){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(g,v,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,v,k))}start(){this.reset(),this._state=1}put(g,v,k){if(this._state!==3){if(this._state===1)for(;v0&&this._put(g,v,k)}}end(g,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,S=this._active.length-1,y=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,k=v,y=this._stack.fallThrough,this._stack.paused=!1),!y&&k===!1){for(;S>=0&&(k=this._active[S].end(g),k!==!0);S--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,k;S--}for(;S>=0;S--)if(k=this._active[S].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,v,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,v,k),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let v=!1;if(this._hitLimit)v=!1;else if(g&&(v=this._handler(this._data),v instanceof Promise))return v.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,v}}},8742:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(f){const g=new h;if(!f.length)return g;for(let v=Array.isArray(f[0])?1:0;v256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(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 g=0;g>8,k=255&this._subParamsIdx[g];k-v>0&&f.push(Array.prototype.slice.call(this._subParams,v,k))}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>u?u: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>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,v=255&this._subParamsIdx[f];return v-g>0?this._subParams.subarray(g,v):null}getSubParamsAll(){const f={};for(let g=0;g>8,k=255&this._subParamsIdx[g];k-v>0&&(f[g]=this._subParams.slice(v,k))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,k=v[g-1];v[g-1]=~k?Math.min(10*k+f,u):f}}c.Params=h},5741:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let m=0;m{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),m=u(511);c.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}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 g=this._buffer.lines.get(f);if(g)return new h.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,f){if(!(m<0||m>=this._line.length))return f?(this._line.loadCell(m,f),f):this._line.loadCell(m,new h.CellData)}translateToString(m,f,g){return this._line.translateToString(m,f,g)}}},8285:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),m=u(8460),f=u(844);class g extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}c.BufferNamespaceApi=g},7975:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(m=>h(m.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((m,f)=>h(m,f.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(l,c,u){var h=this&&this.__decorate||function(y,_,x,w){var C,T=arguments.length,N=T<3?_:w===null?w=Object.getOwnPropertyDescriptor(_,x):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,_,x,w);else for(var j=y.length-1;j>=0;j--)(C=y[j])&&(N=(T<3?C(N):T>3?C(_,x,N):C(_,x))||N);return T>3&&N&&Object.defineProperty(_,x,N),N},m=this&&this.__param||function(y,_){return function(x,w){_(x,w,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const f=u(8460),g=u(844),v=u(5295),k=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let S=c.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(y){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(y.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(y,this))}resize(y,_){this.cols=y,this.rows=_,this.buffers.resize(y,_),this._onResize.fire({cols:y,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,_=!1){const x=this.buffer;let w;w=this._cachedBlankLine,w&&w.length===this.cols&&w.getFg(0)===y.fg&&w.getBg(0)===y.bg||(w=x.getBlankLine(y,_),this._cachedBlankLine=w),w.isWrapped=_;const C=x.ybase+x.scrollTop,T=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;T===x.lines.length-1?N?x.lines.recycle().copyFrom(w):x.lines.push(w.clone()):x.lines.splice(T+1,0,w.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=T-C+1;x.lines.shiftElements(C+1,N-1,-1),x.lines.set(T,w.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(y,_,x){const w=this.buffer;if(y<0){if(w.ydisp===0)return;this.isUserScrolling=!0}else y+w.ydisp>=w.ybase&&(this.isUserScrolling=!1);const C=w.ydisp;w.ydisp=Math.max(Math.min(w.ydisp+y,w.ybase),0),C!==w.ydisp&&(_||this._onScroll.fire(w.ydisp))}};c.BufferService=S=h([m(0,k.IOptionsService)],S)},7994:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(l,c,u){var h=this&&this.__decorate||function(w,C,T,N){var j,A=arguments.length,D=A<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,T):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,C,T,N);else for(var B=w.length-1;B>=0;B--)(j=w[B])&&(D=(A<3?j(D):A>3?j(C,T,D):j(C,T))||D);return A>3&&D&&Object.defineProperty(C,T,D),D},m=this&&this.__param||function(w,C){return function(T,N){C(T,N,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const f=u(2585),g=u(8460),v=u(844),k={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 T=(w.ctrl?16:0)|(w.shift?4:0)|(w.alt?8:0);return w.button===4?(T|=64,T|=w.action):(T|=3&w.button,4&w.button&&(T|=64),8&w.button&&(T|=128),w.action===32?T|=32:w.action!==0||C||(T|=3)),T}const y=String.fromCharCode,_={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${y(C[0])}${y(C[1])}${y(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 x=c.CoreMouseService=class extends v.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 g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(k))this.addProtocol(T,k[T]);for(const T of Object.keys(_))this.addEncoding(T,_[T]);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,T){if(T){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}};c.CoreMouseService=x=h([m(0,f.IBufferService),m(1,f.ICoreService)],x)},6975:function(l,c,u){var h=this&&this.__decorate||function(x,w,C,T){var N,j=arguments.length,A=j<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,w,C,T);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(A=(j<3?N(A):j>3?N(w,C,A):N(w,C))||A);return j>3&&A&&Object.defineProperty(w,C,A),A},m=this&&this.__param||function(x,w){return function(C,T){w(C,T,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const f=u(1439),g=u(8460),v=u(844),k=u(2585),S=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=c.CoreService=class extends v.Disposable{constructor(x,w,C){super(),this._bufferService=x,this._logService=w,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(y)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(y)}triggerDataEvent(x,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 "${x}"`,(()=>x.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((w=>w.charCodeAt(0))))),this._onBinary.fire(x))}};c.CoreService=_=h([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],_)},9074:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),m=u(8460),f=u(844),g=u(6106);let v=0,k=0;class S extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const w=new y(x);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 x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,w,C){let T=0,N=0;for(const j of this._decorations.getKeyIterator(w))T=j.options.x??0,N=T+(j.options.width??1),x>=T&&x{v=N.options.x??0,k=v+(N.options.width??1),x>=v&&x{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),m=u(8343);class f{constructor(...v){this._entries=new Map;for(const[k,S]of v)this.set(k,S)}set(v,k){const S=this._entries.get(v);return this._entries.set(v,k),S}forEach(v){for(const[k,S]of this._entries.entries())v(k,S)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}c.ServiceCollection=f,c.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(g,v){this._services.set(g,v)}getService(g){return this._services.get(g)}createInstance(g,...v){const k=(0,m.getServiceDependencies)(g).sort(((_,x)=>_.index-x.index)),S=[];for(const _ of k){const x=this._services.get(_.id);if(!x)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${_.id}.`);S.push(x)}const y=k.length>0?k[0].index:v.length;if(v.length!==y)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${y+1} conflicts with ${v.length} static arguments`);return new g(...v,...S)}}},7866:function(l,c,u){var h=this&&this.__decorate||function(y,_,x,w){var C,T=arguments.length,N=T<3?_:w===null?w=Object.getOwnPropertyDescriptor(_,x):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,_,x,w);else for(var j=y.length-1;j>=0;j--)(C=y[j])&&(N=(T<3?C(N):T>3?C(_,x,N):C(_,x))||N);return T>3&&N&&Object.defineProperty(_,x,N),N},m=this&&this.__param||function(y,_){return function(x,w){_(x,w,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const f=u(844),g=u(2585),v={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let k,S=c.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let _=0;_JSON.stringify(N))).join(", ")})`);const T=w.apply(this,C);return k.trace(`GlyphRenderer#${w.name} return`,T),T}}},7302:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),m=u(844),f=u(6114);c.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 g=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends m.Disposable{constructor(S){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...c.DEFAULT_OPTIONS};for(const _ in S)if(_ in y)try{const x=S[_];y[_]=this._sanitizeAndValidateOption(_,x)}catch(x){console.error(x)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,y){return this.onOptionChange((_=>{_===S&&y(this.rawOptions[S])}))}onMultipleOptionChange(S,y){return this.onOptionChange((_=>{S.indexOf(_)!==-1&&y()}))}_setupOptions(){const S=_=>{if(!(_ in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},y=(_,x)=>{if(!(_ in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);x=this._sanitizeAndValidateOption(_,x),this.rawOptions[_]!==x&&(this.rawOptions[_]=x,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const x={get:S.bind(this,_),set:y.bind(this,_)};Object.defineProperty(this.options,_,x)}}_sanitizeAndValidateOption(S,y){switch(S){case"cursorStyle":if(y||(y=c.DEFAULT_OPTIONS[S]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${S}`);break;case"wordSeparator":y||(y=c.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=g.includes(y)?y:c.DEFAULT_OPTIONS[S];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${S} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${S} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}c.OptionsService=v},2660:function(l,c,u){var h=this&&this.__decorate||function(v,k,S,y){var _,x=arguments.length,w=x<3?k:y===null?y=Object.getOwnPropertyDescriptor(k,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,k,S,y);else for(var C=v.length-1;C>=0;C--)(_=v[C])&&(w=(x<3?_(w):x>3?_(k,S,w):_(k,S))||w);return x>3&&w&&Object.defineProperty(k,S,w),w},m=this&&this.__param||function(v,k){return function(S,y){k(S,y,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const f=u(2585);let g=c.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const k=this._bufferService.buffer;if(v.id===void 0){const C=k.addMarker(k.ybase+k.y),T={data:v,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(T,C))),this._dataByLinkId.set(T.id,T),T.id}const S=v,y=this._getEntryIdKey(S),_=this._entriesWithId.get(y);if(_)return this.addLineToLink(_.id,k.ybase+k.y),_.id;const x=k.addMarker(k.ybase+k.y),w={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(w,x))),this._entriesWithId.set(w.key,w),this._dataByLinkId.set(w.id,w),w.id}addLineToLink(v,k){const S=this._dataByLinkId.get(v);if(S&&S.lines.every((y=>y.line!==k))){const y=this._bufferService.buffer.addMarker(k);S.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(S,y)))}}getLinkData(v){var k;return(k=this._dataByLinkId.get(v))==null?void 0:k.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,k){const S=v.lines.indexOf(k);S!==-1&&(v.lines.splice(S,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};c.OscLinkService=g=h([m(0,f.IBufferService)],g)},8343:(l,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",h="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(m){return m[h]||[]},c.createDecorator=function(m){if(c.serviceRegistry.has(m))return c.serviceRegistry.get(m);const f=function(g,v,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,y,_){y[u]===y?y[h].push({id:S,index:_}):(y[h]=[{id:S,index:_}],y[u]=y)})(f,g,k)};return f.toString=()=>m,c.serviceRegistry.set(m,f),f}},2585:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const h=u(8343);var m;c.IBufferService=(0,h.createDecorator)("BufferService"),c.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),c.ICoreService=(0,h.createDecorator)("CoreService"),c.ICharsetService=(0,h.createDecorator)("CharsetService"),c.IInstantiationService=(0,h.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"})(m||(c.LogLevelEnum=m={})),c.ILogService=(0,h.createDecorator)("LogService"),c.IOptionsService=(0,h.createDecorator)("OptionsService"),c.IOscLinkService=(0,h.createDecorator)("OscLinkService"),c.IUnicodeService=(0,h.createDecorator)("UnicodeService"),c.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(l,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),m=u(225);class f{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,k,S=!1){return(16777215&v)<<3|(3&k)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const v=new m.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let k=0,S=0;const y=v.length;for(let _=0;_=y)return k+this.wcwidth(x);const T=v.charCodeAt(_);56320<=T&&T<=57343?x=1024*(x-55296)+T-56320+65536:k+=this.wcwidth(T)}const w=this.charProperties(x,S);let C=f.extractWidth(w);f.extractShouldJoin(w)&&(C-=f.extractWidth(S)),k+=C,S=w}return k}charProperties(v,k){return this._activeProvider.charProperties(v,k)}}c.UnicodeService=f}},r={};function i(l){var c=r[l];if(c!==void 0)return c.exports;var u=r[l]={exports:{}};return n[l].call(u.exports,u,u.exports,i),u.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const c=i(9042),u=i(3236),h=i(844),m=i(5741),f=i(8285),g=i(7975),v=i(7090),k=["cols","rows"];class S extends h.Disposable{constructor(_){super(),this._core=this.register(new u.Terminal(_)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const x=C=>this._core.options[C],w=(C,T)=>{this._checkReadonlyOptions(C),this._core.options[C]=T};for(const C in this._core.options){const T={get:x.bind(this,C),set:w.bind(this,C)};Object.defineProperty(this._publicOptions,C,T)}}_checkReadonlyOptions(_){if(k.includes(_))throw new Error(`Option "${_}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.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 _=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:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const x in _)this._publicOptions[x]=_[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,x=!0){this._core.input(_,x)}resize(_,x){this._verifyIntegers(_,x),this._core.resize(_,x)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,x,w){this._verifyIntegers(_,x,w),this._core.select(_,x,w)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,x){this._verifyIntegers(_,x),this._core.selectLines(_,x)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,x){this._core.write(_,x)}writeln(_,x){this._core.write(_),this._core.write(`\r +`,x)}paste(_){this._core.paste(_)}refresh(_,x){this._verifyIntegers(_,x),this._core.refresh(_,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return c}_verifyIntegers(..._){for(const x of _)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const x of _)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}l.Terminal=S})(),a})()))})(N1)),N1.exports}var FV=HV();function c6(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new FV.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),i=new IV.FitAddon;r.loadAddon(i),r.open(n);try{i.fit()}catch{}const a=new ResizeObserver(()=>{try{i.fit()}catch{}});a.observe(n);let l=!1,c=0,u=!1,h=!1;async function m(){if(u){h=!0;return}u=!0;try{for(;;){const g=await uM(e,c);if(l)return;if(g.dataBase64&&r.write(c6(g.dataBase64)),c=g.nextOffset,g.eof)break}}catch{}finally{u=!1,h&&!l&&(h=!1,m())}}const f=_j(e,g=>{if(l)return;const v=c6(g.dataBase64);!u&&g.offset===c?(r.write(v),c+=v.length):g.offset+v.length>c&&m()});return m(),()=>{l=!0,f(),a.disconnect(),r.dispose()}},[e]),d.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const ll="__uncommitted__";function PV({state:e}){return!e||e.loading?d.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?d.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?d.jsx(Y2,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):d.jsx(E9,{diff:e.payload.diff}):d.jsx("div",{className:"diff-empty",children:"No changes."})}function UV({experiment:e}){const[t,n]=O.useState(e.playEntry??""),[r,i]=O.useState(0);O.useEffect(()=>n(e.playEntry??""),[e.playEntry]),O.useEffect(()=>{aM(e.id).catch(f=>console.error("play-build:",f))},[e.id,r]);const[a,l]=O.useState(null),[,c]=O.useState(0);O.useEffect(()=>{let f=!1;const g=()=>cM(e.id).then(S=>{f||l(S)}).catch(()=>{});g();const v=setInterval(g,1e4),k=setInterval(()=>c(S=>S+1),3e4);return()=>{f=!0,clearInterval(v),clearInterval(k)}},[e.id,r]);const u=(f,g)=>{F7(e.id,f,g).then(()=>l(null)).catch(v=>console.error("play-session:",v))},h=oM({id:e.id,playEntry:e.playEntry}),m=()=>{const f=t.trim()||null;(e.playEntry??null)!==f&&lM(e.id,f).then(()=>i(g=>g+1)).catch(g=>console.error("play-entry:",g))};return d.jsxs("div",{className:"play-view",children:[d.jsxs("div",{className:"play-bar",children:[d.jsx("span",{className:"ctl-label",children:"Entry"}),d.jsx("input",{className:"input sm play-entry-input",placeholder:"index.html (e.g. gambit-slots.html?x=1)",value:t,onChange:f=>n(f.target.value),onBlur:m,onKeyDown:f=>{f.key==="Enter"&&f.target.blur()}}),d.jsx("span",{style:{flex:1}}),a&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"session-clock",title:`Session started ${Pi(a.createdAt)}`,children:[d.jsx("span",{className:"dot"}),Z0(Date.now()-a.createdAt)]}),d.jsx(K2,{verdict:a.verdict??null,notes:a.verdictNotes,onSave:u})]}),d.jsxs("button",{className:"btn sm",title:"Rebuild from the branch head and reload",onClick:()=>i(f=>f+1),children:[d.jsx(kd,{size:12})," Rebuild"]}),d.jsx("a",{className:"icon-btn",href:h,target:"_blank",rel:"noreferrer",title:"Open in a browser tab","aria-label":"Open in a browser tab",children:d.jsx(Eu,{size:14})})]}),d.jsx("iframe",{className:"play-frame",src:h,title:"Playable build"},r)]})}const qV=["keep","kill","iterate"];function K2({verdict:e,notes:t,onSave:n,label:r}){const[i,a]=O.useState(e??null),[l,c]=O.useState(t??""),[u,h]=O.useState(!1);O.useEffect(()=>a(e??null),[e]),O.useEffect(()=>c(t??""),[t]);const m=f=>{const g=i===f?null:f;a(g),n(g,l)};return d.jsxs("span",{className:"verdict-control",children:[r&&d.jsx("span",{className:"verdict-label",children:r}),qV.map(f=>d.jsx("button",{className:`verdict-chip ${f} ${i===f?"active":""}`,title:i===f?`Clear ${f}`:f,onClick:()=>m(f),children:f},f)),d.jsx("button",{className:`icon-btn ${u||l?"active":""}`,title:l?`Notes: ${l}`:"Add notes","aria-label":"Verdict notes",onClick:()=>h(f=>!f),children:d.jsx(hT,{size:13})}),u&&d.jsx("input",{className:"input sm verdict-notes",placeholder:"Why? (saved on blur)",value:l,autoFocus:!0,onChange:f=>c(f.target.value),onBlur:()=>{h(!1),n(i,l)},onKeyDown:f=>{f.key==="Enter"&&f.target.blur()}})]})}function A1(e){return typeof e=="number"?Number.isInteger(e)?String(e):e.toPrecision(3):String(e)}function GV({aggregate:e,parentAggregate:t}){return d.jsx("div",{className:"metric-chips",children:Object.entries(e).map(([n,r])=>{const i=t==null?void 0:t[n],a=typeof r=="number"&&typeof i=="number"?r-i:null;return d.jsxs("span",{className:"metric-chip",title:i!=null?`parent: ${A1(i)}`:void 0,children:[d.jsx("span",{className:"metric-key",children:n}),d.jsx("span",{className:"metric-value",children:A1(r)}),a!==null&&a!==0&&d.jsxs("span",{className:`metric-delta ${a>0?"up":"down"}`,children:[a>0?"▲":"▼",A1(Math.abs(a))]})]},n)})})}function VV({runId:e,terminal:t}){const[n,r]=O.useState(null);if(O.useEffect(()=>{sM(e).then(r).catch(()=>r([]))},[e,t]),!n||n.length===0)return null;const i=n.filter(l=>l.contentType.startsWith("image/")),a=n.filter(l=>!l.contentType.startsWith("image/"));return d.jsxs("div",{className:"artifact-gallery",children:[i.length>0&&d.jsx("div",{className:"artifact-grid",children:i.map(l=>d.jsx("a",{href:Im(e,l.path),target:"_blank",rel:"noreferrer",title:l.path,children:d.jsx("img",{src:Im(e,l.path),alt:l.path,loading:"lazy"})},l.path))}),a.length>0&&d.jsx("div",{className:"artifact-files",children:a.map(l=>d.jsx("a",{className:"artifact-file",href:Im(e,l.path),target:"_blank",rel:"noreferrer",children:l.path},l.path))})]})}function WV({experiment:e,project:t,view:n,runs:r,selectedRunId:i,onSelectRun:a,mergeParent:l=null}){var m;const c=r.filter(f=>f.experimentId===e.id).sort((f,g)=>g.createdAt-f.createdAt),u=e.parentExperimentId&&((m=r.filter(f=>f.experimentId===e.parentExperimentId&&f.kind==="sim"&&f.status==="done"&&f.metricsAggregate).sort((f,g)=>g.createdAt-f.createdAt)[0])==null?void 0:m.metricsAggregate)||null,h=n==="terminal"?d.jsx(YV,{experiment:e,expRuns:c,parentAggregate:u,selectedRunId:i,onSelectRun:a}):n==="play"?d.jsx(UV,{experiment:e}):d.jsx(XV,{experiment:e,project:t});return d.jsxs("div",{className:"exp-detail",children:[d.jsxs("div",{className:"exp-verdict-strip",children:[d.jsx(K2,{label:"Experiment verdict",verdict:e.verdict,notes:e.verdictNotes,onSave:(f,g)=>void iM(e.id,f,g).catch(()=>{})}),e.verdictNotes&&d.jsx("span",{className:"verdict-notes-preview",title:e.verdictNotes,children:e.verdictNotes}),l&&d.jsxs("span",{className:"verdict-notes-preview",title:`Branch ${l.branchName} was merged into this node at creation`,children:["merged from ",l.title||l.slug]})]}),d.jsx("div",{className:"exp-detail-body",children:h})]})}function YV({experiment:e,expRuns:t,parentAggregate:n,selectedRunId:r,onSelectRun:i}){const[a,l]=O.useState(null),[c,u]=O.useState(null),[h,m]=O.useState(!1),f=O.useRef(null),g=r&&t.find(x=>x.id===r)||t[0]||null,v=(g==null?void 0:g.status)==="running"||(g==null?void 0:g.status)==="starting",k=!!(g&&v&&(g.cancelRequested||c===g.id)),S=x=>{const w=t.findIndex(C=>C.id===x);return w===-1?t.length:t.length-w},y=O.useRef(null);O.useEffect(()=>{if(y.current===null){y.current=new Set(t.map(w=>w.id));return}const x=t.find(w=>!y.current.has(w.id));for(const w of t)y.current.add(w.id);x&&i(x.id)},[t,i]),O.useEffect(()=>{if(!h)return;const x=w=>{var C;(C=f.current)!=null&&C.contains(w.target)||m(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[h]);async function _(){if(g){l(null),u(g.id);try{await H7(g.id)}catch(x){u(null),l(x instanceof Error?x.message:String(x))}}}return d.jsxs("div",{className:"term-view",children:[d.jsxs("div",{className:"term-bar",children:[d.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),d.jsx("span",{style:{flex:1}}),a&&d.jsx("span",{className:"error",role:"alert",children:a}),g&&!v&&d.jsx(K2,{verdict:g.verdict??null,notes:g.verdictNotes,onSave:(x,w)=>void rM(g.id,x,w).catch(()=>{})}),v&&d.jsxs("button",{className:"btn sm ghost",disabled:k,onClick:()=>void _(),children:[d.jsx(SA,{size:13}),k?"Cancelling…":"Stop"]}),t.length>0&&g&&d.jsxs("div",{className:"run-history",ref:f,children:[d.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>m(x=>!x),children:[d.jsxs("span",{className:"run-label",children:["Run ",S(g.id)]}),d.jsx(Ss,{status:k?"cancelling":wl(g)}),d.jsx(Hi,{size:14,className:"run-picker-chev"})]}),h&&d.jsx("div",{className:"history-menu",children:t.map(x=>d.jsxs("button",{className:`history-item ${x.id===(g==null?void 0:g.id)?"active":""}`,onClick:()=>{i(x.id),m(!1)},children:[d.jsxs("span",{className:"run-label",children:["Run ",S(x.id)]}),d.jsx(Ss,{status:wl(x)}),d.jsx("span",{className:"when",children:Pi(x.createdAt)})]},x.id))})]})]}),(g==null?void 0:g.metricsAggregate)&&d.jsx("div",{className:"results-strip",children:d.jsx(GV,{aggregate:g.metricsAggregate,parentAggregate:n})}),g&&d.jsx(VV,{runId:g.id,terminal:!v},`art-${g.id}`),d.jsx("div",{className:"term-fill",children:g?d.jsx($V,{runId:g.id},g.id):d.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function XV({experiment:e,project:t}){const[n,r]=O.useState(null),[i,a]=O.useState(null),[l,c]=O.useState(null),[u,h]=O.useState(null),[m,f]=O.useState({}),g=!!(l&&l.diff.trim()!==""&&l.experimentId===e.id);async function v(){a(null);try{const[S,y]=await Promise.all([fM(e.id),d3(e.projectId)]);r(S),c(y),h(_=>{var w;return _!==null?_:y.diff.trim()!==""&&y.experimentId===e.id?ll:((w=S[0])==null?void 0:w.sha)??null})}catch(S){a(S instanceof Error?S.message:String(S))}}O.useEffect(()=>{n===null&&!i&&v()},[n,i,e.id]),O.useEffect(()=>{const S=setInterval(()=>{d3(e.projectId).then(c).catch(()=>{})},5e3);return()=>clearInterval(S)},[e.projectId]),O.useEffect(()=>{var S;u===ll&&l&&!g&&h(((S=n==null?void 0:n[0])==null?void 0:S.sha)??null)},[u,l,g,n]),O.useEffect(()=>{if(!u||u===ll||m[u])return;const S=u;f(y=>({...y,[S]:{loading:!0}})),pM(e.id,S).then(y=>f(_=>({..._,[S]:{loading:!1,payload:y}}))).catch(y=>f(_=>({..._,[S]:{loading:!1,error:y instanceof Error?y.message:String(y)}})))},[u,m,e.id]);const k=!g&&((n==null?void 0:n.length)??0)===0;return d.jsx("div",{className:"drawer",children:d.jsx("div",{className:"drawer-body",children:d.jsxs("div",{className:"drawer-section",children:[d.jsxs("div",{className:"changes-branch",children:[d.jsx("span",{className:"ctl-label",children:"Branch"}),d.jsx(BV,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),i?d.jsx("div",{className:"error",children:i}):n===null?d.jsx("div",{className:"changes-note",children:"Loading changes…"}):k?d.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"commit-picker",children:[d.jsx("span",{className:"ctl-label",children:"Commit"}),u===ll&&d.jsx("span",{className:"uncommitted-dot"}),d.jsxs("select",{className:"input sm",value:u??"",onChange:S=>h(S.target.value),children:[g&&d.jsx("option",{value:ll,children:"● Uncommitted changes"}),n.map(S=>d.jsxs("option",{value:S.sha,children:[S.sha.slice(0,7)," — ",S.subject]},S.sha))]}),d.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void v(),children:d.jsx(kd,{size:14})})]}),d.jsx("div",{style:{marginTop:10},children:u===ll&&l?l.truncated?d.jsxs("div",{className:"truncated-notice",children:[d.jsx("h4",{children:"Diff too large to display"}),d.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):d.jsx(E9,{diff:l.diff}):u?d.jsx(PV,{state:m[u]}):d.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}const KV=O.lazy(()=>ff(()=>import("./ModelViewer-C_2Z847L.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ModelViewer}))),ZV=O.lazy(()=>ff(()=>import("./SplatViewer-DWpiLLqa.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SplatViewer})));function QV({kind:e,src:t,name:n}){const[r,i]=O.useState(!1);return r?d.jsxs("div",{className:"file-view-note",children:["No preview — this isn’t a file in the project’s files dir."," ",d.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"Open raw"})]}):e==="image"?d.jsx("a",{className:"fpreview-image",href:t,target:"_blank",rel:"noopener noreferrer",children:d.jsx("img",{src:t,alt:n,onError:()=>i(!0)})}):e==="video"?d.jsx("video",{className:"fpreview-video",src:t,controls:!0,loop:!0,playsInline:!0,onError:()=>i(!0)}):e==="audio"?d.jsx("audio",{className:"fpreview-audio",src:t,controls:!0,onError:()=>i(!0)}):e==="pdf"?d.jsx("iframe",{className:"fpreview-pdf",title:n,src:t}):e==="splat"?d.jsx(O.Suspense,{fallback:d.jsx("div",{className:"file-view-note",children:"Loading splat viewer…"}),children:d.jsx(ZV,{src:t,name:n})}):d.jsx(O.Suspense,{fallback:d.jsx("div",{className:"file-view-note",children:"Loading 3D viewer…"}),children:d.jsx(KV,{src:t,name:n})})}function JV({projectId:e,path:t,source:n="repo",sessionId:r,gitRef:i,onOpenFile:a}){const[l,c]=O.useState(null),[u,h]=O.useState(!1),[m,f]=O.useState(null),[g,v]=O.useState(!0),[k,S]=O.useState(0),y=n==="files",_=j2(t),x=/\.(md|mdx|markdown)$/i.test(t),w=/(^|\/)report\.md$/i.test(t),C=w?t.replace(/\/?report\.md$/i,""):t.split("/").slice(0,-1).join("/"),[T,N]=O.useState(!1),j=(l==null?void 0:l.file)??null,A=(l==null?void 0:l.viaFiles)??!1,D=y||A;O.useEffect(()=>{if(_){c(null),f(null),v(!1);return}let H=!1;v(!0),h(!1);const V=()=>(w&&C?q7(e,C).then(P=>P.markdown).catch(()=>null):qM(e,t)).then(P=>({path:t,content:P??"",truncated:!1,notFound:P===null,root:"clone"}));return(y?V().then(P=>({file:P,viaFiles:!1})):mM(e,t,{sessionId:r,ref:i}).then(P=>P.notFound&&!i?V().then(K=>K.notFound?{file:P,viaFiles:!1}:{file:{...K,root:P.root},viaFiles:!0}):{file:P,viaFiles:!1})).then(P=>{H||((y||P.viaFiles)&&P.file.content.includes("\0")&&h(!0),c(P),f(null))}).catch(P=>{H||f(P.message)}).finally(()=>{H||v(!1)}),()=>{H=!0}},[e,t,n,r,i,k,_]);const B=H=>y?"File not found in the project's files.":i?`File not found on branch ${i}.`:r&&H.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone or the project's files.":`File not found in the ${H.root==="worktree"?"session's worktree":"project clone"} or the project's files.`;return d.jsxs("div",{className:"file-view",children:[d.jsxs("div",{className:"file-view-header",children:[d.jsx(j7,{size:13,style:{flexShrink:0}}),d.jsx("code",{className:"file-view-path",title:t,children:t}),i&&d.jsx("code",{className:"file-view-ref",title:`Committed state of ${i}`,children:i}),x&&d.jsx("button",{className:`icon-btn ${T?"active":""}`,"data-tip":T?"Rendered view":"View source","aria-label":T?"Rendered view":"View source",onClick:()=>N(H=>!H),children:d.jsx(N7,{size:13})}),d.jsx("button",{className:"icon-btn","data-tip":"Reload file","aria-label":"Reload file",onClick:()=>S(H=>H+1),children:g?d.jsx("span",{className:"spinner"}):d.jsx(kd,{size:13})})]}),d.jsx("div",{className:"file-view-body",children:_?d.jsx(QV,{kind:_,src:mo(e,t),name:t}):m?d.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",m]}):j===null?d.jsx("div",{className:"file-view-note",children:"Loading…"}):j.notFound?d.jsx("div",{className:"file-view-note",children:B(j)}):u?d.jsx("div",{className:"file-view-note",children:"Binary file — no inline preview."}):d.jsxs(d.Fragment,{children:[!D&&!i&&r&&j.root==="clone"&&d.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),A&&d.jsxs("div",{className:"file-view-note",children:["Not in the ",j.root==="worktree"?"session's worktree":"project clone"," — showing the copy from the project's files."]}),x&&!T?d.jsx("div",{className:"file-view-md",children:D?d.jsx(B9,{projectId:e,folder:C,markdown:j.content}):d.jsx(ao,{text:j.content,onOpenFile:a&&(H=>a(H,r,i))})}):d.jsx(j9,{text:j.content,path:t}),!D&&j.truncated&&d.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function eW({projectName:e,onHome:t,onCollapse:n}){return d.jsxs("div",{className:"rail-brand",children:[d.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[d.jsx(q1,{size:15}),d.jsx("span",{className:"brand-project",children:e})]}),n&&d.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:d.jsx(L7,{size:15})})]})}const u6="Couldn't reach orx. Check it's still running, then re-check.";function tW({onDone:e}){const[t,n]=O.useState(0),[r,i]=O.useState(null),[a,l]=O.useState(null),[c,u]=O.useState(null),[h,m]=O.useState(!1),[f,g]=O.useState(!1),[v,k]=O.useState(!1),S=(r==null?void 0:r.some(C=>C.agentReady))??!1,y=(a==null?void 0:a.githubTokenSource)!=null,_=O.useRef(0),x=(C,T=!1)=>{const N=++_.current;m(!0),g(!1),k(!1);const j=()=>N===_.current;Promise.allSettled([Sl(C,T).then(A=>j()&&i(A)),G7().then(A=>j()&&l(A)),YM().then(A=>j()&&u(A))]).then(([A,D])=>{j()&&(A.status==="rejected"&&(g(!0),i(null)),D.status==="rejected"&&(k(!0),l(null)))}).finally(()=>m(!1))};O.useEffect(()=>x(!1),[]),O.useEffect(()=>wv(()=>{Sl(!0).then(C=>{i(C),g(!1)}).catch(()=>g(!0))}),[]);const w=()=>{KM((c==null?void 0:c.enabled)??!0).catch(()=>{}),e()};return d.jsx("div",{className:"home onboarding",children:d.jsx("div",{className:"home-inner",children:t===0?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"onb-eyebrow",children:[d.jsx(Yc,{})," · Step 1 of 3"]}),d.jsx("h2",{className:"onb-title",children:"Your coding agents"}),d.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),d.jsx("div",{className:"onb-cards",children:r!==null?r.map(C=>d.jsx(rW,{h:C},C.id)):f?d.jsx("div",{className:"onb-card-meta",children:u6}):d.jsxs("div",{className:"onb-loading",children:[d.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]})}),r!==null&&!S&&d.jsx("p",{className:"onb-gate-hint",children:"Sign in to at least one agent to continue."}),d.jsxs("div",{className:"onb-actions",children:[d.jsxs("button",{className:"btn ghost",onClick:()=>x(!0,!0),disabled:h,children:[d.jsx(Fi,{size:12,className:h?"spin":""})," Re-check"]}),d.jsx("div",{style:{flex:1}}),d.jsxs("button",{className:"btn primary",onClick:()=>n(1),disabled:!S,title:S?void 0:"Sign in to at least one coding agent to continue",children:["Continue ",d.jsx(zm,{size:13})]})]})]}):t===1?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"onb-eyebrow",children:[d.jsx(Yc,{})," · Step 2 of 3"]}),d.jsx("h2",{className:"onb-title",children:"Connect GitHub"}),d.jsx("p",{className:"onb-sub",children:"orx clones your GitHub repos and pushes each experiment as a branch."}),d.jsx("div",{className:"onb-cards",children:v?d.jsx("div",{className:"onb-card-meta",children:u6}):d.jsx(iW,{git:a,onUpdate:C=>{_.current++,l(C),k(!1)}})}),a!==null&&!y&&d.jsx("p",{className:"onb-gate-hint",children:"Without GitHub access, orx can't create repos for you — cloning and pushing still work if you have SSH keys."}),d.jsxs("div",{className:"onb-actions",children:[d.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[d.jsx(q1,{size:12})," Back"]}),d.jsxs("button",{className:"btn ghost",onClick:()=>x(!1),disabled:h,children:[d.jsx(Fi,{size:12,className:h?"spin":""})," Re-check"]}),d.jsx("div",{style:{flex:1}}),d.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",d.jsx(zm,{size:13})]})]})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"onb-eyebrow",children:[d.jsx(Yc,{})," · Step 3 of 3"]}),d.jsx("h2",{className:"onb-title",children:"Usage analytics"}),d.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),d.jsx("div",{className:"onb-cards",children:d.jsx(sW,{telemetry:c,onUpdate:u})}),d.jsx("p",{className:"onb-aside-text",style:{marginTop:12},children:"Your database, run logs, and artifacts stay on this machine — change where they live any time in Settings → Storage."}),d.jsxs("div",{className:"onb-actions",children:[d.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[d.jsx(q1,{size:12})," Back"]}),d.jsx("div",{style:{flex:1}}),d.jsxs("button",{className:"btn primary",onClick:w,children:["Create your first project ",d.jsx(zm,{size:13})]})]})]})})})}function h6({cmd:e}){const[t,n]=O.useState(!1),r=()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return d.jsxs("span",{className:"onb-cmd-chip",children:[d.jsx("code",{children:e}),d.jsx("button",{className:"onb-cmd-copy",onClick:r,"aria-label":t?"Copied":"Copy command",title:t?"Copied":"Copy",children:t?d.jsx(kr,{size:13,strokeWidth:3}):d.jsx(Sd,{size:13})})]})}function nW(e){return e.agentReady?{cls:"st-done",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"st-starting",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"st-starting",label:"Update required"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}:{cls:"st-idle",label:"Not detected"}}function rW({h:e}){var r;const t=nW(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return d.jsxs("div",{className:"onb-card",children:[d.jsxs("div",{className:"onb-card-head",children:[d.jsx("span",{className:"onb-card-name",children:e.name}),d.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?d.jsx(kr,{size:12,strokeWidth:3}):d.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),d.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(i=>X0(i)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):d.jsx("div",{className:"onb-card-meta",children:L2(e.agentNote)})]})}function iW({git:e,onUpdate:t}){const[n,r]=O.useState(!1);if(e===null)return d.jsxs("div",{className:"onb-loading",children:[d.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return d.jsxs("div",{className:"onb-card",children:[d.jsxs("div",{className:"onb-card-head",children:[d.jsx("span",{className:"onb-card-name",children:"git"}),d.jsxs("span",{className:"status-badge st-failed",children:[d.jsx("span",{className:"dot"})," Not found"]})]}),d.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const i=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return d.jsxs("div",{className:"onb-card",children:[d.jsxs("div",{className:"onb-card-row",children:[d.jsx("span",{className:"onb-card-name",children:"GitHub"}),d.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"Token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"Token saved in orx":e.githubTokenSource==="gh"?"Signed in via gh CLI":""}),d.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?d.jsx(kr,{size:12,strokeWidth:3}):d.jsx("span",{className:"dot"}),e.githubTokenSource?"Connected":"Not connected"]})]}),!e.githubTokenSource&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"onb-fix",children:[d.jsx("span",{className:"onb-fix-label",children:n?"Paste a personal access token:":e.ghInstalled?"Run this in your terminal to sign in:":"Install the GitHub CLI, then run this to sign in:"}),d.jsx("button",{className:"onb-fix-alt",onClick:()=>r(a=>!a),children:n?"Use gh instead":"Paste a token instead"})]}),n?d.jsx(T8,{onSaved:t}):d.jsx(h6,{cmd:"gh auth login"})]}),!i&&d.jsxs("div",{className:"onb-aside",children:[d.jsx("div",{className:"onb-aside-text",children:"Optional — so the agent's commits are attributed to you:"}),d.jsx(h6,{cmd:'git config --global user.name "Your Name" && git config --global user.email "you@example.com"'})]})]})}function sW({telemetry:e,onUpdate:t}){const[n,r]=O.useState(!1);if(e===null)return d.jsxs("div",{className:"onb-loading",children:[d.jsx("span",{className:"spinner"})," Checking analytics…"]});const i=e.enabled,a=!i&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",l=c=>{n||c===i||(r(!0),XM(c).then(t).finally(()=>r(!1)))};return d.jsxs("div",{className:"onb-card",children:[d.jsxs("div",{className:"onb-card-head",children:[d.jsxs("div",{children:[d.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),d.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:i?"On — helps prioritize what to build next.":a?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),d.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[d.jsxs("button",{className:`btn ${i?"primary":"ghost"}`,onClick:()=>l(!0),disabled:n,"aria-pressed":i,children:[i?d.jsx(kr,{size:12,strokeWidth:3}):null," On"]}),d.jsxs("button",{className:`btn ${i?"ghost":"primary"}`,onClick:()=>l(!1),disabled:n,"aria-pressed":!i,children:[i?null:d.jsx(kr,{size:12,strokeWidth:3})," Off"]})]})]}),d.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",d.jsx("code",{children:"orx telemetry off"}),"."]}),a&&d.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function y0(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function aW(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function oW(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function lW(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function cW(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)}function uW({info:e,checking:t}){if(t&&!e)return d.jsx("span",{className:"repo-hint",children:"Checking that folder…"});if(!e)return null;switch(e.kind){case"github":return d.jsxs("span",{className:"repo-hint",children:["Found ",d.jsx("strong",{children:`${e.owner}/${e.repo}`}),e.currentBranch?` · ${e.currentBranch}`:""," — crux will use this repo."]});case"noRemote":return e.currentBranch?d.jsx("span",{className:"repo-hint",children:"A git repo with no GitHub remote. Publish it below, or add a remote first."}):d.jsx("span",{className:"repo-hint",children:"A git repo with nothing to publish yet — commit something, or check out a branch."});case"foreignRemote":return d.jsxs("span",{className:"repo-hint",children:["Its remote is ",d.jsx("code",{children:e.remoteUrl}),", which isn't GitHub. crux clones from GitHub when it runs experiments, so this repo can't be used yet."]});case"notARepo":return d.jsxs("span",{className:"repo-hint",children:["That folder isn't a git repo. Run ",d.jsx("code",{children:"git init"})," there, or use New blank repo."]});case"missing":return d.jsx("span",{className:"repo-hint",children:"No folder at that path."})}}function hW({onCreated:e,onCancel:t}){var ct;const[n,r]=O.useState("local"),[i,a]=O.useState("use"),[l,c]=O.useState(""),[u,h]=O.useState(null),[m,f]=O.useState(!1),[g,v]=O.useState(!1),k=O.useRef(0),[S,y]=O.useState(""),[_,x]=O.useState(""),[w,C]=O.useState(!1),[T,N]=O.useState(!1),[j,A]=O.useState(null),[D,B]=O.useState(null);O.useEffect(()=>{if(!T){B(null);return}return Sj(B)},[T]);const[H,V]=O.useState(""),[U,P]=O.useState([]),[K,W]=O.useState(!1),[Z,ee]=O.useState(null),[z,L]=O.useState(!1),[I,Y]=O.useState(null),G=O.useRef(0),[se,oe]=O.useState(null),[fe,te]=O.useState(null);O.useEffect(()=>{qT().then(Fe=>te(Fe.login)).catch(()=>te(null))},[]);const q=fe??"you",ne=y0(S),le=(u==null?void 0:u.kind)==="noRemote"&&!!u.currentBranch,ye=`${cW(_)||"project"}`,ve=(u==null?void 0:u.kind)==="github"||le&&g,Ee=!!(_.trim()&&(n==="new"||n==="local"&&ve||n==="existing"&&ne!==null||n==="paper"&&Z!==null&&(S.trim()===""||ne!==null))),je=Fe=>{r(Fe),Fe!=="paper"&&a("use"),Fe!=="local"&&v(!1)},Pe=Fe=>{if(c(Fe),v(!1),h(null),!w){const et=Fe.trim().replace(/\/+$/,"").split("/").pop()??"";x(et)}},$e=Fe=>{var et;y(Fe),n!=="paper"&&a("use"),w||x(((et=y0(Fe))==null?void 0:et.repo)??"")};O.useEffect(()=>{if(n!=="local")return;const Fe=l.trim();if(Fe===""){h(null),f(!1);return}const et=++k.current;f(!0);const _t=setTimeout(()=>{FT(Fe).then(ut=>{et===k.current&&h(ut)}).catch(()=>{et===k.current&&h(null)}).finally(()=>{et===k.current&&f(!1)})},300);return()=>clearTimeout(_t)},[n,l]);const[Be,Nt]=O.useState(null),[Rt,Lt]=O.useState(!1);O.useEffect(()=>{n==="existing"&&Be===null&&YT().then(Nt).catch(()=>Nt([]))},[n,Be]);const Ft=S.trim().toLowerCase(),an=(Be??[]).filter(Fe=>Fe.fullName.toLowerCase()!==Ft&&(Ft===""||Fe.fullName.toLowerCase().includes(Ft))).slice(0,8);async function wt(Fe){const et=++G.current;P([]),W(!1),L(!0),Y(null);try{const _t=await VT(Fe);if(et!==G.current)return;ee(_t);const ut=_t.repoUrl?y0(_t.repoUrl):null;y(ut?`${ut.owner}/${ut.repo}`:""),a("fork"),w||x((ut==null?void 0:ut.repo)??(_t.title??"").trim().slice(0,60))}catch(_t){if(et!==G.current)return;Y(_t instanceof Error?_t.message:String(_t))}finally{et===G.current&&L(!1)}}function Je(){G.current++,ee(null),V(""),P([]),Y(null),y(""),w||x("")}const pt=ne?`${ne.owner}/${ne.repo}`:"";O.useEffect(()=>{if(!pt){oe(null);return}const[Fe,et]=pt.split("/");oe(null);let _t=!0;const ut=setTimeout(()=>{GT(Fe,et).then(on=>{_t&&(oe(on.canPush),on.canPush||a("fork"))}).catch(()=>{_t&&oe(!0)})},400);return()=>{_t=!1,clearTimeout(ut)}},[pt]),O.useEffect(()=>{if(n!=="paper"||Z)return;const Fe=H.trim(),et=oW(Fe);if(!et&&Fe.length<3){P([]),W(!1);return}const _t=++G.current;et||W(!0);const ut=setTimeout(()=>{if(et){wt(et);return}UT(Fe).then(on=>{_t===G.current&&P(on)}).catch(on=>{_t===G.current&&(P([]),Y(on instanceof Error?on.message:String(on)))}).finally(()=>{_t===G.current&&W(!1)})},350);return()=>clearTimeout(ut)},[n,Z,H]);async function _e(Fe){if(Fe.preventDefault(),!(!Ee||T)){N(!0),A(null);try{const et=await PT(n==="local"&&(u==null?void 0:u.kind)==="github"?{name:_.trim(),githubOwner:u.owner,githubRepo:u.repo}:n==="local"?{name:_.trim(),publishLocalPath:l.trim()}:n==="new"?{name:_.trim(),createRepo:!0}:n==="paper"&&!ne?{name:_.trim(),createRepo:!0,paperId:Z.paperId}:{name:_.trim(),githubOwner:ne.owner,githubRepo:ne.repo,forkRepo:i==="fork",...n==="paper"?{paperId:Z.paperId}:{}});e(et)}catch(et){A(et instanceof Error?et.message:String(et))}finally{N(!1)}}}const Ne=n==="new"||n==="paper"&&!ne,He=ne?`${ne.owner}/${ne.repo}`:"the repo",Qe=ne?se===null?d.jsxs("span",{className:"repo-hint",children:["Checking your access to ",He,"…"]}):d.jsx(d.Fragment,{children:se===!1?d.jsxs("span",{className:"repo-hint",children:["You can't push to ",He,", so orx snapshots its latest commit into a new private repo on github.com/",q,". Your experiments push there."]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"seg form-seg",children:[d.jsx("button",{type:"button",className:i==="use"?"active":"",onClick:()=>a("use"),children:"Use this repo"}),d.jsx("button",{type:"button",className:i==="fork"?"active":"",onClick:()=>a("fork"),children:"Private copy"})]}),d.jsx("span",{className:"repo-hint mono ok",children:i==="fork"?`Snapshots the latest commit of ${He} into a new private repo on github.com/${q}`:`Experiments push branches straight to ${He}`})]})}):null,rt=d.jsxs("label",{children:["Project name",d.jsx("input",{value:_,onChange:Fe=>{C(!0),x(Fe.target.value)},placeholder:"my-game"})]}),$t=d.jsx("span",{className:`repo-hint mono ${_.trim()?"ok":""}`,children:_.trim()?`Creates github.com/${q}/${aW(_)} · private`:"A blank private repo is created on your GitHub account"});return d.jsxs("form",{className:"form",onSubmit:_e,children:[d.jsxs("div",{className:"seg form-seg",children:[d.jsx("button",{type:"button",className:n==="local"?"active":"",onClick:()=>je("local"),children:"Local repo"}),d.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>je("existing"),children:"Existing repo"}),d.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>je("new"),children:"New blank repo"}),d.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>je("paper"),children:"From a paper"})]}),n==="local"&&d.jsxs(d.Fragment,{children:[d.jsxs("label",{children:[d.jsx("span",{children:"Folder on this machine"}),d.jsxs("div",{className:"path-row",children:[d.jsx("input",{autoFocus:!0,type:"text",placeholder:"~/projects/my-game",value:l,onChange:Fe=>Pe(Fe.target.value),spellCheck:!1}),d.jsxs("button",{type:"button",className:"btn",title:"Choose a folder",onClick:()=>{$T().then(Fe=>Fe&&Pe(Fe)).catch(()=>{})},children:[d.jsx(gv,{size:13})," Browse…"]})]})]}),l.trim()!==""&&d.jsx(uW,{info:u,checking:m}),((u==null?void 0:u.kind)==="github"||le)&&rt,le&&d.jsxs("label",{className:"check",children:[d.jsx("input",{type:"checkbox",checked:g,onChange:Fe=>v(Fe.target.checked)}),d.jsxs("span",{children:["Create ",d.jsx("code",{children:ye})," on GitHub and push this history to it. This also sets the folder's ",d.jsx("code",{children:"origin"}),"."]})]})]}),n==="existing"&&d.jsxs(d.Fragment,{children:[d.jsxs("label",{children:["GitHub repository",d.jsx("input",{value:S,onChange:Fe=>$e(Fe.target.value),onFocus:()=>Lt(!0),onBlur:()=>Lt(!1),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),d.jsx("span",{className:`repo-hint mono ${ne?"ok":""}`,children:ne?`${ne.owner} / ${ne.repo}`:S.trim()?"Paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),Rt&&an.length>0&&d.jsx("div",{className:"paper-results",children:an.map(Fe=>d.jsxs("button",{type:"button",onMouseDown:et=>et.preventDefault(),onClick:()=>$e(Fe.fullName),children:[d.jsx("span",{className:"title",children:Fe.fullName}),d.jsx("span",{className:"id",children:Fe.private?"private":"public"})]},Fe.fullName))}),Qe,ne&&rt]}),n==="paper"&&(Z===null?d.jsxs(d.Fragment,{children:[d.jsxs("label",{children:["Paper",d.jsx("input",{value:H,onChange:Fe=>V(Fe.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),d.jsx("span",{className:`repo-hint ${I?"":"mono"}`,children:z?"Looking up paper…":K?"Searching alphaXiv…":I??"Searches alphaXiv by title — or paste an arXiv id / URL"})]}),!I&&!z&&!K&&d.jsx("span",{className:"repo-hint",children:"orx clones the code repo linked to the paper on alphaXiv."}),U.length>0&&d.jsx("div",{className:"paper-results",children:U.map(Fe=>d.jsxs("button",{type:"button",onClick:()=>void wt(Fe.paperId),children:[d.jsx("span",{className:"title",children:lW(Fe.title)}),d.jsx("span",{className:"id",children:Fe.paperId})]},Fe.paperId))})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"paper-pick",children:[d.jsxs("div",{className:"meta",children:[d.jsx("div",{className:"title",children:Z.title||Z.paperId}),d.jsxs("div",{className:"id",children:["arXiv ",Z.paperId]})]}),d.jsx("button",{type:"button",className:"btn ghost",onClick:Je,children:"Change"})]}),d.jsxs("label",{children:["GitHub repository",Z.repoUrl?"":" (optional)",d.jsx("input",{value:S,onChange:Fe=>$e(Fe.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),d.jsx("span",{className:`repo-hint mono ${ne?"ok":""}`,children:ne?`${ne.owner} / ${ne.repo}`+(Z.repoUrl&&((ct=y0(Z.repoUrl))==null?void 0:ct.repo)===ne.repo?` · linked on alphaXiv${Z.repoStars!=null?` · ★ ${Z.repoStars}`:""}`:""):S.trim()?"Paste a GitHub URL or owner/repo":"No code linked to this paper — a blank private repo will be created"})]}),Qe,rt,!ne&&$t]})),n==="new"&&d.jsxs(d.Fragment,{children:[rt,$t]}),j&&d.jsx("div",{className:"error",children:j}),T&&D&&d.jsxs("div",{className:"progress",children:[d.jsx("div",{className:"progress-track",children:d.jsx("div",{className:`progress-fill${D.percent==null?" indeterminate":""}`,style:D.percent==null?void 0:{width:`${D.percent}%`}})}),d.jsx("div",{className:"progress-caption",children:d.jsxs("span",{children:[D.phase,D.percent!=null?` ${D.percent}%`:"…"]})})]}),d.jsxs("div",{className:"actions",children:[t&&d.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),d.jsx("button",{type:"submit",className:"btn primary",disabled:!Ee||T,children:T?Ne?"Creating repo…":i==="fork"?"Copying repo…":"Cloning repo…":"Create project"})]})]})}function d6({projects:e,onOpen:t,onCreated:n,onDeleted:r,openNewProject:i=!1,onNewProjectOpened:a}){const[l,c]=O.useState(i),[u,h]=O.useState(null);O.useEffect(()=>{i&&(a==null||a())},[]);async function m(f){if(window.confirm(`Delete project "${f.name}"? + +Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){h(f.id);try{await QT(f.id),r(f.id)}catch(v){window.alert(v instanceof Error?v.message:String(v))}finally{h(null)}}}return d.jsxs("div",{className:"home",children:[d.jsxs("div",{className:"home-inner",children:[d.jsx("div",{className:"home-brand",children:d.jsx(Yc,{})}),d.jsxs("div",{className:"home-head",children:[d.jsx("h2",{children:"Projects"}),d.jsxs("button",{className:"btn sm",onClick:()=>c(!0),children:[d.jsx(bv,{size:13})," New project"]})]}),d.jsx("div",{className:"home-list",children:e.length===0?d.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,g)=>g.updatedAt-f.updatedAt).map(f=>d.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&t(f.id)},children:[d.jsx("span",{className:"name",children:f.name}),d.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&d.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),d.jsxs("span",{className:"time",children:["created ",Pi(f.createdAt)]}),d.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:g=>{g.stopPropagation(),m(f)},children:d.jsx(Cd,{size:14})})]},f.id))})]}),l&&d.jsx("div",{className:"modal-backdrop",onClick:()=>c(!1),children:d.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[d.jsx("h2",{children:"New project"}),d.jsx(hW,{onCancel:()=>c(!1),onCreated:f=>{c(!1),n(f)}})]})})]})}function dW(e){const t=Ad(e.backend);return t?[t,W7(e.backend)].filter(Boolean).join(" · "):"—"}function fW({runs:e,experiments:t,emptyHint:n,onOpen:r,onOpenChanges:i,onCancel:a}){const[l,c]=O.useState(new Set),[u,h]=O.useState(null),m=new Map(t.map(v=>[v.id,v.slug])),f=[...e].sort((v,k)=>k.createdAt-v.createdAt);async function g(v){h(null),c(k=>new Set(k).add(v));try{await a(v)}catch(k){c(S=>{const y=new Set(S);return y.delete(v),y}),h(k instanceof Error?k.message:String(k))}}return f.length===0?d.jsx("div",{className:"empty-state",children:d.jsx("p",{children:n??"No runs yet."})}):d.jsxs("div",{className:"runs-table-wrap",children:[u&&d.jsxs("div",{className:"runs-table-error",role:"alert",children:["Cancel failed: ",u]}),d.jsxs("table",{className:"runs-table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Run"}),d.jsx("th",{children:"Experiment"}),d.jsx("th",{children:"Status"}),d.jsx("th",{children:"Backend"}),d.jsx("th",{children:"Commit"}),d.jsx("th",{children:"Started"}),d.jsx("th",{children:"Exit"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:f.map(v=>{const k=v.status==="running"||v.status==="starting",S=k&&(v.cancelRequested||l.has(v.id));return d.jsxs("tr",{className:"clickable",onClick:()=>r(v),children:[d.jsx("td",{className:"mono",children:Y1(v.id)}),d.jsx("td",{className:"mono",children:m.get(v.experimentId)??Y1(v.experimentId)}),d.jsx("td",{children:d.jsx(Ss,{status:S?"cancelling":wl(v)})}),d.jsx("td",{className:"mono",children:dW(v)}),d.jsx("td",{className:"mono",children:v.commitSha?v.commitSha.slice(0,7):"—"}),d.jsx("td",{children:Pi(v.createdAt)}),d.jsx("td",{className:"mono",children:v.exitCode??"—"}),d.jsx("td",{children:d.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[d.jsx("button",{className:"icon-btn",title:"Open changes",onClick:y=>{y.stopPropagation(),i(v.experimentId)},children:d.jsx(Ol,{size:14})}),k&&d.jsx("button",{className:"btn sm danger",disabled:S,onClick:y=>{y.stopPropagation(),g(v.id)},children:S?"Cancelling…":"Cancel"})]})})]},v.id)})})]})]})}var U9=k7();function pW(e){const[t,n]=O.useState(null),[,r]=O.useState({});return t==null||t.setTracked(e),O.useEffect(()=>{const i=new mW(()=>r({}));return i.setTracked(e),n(i),()=>i.dispose()},[]),(t==null?void 0:t.bounds)??null}var wi,Kg,Zg,Qg;class mW{constructor(t){Z_(this,wi);Ua(this,"selectors",new Set);Ua(this,"elements",new Set);Ua(this,"onSizeChange",()=>qa(this,wi,Kg).call(this));Ua(this,"resizeObs",new ResizeObserver(this.onSizeChange));Ua(this,"mutationObs",new MutationObserver(t=>this.onMutation(t)));Ua(this,"bounds",null);this.onBoundsChange=t,window.addEventListener("resize",this.onSizeChange),document.addEventListener("scroll",this.onSizeChange,!0),this.mutationObs.observe(document.body,{childList:!0,subtree:!0})}dispose(){this.resizeObs.disconnect(),this.mutationObs.disconnect(),window.removeEventListener("resize",this.onSizeChange),document.removeEventListener("scroll",this.onSizeChange,!0)}setTracked(t){const n=new Set(t),r=[...n].filter(l=>!this.selectors.has(l)),i=[...this.selectors].filter(l=>!n.has(l));let a=!1;if(r.length>0){const l=r.map(u=>`[data-onboarding="${u}"]`).join(","),c=document.body.querySelectorAll(l);c.forEach(u=>{this.elements.add(u),this.resizeObs.observe(u)}),a||(a=c.length>0)}if(i.length>0){const l=i.map(u=>`[data-onboarding="${u}"]`).join(","),c=document.body.querySelectorAll(l);c.forEach(u=>{this.elements.delete(u),this.resizeObs.unobserve(u)}),a||(a=c.length>0)}a&&qa(this,wi,Zg).call(this),this.selectors=n}onMutation(t){if(this.selectors.size===0)return;const n=Array.from(this.selectors,i=>`[data-onboarding="${i}"]`).join(",");let r=!1;for(const i of t){for(const a of i.addedNodes)a instanceof Element&&(a.matches(n)&&(this.elements.add(a),this.resizeObs.observe(a),r=!0),a.querySelectorAll(n).forEach(l=>{this.elements.add(l),this.resizeObs.observe(l),r=!0}));for(const a of i.removedNodes)a instanceof Element&&(a.matches(n)&&(this.elements.delete(a),this.resizeObs.unobserve(a),r=!0),a.querySelectorAll(n).forEach(l=>{this.elements.delete(l),this.resizeObs.unobserve(l),r=!0}))}r&&qa(this,wi,Kg).call(this)}}wi=new WeakSet,Kg=function(){const t=qa(this,wi,Qg).call(this);qa(this,wi,Zg).call(this),t!==qa(this,wi,Qg).call(this)&&this.onBoundsChange()},Zg=function(){if(this.elements.size===0){this.bounds=null;return}const t=Array.from(this.elements,l=>l.getBoundingClientRect()).filter(l=>l.width>0&&l.height>0);if(t.length===0){this.bounds=null;return}const n=Math.min(...t.map(l=>l.left)),r=Math.min(...t.map(l=>l.top)),i=Math.max(...t.map(l=>l.right)),a=Math.max(...t.map(l=>l.bottom));this.bounds={x:n,y:r,width:i-n,height:a-r}},Qg=function(){return this.bounds?[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height].join(","):"null"};function q9(){const[e,t]=O.useState(0),[n,r]=O.useState(0);return{ref:O.useCallback(a=>{if(!a)return;function l(){t(a.offsetWidth),r(a.offsetHeight)}const c=new ResizeObserver(l),u=new MutationObserver(l);return c.observe(a),u.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),l(),()=>{c.disconnect(),u.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const _0=8;function G9(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:i,viewWidth:a},l]=O.useState({viewWidth:0,viewHeight:0});O.useEffect(()=>{function m(){l({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",m),m(),()=>window.removeEventListener("resize",m)},[]);let c=0,u=0,h=0;if(e){const{distance:m}=e;switch(e.anchor){case"left":c=e.x-n-m,u=e.y+e.height/2-r/2;break;case"right":c=e.x+e.width+m,u=e.y+e.height/2-r/2;break;case"below":c=e.x+e.width/2-n/2,u=e.y+e.height+m;break;case"above":c=e.x+e.width/2-n/2,u=e.y-r-m;break}const f=c,g=u;c=Math.min(Math.max(c,_0),a-n-_0),u=Math.min(Math.max(u,_0),i-r-_0),h=e.anchor==="left"||e.anchor==="right"?g-u:f-c}return{x:c,y:u,arrowAdjustment:h}}const f6="orx:tour-done",ma=8,gW=20,cd=[{focus:null,anchor:null,title:"Welcome to Crux",description:"Crux turns a one-line game idea into a validated, playable prototype. A producer orchestrates a crew of AI agents — you approve the moves."},{focus:["composer"],anchor:"above",title:"Pitch a game idea",description:"Tell the producer what kind of game you want to make — even one vague line. It captures the idea into a thesis, gets it scored, and leads you to a playable. Type / for skills."},{focus:["model-picker"],anchor:"above",title:"Pick your model",description:"Choose a model from any harness you've connected: Claude Code, Codex, or OpenCode. New sessions start with whatever you pick here, and each session keeps its harness."},{focus:["nav-artifacts"],anchor:"right",title:"Files and outputs",description:"Theses, evaluations, and build artifacts land here, and anything you drop in is visible to the agents too. Check Files after a build to see what came back."},{focus:["nav-compute"],anchor:"right",title:"Where builds run",description:"Prototypes build on this machine by default. If you need heavier runs, point them at Modal, SSH boxes, Kubernetes, or Slurm — set it up once and agents pick per run."},{focus:["experiments"],anchor:"left",title:"Your game gallery",description:"Every idea and prototype lands here. Capture ideas, evaluate them against the market-fit rubric, greenlight the strong ones, and open any prototype's play build, code, or logs."},{focus:["new-session"],anchor:"right",title:"Start a session",description:"Each session is an agent in its own worktree, so a whole crew can work in parallel. Pitch your first game idea whenever you're ready."}];function vW({onClose:e}){const[t,n]=O.useState(0),[r,i]=O.useState(!1),[a,l]=O.useState(null),c=cd[t],u=pW(c.focus??[]),h=O.useCallback(()=>{r||(i(!0),l(null),e(),i(!1))},[r,e]);O.useEffect(()=>{function f(g){g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),h())}return document.addEventListener("keydown",f,!0),()=>document.removeEventListener("keydown",f,!0)},[h]);const m=u?{left:u.x-ma,top:u.y-ma,width:u.width+ma*2,height:u.height+ma*2}:null;return U9.createPortal(d.jsxs("div",{className:"tour-overlay fixed inset-0 z-200",children:[m?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"tour-spotlight absolute rounded-lg shadow-[0_0_0_9999px_rgba(0,_0,_0,_0.55)] transition-all duration-300 ease-standard",style:m}),d.jsx("div",{className:"tour-ring absolute rounded-lg border-2 border-primary transition-all duration-300 ease-standard",style:m})]}):d.jsx("div",{className:"tour-dim absolute inset-0 bg-[rgba(0,_0,_0,_0.55)]"}),d.jsx(bW,{step:c,bounds:u,index:t,onBack:()=>n(f=>Math.max(0,f-1)),onNext:()=>t+1>=cd.length?h():n(t+1),onClose:h,closing:r,closeError:a})]}),document.body)}function bW({step:e,bounds:t,index:n,onBack:r,onNext:i,onClose:a,closing:l,closeError:c}){const u=q9(),h=G9(t&&e.anchor?{x:t.x-ma,y:t.y-ma,width:t.width+ma*2,height:t.height+ma*2,anchor:e.anchor,distance:gW}:null,u),m=e.anchor!=null&&t!=null&&h.x>0,f=n+1===cd.length;return d.jsxs("div",{ref:u.ref,className:`tour-card absolute w-97.5 max-w-[calc(100vw_-_32px)] bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] pt-[21px] px-[23px] pb-0 transition-[left,top] duration-200 ease-standard [&.centered]:left-1/2 [&.centered]:top-1/2 [&.centered]:-translate-x-1/2 [&.centered]:-translate-y-1/2 [&.centered]:transition-none [&_h3]:mt-0 [&_h3]:mr-6.5 [&_h3]:mb-[7px] [&_h3]:ml-0 [&_h3]:text-lg [&_h3]:font-semibold [&_p]:m-0 [&_p]:text-base [&_p]:leading-[1.55] [&_p]:text-text [&_.tour-close]:absolute [&_.tour-close]:top-3 [&_.tour-close]:right-3 ${m?"":"centered"}`,style:m?{left:h.x,top:h.y}:void 0,children:[m&&e.anchor&&d.jsx(yW,{anchor:e.anchor,adjustment:h.arrowAdjustment}),d.jsx("button",{className:`${oo} tour-close`,title:"Skip tour",onClick:a,disabled:l,children:d.jsx(eo,{size:15})}),d.jsx("h3",{children:e.title}),d.jsx("p",{children:e.description}),c&&d.jsx("div",{className:"error",children:"Couldn't save tour progress. Try again."}),d.jsxs("div",{className:"tour-footer flex items-center border-t border-t-border-variant mt-4 py-[11px] px-0",children:[d.jsx("div",{className:"tour-footer-side flex-1 flex [&.end]:justify-end",children:n>0&&d.jsx("button",{className:f$,onClick:r,children:"Back"})}),d.jsxs("span",{className:"tour-count text-sm text-muted tabular-nums",children:[n+1," / ",cd.length]}),d.jsx("div",{className:"tour-footer-side flex-1 flex [&.end]:justify-end end",children:d.jsx("button",{className:_o,onClick:i,disabled:l,children:l?"Saving…":f?"Done":"Next"})})]})]})}function yW({anchor:e,adjustment:t}){const n=e==="above"||e==="below"?`${t}px 0`:`0 ${t}px`;return d.jsx("div",{className:`tour-arrow absolute w-3 h-3 bg-background rotate-45 pointer-events-none [&.above]:-bottom-[6.5px] [&.above]:left-[calc(50%_-_6px)] [&.above]:border-r [&.above]:border-r-border [&.above]:border-b [&.above]:border-b-border [&.below]:-top-[6.5px] [&.below]:left-[calc(50%_-_6px)] [&.below]:border-l [&.below]:border-l-border [&.below]:border-t [&.below]:border-t-border [&.left]:-right-[6.5px] [&.left]:top-[calc(50%_-_6px)] [&.left]:border-t [&.left]:border-t-border [&.left]:border-r [&.left]:border-r-border [&.right]:-left-[6.5px] [&.right]:top-[calc(50%_-_6px)] [&.right]:border-b [&.right]:border-b-border [&.right]:border-l [&.right]:border-l-border ${e}`,style:{translate:n}})}function Fn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function pf(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}P0.prototype=pf.prototype={constructor:P0,on:function(e,t){var n=this._,r=xW(e+"",n),i,a=-1,l=r.length;if(arguments.length<2){for(;++a0)for(var n=new Array(i),r=0,i,a;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),m6.hasOwnProperty(t)?{space:m6[t],local:e}:e}function SW(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Jg&&t.documentElement.namespaceURI===Jg?t.createElement(e):t.createElementNS(n,e)}}function kW(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function V9(e){var t=mf(e);return(t.local?kW:SW)(t)}function CW(){}function Z2(e){return e==null?CW:function(){return this.querySelector(e)}}function EW(e){typeof e!="function"&&(e=Z2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=w&&(w=x+1);!(T=y[w])&&++w=0;)(l=r[i])&&(a&&l.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(l,a),a=l);return this}function ZW(e){e||(e=QW);function t(f,g){return f&&g?e(f.__data__,g.__data__):!f-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;at?1:e>=t?0:NaN}function JW(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function eY(){return Array.from(this)}function tY(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?dY:typeof t=="function"?pY:fY)(e,t,n??"")):Tl(this.node(),e)}function Tl(e,t){return e.style.getPropertyValue(t)||Z9(e).getComputedStyle(e,null).getPropertyValue(t)}function gY(e){return function(){delete this[e]}}function vY(e,t){return function(){this[e]=t}}function bY(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yY(e,t){return arguments.length>1?this.each((t==null?gY:typeof t=="function"?bY:vY)(e,t)):this.node()[e]}function Q9(e){return e.trim().split(/^|\s+/)}function Q2(e){return e.classList||new J9(e)}function J9(e){this._node=e,this._names=Q9(e.getAttribute("class")||"")}J9.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ek(e,t){for(var n=Q2(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function WY(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n()=>e;function ev(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:l,y:c,dx:u,dy:h,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:m}})}ev.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function rX(e){return!e.ctrlKey&&!e.button}function iX(){return this.parentNode}function sX(e,t){return t??{x:e.x,y:e.y}}function aX(){return navigator.maxTouchPoints||"ontouchstart"in this}function ak(){var e=rX,t=iX,n=sX,r=aX,i={},a=pf("start","drag","end"),l=0,c,u,h,m,f=0;function g(C){C.on("mousedown.drag",v).filter(r).on("touchstart.drag",y).on("touchmove.drag",_,nX).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(C,T){if(!(m||!e.call(this,C,T))){var N=w(this,t.call(this,C,T),C,T,"mouse");N&&(Or(C.view).on("mousemove.drag",k,gu).on("mouseup.drag",S,gu),ik(C.view),T1(C),h=!1,c=C.clientX,u=C.clientY,N("start",C))}}function k(C){if(_l(C),!h){var T=C.clientX-c,N=C.clientY-u;h=T*T+N*N>f}i.mouse("drag",C)}function S(C){Or(C.view).on("mousemove.drag mouseup.drag",null),sk(C.view,h),_l(C),i.mouse("end",C)}function y(C,T){if(e.call(this,C,T)){var N=C.changedTouches,j=t.call(this,C,T),A=N.length,D,B;for(D=0;D>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?w0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?w0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=lX.exec(e))?new Sr(t[1],t[2],t[3],1):(t=cX.exec(e))?new Sr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=uX.exec(e))?w0(t[1],t[2],t[3],t[4]):(t=hX.exec(e))?w0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dX.exec(e))?w6(t[1],t[2]/100,t[3]/100,1):(t=fX.exec(e))?w6(t[1],t[2]/100,t[3]/100,t[4]):g6.hasOwnProperty(e)?y6(g6[e]):e==="transparent"?new Sr(NaN,NaN,NaN,0):null}function y6(e){return new Sr(e>>16&255,e>>8&255,e&255,1)}function w0(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sr(e,t,n,r)}function gX(e){return e instanceof Hu||(e=lo(e)),e?(e=e.rgb(),new Sr(e.r,e.g,e.b,e.opacity)):new Sr}function tv(e,t,n,r){return arguments.length===1?gX(e):new Sr(e,t,n,r??1)}function Sr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}J2(Sr,tv,ok(Hu,{brighter(e){return e=e==null?hd:Math.pow(hd,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vu:Math.pow(vu,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sr(no(this.r),no(this.g),no(this.b),dd(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:_6,formatHex:_6,formatHex8:vX,formatRgb:x6,toString:x6}));function _6(){return`#${Ja(this.r)}${Ja(this.g)}${Ja(this.b)}`}function vX(){return`#${Ja(this.r)}${Ja(this.g)}${Ja(this.b)}${Ja((isNaN(this.opacity)?1:this.opacity)*255)}`}function x6(){const e=dd(this.opacity);return`${e===1?"rgb(":"rgba("}${no(this.r)}, ${no(this.g)}, ${no(this.b)}${e===1?")":`, ${e})`}`}function dd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function no(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ja(e){return e=no(e),(e<16?"0":"")+e.toString(16)}function w6(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mi(e,t,n,r)}function lk(e){if(e instanceof mi)return new mi(e.h,e.s,e.l,e.opacity);if(e instanceof Hu||(e=lo(e)),!e)return new mi;if(e instanceof mi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),l=NaN,c=a-i,u=(a+i)/2;return c?(t===a?l=(n-r)/c+(n0&&u<1?0:l,new mi(l,c,u,e.opacity)}function bX(e,t,n,r){return arguments.length===1?lk(e):new mi(e,t,n,r??1)}function mi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}J2(mi,bX,ok(Hu,{brighter(e){return e=e==null?hd:Math.pow(hd,e),new mi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vu:Math.pow(vu,e),new mi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Sr(M1(e>=240?e-240:e+120,i,r),M1(e,i,r),M1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mi(S6(this.h),S0(this.s),S0(this.l),dd(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=dd(this.opacity);return`${e===1?"hsl(":"hsla("}${S6(this.h)}, ${S0(this.s)*100}%, ${S0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function S6(e){return e=(e||0)%360,e<0?e+360:e}function S0(e){return Math.max(0,Math.min(1,e||0))}function M1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const eb=e=>()=>e;function yX(e,t){return function(n){return e+n*t}}function _X(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xX(e){return(e=+e)==1?ck:function(t,n){return n-t?_X(t,n,e):eb(isNaN(t)?n:t)}}function ck(e,t){var n=t-e;return n?yX(e,n):eb(isNaN(e)?t:e)}const fd=(function e(t){var n=xX(t);function r(i,a){var l=n((i=tv(i)).r,(a=tv(a)).r),c=n(i.g,a.g),u=n(i.b,a.b),h=ck(i.opacity,a.opacity);return function(m){return i.r=l(m),i.g=c(m),i.b=u(m),i.opacity=h(m),i+""}}return r.gamma=e,r})(1);function wX(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),c[l]?c[l]+=a:c[++l]=a),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,u.push({i:l,x:Bi(r,i)})),n=j1.lastIndex;return n180?m+=360:m-h>180&&(h+=360),g.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Bi(h,m)})):m&&f.push(i(f)+"rotate("+m+r)}function c(h,m,f,g){h!==m?g.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Bi(h,m)}):m&&f.push(i(f)+"skewX("+m+r)}function u(h,m,f,g,v,k){if(h!==f||m!==g){var S=v.push(i(v)+"scale(",null,",",null,")");k.push({i:S-4,x:Bi(h,f)},{i:S-2,x:Bi(m,g)})}else(f!==1||g!==1)&&v.push(i(v)+"scale("+f+","+g+")")}return function(h,m){var f=[],g=[];return h=e(h),m=e(m),a(h.translateX,h.translateY,m.translateX,m.translateY,f,g),l(h.rotate,m.rotate,f,g),c(h.skewX,m.skewX,f,g),u(h.scaleX,h.scaleY,m.scaleX,m.scaleY,f,g),h=m=null,function(v){for(var k=-1,S=g.length,y;++k=0&&e._call.call(void 0,t),e=e._next;--Ml}function E6(){co=(md=yu.now())+gf,Ml=Vc=0;try{zX()}finally{Ml=0,HX(),co=0}}function IX(){var e=yu.now(),t=e-md;t>fk&&(gf-=t,md=e)}function HX(){for(var e,t=pd,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:pd=n);Wc=e,iv(r)}function iv(e){if(!Ml){Vc&&(Vc=clearTimeout(Vc));var t=e-co;t>24?(e<1/0&&(Vc=setTimeout(E6,e-yu.now()-gf)),Pc&&(Pc=clearInterval(Pc))):(Pc||(md=yu.now(),Pc=setInterval(IX,fk)),Ml=1,pk(E6))}}function N6(e,t,n){var r=new gd;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var FX=pf("start","end","cancel","interrupt"),$X=[],gk=0,A6=1,sv=2,q0=3,T6=4,av=5,G0=6;function vf(e,t,n,r,i,a){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;PX(e,n,{name:t,index:r,group:i,on:FX,tween:$X,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:gk})}function nb(e,t){var n=Si(e,t);if(n.state>gk)throw new Error("too late; already scheduled");return n}function Yi(e,t){var n=Si(e,t);if(n.state>q0)throw new Error("too late; already running");return n}function Si(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function PX(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=mk(a,0,n.time);function a(h){n.state=A6,n.timer.restart(l,n.delay,n.time),n.delay<=h&&l(h-n.delay)}function l(h){var m,f,g,v;if(n.state!==A6)return u();for(m in r)if(v=r[m],v.name===n.name){if(v.state===q0)return N6(l);v.state===T6?(v.state=G0,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+msv&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function bK(e,t,n){var r,i,a=vK(t)?nb:Yi;return function(){var l=a(this,e),c=l.on;c!==r&&(i=(r=c).copy()).on(t,n),l.on=i}}function yK(e,t){var n=this._id;return arguments.length<2?Si(this.node(),n).on.on(e):this.each(bK(n,e,t))}function _K(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xK(){return this.on("end.remove",_K(this._id))}function wK(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Z2(e));for(var r=this._groups,i=r.length,a=new Array(i),l=0;l()=>e;function WK(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function bs(e,t,n){this.k=e,this.x=t,this.y=n}bs.prototype={constructor:bs,scale:function(e){return e===1?this:new bs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new bs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bf=new bs(1,0,0);_k.prototype=bs.prototype;function _k(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bf;return e.__zoom}function D1(e){e.stopImmediatePropagation()}function Uc(e){e.preventDefault(),e.stopImmediatePropagation()}function YK(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function XK(){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 M6(){return this.__zoom||bf}function KK(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ZK(){return navigator.maxTouchPoints||"ontouchstart"in this}function QK(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),l>a?(a+l)/2:Math.min(0,a)||Math.max(0,l))}function xk(){var e=YK,t=XK,n=QK,r=KK,i=ZK,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,u=U0,h=pf("start","zoom","end"),m,f,g,v=500,k=150,S=0,y=10;function _(P){P.property("__zoom",M6).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(P,K,W,Z){var ee=P.selection?P.selection():P;ee.property("__zoom",M6),P!==ee?T(P,K,W,Z):ee.interrupt().each(function(){N(this,arguments).event(Z).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},_.scaleBy=function(P,K,W,Z){_.scaleTo(P,function(){var ee=this.__zoom.k,z=typeof K=="function"?K.apply(this,arguments):K;return ee*z},W,Z)},_.scaleTo=function(P,K,W,Z){_.transform(P,function(){var ee=t.apply(this,arguments),z=this.__zoom,L=W==null?C(ee):typeof W=="function"?W.apply(this,arguments):W,I=z.invert(L),Y=typeof K=="function"?K.apply(this,arguments):K;return n(w(x(z,Y),L,I),ee,l)},W,Z)},_.translateBy=function(P,K,W,Z){_.transform(P,function(){return n(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof W=="function"?W.apply(this,arguments):W),t.apply(this,arguments),l)},null,Z)},_.translateTo=function(P,K,W,Z,ee){_.transform(P,function(){var z=t.apply(this,arguments),L=this.__zoom,I=Z==null?C(z):typeof Z=="function"?Z.apply(this,arguments):Z;return n(bf.translate(I[0],I[1]).scale(L.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof W=="function"?-W.apply(this,arguments):-W),z,l)},Z,ee)};function x(P,K){return K=Math.max(a[0],Math.min(a[1],K)),K===P.k?P:new bs(K,P.x,P.y)}function w(P,K,W){var Z=K[0]-W[0]*P.k,ee=K[1]-W[1]*P.k;return Z===P.x&&ee===P.y?P:new bs(P.k,Z,ee)}function C(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function T(P,K,W,Z){P.on("start.zoom",function(){N(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(Z).end()}).tween("zoom",function(){var ee=this,z=arguments,L=N(ee,z).event(Z),I=t.apply(ee,z),Y=W==null?C(I):typeof W=="function"?W.apply(ee,z):W,G=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),se=ee.__zoom,oe=typeof K=="function"?K.apply(ee,z):K,fe=u(se.invert(Y).concat(G/se.k),oe.invert(Y).concat(G/oe.k));return function(te){if(te===1)te=oe;else{var q=fe(te),ne=G/q[2];te=new bs(ne,Y[0]-q[0]*ne,Y[1]-q[1]*ne)}L.zoom(null,te)}})}function N(P,K,W){return!W&&P.__zooming||new j(P,K)}function j(P,K){this.that=P,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,K),this.taps=0}j.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,K){return this.mouse&&P!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var K=Or(this.that).datum();h.call(P,this.that,new WK(P,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:h}),K)}};function A(P,...K){if(!e.apply(this,arguments))return;var W=N(this,K).event(P),Z=this.__zoom,ee=Math.max(a[0],Math.min(a[1],Z.k*Math.pow(2,r.apply(this,arguments)))),z=fi(P);if(W.wheel)(W.mouse[0][0]!==z[0]||W.mouse[0][1]!==z[1])&&(W.mouse[1]=Z.invert(W.mouse[0]=z)),clearTimeout(W.wheel);else{if(Z.k===ee)return;W.mouse=[z,Z.invert(z)],V0(this),W.start()}Uc(P),W.wheel=setTimeout(L,k),W.zoom("mouse",n(w(x(Z,ee),W.mouse[0],W.mouse[1]),W.extent,l));function L(){W.wheel=null,W.end()}}function D(P,...K){if(g||!e.apply(this,arguments))return;var W=P.currentTarget,Z=N(this,K,!0).event(P),ee=Or(P.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",G,!0),z=fi(P,W),L=P.clientX,I=P.clientY;ik(P.view),D1(P),Z.mouse=[z,this.__zoom.invert(z)],V0(this),Z.start();function Y(se){if(Uc(se),!Z.moved){var oe=se.clientX-L,fe=se.clientY-I;Z.moved=oe*oe+fe*fe>S}Z.event(se).zoom("mouse",n(w(Z.that.__zoom,Z.mouse[0]=fi(se,W),Z.mouse[1]),Z.extent,l))}function G(se){ee.on("mousemove.zoom mouseup.zoom",null),sk(se.view,Z.moved),Uc(se),Z.event(se).end()}}function B(P,...K){if(e.apply(this,arguments)){var W=this.__zoom,Z=fi(P.changedTouches?P.changedTouches[0]:P,this),ee=W.invert(Z),z=W.k*(P.shiftKey?.5:2),L=n(w(x(W,z),Z,ee),t.apply(this,K),l);Uc(P),c>0?Or(this).transition().duration(c).call(T,L,Z,P):Or(this).call(_.transform,L,Z,P)}}function H(P,...K){if(e.apply(this,arguments)){var W=P.touches,Z=W.length,ee=N(this,K,P.changedTouches.length===Z).event(P),z,L,I,Y;for(D1(P),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:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},_u=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],wk=["Enter"," ","Escape"],Sk={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var jl;(function(e){e.Strict="strict",e.Loose="loose"})(jl||(jl={}));var ro;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ro||(ro={}));var xu;(function(e){e.Partial="partial",e.Full="full"})(xu||(xu={}));const kk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var da;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(da||(da={}));var vd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(vd||(vd={}));var Ze;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ze||(Ze={}));const j6={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function Ck(e){return e===null?null:e?"valid":"invalid"}const Ek=e=>"id"in e&&"source"in e&&"target"in e,JK=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ib=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Fu=(e,t=[0,0])=>{const{width:n,height:r}=Ds(e),i=e.origin??t,a=n*i[0],l=r*i[1];return{x:e.position.x-a,y:e.position.y-l}},eZ=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let l=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(l=a?t.nodeLookup.get(i):ib(i)?i:t.nodeLookup.get(i.id));const c=l?bd(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return yf(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _f(n)},$u=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=yf(n,bd(i)),r=!0)}),r?_f(n):{x:0,y:0,width:0,height:0}},sb=(e,t,[n,r,i]=[0,0,1],a=!1,l=!1)=>{const c=(t.x-n)/i,u=(t.y-r)/i,h=t.width/i,m=t.height/i,f=[];for(const g of e.values()){const{measured:v,selectable:k=!0,hidden:S=!1}=g;if(l&&!k||S)continue;const y=v.width??g.width??g.initialWidth??0,_=v.height??g.height??g.initialHeight??0,{x,y:w}=g.internals.positionAbsolute,C=Mk(c,u,h,m,x,w,y,_),T=y*_,N=a&&C>0;(!g.internals.handleBounds||N||C>=T||g.dragging)&&f.push(g)}return f},tZ=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function nZ(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function rZ({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},l){if(e.size===0)return!0;const c=nZ(e,l),u=$u(c),h=ob(u,t,n,(l==null?void 0:l.minZoom)??i,(l==null?void 0:l.maxZoom)??a,(l==null?void 0:l.padding)??.1);return await r.setViewport(h,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function Nk({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:u,y:h}=c?c.internals.positionAbsolute:{x:0,y:0},m=l.origin??r;let f=l.extent||i;if(l.extent==="parent"&&!l.expandParent)if(!c)a==null||a("005",xi.error005());else{const v=c.measured.width,k=c.measured.height;v&&k&&(f=[[u,h],[u+v,h+k]])}else c&&ho(l.extent)&&(f=[[l.extent[0][0]+u,l.extent[0][1]+h],[l.extent[1][0]+u,l.extent[1][1]+h]]);const g=ho(f)?uo(t,f,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(a==null||a("015",xi.error015())),{position:{x:g.x-u+(l.measured.width??0)*m[0],y:g.y-h+(l.measured.height??0)*m[1]},positionAbsolute:g}}async function iZ({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),l=[];for(const g of n){if(g.deletable===!1)continue;const v=a.has(g.id),k=!v&&g.parentId&&l.find(S=>S.id===g.parentId);(v||k)&&l.push(g)}const c=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),m=tZ(l,u);for(const g of u)c.has(g.id)&&!m.find(k=>k.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:l};const f=await i({nodes:l,edges:m});return typeof f=="boolean"?f?{edges:m,nodes:l}:{edges:[],nodes:[]}:f}const Dl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),uo=(e={x:0,y:0},t,n)=>({x:Dl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Dl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Ak(e,t,n){const{width:r,height:i}=Ds(n),{x:a,y:l}=n.internals.positionAbsolute;return uo(e,[[a,l],[a+r,l+i]],t)}const D6=(e,t,n)=>en?-Dl(Math.abs(e-n),1,t)/t:0,ab=(e,t,n=15,r=40)=>{const i=D6(e.x,r,t.width-r)*n,a=D6(e.y,r,t.height-r)*n;return[i,a]},yf=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),ov=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),_f=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),wu=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=ib(e)?e.internals.positionAbsolute:Fu(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},bd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=ib(e)?e.internals.positionAbsolute:Fu(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},Tk=(e,t)=>_f(yf(ov(e),ov(t))),Mk=(e,t,n,r,i,a,l,c)=>{const u=Math.max(0,Math.min(e+n,i+l)-Math.max(e,i)),h=Math.max(0,Math.min(t+r,a+c)-Math.max(t,a));return Math.ceil(u*h)},yd=(e,t)=>Mk(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),R6=e=>gi(e.width)&&gi(e.height)&&gi(e.x)&&gi(e.y),gi=e=>!isNaN(e)&&isFinite(e),jk=(e,t)=>(n,r)=>{},Pu=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Uu=({x:e,y:t},[n,r,i],a=!1,l=[1,1])=>{const c={x:(e-n)/i,y:(t-r)/i};return a?Pu(c,l):c},Rl=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function cl(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sZ(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=cl(e,n),i=cl(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=cl(e.top??e.y??0,n),i=cl(e.bottom??e.y??0,n),a=cl(e.left??e.x??0,t),l=cl(e.right??e.x??0,t);return{top:r,right:l,bottom:i,left:a,x:a+l,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function aZ(e,t,n,r,i,a){const{x:l,y:c}=Rl(e,[t,n,r]),{x:u,y:h}=Rl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-u,f=a-h;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(f)}}const ob=(e,t,n,r,i,a)=>{const l=sZ(a,t,n),c=(t-l.x)/e.width,u=(n-l.y)/e.height,h=Math.min(c,u),m=Dl(h,r,i),f=e.x+e.width/2,g=e.y+e.height/2,v=t/2-f*m,k=n/2-g*m,S=aZ(e,v,k,m,t,n),y={left:Math.min(S.left-l.left,0),top:Math.min(S.top-l.top,0),right:Math.min(S.right-l.right,0),bottom:Math.min(S.bottom-l.bottom,0)};return{x:v-y.left+y.right,y:k-y.top+y.bottom,zoom:m}},Su=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ho(e){return e!=null&&e!=="parent"}function Ds(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Dk(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Rk(e,t={width:0,height:0},n,r,i){const a={...e},l=r.get(n);if(l){const c=l.origin||i;a.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],a.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return a}function L6(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function oZ(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function lZ(e){return{...Sk,...e||{}}}function ru(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:l}=vi(e),c=Uu({x:a-((i==null?void 0:i.left)??0),y:l-((i==null?void 0:i.top)??0)},r),{x:u,y:h}=n?Pu(c,t):c;return{xSnapped:u,ySnapped:h,...c}}const lb=e=>({width:e.offsetWidth,height:e.offsetHeight}),Lk=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},cZ=["INPUT","SELECT","TEXTAREA"];function Ok(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:cZ.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Bk=e=>"clientX"in e,vi=(e,t)=>{var a,l;const n=Bk(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},O6=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:i,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...lb(l)}})};function zk({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:l,targetControlY:c}){const u=e*.125+i*.375+l*.375+n*.125,h=t*.125+a*.375+c*.375+r*.125,m=Math.abs(u-e),f=Math.abs(h-t);return[u,h,m,f]}function E0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function B6({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Ze.Left:return[t-E0(t-r,a),n];case Ze.Right:return[t+E0(r-t,a),n];case Ze.Top:return[t,n-E0(n-i,a)];case Ze.Bottom:return[t,n+E0(i-n,a)]}}function Ik({sourceX:e,sourceY:t,sourcePosition:n=Ze.Bottom,targetX:r,targetY:i,targetPosition:a=Ze.Top,curvature:l=.25}){const[c,u]=B6({pos:n,x1:e,y1:t,x2:r,y2:i,c:l}),[h,m]=B6({pos:a,x1:r,y1:i,x2:e,y2:t,c:l}),[f,g,v,k]=zk({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:u,targetControlX:h,targetControlY:m});return[`M${e},${t} C${c},${u} ${h},${m} ${r},${i}`,f,g,v,k]}function Hk({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n0}const dZ=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,fZ=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),pZ=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",xi.error006()),t;const r=n.getEdgeId||dZ;let i;return Ek(e)?i={...e}:i={...e,id:r(e)},fZ(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function Fk({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,l,c]=Hk({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,l,c]}const z6={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},mZ=({source:e,sourcePosition:t=Ze.Bottom,target:n})=>t===Ze.Left||t===Ze.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gZ({source:e,sourcePosition:t=Ze.Bottom,target:n,targetPosition:r=Ze.Top,center:i,offset:a,stepPosition:l}){const c=z6[t],u=z6[r],h={x:e.x+c.x*a,y:e.y+c.y*a},m={x:n.x+u.x*a,y:n.y+u.y*a},f=mZ({source:h,sourcePosition:t,target:m}),g=f.x!==0?"x":"y",v=f[g];let k=[],S,y;const _={x:0,y:0},x={x:0,y:0},[,,w,C]=Hk({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*u[g]===-1){g==="x"?(S=i.x??h.x+(m.x-h.x)*l,y=i.y??(h.y+m.y)/2):(S=i.x??(h.x+m.x)/2,y=i.y??h.y+(m.y-h.y)*l);const A=[{x:S,y:h.y},{x:S,y:m.y}],D=[{x:h.x,y},{x:m.x,y}];c[g]===v?k=g==="x"?A:D:k=g==="x"?D:A}else{const A=[{x:h.x,y:m.y}],D=[{x:m.x,y:h.y}];if(g==="x"?k=c.x===v?D:A:k=c.y===v?A:D,t===r){const P=Math.abs(e[g]-n[g]);if(P<=a){const K=Math.min(a-1,a-P);c[g]===v?_[g]=(h[g]>e[g]?-1:1)*K:x[g]=(m[g]>n[g]?-1:1)*K}}if(t!==r){const P=g==="x"?"y":"x",K=c[g]===u[P],W=h[P]>m[P],Z=h[P]=U?(S=(B.x+H.x)/2,y=k[0].y):(S=k[0].x,y=(B.y+H.y)/2)}const T={x:h.x+_.x,y:h.y+_.y},N={x:m.x+x.x,y:m.y+x.y};return[[e,...T.x!==k[0].x||T.y!==k[0].y?[T]:[],...k,...N.x!==k[k.length-1].x||N.y!==k[k.length-1].y?[N]:[],n],S,y,w,C]}function vZ(e,t,n,r){const i=Math.min(I6(e,t)/2,I6(t,n)/2,r),{x:a,y:l}=t;if(e.x===a&&a===n.x||e.y===l&&l===n.y)return`L${a} ${l}`;if(e.y===l){const h=e.xn.id===t):e[0])||null}function cv(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function yZ(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((l,c)=>([c.markerStart||r,c.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const h=cv(u,t);a.has(h)||(l.push({id:h,color:u.color||n,...u}),a.add(h))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const $k=1e3,_Z=10,cb={nodeOrigin:[0,0],nodeExtent:_u,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xZ={...cb,checkEquality:!0};function ub(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function wZ(e,t,n){const r=ub(cb,n);for(const i of e.values())if(i.parentId)db(i,e,t,r);else{const a=Fu(i,r.nodeOrigin),l=ho(i.extent)?i.extent:r.nodeExtent,c=uo(a,l,Ds(i));i.internals.positionAbsolute=c}}function SZ(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function hb(e){return e==="manual"}function uv(e,t,n,r={}){var m,f;const i=ub(xZ,r),a={i:0},l=new Map(t),c=i!=null&&i.elevateNodesOnSelect&&!hb(i.zIndexMode)?$k:0;let u=e.length>0,h=!1;t.clear(),n.clear();for(const g of e){let v=l.get(g.id);if(i.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const k=Fu(g,i.nodeOrigin),S=ho(g.extent)?g.extent:i.nodeExtent,y=uo(k,S,Ds(g));v={...i.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(f=g.measured)==null?void 0:f.height},internals:{positionAbsolute:y,handleBounds:SZ(g,v),z:Pk(g,c,i.zIndexMode),userNode:g}},t.set(g.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(u=!1),g.parentId&&db(v,t,n,r,a),h||(h=g.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:h}}function kZ(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function db(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:l,nodeExtent:c,zIndexMode:u}=ub(cb,r),h=e.parentId,m=t.get(h);if(!m){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}kZ(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*_Z),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const f=a&&!hb(u)?$k:0,{x:g,y:v,z:k}=CZ(e,m,l,c,f,u),{positionAbsolute:S}=e.internals,y=g!==S.x||v!==S.y;(y||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:g,y:v}:S,z:k}})}function Pk(e,t,n){const r=gi(e.zIndex)?e.zIndex:0;return hb(n)?r:r+(e.selected?t:0)}function CZ(e,t,n,r,i,a){const{x:l,y:c}=t.internals.positionAbsolute,u=Ds(e),h=Fu(e,n),m=ho(e.extent)?uo(h,e.extent,u):h;let f=uo({x:l+m.x,y:c+m.y},r,u);e.extent==="parent"&&(f=Ak(f,u,t));const g=Pk(e,i,a),v=t.internals.z??0;return{x:f.x,y:f.y,z:v>=g?v+1:g}}function fb(e,t,n,r=[0,0]){var l;const i=[],a=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const h=((l=a.get(c.parentId))==null?void 0:l.expandedRect)??wu(u),m=Tk(h,c.rect);a.set(c.parentId,{expandedRect:m,parent:u})}return a.size>0&&a.forEach(({expandedRect:c,parent:u},h)=>{var w;const m=u.internals.positionAbsolute,f=Ds(u),g=u.origin??r,v=c.x0||k>0||_||x)&&(i.push({id:h,type:"position",position:{x:u.position.x-v+_,y:u.position.y-k+x}}),(w=n.get(h))==null||w.forEach(C=>{e.some(T=>T.id===C.id)||i.push({id:C.id,type:"position",position:{x:C.position.x+v,y:C.position.y+k}})})),(f.width0){const v=fb(g,t,n,i);h.push(...v)}return{changes:h,updatedInternals:u}}async function NZ({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2])}function P6(e,t,n,r,i,a){let l=i;const c=r.get(l)||new Map;r.set(l,c.set(n,t)),l=`${i}-${e}`;const u=r.get(l)||new Map;if(r.set(l,u.set(n,t)),a){l=`${i}-${e}-${a}`;const h=r.get(l)||new Map;r.set(l,h.set(n,t))}}function Uk(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:l=null,targetHandle:c=null}=r,u={edgeId:r.id,source:i,target:a,sourceHandle:l,targetHandle:c},h=`${i}-${l}--${a}-${c}`,m=`${a}-${c}--${i}-${l}`;P6("source",u,m,e,i,l),P6("target",u,h,e,a,c),t.set(r.id,r)}}function qk(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:qk(n,t):!1}function U6(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function AZ(e,t,n,r){const i=new Map;for(const[a,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!qk(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(a);c&&i.set(a,{id:a,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return i}function R1({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var l,c,u;const i=[];for(const[h,m]of t){const f=(l=n.get(h))==null?void 0:l.internals.userNode;f&&i.push({...f,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(c=n.get(e))==null?void 0:c.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:r}:i[0],i]}function TZ({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},l=Pu(a,t);return{x:l.x-a.x,y:l.y-a.y}}function MZ({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},l=0,c=new Map,u=!1,h={x:0,y:0},m=null,f=!1,g=null,v=!1,k=!1,S=null;function y({noDragClassName:x,handleSelector:w,domNode:C,isSelectable:T,nodeId:N,nodeClickDistance:j=0}){g=Or(C);function A({x:V,y:U}){const{nodeLookup:P,nodeExtent:K,snapGrid:W,snapToGrid:Z,nodeOrigin:ee,onNodeDrag:z,onSelectionDrag:L,onError:I,updateNodePositions:Y}=t();a={x:V,y:U};let G=!1;const se=c.size>1,oe=se&&K?ov($u(c)):null,fe=se&&Z?TZ({dragItems:c,snapGrid:W,x:V,y:U}):null;for(const[te,q]of c){if(!P.has(te))continue;let ne={x:V-q.distance.x,y:U-q.distance.y};Z&&(ne=fe?{x:Math.round(ne.x+fe.x),y:Math.round(ne.y+fe.y)}:Pu(ne,W));let le=null;if(se&&K&&!q.extent&&oe){const{positionAbsolute:Ee}=q.internals,je=Ee.x-oe.x+K[0][0],Pe=Ee.x+q.measured.width-oe.x2+K[1][0],$e=Ee.y-oe.y+K[0][1],Be=Ee.y+q.measured.height-oe.y2+K[1][1];le=[[je,$e],[Pe,Be]]}const{position:ye,positionAbsolute:ve}=Nk({nodeId:te,nextPosition:ne,nodeLookup:P,nodeExtent:le||K,nodeOrigin:ee,onError:I});G=G||q.position.x!==ye.x||q.position.y!==ye.y,q.position=ye,q.internals.positionAbsolute=ve}if(k=k||G,!!G&&(Y(c,!0),S&&(r||z||!N&&L))){const[te,q]=R1({nodeId:N,dragItems:c,nodeLookup:P});r==null||r(S,c,te,q),z==null||z(S,te,q),N||L==null||L(S,q)}}async function D(){if(!m)return;const{transform:V,panBy:U,autoPanSpeed:P,autoPanOnNodeDrag:K}=t();if(!K){u=!1,cancelAnimationFrame(l);return}const[W,Z]=ab(h,m,P);(W!==0||Z!==0)&&(a.x=(a.x??0)-W/V[2],a.y=(a.y??0)-Z/V[2],await U({x:W,y:Z})&&A(a)),l=requestAnimationFrame(D)}function B(V){var se;const{nodeLookup:U,multiSelectionActive:P,nodesDraggable:K,transform:W,snapGrid:Z,snapToGrid:ee,selectNodesOnDrag:z,onNodeDragStart:L,onSelectionDragStart:I,unselectNodesAndEdges:Y}=t();f=!0,(!z||!T)&&!P&&N&&((se=U.get(N))!=null&&se.selected||Y()),T&&z&&N&&(e==null||e(N));const G=ru(V.sourceEvent,{transform:W,snapGrid:Z,snapToGrid:ee,containerBounds:m});if(a=G,c=AZ(U,K,G,N),c.size>0&&(n||L||!N&&I)){const[oe,fe]=R1({nodeId:N,dragItems:c,nodeLookup:U});n==null||n(V.sourceEvent,c,oe,fe),L==null||L(V.sourceEvent,oe,fe),N||I==null||I(V.sourceEvent,fe)}}const H=ak().clickDistance(j).on("start",V=>{const{domNode:U,nodeDragThreshold:P,transform:K,snapGrid:W,snapToGrid:Z}=t();m=(U==null?void 0:U.getBoundingClientRect())||null,v=!1,k=!1,S=V.sourceEvent,P===0&&B(V),a=ru(V.sourceEvent,{transform:K,snapGrid:W,snapToGrid:Z,containerBounds:m}),h=vi(V.sourceEvent,m)}).on("drag",V=>{const{autoPanOnNodeDrag:U,transform:P,snapGrid:K,snapToGrid:W,nodeDragThreshold:Z,nodeLookup:ee}=t(),z=ru(V.sourceEvent,{transform:P,snapGrid:K,snapToGrid:W,containerBounds:m});if(S=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||N&&!ee.has(N))&&(v=!0),!v){if(!u&&U&&f&&(u=!0,D()),!f){const L=vi(V.sourceEvent,m),I=L.x-h.x,Y=L.y-h.y;Math.sqrt(I*I+Y*Y)>Z&&B(V)}(a.x!==z.xSnapped||a.y!==z.ySnapped)&&c&&f&&(h=vi(V.sourceEvent,m),A(z))}}).on("end",V=>{if(!f||v){v&&c.size>0&&t().updateNodePositions(c,!1);return}if(u=!1,f=!1,cancelAnimationFrame(l),c.size>0){const{nodeLookup:U,updateNodePositions:P,onNodeDragStop:K,onSelectionDragStop:W}=t();if(k&&(P(c,!1),k=!1),i||K||!N&&W){const[Z,ee]=R1({nodeId:N,dragItems:c,nodeLookup:U,dragging:!1});i==null||i(V.sourceEvent,c,Z,ee),K==null||K(V.sourceEvent,Z,ee),N||W==null||W(V.sourceEvent,ee)}}}).filter(V=>{const U=V.target;return!V.button&&(!x||!U6(U,`.${x}`,C))&&(!w||U6(U,w,C))});g.call(H)}function _(){g==null||g.on(".drag",null)}return{update:y,destroy:_}}function jZ(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())yd(i,wu(a))>0&&r.push(a);return r}const DZ=250;function RZ(e,t,n,r){var c,u;let i=[],a=1/0;const l=jZ(e,n,t+DZ);for(const h of l){const m=[...((c=h.internals.handleBounds)==null?void 0:c.source)??[],...((u=h.internals.handleBounds)==null?void 0:u.target)??[]];for(const f of m){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:g,y:v}=fo(h,f,f.position,!0),k=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));k>t||(k1){const h=r.type==="source"?"target":"source";return i.find(m=>m.type===h)??i[0]}return i[0]}function Gk(e,t,n,r,i,a=!1){var h,m,f;const l=r.get(e);if(!l)return null;const c=i==="strict"?(h=l.internals.handleBounds)==null?void 0:h[t]:[...((m=l.internals.handleBounds)==null?void 0:m.source)??[],...((f=l.internals.handleBounds)==null?void 0:f.target)??[]],u=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return u&&a?{...u,...fo(l,u,u.position,!0)}:u}function Vk(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function LZ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Wk=()=>!0;function OZ(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:l,domNode:c,nodeLookup:u,lib:h,autoPanOnConnect:m,flowId:f,panBy:g,cancelConnection:v,onConnectStart:k,onConnect:S,onConnectEnd:y,isValidConnection:_=Wk,onReconnectEnd:x,updateConnection:w,getTransform:C,getFromHandle:T,autoPanSpeed:N,dragThreshold:j=1,handleDomNode:A}){const D=Lk(e.target);let B=0,H;const{x:V,y:U}=vi(e),P=Vk(a,A),K=c==null?void 0:c.getBoundingClientRect();let W=!1;if(!K||!P)return;const Z=Gk(i,P,r,u,t);if(!Z)return;let ee=vi(e,K),z=!1,L=null,I=!1,Y=null;function G(){if(!m||!K)return;const[ye,ve]=ab(ee,K,N);g({x:ye,y:ve}),B=requestAnimationFrame(G)}const se={...Z,nodeId:i,type:P,position:Z.position},oe=u.get(i);let te={inProgress:!0,isValid:null,from:fo(oe,se,Ze.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:oe,to:ee,toHandle:null,toPosition:j6[se.position],toNode:null,pointer:ee};function q(){W=!0,w(te),k==null||k(e,{nodeId:i,handleId:r,handleType:P})}j===0&&q();function ne(ye){if(!W){const{x:Be,y:Nt}=vi(ye),Rt=Be-V,Lt=Nt-U;if(!(Rt*Rt+Lt*Lt>j*j))return;q()}if(!T()||!se){le(ye);return}const ve=C();ee=vi(ye,K),H=RZ(Uu(ee,ve,!1,[1,1]),n,u,se),z||(G(),z=!0);const Ee=Yk(ye,{handle:H,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:l?"target":"source",isValidConnection:_,doc:D,lib:h,flowId:f,nodeLookup:u});Y=Ee.handleDomNode,L=Ee.connection,I=LZ(!!H,Ee.isValid);const je=u.get(i),Pe=je?fo(je,se,Ze.Left,!0):te.from,$e={...te,from:Pe,isValid:I,to:Ee.toHandle&&I?Rl({x:Ee.toHandle.x,y:Ee.toHandle.y},ve):ee,toHandle:Ee.toHandle,toPosition:I&&Ee.toHandle?Ee.toHandle.position:j6[se.position],toNode:Ee.toHandle?u.get(Ee.toHandle.nodeId):null,pointer:ee};w($e),te=$e}function le(ye){if(!("touches"in ye&&ye.touches.length>0)){if(W){(H||Y)&&L&&I&&(S==null||S(L));const{inProgress:ve,...Ee}=te,je={...Ee,toPosition:te.toHandle?te.toPosition:null};y==null||y(ye,je),a&&(x==null||x(ye,je))}v(),cancelAnimationFrame(B),z=!1,I=!1,L=null,Y=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 Yk(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:l,lib:c,flowId:u,isValidConnection:h=Wk,nodeLookup:m}){const f=a==="target",g=t?l.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:k}=vi(e),S=l.elementFromPoint(v,k),y=S!=null&&S.classList.contains(`${c}-flow__handle`)?S:g,_={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const x=Vk(void 0,y),w=y.getAttribute("data-nodeid"),C=y.getAttribute("data-handleid"),T=y.classList.contains("connectable"),N=y.classList.contains("connectableend");if(!w||!x)return _;const j={source:f?w:r,sourceHandle:f?C:i,target:f?r:w,targetHandle:f?i:C};_.connection=j;const D=T&&N&&(n===jl.Strict?f&&x==="source"||!f&&x==="target":w!==r||C!==i);_.isValid=D&&h(j),_.toHandle=Gk(w,x,C,m,n,!0)}return _}const hv={onPointerDown:OZ,isValid:Yk};function BZ({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Or(e);function a({translateExtent:c,width:u,height:h,zoomStep:m=1,pannable:f=!0,zoomable:g=!0,inversePan:v=!1}){const k=w=>{if(w.sourceEvent.type!=="wheel"||!t)return;const C=n(),T=w.sourceEvent.ctrlKey&&Su()?10:1,N=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*m,j=C[2]*Math.pow(2,N*T);t.scaleTo(j)};let S=[0,0];const y=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])},_=w=>{const C=n();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!t)return;const T=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],N=[T[0]-S[0],T[1]-S[1]];S=T;const j=r()*Math.max(C[2],Math.log(C[2]))*(v?-1:1),A={x:C[0]-N[0]*j,y:C[1]-N[1]*j},D=[[0,0],[u,h]];t.setViewportConstrained({x:A.x,y:A.y,zoom:C[2]},D,c)},x=xk().on("start",y).on("zoom",f?_:null).on("zoom.wheel",g?k:null);i.call(x,{})}function l(){i.on("zoom",null)}return{update:a,destroy:l,pointer:fi}}const xf=e=>({x:e.x,y:e.y,zoom:e.k}),L1=({x:e,y:t,zoom:n})=>bf.translate(e,t).scale(n),vl=(e,t)=>e.target.closest(`.${t}`),Xk=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),zZ=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,O1=(e,t=0,n=zZ,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},Kk=e=>{const t=e.ctrlKey&&Su()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function IZ({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:h}){return m=>{if(vl(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(m.ctrlKey&&l){const y=fi(m),_=Kk(m),x=f*Math.pow(2,_);r.scaleTo(n,x,y,m);return}const g=m.deltaMode===1?20:1;let v=i===ro.Vertical?0:m.deltaX*g,k=i===ro.Horizontal?0:m.deltaY*g;!Su()&&m.shiftKey&&i!==ro.Vertical&&(v=m.deltaY*g,k=0),r.translateBy(n,-(v/f)*a,-(k/f)*a,{internal:!0});const S=xf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,S),e.panScrollTimeout=setTimeout(()=>{h==null||h(m,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,S))}}function HZ({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",l=!t&&a&&!r.ctrlKey,c=vl(r,e);if(r.ctrlKey&&a&&c&&r.preventDefault(),l||c)return null;r.preventDefault(),n.call(this,r,i)}}function FZ({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,l,c;if((a=r.sourceEvent)!=null&&a.internal)return;const i=xf(r.transform);e.mouseButton=((l=r.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function $Z({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var l,c;e.usedRightMouseButton=!!(n&&Xk(t,e.mouseButton??0)),(l=a.sourceEvent)!=null&&l.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((c=a.sourceEvent)!=null&&c.internal)&&(i==null||i(a.sourceEvent,xf(a.transform)))}}function PZ({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,a&&Xk(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&a(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const u=xf(l.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(l.sourceEvent,u)},n?150:0)}}}function UZ({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:u,lib:h,connectionInProgress:m}){return f=>{var y;const g=e||t,v=n&&f.ctrlKey,k=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(vl(f,`${h}-flow__node`)||vl(f,`${h}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||l||m&&!k||vl(f,c)&&k||vl(f,u)&&(!k||i&&k&&!e)||!n&&f.ctrlKey&&k)return!1;if(!n&&f.type==="touchstart"&&((y=f.touches)==null?void 0:y.length)>1)return f.preventDefault(),!1;if(!g&&!i&&!v&&k||!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||k)&&S}}function qZ({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:u}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),f=xk().scaleExtent([t,n]).translateExtent(r),g=Or(e).call(f);x({x:i.x,y:i.y,zoom:Dl(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const v=g.on("wheel.zoom"),k=g.on("dblclick.zoom");f.wheelDelta(Kk);async function S(H,V){return g?new Promise(U=>{f==null||f.interpolate((V==null?void 0:V.interpolate)==="linear"?nu:U0).transform(O1(g,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>U(!0)),H)}):!1}function y({noWheelClassName:H,noPanClassName:V,onPaneContextMenu:U,userSelectionActive:P,panOnScroll:K,panOnDrag:W,panOnScrollMode:Z,panOnScrollSpeed:ee,preventScrolling:z,zoomOnPinch:L,zoomOnScroll:I,zoomOnDoubleClick:Y,zoomActivationKeyPressed:G,lib:se,onTransformChange:oe,connectionInProgress:fe,paneClickDistance:te,selectionOnDrag:q}){P&&!h.isZoomingOrPanning&&_();const ne=K&&!G&&!P;f.clickDistance(q?1/0:!gi(te)||te<0?0:te);const le=ne?IZ({zoomPanValues:h,noWheelClassName:H,d3Selection:g,d3Zoom:f,panOnScrollMode:Z,panOnScrollSpeed:ee,zoomOnPinch:L,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}):HZ({noWheelClassName:H,preventScrolling:z,d3ZoomHandler:v});g.on("wheel.zoom",le,{passive:!1});const ye=FZ({zoomPanValues:h,onDraggingChange:u,onPanZoomStart:l});f.on("start",ye);const ve=$Z({zoomPanValues:h,panOnDrag:W,onPaneContextMenu:!!U,onPanZoom:a,onTransformChange:oe});f.on("zoom",ve);const Ee=PZ({zoomPanValues:h,panOnDrag:W,panOnScroll:K,onPaneContextMenu:U,onPanZoomEnd:c,onDraggingChange:u});f.on("end",Ee);const je=UZ({zoomActivationKeyPressed:G,panOnDrag:W,zoomOnScroll:I,panOnScroll:K,zoomOnDoubleClick:Y,zoomOnPinch:L,userSelectionActive:P,noPanClassName:V,noWheelClassName:H,lib:se,connectionInProgress:fe});f.filter(je),Y?g.on("dblclick.zoom",k):g.on("dblclick.zoom",null)}function _(){f.on("zoom",null)}async function x(H,V,U){const P=L1(H),K=f==null?void 0:f.constrain()(P,V,U);return K&&await S(K),K}async function w(H,V){const U=L1(H);return await S(U,V),U}function C(H){if(g){const V=L1(H),U=g.property("__zoom");(U.k!==H.zoom||U.x!==H.x||U.y!==H.y)&&(f==null||f.transform(g,V,null,{sync:!0}))}}function T(){const H=g?_k(g.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function N(H,V){return g?new Promise(U=>{f==null||f.interpolate((V==null?void 0:V.interpolate)==="linear"?nu:U0).scaleTo(O1(g,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>U(!0)),H)}):!1}async function j(H,V){return g?new Promise(U=>{f==null||f.interpolate((V==null?void 0:V.interpolate)==="linear"?nu:U0).scaleBy(O1(g,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>U(!0)),H)}):!1}function A(H){f==null||f.scaleExtent(H)}function D(H){f==null||f.translateExtent(H)}function B(H){const V=!gi(H)||H<0?0:H;f==null||f.clickDistance(V)}return{update:y,destroy:_,setViewport:w,setViewportConstrained:x,getViewport:T,scaleTo:N,scaleBy:j,setScaleExtent:A,setTranslateExtent:D,syncViewport:C,setClickDistance:B}}var Ll;(function(e){e.Line="line",e.Handle="handle"})(Ll||(Ll={}));function GZ({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const l=e-t,c=n-r,u=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&i&&(u[0]=u[0]*-1),c&&a&&(u[1]=u[1]*-1),u}function q6(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function ua(e,t){return Math.max(0,t-e)}function ha(e,t){return Math.max(0,e-t)}function N0(e,t,n){return Math.max(0,t-e,e-n)}function G6(e,t){return e?!t:t}function VZ(e,t,n,r,i,a,l,c){let{affectsX:u,affectsY:h}=t;const{isHorizontal:m,isVertical:f}=t,g=m&&f,{xSnapped:v,ySnapped:k}=n,{minWidth:S,maxWidth:y,minHeight:_,maxHeight:x}=r,{x:w,y:C,width:T,height:N,aspectRatio:j}=e;let A=Math.floor(m?v-e.pointerX:0),D=Math.floor(f?k-e.pointerY:0);const B=T+(u?-A:A),H=N+(h?-D:D),V=-a[0]*T,U=-a[1]*N;let P=N0(B,S,y),K=N0(H,_,x);if(l){let ee=0,z=0;u&&A<0?ee=ua(w+A+V,l[0][0]):!u&&A>0&&(ee=ha(w+B+V,l[1][0])),h&&D<0?z=ua(C+D+U,l[0][1]):!h&&D>0&&(z=ha(C+H+U,l[1][1])),P=Math.max(P,ee),K=Math.max(K,z)}if(c){let ee=0,z=0;u&&A>0?ee=ha(w+A,c[0][0]):!u&&A<0&&(ee=ua(w+B,c[1][0])),h&&D>0?z=ha(C+D,c[0][1]):!h&&D<0&&(z=ua(C+H,c[1][1])),P=Math.max(P,ee),K=Math.max(K,z)}if(i){if(m){const ee=N0(B/j,_,x)*j;if(P=Math.max(P,ee),l){let z=0;!u&&!h||u&&!h&&g?z=ha(C+U+B/j,l[1][1])*j:z=ua(C+U+(u?A:-A)/j,l[0][1])*j,P=Math.max(P,z)}if(c){let z=0;!u&&!h||u&&!h&&g?z=ua(C+B/j,c[1][1])*j:z=ha(C+(u?A:-A)/j,c[0][1])*j,P=Math.max(P,z)}}if(f){const ee=N0(H*j,S,y)/j;if(K=Math.max(K,ee),l){let z=0;!u&&!h||h&&!u&&g?z=ha(w+H*j+V,l[1][0])/j:z=ua(w+(h?D:-D)*j+V,l[0][0])/j,K=Math.max(K,z)}if(c){let z=0;!u&&!h||h&&!u&&g?z=ua(w+H*j,c[1][0])/j:z=ha(w+(h?D:-D)*j,c[0][0])/j,K=Math.max(K,z)}}}D=D+(D<0?K:-K),A=A+(A<0?P:-P),i&&(g?B>H*j?D=(G6(u,h)?-A:A)/j:A=(G6(u,h)?-D:D)*j:m?(D=A/j,h=u):(A=D*j,u=h));const W=u?w+A:w,Z=h?C+D:C;return{width:T+(u?-A:A),height:N+(h?-D:D),x:a[0]*A*(u?-1:1)+W,y:a[1]*D*(h?-1:1)+Z}}const Zk={width:0,height:0,x:0,y:0},WZ={...Zk,pointerX:0,pointerY:0,aspectRatio:1};function YZ(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,l=e.measured.height??0,c=n[0]*a,u=n[1]*l;return[[r-c,i-u],[r+a-c,i+l-u]]}function XZ({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Or(e);let l={controlDirection:q6("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:h,boundaries:m,keepAspectRatio:f,resizeDirection:g,onResizeStart:v,onResize:k,onResizeEnd:S,shouldResize:y}){let _={...Zk},x={...WZ};l={boundaries:m,resizeDirection:g,keepAspectRatio:f,controlDirection:q6(h)};let w,C=null,T=[],N,j,A,D=!1;const B=ak().on("start",H=>{const{nodeLookup:V,transform:U,snapGrid:P,snapToGrid:K,nodeOrigin:W,paneDomNode:Z}=n();if(w=V.get(t),!w)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:ee,ySnapped:z}=ru(H.sourceEvent,{transform:U,snapGrid:P,snapToGrid:K,containerBounds:C});_={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},x={..._,pointerX:ee,pointerY:z,aspectRatio:_.width/_.height},N=void 0,j=ho(w.extent)?w.extent:void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(N=V.get(w.parentId)),N&&w.extent==="parent"&&(j=[[0,0],[N.measured.width,N.measured.height]]),T=[],A=void 0;for(const[L,I]of V)if(I.parentId===t&&(T.push({id:L,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent)){const Y=YZ(I,w,I.origin??W);A?A=[[Math.min(Y[0][0],A[0][0]),Math.min(Y[0][1],A[0][1])],[Math.max(Y[1][0],A[1][0]),Math.max(Y[1][1],A[1][1])]]:A=Y}v==null||v(H,{..._})}).on("drag",H=>{const{transform:V,snapGrid:U,snapToGrid:P,nodeOrigin:K}=n(),W=ru(H.sourceEvent,{transform:V,snapGrid:U,snapToGrid:P,containerBounds:C}),Z=[];if(!w)return;const{x:ee,y:z,width:L,height:I}=_,Y={},G=w.origin??K,{width:se,height:oe,x:fe,y:te}=VZ(x,l.controlDirection,W,l.boundaries,l.keepAspectRatio,G,j,A),q=se!==L,ne=oe!==I,le=fe!==ee&&q,ye=te!==z&≠if(!le&&!ye&&!q&&!ne)return;if((le||ye||G[0]===1||G[1]===1)&&(Y.x=le?fe:_.x,Y.y=ye?te:_.y,_.x=Y.x,_.y=Y.y,T.length>0)){const Pe=fe-ee,$e=te-z;for(const Be of T)Be.position={x:Be.position.x-Pe+G[0]*(se-L),y:Be.position.y-$e+G[1]*(oe-I)},Z.push(Be)}if((q||ne)&&(Y.width=q&&(!l.resizeDirection||l.resizeDirection==="horizontal")?se:_.width,Y.height=ne&&(!l.resizeDirection||l.resizeDirection==="vertical")?oe:_.height,_.width=Y.width,_.height=Y.height),N&&w.expandParent){const Pe=G[0]*(Y.width??0);Y.x&&Y.x{D&&(S==null||S(H,{..._}),i==null||i({..._}),D=!1)});a.call(B)}function u(){a.on(".drag",null)}return{update:c,destroy:u}}var B1={exports:{}},z1={},I1={exports:{}},H1={};/** + * @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 V6;function KZ(){if(V6)return H1;V6=1;var e=Cu();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(f,g){var v=g(),k=r({inst:{value:v,getSnapshot:g}}),S=k[0].inst,y=k[1];return a(function(){S.value=v,S.getSnapshot=g,u(S)&&y({inst:S})},[f,v,g]),i(function(){return u(S)&&y({inst:S}),f(function(){u(S)&&y({inst:S})})},[f]),l(v),v}function u(f){var g=f.getSnapshot;f=f.value;try{var v=g();return!n(f,v)}catch{return!0}}function h(f,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return H1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,H1}var W6;function ZZ(){return W6||(W6=1,I1.exports=KZ()),I1.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 Y6;function QZ(){if(Y6)return z1;Y6=1;var e=Cu(),t=ZZ();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return z1.useSyncExternalStoreWithSelector=function(h,m,f,g,v){var k=a(null);if(k.current===null){var S={hasValue:!1,value:null};k.current=S}else S=k.current;k=c(function(){function _(N){if(!x){if(x=!0,w=N,N=g(N),v!==void 0&&S.hasValue){var j=S.value;if(v(j,N))return C=j}return C=N}if(j=C,r(w,N))return j;var A=g(N);return v!==void 0&&v(j,A)?(w=N,j):(w=N,C=A)}var x=!1,w,C,T=f===void 0?null:f;return[function(){return _(m())},T===null?void 0:function(){return _(T())}]},[m,f,g,v]);var y=i(h,k[0],k[1]);return l(function(){S.hasValue=!0,S.value=y},[y]),u(y),y},z1}var X6;function JZ(){return X6||(X6=1,B1.exports=QZ()),B1.exports}var eQ=JZ();const tQ=wd(eQ),nQ={},K6=e=>{let t;const n=new Set,r=(m,f)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(k=>k(t,v))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(nQ?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(r,i,u);return u},rQ=e=>e?K6(e):K6,{useDebugValue:iQ}=GN,{useSyncExternalStoreWithSelector:sQ}=tQ,aQ=e=>e;function Qk(e,t=aQ,n){const r=sQ(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return iQ(r),r}const Z6=(e,t)=>{const n=rQ(e),r=(i,a=t)=>Qk(n,i,a);return Object.assign(r,n),r},oQ=(e,t)=>e?Z6(e,t):Z6;function mn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const wf=O.createContext(null),lQ=wf.Provider,Jk=xi.error001("react");function Ot(e,t){const n=O.useContext(wf);if(n===null)throw new Error(Jk);return Qk(n,e,t)}function vn(){const e=O.useContext(wf);if(e===null)throw new Error(Jk);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Q6={display:"none"},cQ={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},eC="react-flow__node-desc",tC="react-flow__edge-desc",uQ="react-flow__aria-live",hQ=e=>e.ariaLiveMessage,dQ=e=>e.ariaLabelConfig;function fQ({rfId:e}){const t=Ot(hQ);return d.jsx("div",{id:`${uQ}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:cQ,children:t})}function pQ({rfId:e,disableKeyboardA11y:t}){const n=Ot(dQ);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${eC}-${e}`,style:Q6,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${tC}-${e}`,style:Q6,children:n["edge.a11yDescription.default"]}),!t&&d.jsx(fQ,{rfId:e})]})}const Sf=O.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const l=`${e}`.split("-");return d.jsx("div",{className:Fn(["react-flow__panel",n,...l]),style:r,ref:a,...i,children:t})});Sf.displayName="Panel";const J6="https://reactflow.dev?utm_source=attribution";function mQ({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(Sf,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${J6}`,children:d.jsx("a",{href:J6,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const gQ=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},A0=e=>e.id;function vQ(e,t){return mn(e.selectedNodes.map(A0),t.selectedNodes.map(A0))&&mn(e.selectedEdges.map(A0),t.selectedEdges.map(A0))}function bQ({onSelectionChange:e}){const t=vn(),{selectedNodes:n,selectedEdges:r}=Ot(gQ,vQ);return O.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const yQ=e=>!!e.onSelectionChangeHandlers;function _Q({onSelectionChange:e}){const t=Ot(yQ);return e||t?d.jsx(bQ,{onSelectionChange:e}):null}const nC=[0,0],xQ={x:0,y:0,zoom:1},wQ=["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"],e7=[...wQ,"rfId"],SQ=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}),t7={translateExtent:_u,nodeOrigin:nC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kQ(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:u}=Ot(SQ,mn),h=vn();O.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=t7,c()}),[]);const m=O.useRef(t7);return O.useEffect(()=>{for(const f of e7){const g=e[f],v=m.current[f];g!==v&&(typeof e[f]>"u"||(f==="nodes"?t(g):f==="edges"?n(g):f==="minZoom"?r(g):f==="maxZoom"?i(g):f==="translateExtent"?a(g):f==="nodeExtent"?l(g):f==="ariaLabelConfig"?h.setState({ariaLabelConfig:lZ(g)}):f==="fitView"?h.setState({fitViewQueued:g}):f==="fitViewOptions"?h.setState({fitViewOptions:g}):h.setState({[f]:g})))}m.current=e},e7.map(f=>e[f])),null}function n7(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function CQ(e){var r;const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const i=n7(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=n7())!=null&&r.matches?"dark":"light"}const r7=typeof document<"u"?document:null;function ku(e=null,t={target:r7,actInsideInputWithModifier:!0}){const[n,r]=O.useState(!1),i=O.useRef(!1),a=O.useRef(new Set([])),[l,c]=O.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`).replace(` + +`,` ++`).split(` +`)),m=h.reduce((f,g)=>f.concat(...g),[]);return[h,m]}return[[],[]]},[e]);return O.useEffect(()=>{const u=(t==null?void 0:t.target)??r7,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var y,_;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!h)&&Ok(v))return!1;const S=s7(v.code,c);if(a.current.add(v[S]),i7(l,a.current,!1)){const x=((_=(y=v.composedPath)==null?void 0:y.call(v))==null?void 0:_[0])||v.target,w=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(i.current||!w)&&v.preventDefault(),r(!0)}},f=v=>{const k=s7(v.code,c);i7(l,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(v[k]),v.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function i7(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function s7(e,t){return t.includes(e)?"code":"key"}const EQ=()=>{const e=vn();return O.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,a],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:a,maxZoom:l,panZoom:c}=e.getState(),u=ob(t,r,i,a,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:a,domNode:l}=e.getState();if(!l)return t;const{x:c,y:u}=l.getBoundingClientRect(),h={x:t.x-c,y:t.y-u},m=n.snapGrid??i,f=n.snapToGrid??a;return Uu(h,r,f,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),l=Rl(t,n);return{x:l.x+i,y:l.y+a}}}),[])};function rC(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const l=r.get(a.id);l?l.push(a):r.set(a.id,[a])}for(const a of t){const l=r.get(a.id);if(!l){n.push(a);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...a};for(const u of l)NQ(u,c);n.push(c)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function NQ(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function AQ(e,t){return rC(e,t)}function TQ(e,t){return rC(e,t)}function Za(e,t){return{id:e,type:"select",selected:t}}function bl(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const l=t.has(i);!(a.selected===void 0&&!l)&&a.selected!==l&&(n&&(a.selected=l),r.push(Za(a.id,l)))}return r}function a7({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,l]of e.entries()){const c=t.get(l.id),u=((i=c==null?void 0:c.internals)==null?void 0:i.userNode)??c;u!==void 0&&u!==l&&n.push({id:l.id,item:l,type:"replace"}),u===void 0&&n.push({item:l,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function o7(e){return{id:e.id,type:"remove"}}const MQ=jk();function jQ(e,t,n={}){return pZ(e,t,{...n,onError:n.onError??MQ})}const l7=e=>JK(e),DQ=e=>Ek(e);function iC(e){return O.forwardRef(e)}const RQ=typeof window<"u"?O.useLayoutEffect:O.useEffect;function c7(e){const[t,n]=O.useState(BigInt(0)),[r]=O.useState(()=>LQ(()=>n(i=>i+BigInt(1))));return RQ(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function LQ(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const sC=O.createContext(null);function OQ({children:e}){const t=vn(),n=O.useCallback(c=>{const{nodes:u=[],setNodes:h,hasDefaultNodes:m,onNodesChange:f,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:k}=t.getState();let S=u;for(const _ of c)S=typeof _=="function"?_(S):_;let y=a7({items:S,lookup:g});for(const _ of k.values())y=_(y);m&&h(S),y.length>0?f==null||f(y):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:x,setNodes:w}=t.getState();_&&w(x)})},[]),r=c7(n),i=O.useCallback(c=>{const{edges:u=[],setEdges:h,hasDefaultEdges:m,onEdgesChange:f,edgeLookup:g}=t.getState();let v=u;for(const k of c)v=typeof k=="function"?k(v):k;m?h(v):f&&f(a7({items:v,lookup:g}))},[]),a=c7(i),l=O.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return d.jsx(sC.Provider,{value:l,children:e})}function BQ(){const e=O.useContext(sC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zQ=e=>!!e.panZoom;function pb(){const e=EQ(),t=vn(),n=BQ(),r=Ot(zQ),i=O.useMemo(()=>{const a=f=>t.getState().nodeLookup.get(f),l=f=>{n.nodeQueue.push(f)},c=f=>{n.edgeQueue.push(f)},u=f=>{var _,x;const{nodeLookup:g,nodeOrigin:v}=t.getState(),k=l7(f)?f:g.get(f.id),S=k.parentId?Rk(k.position,k.measured,k.parentId,g,v):k.position,y={...k,position:S,width:((_=k.measured)==null?void 0:_.width)??k.width,height:((x=k.measured)==null?void 0:x.height)??k.height};return wu(y)},h=(f,g,v={replace:!1})=>{l(k=>k.map(S=>{if(S.id===f){const y=typeof g=="function"?g(S):g;return v.replace&&l7(y)?y:{...S,...y}}return S}))},m=(f,g,v={replace:!1})=>{c(k=>k.map(S=>{if(S.id===f){const y=typeof g=="function"?g(S):g;return v.replace&&DQ(y)?y:{...S,...y}}return S}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var g;return(g=a(f))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(g=>({...g}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:l,setEdges:c,addNodes:f=>{const g=Array.isArray(f)?f:[f];n.nodeQueue.push(v=>[...v,...g])},addEdges:f=>{const g=Array.isArray(f)?f:[f];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:f=[],edges:g=[],transform:v}=t.getState(),[k,S,y]=v;return{nodes:f.map(_=>({..._})),edges:g.map(_=>({..._})),viewport:{x:k,y:S,zoom:y}}},deleteElements:async({nodes:f=[],edges:g=[]})=>{const{nodes:v,edges:k,onNodesDelete:S,onEdgesDelete:y,triggerNodeChanges:_,triggerEdgeChanges:x,onDelete:w,onBeforeDelete:C}=t.getState(),{nodes:T,edges:N}=await iZ({nodesToRemove:f,edgesToRemove:g,nodes:v,edges:k,onBeforeDelete:C}),j=N.length>0,A=T.length>0;if(j){const D=N.map(o7);y==null||y(N),x(D)}if(A){const D=T.map(o7);S==null||S(T),_(D)}return(A||j)&&(w==null||w({nodes:T,edges:N})),{deletedNodes:T,deletedEdges:N}},getIntersectingNodes:(f,g=!0,v)=>{const k=R6(f),S=k?f:u(f),y=v!==void 0;return S?(v||t.getState().nodes).filter(_=>{const x=t.getState().nodeLookup.get(_.id);if(x&&!k&&(_.id===f.id||!x.internals.positionAbsolute))return!1;const w=wu(y?_:x),C=yd(w,S);return g&&C>0||C>=w.width*w.height||C>=S.width*S.height}):[]},isNodeIntersecting:(f,g,v=!0)=>{const S=R6(f)?f:u(f);if(!S)return!1;const y=yd(S,g);return v&&y>0||y>=g.width*g.height||y>=S.width*S.height},updateNode:h,updateNodeData:(f,g,v={replace:!1})=>{h(f,k=>{const S=typeof g=="function"?g(k):g;return v.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},v)},updateEdge:m,updateEdgeData:(f,g,v={replace:!1})=>{m(f,k=>{const S=typeof g=="function"?g(k):g;return v.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},v)},getNodesBounds:f=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return eZ(f,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:f,id:g,nodeId:v})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${v}-${f}${g?`-${g}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:f,handleId:g,nodeId:v})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${v}${f?g?`-${f}-${g}`:`-${f}`:""}`))==null?void 0:k.values())??[])},fitView:async f=>{const g=t.getState().fitViewResolver??oZ();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return O.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const u7=e=>e.selected,IQ=typeof window<"u"?window:void 0;function HQ({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=vn(),{deleteElements:r}=pb(),i=ku(e,{actInsideInputWithModifier:!1}),a=ku(t,{target:IQ});O.useEffect(()=>{if(i){const{edges:l,nodes:c}=n.getState();r({nodes:c.filter(u7),edges:l.filter(u7)}),n.setState({nodesSelectionActive:!1})}},[i]),O.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function FQ(e){const t=vn();O.useEffect(()=>{const n=()=>{var i,a,l,c;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=lb(e.current);(r.height===0||r.width===0)&&((c=(l=t.getState()).onError)==null||c.call(l,"004",xi.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const kf={position:"absolute",width:"100%",height:"100%",top:0,left:0},$Q=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function PQ({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=ro.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:h,minZoom:m,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:v=!0,children:k,noWheelClassName:S,noPanClassName:y,onViewportChange:_,isControlledViewport:x,paneClickDistance:w,selectionOnDrag:C}){const T=vn(),N=O.useRef(null),{userSelectionActive:j,lib:A,connectionInProgress:D}=Ot($Q,mn),B=ku(g),H=O.useRef();FQ(N);const V=O.useCallback(U=>{_==null||_({x:U[0],y:U[1],zoom:U[2]}),x||T.setState({transform:U})},[_,x]);return O.useEffect(()=>{if(N.current){H.current=qZ({domNode:N.current,minZoom:m,maxZoom:f,translateExtent:h,viewport:u,onDraggingChange:W=>T.setState(Z=>Z.paneDragging===W?Z:{paneDragging:W}),onPanZoomStart:(W,Z)=>{const{onViewportChangeStart:ee,onMoveStart:z}=T.getState();z==null||z(W,Z),ee==null||ee(Z)},onPanZoom:(W,Z)=>{const{onViewportChange:ee,onMove:z}=T.getState();z==null||z(W,Z),ee==null||ee(Z)},onPanZoomEnd:(W,Z)=>{const{onViewportChangeEnd:ee,onMoveEnd:z}=T.getState();z==null||z(W,Z),ee==null||ee(Z)}});const{x:U,y:P,zoom:K}=H.current.getViewport();return T.setState({panZoom:H.current,transform:[U,P,K],domNode:N.current.closest(".react-flow")}),()=>{var W;(W=H.current)==null||W.destroy()}}},[]),O.useEffect(()=>{var U;(U=H.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:y,userSelectionActive:j,noWheelClassName:S,lib:A,onTransformChange:V,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:w})},[e,t,n,r,i,a,l,c,B,v,y,j,S,A,V,D,C,w]),d.jsx("div",{className:"react-flow__renderer",ref:N,style:kf,children:k})}const UQ=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qQ(){const{userSelectionActive:e,userSelectionRect:t}=Ot(UQ,mn);return e&&t?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const F1=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},GQ=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function VQ({isSelecting:e,selectionKeyPressed:t,selectionMode:n=xu.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:u,onPaneClick:h,onPaneContextMenu:m,onPaneScroll:f,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:k,children:S}){const y=O.useRef(0),_=vn(),{userSelectionActive:x,elementsSelectable:w,dragging:C,panBy:T,autoPanSpeed:N}=Ot(GQ,mn),j=w&&(e||x),A=O.useRef(null),D=O.useRef(),B=O.useRef(new Set),H=O.useRef(new Set),V=O.useRef(!1),U=O.useRef(!1),P=O.useRef({x:0,y:0}),K=O.useRef(!1),W=q=>{if(U.current||V.current||_.getState().connection.inProgress){U.current=!1,V.current=!1;return}h==null||h(q),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},Z=q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){q.preventDefault();return}m==null||m(q)},ee=f?q=>f(q):void 0,z=q=>{U.current&&(q.stopPropagation(),U.current=!1)},L=q=>{var Be,Nt;const{domNode:ne,transform:le}=_.getState();if(D.current=ne==null?void 0:ne.getBoundingClientRect(),!D.current)return;const ye=q.target===A.current;if(!ye&&!!q.target.closest(".nokey")||!e||!(l&&ye||t)||q.button!==0||!q.isPrimary)return;(Nt=(Be=q.target)==null?void 0:Be.setPointerCapture)==null||Nt.call(Be,q.pointerId),U.current=!1;const{x:je,y:Pe}=vi(q.nativeEvent,D.current),$e=Uu({x:je,y:Pe},le);_.setState({userSelectionRect:{width:0,height:0,startX:$e.x,startY:$e.y,x:je,y:Pe}}),ye||(q.stopPropagation(),q.preventDefault())};function I(q,ne){const{userSelectionRect:le}=_.getState();if(!le)return;const{transform:ye,nodeLookup:ve,edgeLookup:Ee,connectionLookup:je,triggerNodeChanges:Pe,triggerEdgeChanges:$e,defaultEdgeOptions:Be}=_.getState(),Nt={x:le.startX,y:le.startY},{x:Rt,y:Lt}=Rl(Nt,ye),Ft={startX:Nt.x,startY:Nt.y,x:qpt.id)),H.current=new Set;const Je=(Be==null?void 0:Be.selectable)??!0;for(const pt of B.current){const _e=je.get(pt);if(_e)for(const{edgeId:Ne}of _e.values()){const He=Ee.get(Ne);He&&(He.selectable??Je)&&H.current.add(Ne)}}if(!L6(an,B.current)){const pt=bl(ve,B.current,!0);Pe(pt)}if(!L6(wt,H.current)){const pt=bl(Ee,H.current);$e(pt)}_.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function Y(){if(!i||!D.current)return;const[q,ne]=ab(P.current,D.current,N);T({x:q,y:ne}).then(le=>{if(!U.current||!le){y.current=requestAnimationFrame(Y);return}const{x:ye,y:ve}=P.current;I(ye,ve),y.current=requestAnimationFrame(Y)})}const G=()=>{cancelAnimationFrame(y.current),y.current=0,K.current=!1};O.useEffect(()=>()=>G(),[]);const se=q=>{const{userSelectionRect:ne,transform:le,resetSelectedElements:ye}=_.getState();if(!D.current||!ne)return;const{x:ve,y:Ee}=vi(q.nativeEvent,D.current);P.current={x:ve,y:Ee};const je=Rl({x:ne.startX,y:ne.startY},le);if(!U.current){const Pe=t?0:a;if(Math.hypot(ve-je.x,Ee-je.y)<=Pe)return;ye(),c==null||c(q)}U.current=!0,K.current||(Y(),K.current=!0),I(ve,Ee)},oe=q=>{var ne,le;if(!j){q.target===A.current&&_.getState().connection.inProgress&&(V.current=!0);return}q.button===0&&((le=(ne=q.target)==null?void 0:ne.releasePointerCapture)==null||le.call(ne,q.pointerId),!x&&q.target===A.current&&_.getState().userSelectionRect&&(W==null||W(q)),_.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(u==null||u(q),_.setState({nodesSelectionActive:B.current.size>0})),G())},fe=q=>{var ne,le;(le=(ne=q.target)==null?void 0:ne.releasePointerCapture)==null||le.call(ne,q.pointerId),G()},te=r===!0||Array.isArray(r)&&r.includes(0);return d.jsxs("div",{className:Fn(["react-flow__pane",{draggable:te,dragging:C,selection:e}]),onClick:j?void 0:F1(W,A),onContextMenu:F1(Z,A),onWheel:F1(ee,A),onPointerEnter:j?void 0:g,onPointerMove:j?se:v,onPointerUp:oe,onPointerCancel:j?fe:void 0,onPointerDownCapture:j?L:void 0,onClickCapture:j?z:void 0,onPointerLeave:k,ref:A,style:kf,children:[S,d.jsx(qQ,{})]})}function dv({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:c,onError:u}=t.getState(),h=c.get(e);if(!h){u==null||u("012",xi.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&l)&&(a({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function aC({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:l}){const c=vn(),[u,h]=O.useState(!1),m=O.useRef();return O.useEffect(()=>{m.current=MZ({getStoreItems:()=>c.getState(),onNodeMouseDown:f=>{dv({id:f,store:c,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),O.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:l}),()=>{var f;(f=m.current)==null||f.destroy()}},[n,r,t,a,e,i,l]),u}const WQ=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function oC(){const e=vn();return O.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:l,onError:c,updateNodePositions:u,nodeLookup:h,nodeOrigin:m}=e.getState(),f=new Map,g=WQ(l),v=i?a[0]:5,k=i?a[1]:5,S=n.direction.x*v*n.factor,y=n.direction.y*k*n.factor;for(const[,_]of h){if(!g(_))continue;let x={x:_.internals.positionAbsolute.x+S,y:_.internals.positionAbsolute.y+y};i&&(x=Pu(x,a));const{position:w,positionAbsolute:C}=Nk({nodeId:_.id,nextPosition:x,nodeLookup:h,nodeExtent:r,nodeOrigin:m,onError:c});_.position=w,_.internals.positionAbsolute=C,f.set(_.id,_)}u(f)},[])}const mb=O.createContext(null),YQ=mb.Provider;mb.Consumer;const lC=()=>O.useContext(mb),XQ=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cC=O.createContext(null);function KQ({children:e}){const t=Ot(XQ,mn);return d.jsx(cC.Provider,{value:t,children:e})}function ZQ(){const e=O.useContext(cC);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const QQ={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},JQ=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:l}=r,{fromHandle:c,toHandle:u,isValid:h}=l;if(!c&&!i)return QQ;const m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===jl.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!i,valid:m&&h}};function eJ({type:e="source",position:t=Ze.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:l,onConnect:c,children:u,className:h,onMouseDown:m,onTouchStart:f,...g},v){var K,W;const k=l||null,S=e==="target",y=vn(),_=lC(),{connectOnClick:x,noPanClassName:w,rfId:C}=ZQ(),{connectingFrom:T,connectingTo:N,clickConnecting:j,isPossibleEndHandle:A,connectionInProcess:D,clickConnectionInProcess:B,valid:H}=Ot(JQ(_,k,e),mn);_||(W=(K=y.getState()).onError)==null||W.call(K,"010",xi.error010());const V=Z=>{const{defaultEdgeOptions:ee,onConnect:z,hasDefaultEdges:L}=y.getState(),I={...ee,...Z};if(L){const{edges:Y,setEdges:G,onError:se}=y.getState();G(jQ(I,Y,{onError:se}))}z==null||z(I),c==null||c(I)},U=Z=>{if(!_)return;const ee=Bk(Z.nativeEvent);if(i&&(ee&&Z.button===0||!ee)){const z=y.getState();hv.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:S,handleId:k,nodeId:_,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:(...L)=>{var I,Y;return(Y=(I=y.getState()).onConnectEnd)==null?void 0:Y.call(I,...L)},updateConnection:z.updateConnection,onConnect:V,isValidConnection:n||((...L)=>{var I,Y;return((Y=(I=y.getState()).isValidConnection)==null?void 0:Y.call(I,...L))??!0}),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}ee?m==null||m(Z):f==null||f(Z)},P=Z=>{const{onClickConnectStart:ee,onClickConnectEnd:z,connectionClickStartHandle:L,connectionMode:I,isValidConnection:Y,lib:G,rfId:se,nodeLookup:oe,connection:fe}=y.getState();if(!_||!L&&!i)return;if(!L){ee==null||ee(Z.nativeEvent,{nodeId:_,handleId:k,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:_,type:e,id:k}});return}const te=Lk(Z.target),q=n||Y,{connection:ne,isValid:le}=hv.isValid(Z.nativeEvent,{handle:{nodeId:_,id:k,type:e},connectionMode:I,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:q,flowId:se,doc:te,lib:G,nodeLookup:oe});le&&ne&&V(ne);const ye=structuredClone(fe);delete ye.inProgress,ye.toPosition=ye.toHandle?ye.toHandle.position:null,z==null||z(Z,ye),y.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":k,"data-nodeid":_,"data-handlepos":t,"data-id":`${C}-${_}-${k}-${e}`,className:Fn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,h,{source:!S,target:S,connectable:r,connectablestart:i,connectableend:a,clickconnecting:j,connectingfrom:T,connectingto:N,valid:H,connectionindicator:r&&(!D||A)&&(D||B?a:i)}]),onMouseDown:U,onTouchStart:U,onClick:x?P:void 0,ref:v,...g,children:u})}const wa=O.memo(iC(eJ));function tJ({data:e,isConnectable:t,sourcePosition:n=Ze.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(wa,{type:"source",position:n,isConnectable:t})]})}function nJ({data:e,isConnectable:t,targetPosition:n=Ze.Top,sourcePosition:r=Ze.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(wa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,d.jsx(wa,{type:"source",position:r,isConnectable:t})]})}function rJ(){return null}function iJ({data:e,isConnectable:t,targetPosition:n=Ze.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(wa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _d={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},h7={input:tJ,default:nJ,output:iJ,group:rJ};function sJ(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const aJ=e=>{const{width:t,height:n,x:r,y:i}=$u(e.nodeLookup,{filter:a=>!!a.selected});return{width:gi(t)?t:null,height:gi(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function oJ({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=vn(),{width:i,height:a,transformString:l,userSelectionActive:c}=Ot(aJ,mn),u=oC(),h=O.useRef(null);O.useEffect(()=>{var v;n||(v=h.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&i!==null&&a!==null;if(aC({nodeRef:h,disabled:!m}),!m)return null;const f=e?v=>{const k=r.getState().nodes.filter(S=>S.selected);e(v,k)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(_d,v.key)&&(v.preventDefault(),u({direction:_d[v.key],factor:v.shiftKey?4:1}))};return d.jsx("div",{className:Fn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:d.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const d7=typeof window<"u"?window:void 0,lJ=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function uC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:h,selectionOnDrag:m,selectionMode:f,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:y,elementsSelectable:_,zoomOnScroll:x,zoomOnPinch:w,panOnScroll:C,panOnScrollSpeed:T,panOnScrollMode:N,zoomOnDoubleClick:j,panOnDrag:A,autoPanOnSelection:D,defaultViewport:B,translateExtent:H,minZoom:V,maxZoom:U,preventScrolling:P,onSelectionContextMenu:K,noWheelClassName:W,noPanClassName:Z,disableKeyboardA11y:ee,onViewportChange:z,isControlledViewport:L}){const{nodesSelectionActive:I,userSelectionActive:Y}=Ot(lJ,mn),G=ku(h,{target:d7}),se=ku(S,{target:d7}),oe=se||A,fe=se||C,te=m&&oe!==!0,q=G||Y||te;return HQ({deleteKeyCode:u,multiSelectionKeyCode:k}),d.jsx(PQ,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:x,zoomOnPinch:w,panOnScroll:fe,panOnScrollSpeed:T,panOnScrollMode:N,zoomOnDoubleClick:j,panOnDrag:!G&&oe,defaultViewport:B,translateExtent:H,minZoom:V,maxZoom:U,zoomActivationKeyCode:y,preventScrolling:P,noWheelClassName:W,noPanClassName:Z,onViewportChange:z,isControlledViewport:L,paneClickDistance:c,selectionOnDrag:te,children:d.jsxs(VQ,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:l,panOnDrag:oe,autoPanOnSelection:D,isSelecting:!!q,selectionMode:f,selectionKeyPressed:G,paneClickDistance:c,selectionOnDrag:te,children:[e,I&&d.jsx(oJ,{onSelectionContextMenu:K,noPanClassName:Z,disableKeyboardA11y:ee})]})})}uC.displayName="FlowRenderer";const cJ=O.memo(uC),uJ=e=>t=>e?sb(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function hJ(e){return Ot(O.useCallback(uJ(e),[e]),mn)}const dJ=e=>e.updateNodeInternals;function fJ(){const e=Ot(dJ),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function pJ({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=vn(),a=O.useRef(null),l=O.useRef(null),c=O.useRef(e.sourcePosition),u=O.useRef(e.targetPosition),h=O.useRef(t),m=n&&!!e.internals.handleBounds;return O.useEffect(()=>{a.current&&!e.hidden&&(!m||l.current!==a.current)&&(l.current&&(r==null||r.unobserve(l.current)),r==null||r.observe(a.current),l.current=a.current)},[m,e.hidden]),O.useEffect(()=>()=>{l.current&&(r==null||r.unobserve(l.current),l.current=null)},[]),O.useEffect(()=>{if(a.current){const f=h.current!==t,g=c.current!==e.sourcePosition,v=u.current!==e.targetPosition;(f||g||v)&&(h.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function mJ({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:l,nodesDraggable:c,elementsSelectable:u,nodesConnectable:h,nodesFocusable:m,resizeObserver:f,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:k,rfId:S,nodeTypes:y,nodeClickDistance:_,onError:x}){const{node:w,internals:C,isParent:T}=Ot(q=>{const ne=q.nodeLookup.get(e),le=q.parentLookup.has(e);return{node:ne,internals:ne.internals,isParent:le}},mn);let N=w.type||"default",j=(y==null?void 0:y[N])||h7[N];j===void 0&&(x==null||x("003",xi.error003(N)),N="default",j=(y==null?void 0:y.default)||h7.default);const A=!!(w.draggable||c&&typeof w.draggable>"u"),D=!!(w.selectable||u&&typeof w.selectable>"u"),B=!!(w.connectable||h&&typeof w.connectable>"u"),H=!!(w.focusable||m&&typeof w.focusable>"u"),V=vn(),U=Dk(w),P=pJ({node:w,nodeType:N,hasDimensions:U,resizeObserver:f}),K=aC({nodeRef:P,disabled:w.hidden||!A,noDragClassName:g,handleSelector:w.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:_}),W=oC();if(w.hidden)return null;const Z=Ds(w),ee=sJ(w),z=D||A||t||n||r||i,L=n?q=>n(q,{...C.userNode}):void 0,I=r?q=>r(q,{...C.userNode}):void 0,Y=i?q=>i(q,{...C.userNode}):void 0,G=a?q=>a(q,{...C.userNode}):void 0,se=l?q=>l(q,{...C.userNode}):void 0,oe=q=>{const{selectNodesOnDrag:ne,nodeDragThreshold:le}=V.getState();D&&(!ne||!A||le>0)&&dv({id:e,store:V,nodeRef:P}),t&&t(q,{...C.userNode})},fe=q=>{if(!(Ok(q.nativeEvent)||k)){if(wk.includes(q.key)&&D){const ne=q.key==="Escape";dv({id:e,store:V,unselect:ne,nodeRef:P})}else if(A&&w.selected&&Object.prototype.hasOwnProperty.call(_d,q.key)){q.preventDefault();const{ariaLabelConfig:ne}=V.getState();V.setState({ariaLiveMessage:ne["node.a11yDescription.ariaLiveMessage"]({direction:q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),W({direction:_d[q.key],factor:q.shiftKey?4:1})}}},te=()=>{var je;if(k||!((je=P.current)!=null&&je.matches(":focus-visible")))return;const{transform:q,width:ne,height:le,autoPanOnNodeFocus:ye,setCenter:ve}=V.getState();if(!ye)return;sb(new Map([[e,w]]),{x:0,y:0,width:ne,height:le},q,!0).length>0||ve(w.position.x+Z.width/2,w.position.y+Z.height/2,{zoom:q[2]})};return d.jsx("div",{className:Fn(["react-flow__node",`react-flow__node-${N}`,{[v]:A},w.className,{selected:w.selected,selectable:D,parent:T,draggable:A,dragging:K}]),ref:P,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:U?"visible":"hidden",...w.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:I,onMouseLeave:Y,onContextMenu:G,onClick:oe,onDoubleClick:se,onKeyDown:H?fe:void 0,tabIndex:H?0:void 0,onFocus:H?te:void 0,role:w.ariaRole??(H?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${eC}-${S}`,"aria-label":w.ariaLabel,...w.domAttributes,children:d.jsx(YQ,{value:e,children:d.jsx(j,{id:e,data:w.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:w.selected??!1,selectable:D,draggable:A,deletable:w.deletable??!0,isConnectable:B,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:K,dragHandle:w.dragHandle,zIndex:C.z,parentId:w.parentId,...Z})})})}var gJ=O.memo(mJ);const vJ=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Ot(vJ,mn),l=hJ(e.onlyRenderVisibleElements),c=fJ();return d.jsx("div",{className:"react-flow__nodes",style:kf,children:l.map(u=>d.jsx(gJ,{id:u,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:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}hC.displayName="NodeRenderer";const bJ=O.memo(hC);function yJ(e){return Ot(O.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),l=n.nodeLookup.get(i.target);a&&l&&hZ({sourceNode:a,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),mn)}const _J=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},xJ=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},f7={[vd.Arrow]:_J,[vd.ArrowClosed]:xJ};function wJ(e){const t=vn();return O.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(f7,e)?f7[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",xi.error009(e)),null)},[e])}const SJ=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=wJ(t);return u?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0",children:d.jsx(u,{color:n,strokeWidth:l})}):null},dC=({defaultColor:e,rfId:t})=>{const n=Ot(a=>a.edges),r=Ot(a=>a.defaultEdgeOptions),i=O.useMemo(()=>yZ(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:i.map(a=>d.jsx(SJ,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};dC.displayName="MarkerDefinitions";var kJ=O.memo(dC);function fC({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:h,...m}){const[f,g]=O.useState({x:1,y:0,width:0,height:0}),v=Fn(["react-flow__edge-textwrapper",h]),k=O.useRef(null);return O.useEffect(()=>{if(k.current){const S=k.current.getBBox();g({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),n?d.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:v,visibility:f.width?"visible":"hidden",...m,children:[i&&d.jsx("rect",{width:f.width+2*l[0],x:-l[0],y:-l[1],height:f.height+2*l[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),d.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:k,style:r,children:n}),u]}):null}fC.displayName="EdgeText";const CJ=O.memo(fC);function Cf({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:h=20,...m}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...m,d:e,fill:"none",className:Fn(["react-flow__edge-path",m.className])}),h?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,r&&gi(t)&&gi(n)?d.jsx(CJ,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function p7({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ze.Left||e===Ze.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function pC({sourceX:e,sourceY:t,sourcePosition:n=Ze.Bottom,targetX:r,targetY:i,targetPosition:a=Ze.Top}){const[l,c]=p7({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,h]=p7({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,f,g,v]=zk({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${t} C${l},${c} ${u},${h} ${r},${i}`,m,f,g,v]}function mC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:S,markerStart:y,interactionWidth:_})=>{const[x,w,C]=pC({sourceX:n,sourceY:r,sourcePosition:l,targetX:i,targetY:a,targetPosition:c}),T=e.isInternal?void 0:t;return d.jsx(Cf,{id:T,path:x,labelX:w,labelY:C,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:S,markerStart:y,interactionWidth:_})})}const EJ=mC({isInternal:!1}),gC=mC({isInternal:!0});EJ.displayName="SimpleBezierEdge";gC.displayName="SimpleBezierEdgeInternal";function vC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:f,style:g,sourcePosition:v=Ze.Bottom,targetPosition:k=Ze.Top,markerEnd:S,markerStart:y,pathOptions:_,interactionWidth:x})=>{const[w,C,T]=lv({sourceX:n,sourceY:r,sourcePosition:v,targetX:i,targetY:a,targetPosition:k,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset,stepPosition:_==null?void 0:_.stepPosition}),N=e.isInternal?void 0:t;return d.jsx(Cf,{id:N,path:w,labelX:C,labelY:T,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:S,markerStart:y,interactionWidth:x})})}const bC=vC({isInternal:!1}),yC=vC({isInternal:!0});bC.displayName="SmoothStepEdge";yC.displayName="SmoothStepEdgeInternal";function _C(e){return O.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return d.jsx(bC,{...n,id:r,pathOptions:O.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const NJ=_C({isInternal:!1}),xC=_C({isInternal:!0});NJ.displayName="StepEdge";xC.displayName="StepEdgeInternal";function wC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:v,markerStart:k,interactionWidth:S})=>{const[y,_,x]=Fk({sourceX:n,sourceY:r,targetX:i,targetY:a}),w=e.isInternal?void 0:t;return d.jsx(Cf,{id:w,path:y,labelX:_,labelY:x,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:v,markerStart:k,interactionWidth:S})})}const AJ=wC({isInternal:!1}),SC=wC({isInternal:!0});AJ.displayName="StraightEdge";SC.displayName="StraightEdgeInternal";function kC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:l=Ze.Bottom,targetPosition:c=Ze.Top,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:S,markerStart:y,pathOptions:_,interactionWidth:x})=>{const[w,C,T]=Ik({sourceX:n,sourceY:r,sourcePosition:l,targetX:i,targetY:a,targetPosition:c,curvature:_==null?void 0:_.curvature}),N=e.isInternal?void 0:t;return d.jsx(Cf,{id:N,path:w,labelX:C,labelY:T,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:S,markerStart:y,interactionWidth:x})})}const TJ=kC({isInternal:!1}),CC=kC({isInternal:!0});TJ.displayName="BezierEdge";CC.displayName="BezierEdgeInternal";const m7={default:CC,straight:SC,step:xC,smoothstep:yC,simplebezier:gC},g7={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},MJ=(e,t,n)=>n===Ze.Left?e-t:n===Ze.Right?e+t:e,jJ=(e,t,n)=>n===Ze.Top?e-t:n===Ze.Bottom?e+t:e,v7="react-flow__edgeupdater";function b7({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:l,type:c}){return d.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:l,className:Fn([v7,`${v7}-${c}`]),cx:MJ(t,r,e),cy:jJ(n,r,e),r,stroke:"transparent",fill:"transparent"})}function DJ({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:l,sourcePosition:c,targetPosition:u,onReconnect:h,onReconnectStart:m,onReconnectEnd:f,setReconnecting:g,setUpdateHover:v}){const k=vn(),S=(C,T)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:j,connectionMode:A,connectionRadius:D,lib:B,onConnectStart:H,cancelConnection:V,nodeLookup:U,rfId:P,panBy:K,updateConnection:W}=k.getState(),Z=T.type==="target",ee=(I,Y)=>{g(!1),f==null||f(I,n,T.type,Y)},z=I=>h==null?void 0:h(n,I),L=(I,Y)=>{g(!0),m==null||m(C,n,T.type),H==null||H(I,Y)};hv.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:A,connectionRadius:D,domNode:j,handleId:T.id,nodeId:T.nodeId,nodeLookup:U,isTarget:Z,edgeUpdaterType:T.type,lib:B,flowId:P,cancelConnection:V,panBy:K,isValidConnection:(...I)=>{var Y,G;return((G=(Y=k.getState()).isValidConnection)==null?void 0:G.call(Y,...I))??!0},onConnect:z,onConnectStart:L,onConnectEnd:(...I)=>{var Y,G;return(G=(Y=k.getState()).onConnectEnd)==null?void 0:G.call(Y,...I)},onReconnectEnd:ee,updateConnection:W,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},y=C=>S(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=C=>S(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>v(!0),w=()=>v(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(b7,{position:c,centerX:r,centerY:i,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:w,type:"source"}),(e===!0||e==="target")&&d.jsx(b7,{position:u,centerX:a,centerY:l,radius:t,onMouseDown:_,onMouseEnter:x,onMouseOut:w,type:"target"})]})}function RJ({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:h,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:v,rfId:k,edgeTypes:S,noPanClassName:y,onError:_,disableKeyboardA11y:x}){let w=Ot(ve=>ve.edgeLookup.get(e));const C=Ot(ve=>ve.defaultEdgeOptions);w=C?{...C,...w}:w;let T=w.type||"default",N=(S==null?void 0:S[T])||m7[T];N===void 0&&(_==null||_("011",xi.error011(T)),T="default",N=(S==null?void 0:S.default)||m7.default);const j=!!(w.focusable||t&&typeof w.focusable>"u"),A=typeof f<"u"&&(w.reconnectable||n&&typeof w.reconnectable>"u"),D=!!(w.selectable||r&&typeof w.selectable>"u"),B=O.useRef(null),[H,V]=O.useState(!1),[U,P]=O.useState(!1),K=vn(),{zIndex:W=w.zIndex,sourceX:Z,sourceY:ee,targetX:z,targetY:L,sourcePosition:I,targetPosition:Y}=Ot(O.useCallback(ve=>{const Ee=ve.nodeLookup.get(w.source),je=ve.nodeLookup.get(w.target);if(!Ee||!je)return g7;const Pe=bZ({id:e,sourceNode:Ee,targetNode:je,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:ve.connectionMode,onError:_}),$e=uZ({selected:w.selected,zIndex:w.zIndex,sourceNode:Ee,targetNode:je,elevateOnSelect:ve.elevateEdgesOnSelect,zIndexMode:ve.zIndexMode});return{...Pe||g7,zIndex:$e}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),mn),G=O.useMemo(()=>w.markerStart?`url('#${cv(w.markerStart,k)}')`:void 0,[w.markerStart,k]),se=O.useMemo(()=>w.markerEnd?`url('#${cv(w.markerEnd,k)}')`:void 0,[w.markerEnd,k]);if(w.hidden||Z===null||ee===null||z===null||L===null)return null;const oe=ve=>{var $e;const{addSelectedEdges:Ee,unselectNodesAndEdges:je,multiSelectionActive:Pe}=K.getState();D&&(K.setState({nodesSelectionActive:!1}),w.selected&&Pe?(je({nodes:[],edges:[w]}),($e=B.current)==null||$e.blur()):Ee([e])),i&&i(ve,w)},fe=a?ve=>{a(ve,{...w})}:void 0,te=l?ve=>{l(ve,{...w})}:void 0,q=c?ve=>{c(ve,{...w})}:void 0,ne=u?ve=>{u(ve,{...w})}:void 0,le=h?ve=>{h(ve,{...w})}:void 0,ye=ve=>{var Ee;if(!x&&wk.includes(ve.key)&&D){const{unselectNodesAndEdges:je,addSelectedEdges:Pe}=K.getState();ve.key==="Escape"?((Ee=B.current)==null||Ee.blur(),je({edges:[w]})):Pe([e])}};return d.jsx("svg",{style:{zIndex:W},children:d.jsxs("g",{className:Fn(["react-flow__edge",`react-flow__edge-${T}`,w.className,y,{selected:w.selected,animated:w.animated,inactive:!D&&!i,updating:H,selectable:D}]),onClick:oe,onDoubleClick:fe,onContextMenu:te,onMouseEnter:q,onMouseMove:ne,onMouseLeave:le,onKeyDown:j?ye:void 0,tabIndex:j?0:void 0,role:w.ariaRole??(j?"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":j?`${tC}-${k}`:void 0,ref:B,...w.domAttributes,children:[!U&&d.jsx(N,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:D,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:Z,sourceY:ee,targetX:z,targetY:L,sourcePosition:I,targetPosition:Y,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:G,markerEnd:se,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),A&&d.jsx(DJ,{edge:w,isReconnectable:A,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:v,sourceX:Z,sourceY:ee,targetX:z,targetY:L,sourcePosition:I,targetPosition:Y,setUpdateHover:V,setReconnecting:P})]})})}var LJ=O.memo(RJ);const OJ=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function EC({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:f,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:k,disableKeyboardA11y:S}){const{edgesFocusable:y,edgesReconnectable:_,elementsSelectable:x,onError:w}=Ot(OJ,mn),C=yJ(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(kJ,{defaultColor:e,rfId:n}),C.map(T=>d.jsx(LJ,{id:T,edgesFocusable:y,edgesReconnectable:_,elementsSelectable:x,noPanClassName:i,onReconnect:a,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:h,onClick:m,reconnectRadius:f,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:k,rfId:n,onError:w,edgeTypes:r,disableKeyboardA11y:S},T))]})}EC.displayName="EdgeRenderer";const BJ=O.memo(EC),zJ=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function IJ({children:e}){const t=Ot(zJ);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function HJ(e){const t=pb(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const FJ=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function $J(e){const t=Ot(FJ),n=vn();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function PJ(e){return e.connection.inProgress?{...e.connection,to:Uu(e.connection.to,e.transform)}:{...e.connection}}function UJ(e){return PJ}function qJ(e){const t=UJ();return Ot(t,mn)}const GJ=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function VJ({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:l,isValid:c,inProgress:u}=Ot(GJ,mn);return!(a&&i&&u)?null:d.jsx("svg",{style:e,width:a,height:l,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:Fn(["react-flow__connection",Ck(c)]),children:d.jsx(NC,{style:t,type:n,CustomComponent:r,isValid:c})})})}const NC=({style:e,type:t=da.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:l,fromHandle:c,fromPosition:u,to:h,toNode:m,toHandle:f,toPosition:g,pointer:v}=qJ();if(!i)return;if(n)return d.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:a.x,fromY:a.y,toX:h.x,toY:h.y,fromPosition:u,toPosition:g,connectionStatus:Ck(r),toNode:m,toHandle:f,pointer:v});let k="";const S={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:h.x,targetY:h.y,targetPosition:g};switch(t){case da.Bezier:[k]=Ik(S);break;case da.SimpleBezier:[k]=pC(S);break;case da.Step:[k]=lv({...S,borderRadius:0});break;case da.SmoothStep:[k]=lv(S);break;default:[k]=Fk(S)}return d.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};NC.displayName="ConnectionLine";const WJ={};function y7(e=WJ){O.useRef(e),vn(),O.useEffect(()=>{},[e])}function YJ(){vn(),O.useRef(!1),O.useEffect(()=>{},[])}function AC({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:f,onSelectionStart:g,onSelectionEnd:v,connectionLineType:k,connectionLineStyle:S,connectionLineComponent:y,connectionLineContainerStyle:_,selectionKeyCode:x,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:T,panActivationKeyCode:N,zoomActivationKeyCode:j,deleteKeyCode:A,onlyRenderVisibleElements:D,elementsSelectable:B,defaultViewport:H,translateExtent:V,minZoom:U,maxZoom:P,preventScrolling:K,defaultMarkerColor:W,zoomOnScroll:Z,zoomOnPinch:ee,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:I,zoomOnDoubleClick:Y,panOnDrag:G,autoPanOnSelection:se,onPaneClick:oe,onPaneMouseEnter:fe,onPaneMouseMove:te,onPaneMouseLeave:q,onPaneScroll:ne,onPaneContextMenu:le,paneClickDistance:ye,nodeClickDistance:ve,onEdgeContextMenu:Ee,onEdgeMouseEnter:je,onEdgeMouseMove:Pe,onEdgeMouseLeave:$e,reconnectRadius:Be,onReconnect:Nt,onReconnectStart:Rt,onReconnectEnd:Lt,noDragClassName:Ft,noWheelClassName:an,noPanClassName:wt,disableKeyboardA11y:Je,nodeExtent:pt,rfId:_e,viewport:Ne,onViewportChange:He}){return y7(e),y7(t),YJ(),HJ(n),$J(Ne),d.jsx(cJ,{onPaneClick:oe,onPaneMouseEnter:fe,onPaneMouseMove:te,onPaneMouseLeave:q,onPaneContextMenu:le,onPaneScroll:ne,paneClickDistance:ye,deleteKeyCode:A,selectionKeyCode:x,selectionOnDrag:w,selectionMode:C,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:T,panActivationKeyCode:N,zoomActivationKeyCode:j,elementsSelectable:B,zoomOnScroll:Z,zoomOnPinch:ee,zoomOnDoubleClick:Y,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:I,panOnDrag:G,autoPanOnSelection:se,defaultViewport:H,translateExtent:V,minZoom:U,maxZoom:P,onSelectionContextMenu:f,preventScrolling:K,noDragClassName:Ft,noWheelClassName:an,noPanClassName:wt,disableKeyboardA11y:Je,onViewportChange:He,isControlledViewport:!!Ne,children:d.jsxs(IJ,{children:[d.jsx(BJ,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:l,onReconnect:Nt,onReconnectStart:Rt,onReconnectEnd:Lt,onlyRenderVisibleElements:D,onEdgeContextMenu:Ee,onEdgeMouseEnter:je,onEdgeMouseMove:Pe,onEdgeMouseLeave:$e,reconnectRadius:Be,defaultMarkerColor:W,noPanClassName:wt,disableKeyboardA11y:Je,rfId:_e}),d.jsx(VJ,{style:S,type:k,component:y,containerStyle:_}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(bJ,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:ve,onlyRenderVisibleElements:D,noPanClassName:wt,noDragClassName:Ft,disableKeyboardA11y:Je,nodeExtent:pt,rfId:_e}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}AC.displayName="GraphView";const XJ=O.memo(AC),KJ=jk(),_7=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u=.5,maxZoom:h=2,nodeOrigin:m,nodeExtent:f,zIndexMode:g="basic"}={})=>{const v=new Map,k=new Map,S=new Map,y=new Map,_=r??t??[],x=n??e??[],w=m??[0,0],C=f??_u;Uk(S,y,_);const{nodesInitialized:T}=uv(x,v,k,{nodeOrigin:w,nodeExtent:C,zIndexMode:g});let N=[0,0,1];if(l&&i&&a){const j=$u(v,{filter:H=>!!((H.width||H.initialWidth)&&(H.height||H.initialHeight))}),{x:A,y:D,zoom:B}=ob(j,i,a,u,h,(c==null?void 0:c.padding)??.1);N=[A,D,B]}return{rfId:"1",width:i??0,height:a??0,transform:N,nodes:x,nodesInitialized:T,nodeLookup:v,parentLookup:k,edges:_,edgeLookup:y,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:h,translateExtent:_u,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:jl.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:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...kk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:KJ,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Sk,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},ZJ=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:m,nodeExtent:f,zIndexMode:g})=>oQ((v,k)=>{async function S(){const{nodeLookup:y,panZoom:_,fitViewOptions:x,fitViewResolver:w,width:C,height:T,minZoom:N,maxZoom:j}=k();_&&(await rZ({nodes:y,width:C,height:T,panZoom:_,minZoom:N,maxZoom:j},x),w==null||w.resolve(!0),v({fitViewResolver:null}))}return{..._7({nodes:e,edges:t,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:m,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:y=>{const{nodeLookup:_,parentLookup:x,nodeOrigin:w,elevateNodesOnSelect:C,fitViewQueued:T,zIndexMode:N,nodesSelectionActive:j}=k(),{nodesInitialized:A,hasSelectedNodes:D}=uv(y,_,x,{nodeOrigin:w,nodeExtent:f,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),B=j&&D;T&&A?(S(),v({nodes:y,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):v({nodes:y,nodesInitialized:A,nodesSelectionActive:B})},setEdges:y=>{const{connectionLookup:_,edgeLookup:x}=k();Uk(_,x,y),v({edges:y})},setDefaultNodesAndEdges:(y,_)=>{if(y){const{setNodes:x}=k();x(y),v({hasDefaultNodes:!0})}if(_){const{setEdges:x}=k();x(_),v({hasDefaultEdges:!0})}},updateNodeInternals:y=>{const{triggerNodeChanges:_,nodeLookup:x,parentLookup:w,domNode:C,nodeOrigin:T,nodeExtent:N,debug:j,fitViewQueued:A,zIndexMode:D}=k(),{changes:B,updatedInternals:H}=EZ(y,x,w,C,T,N,D);H&&(wZ(x,w,{nodeOrigin:T,nodeExtent:N,zIndexMode:D}),A?(S(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(j&&console.log("React Flow: trigger node changes",B),_==null||_(B)))},updateNodePositions:(y,_=!1)=>{const x=[];let w=[];const{nodeLookup:C,triggerNodeChanges:T,connection:N,updateConnection:j,onNodesChangeMiddlewareMap:A}=k();for(const[D,B]of y){const H=C.get(D),V=!!(H!=null&&H.expandParent&&(H!=null&&H.parentId)&&(B!=null&&B.position)),U={id:D,type:"position",position:V?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:_};if(H&&N.inProgress&&N.fromNode.id===H.id){const P=fo(H,N.fromHandle,Ze.Left,!0);j({...N,from:P})}V&&H.parentId&&x.push({id:D,parentId:H.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),w.push(U)}if(x.length>0){const{parentLookup:D,nodeOrigin:B}=k(),H=fb(x,C,D,B);w.push(...H)}for(const D of A.values())w=D(w);T(w)},triggerNodeChanges:y=>{const{onNodesChange:_,setNodes:x,nodes:w,hasDefaultNodes:C,debug:T}=k();if(y!=null&&y.length){if(C){const N=AQ(y,w);x(N)}T&&console.log("React Flow: trigger node changes",y),_==null||_(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:_,setEdges:x,edges:w,hasDefaultEdges:C,debug:T}=k();if(y!=null&&y.length){if(C){const N=TQ(y,w);x(N)}T&&console.log("React Flow: trigger edge changes",y),_==null||_(y)}},addSelectedNodes:y=>{const{multiSelectionActive:_,edgeLookup:x,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:T}=k();if(_){const N=y.map(j=>Za(j,!0));C(N);return}C(bl(w,new Set([...y]),!0)),T(bl(x))},addSelectedEdges:y=>{const{multiSelectionActive:_,edgeLookup:x,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:T}=k();if(_){const N=y.map(j=>Za(j,!0));T(N);return}T(bl(x,new Set([...y]))),C(bl(w,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:_}={})=>{const{edges:x,nodes:w,nodeLookup:C,triggerNodeChanges:T,triggerEdgeChanges:N}=k(),j=y||w,A=_||x,D=[];for(const H of j){if(!H.selected)continue;const V=C.get(H.id);V&&(V.selected=!1),D.push(Za(H.id,!1))}const B=[];for(const H of A)H.selected&&B.push(Za(H.id,!1));T(D),N(B)},setMinZoom:y=>{const{panZoom:_,maxZoom:x}=k();_==null||_.setScaleExtent([y,x]),v({minZoom:y})},setMaxZoom:y=>{const{panZoom:_,minZoom:x}=k();_==null||_.setScaleExtent([x,y]),v({maxZoom:y})},setTranslateExtent:y=>{var _;(_=k().panZoom)==null||_.setTranslateExtent(y),v({translateExtent:y})},resetSelectedElements:()=>{const{edges:y,nodes:_,triggerNodeChanges:x,triggerEdgeChanges:w,elementsSelectable:C}=k();if(!C)return;const T=_.reduce((j,A)=>A.selected?[...j,Za(A.id,!1)]:j,[]),N=y.reduce((j,A)=>A.selected?[...j,Za(A.id,!1)]:j,[]);x(T),w(N)},setNodeExtent:y=>{const{nodes:_,nodeLookup:x,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:T,nodeExtent:N,zIndexMode:j}=k();y[0][0]===N[0][0]&&y[0][1]===N[0][1]&&y[1][0]===N[1][0]&&y[1][1]===N[1][1]||(uv(_,x,w,{nodeOrigin:C,nodeExtent:y,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:j}),v({nodeExtent:y}))},panBy:y=>{const{transform:_,width:x,height:w,panZoom:C,translateExtent:T}=k();return NZ({delta:y,panZoom:C,transform:_,translateExtent:T,width:x,height:w})},setCenter:async(y,_,x)=>{const{width:w,height:C,maxZoom:T,panZoom:N}=k();if(!N)return!1;const j=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:T;return await N.setViewport({x:w/2-y*j,y:C/2-_*j,zoom:j},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{v({connection:{...kk}})},updateConnection:y=>{v({connection:y})},reset:()=>v({..._7()})}},Object.is);function QJ({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:u,fitView:h,nodeOrigin:m,nodeExtent:f,zIndexMode:g,children:v}){const[k]=O.useState(()=>ZJ({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:h,minZoom:l,maxZoom:c,fitViewOptions:u,nodeOrigin:m,nodeExtent:f,zIndexMode:g}));return d.jsx(lQ,{value:k,children:d.jsx(OQ,{children:d.jsx(KQ,{children:v})})})}function JJ({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:l,fitView:c,fitViewOptions:u,minZoom:h,maxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:v}){return O.useContext(wf)?d.jsx(d.Fragment,{children:e}):d.jsx(QJ,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:l,fitView:c,initialFitViewOptions:u,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:v,children:e})}const eee={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function tee({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:l,onNodeClick:c,onEdgeClick:u,onInit:h,onMove:m,onMoveStart:f,onMoveEnd:g,onConnect:v,onConnectStart:k,onConnectEnd:S,onClickConnectStart:y,onClickConnectEnd:_,onNodeMouseEnter:x,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:N,onNodeDragStart:j,onNodeDrag:A,onNodeDragStop:D,onNodesDelete:B,onEdgesDelete:H,onDelete:V,onSelectionChange:U,onSelectionDragStart:P,onSelectionDrag:K,onSelectionDragStop:W,onSelectionContextMenu:Z,onSelectionStart:ee,onSelectionEnd:z,onBeforeDelete:L,connectionMode:I,connectionLineType:Y=da.Bezier,connectionLineStyle:G,connectionLineComponent:se,connectionLineContainerStyle:oe,deleteKeyCode:fe="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:q=!1,selectionMode:ne=xu.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:ye=Su()?"Meta":"Control",zoomActivationKeyCode:ve=Su()?"Meta":"Control",snapToGrid:Ee,snapGrid:je,onlyRenderVisibleElements:Pe=!1,selectNodesOnDrag:$e,nodesDraggable:Be,autoPanOnNodeFocus:Nt,nodesConnectable:Rt,nodesFocusable:Lt,nodeOrigin:Ft=nC,edgesFocusable:an,edgesReconnectable:wt,elementsSelectable:Je=!0,defaultViewport:pt=xQ,minZoom:_e=.5,maxZoom:Ne=2,translateExtent:He=_u,preventScrolling:Qe=!0,nodeExtent:rt,defaultMarkerColor:$t="#b1b1b7",zoomOnScroll:ct=!0,zoomOnPinch:Fe=!0,panOnScroll:et=!1,panOnScrollSpeed:_t=.5,panOnScrollMode:ut=ro.Free,zoomOnDoubleClick:on=!0,panOnDrag:Gn=!0,onPaneClick:hn,onPaneMouseEnter:xn,onPaneMouseMove:vt,onPaneMouseLeave:wn,onPaneScroll:At,onPaneContextMenu:Vr,paneClickDistance:Mn=1,nodeClickDistance:ki=0,children:Rs,onReconnect:Er,onReconnectStart:jn,onReconnectEnd:hr,onEdgeContextMenu:li,onEdgeDoubleClick:ge,onEdgeMouseEnter:De,onEdgeMouseMove:it,onEdgeMouseLeave:Ge,reconnectRadius:zt=10,onNodesChange:Wt,onEdgesChange:dn,noDragClassName:Bt="nodrag",noWheelClassName:$n="nowheel",noPanClassName:Wr="nopan",fitView:ci,fitViewOptions:ko,connectOnClick:Gl,attributionPosition:Ls,proOptions:Ci,defaultEdgeOptions:Os,elevateNodesOnSelect:Ei=!0,elevateEdgesOnSelect:Yr=!1,disableKeyboardA11y:Ni=!1,autoPanOnConnect:Ai,autoPanOnNodeDrag:Sn,autoPanOnSelection:Co=!0,autoPanSpeed:Ti,connectionRadius:dr,isValidConnection:Xr,onError:Vl,style:Xi,id:Bs,nodeDragThreshold:Wl,connectionDragThreshold:Ki,viewport:Zi,onViewportChange:fr,width:Xn,height:Ea,colorMode:Eo="light",debug:ce,onScroll:Se,ariaLabelConfig:Me,zIndexMode:Ie="basic",...Ve},at){const Jt=Bs||"1",Pt=CQ(Eo),en=O.useCallback(zs=>{zs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Se==null||Se(zs)},[Se]);return d.jsx("div",{"data-testid":"rf__wrapper",...Ve,onScroll:en,style:{...Xi,...eee},ref:at,className:Fn(["react-flow",i,Pt]),id:Bs,role:"application",children:d.jsxs(JJ,{nodes:e,edges:t,width:Xn,height:Ea,fitView:ci,fitViewOptions:ko,minZoom:_e,maxZoom:Ne,nodeOrigin:Ft,nodeExtent:rt,zIndexMode:Ie,children:[d.jsx(kQ,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:k,onConnectEnd:S,onClickConnectStart:y,onClickConnectEnd:_,nodesDraggable:Be,autoPanOnNodeFocus:Nt,nodesConnectable:Rt,nodesFocusable:Lt,edgesFocusable:an,edgesReconnectable:wt,elementsSelectable:Je,elevateNodesOnSelect:Ei,elevateEdgesOnSelect:Yr,minZoom:_e,maxZoom:Ne,nodeExtent:rt,onNodesChange:Wt,onEdgesChange:dn,snapToGrid:Ee,snapGrid:je,connectionMode:I,translateExtent:He,connectOnClick:Gl,defaultEdgeOptions:Os,fitView:ci,fitViewOptions:ko,onNodesDelete:B,onEdgesDelete:H,onDelete:V,onNodeDragStart:j,onNodeDrag:A,onNodeDragStop:D,onSelectionDrag:K,onSelectionDragStart:P,onSelectionDragStop:W,onMove:m,onMoveStart:f,onMoveEnd:g,noPanClassName:Wr,nodeOrigin:Ft,rfId:Jt,autoPanOnConnect:Ai,autoPanOnNodeDrag:Sn,autoPanSpeed:Ti,onError:Vl,connectionRadius:dr,isValidConnection:Xr,selectNodesOnDrag:$e,nodeDragThreshold:Wl,connectionDragThreshold:Ki,onBeforeDelete:L,debug:ce,ariaLabelConfig:Me,zIndexMode:Ie}),d.jsx(XJ,{onInit:h,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:x,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:N,nodeTypes:a,edgeTypes:l,connectionLineType:Y,connectionLineStyle:G,connectionLineComponent:se,connectionLineContainerStyle:oe,selectionKeyCode:te,selectionOnDrag:q,selectionMode:ne,deleteKeyCode:fe,multiSelectionKeyCode:ye,panActivationKeyCode:le,zoomActivationKeyCode:ve,onlyRenderVisibleElements:Pe,defaultViewport:pt,translateExtent:He,minZoom:_e,maxZoom:Ne,preventScrolling:Qe,zoomOnScroll:ct,zoomOnPinch:Fe,zoomOnDoubleClick:on,panOnScroll:et,panOnScrollSpeed:_t,panOnScrollMode:ut,panOnDrag:Gn,autoPanOnSelection:Co,onPaneClick:hn,onPaneMouseEnter:xn,onPaneMouseMove:vt,onPaneMouseLeave:wn,onPaneScroll:At,onPaneContextMenu:Vr,paneClickDistance:Mn,nodeClickDistance:ki,onSelectionContextMenu:Z,onSelectionStart:ee,onSelectionEnd:z,onReconnect:Er,onReconnectStart:jn,onReconnectEnd:hr,onEdgeContextMenu:li,onEdgeDoubleClick:ge,onEdgeMouseEnter:De,onEdgeMouseMove:it,onEdgeMouseLeave:Ge,reconnectRadius:zt,defaultMarkerColor:$t,noDragClassName:Bt,noWheelClassName:$n,noPanClassName:Wr,rfId:Jt,disableKeyboardA11y:Ni,nodeExtent:rt,viewport:Zi,onViewportChange:fr}),d.jsx(_Q,{onSelectionChange:U}),Rs,d.jsx(mQ,{proOptions:Ci,position:Ls}),d.jsx(pQ,{rfId:Jt,disableKeyboardA11y:Ni})]})})}var nee=iC(tee);function ree({dimensions:e,lineWidth:t,variant:n,className:r}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Fn(["react-flow__background-pattern",n,r])})}function iee({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:Fn(["react-flow__background-pattern","dots",t])})}var _s;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(_s||(_s={}));const see={[_s.Dots]:1,[_s.Lines]:1,[_s.Cross]:6},aee=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function TC({id:e,variant:t=_s.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:l,bgColor:c,style:u,className:h,patternClassName:m}){const f=O.useRef(null),{transform:g,patternId:v}=Ot(aee,mn),k=r||see[t],S=t===_s.Dots,y=t===_s.Cross,_=Array.isArray(n)?n:[n,n],x=[_[0]*g[2]||1,_[1]*g[2]||1],w=k*g[2],C=Array.isArray(a)?a:[a,a],T=y?[w,w]:x,N=[C[0]*g[2]||1+T[0]/2,C[1]*g[2]||1+T[1]/2],j=`${v}${e||""}`;return d.jsxs("svg",{className:Fn(["react-flow__background",h]),style:{...u,...kf,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:f,"data-testid":"rf__background",children:[d.jsx("pattern",{id:j,x:g[0]%x[0],y:g[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?d.jsx(iee,{radius:w/2,className:m}):d.jsx(ree,{dimensions:T,lineWidth:i,variant:t,className:m})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}TC.displayName="Background";const oee=O.memo(TC);function lee(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cee(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function uee(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.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 hee(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 dee(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 T0({children:e,className:t,...n}){return d.jsx("button",{type:"button",className:Fn(["react-flow__controls-button",t]),...n,children:e})}const fee=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function MC({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:l,onFitView:c,onInteractiveChange:u,className:h,children:m,position:f="bottom-left",orientation:g="vertical","aria-label":v}){const k=vn(),{isInteractive:S,minZoomReached:y,maxZoomReached:_,ariaLabelConfig:x}=Ot(fee,mn),{zoomIn:w,zoomOut:C,fitView:T}=pb(),N=()=>{w(),a==null||a()},j=()=>{C(),l==null||l()},A=()=>{T(i),c==null||c()},D=()=>{k.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),u==null||u(!S)},B=g==="horizontal"?"horizontal":"vertical";return d.jsxs(Sf,{className:Fn(["react-flow__controls",B,h]),position:f,style:e,"data-testid":"rf__controls","aria-label":v??x["controls.ariaLabel"],children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(T0,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:_,children:d.jsx(lee,{})}),d.jsx(T0,{onClick:j,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:y,children:d.jsx(cee,{})})]}),n&&d.jsx(T0,{className:"react-flow__controls-fitview",onClick:A,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:d.jsx(uee,{})}),r&&d.jsx(T0,{className:"react-flow__controls-interactive",onClick:D,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:S?d.jsx(dee,{}):d.jsx(hee,{})}),m]})}MC.displayName="Controls";O.memo(MC);function pee({id:e,x:t,y:n,width:r,height:i,style:a,color:l,strokeColor:c,strokeWidth:u,className:h,borderRadius:m,shapeRendering:f,selected:g,onClick:v}){const{background:k,backgroundColor:S}=a||{},y=l||k||S;return d.jsx("rect",{className:Fn(["react-flow__minimap-node",{selected:g},h]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:y,stroke:c,strokeWidth:u},shapeRendering:f,onClick:v?_=>v(_,e):void 0})}const mee=O.memo(pee),gee=e=>e.nodes.map(t=>t.id),$1=e=>e instanceof Function?e:()=>e;function vee({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=mee,onClick:l}){const c=Ot(gee,mn),u=$1(t),h=$1(e),m=$1(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:c.map(g=>d.jsx(yee,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:l,shapeRendering:f},g))})}function bee({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:l,NodeComponent:c,onClick:u}){const{node:h,x:m,y:f,width:g,height:v}=Ot(k=>{const S=k.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const y=S.internals.userNode,{x:_,y:x}=S.internals.positionAbsolute,{width:w,height:C}=Ds(y);return{node:y,x:_,y:x,width:w,height:C}},mn);return!h||h.hidden||!Dk(h)?null:d.jsx(c,{x:m,y:f,width:g,height:v,style:h.style,selected:!!h.selected,className:r(h),color:t(h),borderRadius:i,strokeColor:n(h),strokeWidth:a,shapeRendering:l,onClick:u,id:h.id})}const yee=O.memo(bee);var _ee=O.memo(vee);const xee=200,wee=150,See=e=>!e.hidden,kee=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Tk($u(e.nodeLookup,{filter:See}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Cee="react-flow__minimap-desc";function jC({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:u,maskColor:h,maskStrokeColor:m,maskStrokeWidth:f,position:g="bottom-right",onClick:v,onNodeClick:k,pannable:S=!1,zoomable:y=!1,ariaLabel:_,inversePan:x,zoomStep:w=1,offsetScale:C=5}){const T=vn(),N=O.useRef(null),{boundingRect:j,viewBB:A,rfId:D,panZoom:B,translateExtent:H,flowWidth:V,flowHeight:U,ariaLabelConfig:P}=Ot(kee,mn),K=(e==null?void 0:e.width)??xee,W=(e==null?void 0:e.height)??wee,Z=j.width/K,ee=j.height/W,z=Math.max(Z,ee),L=z*K,I=z*W,Y=C*z,G=j.x-(L-j.width)/2-Y,se=j.y-(I-j.height)/2-Y,oe=L+Y*2,fe=I+Y*2,te=`${Cee}-${D}`,q=O.useRef(0),ne=O.useRef();q.current=z,O.useEffect(()=>{if(N.current&&B)return ne.current=BZ({domNode:N.current,panZoom:B,getTransform:()=>T.getState().transform,getViewScale:()=>q.current}),()=>{var Ee;(Ee=ne.current)==null||Ee.destroy()}},[B]),O.useEffect(()=>{var Ee;(Ee=ne.current)==null||Ee.update({translateExtent:H,width:V,height:U,inversePan:x,pannable:S,zoomStep:w,zoomable:y})},[S,y,x,w,H,V,U]);const le=v?Ee=>{var $e;const[je,Pe]=(($e=ne.current)==null?void 0:$e.pointer(Ee))||[0,0];v(Ee,{x:je,y:Pe})}:void 0,ye=k?O.useCallback((Ee,je)=>{const Pe=T.getState().nodeLookup.get(je).internals.userNode;k(Ee,Pe)},[]):void 0,ve=_??P["minimap.ariaLabel"];return d.jsx(Sf,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*z:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Fn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:K,height:W,viewBox:`${G} ${se} ${oe} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:N,onClick:le,children:[ve&&d.jsx("title",{id:te,children:ve}),d.jsx(_ee,{onClick:ye,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:l,nodeComponent:c}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-Y},${se-Y}h${oe+Y*2}v${fe+Y*2}h${-oe-Y*2}z + M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}jC.displayName="MiniMap";O.memo(jC);const Eee=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Nee={[Ll.Line]:"right",[Ll.Handle]:"bottom-right"};function Aee({nodeId:e,position:t,variant:n=Ll.Handle,className:r,style:i=void 0,children:a,color:l,minWidth:c=10,minHeight:u=10,maxWidth:h=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:g,autoScale:v=!0,shouldResize:k,onResizeStart:S,onResize:y,onResizeEnd:_}){const x=lC(),w=typeof e=="string"?e:x,C=vn(),T=O.useRef(null),N=n===Ll.Handle,j=Ot(O.useCallback(Eee(N&&v),[N,v]),mn),A=O.useRef(null),D=t??Nee[n];O.useEffect(()=>{if(!(!T.current||!w))return A.current||(A.current=XZ({domNode:T.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:H,transform:V,snapGrid:U,snapToGrid:P,nodeOrigin:K,domNode:W}=C.getState();return{nodeLookup:H,transform:V,snapGrid:U,snapToGrid:P,nodeOrigin:K,paneDomNode:W}},onChange:(H,V)=>{const{triggerNodeChanges:U,nodeLookup:P,parentLookup:K,nodeOrigin:W}=C.getState(),Z=[],ee={x:H.x,y:H.y},z=P.get(w);if(z&&z.expandParent&&z.parentId){const L=z.origin??W,I=H.width??z.measured.width??0,Y=H.height??z.measured.height??0,G={id:z.id,parentId:z.parentId,rect:{width:I,height:Y,...Rk({x:H.x??z.position.x,y:H.y??z.position.y},{width:I,height:Y},z.parentId,P,L)}},se=fb([G],P,K,W);Z.push(...se),ee.x=H.x?Math.max(L[0]*I,H.x):void 0,ee.y=H.y?Math.max(L[1]*Y,H.y):void 0}if(ee.x!==void 0&&ee.y!==void 0){const L={id:w,type:"position",position:{...ee}};Z.push(L)}if(H.width!==void 0&&H.height!==void 0){const I={id:w,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};Z.push(I)}for(const L of V){const I={...L,type:"position"};Z.push(I)}U(Z)},onEnd:({width:H,height:V})=>{const U={id:w,type:"dimensions",resizing:!1,dimensions:{width:H,height:V}};C.getState().triggerNodeChanges([U])}})),A.current.update({controlPosition:D,boundaries:{minWidth:c,minHeight:u,maxWidth:h,maxHeight:m},keepAspectRatio:f,resizeDirection:g,onResizeStart:S,onResize:y,onResizeEnd:_,shouldResize:k}),()=>{var H;(H=A.current)==null||H.destroy()}},[D,c,u,h,m,f,S,y,_,k]);const B=D.split("-");return d.jsx("div",{className:Fn(["react-flow__resize-control","nodrag",...B,n,r]),ref:T,style:{...i,scale:j,...l&&{[N?"backgroundColor":"borderColor"]:l}},children:a})}O.memo(Aee);const P1=380,U1=12,Tee=350,Mee=150,fv=new EventTarget;function jee(){fv.dispatchEvent(new Event("move"))}function Dee(e,t){const[n,r]=O.useState(null),i=O.useRef(void 0),a=O.useRef(void 0);O.useEffect(()=>{const h=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),r(null)};return fv.addEventListener("move",h),()=>{fv.removeEventListener("move",h),window.clearTimeout(i.current),window.clearTimeout(a.current)}},[]),O.useEffect(()=>{r(h=>{var f;if(!h)return h;const m=((f=e.current)==null?void 0:f.getBoundingClientRect())??null;return m&&h.x===m.x&&h.y===m.y&&h.width===m.width&&h.height===m.height?h:m})},[e,t]);const l=O.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{var h;r(((h=e.current)==null?void 0:h.getBoundingClientRect())??null)},Tee)},[e]),c=O.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),Mee)},[]),u=O.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:n,onMouseEnter:l,onMouseLeave:c,keepOpen:u}}function Ree(e){const t=new Date(e),n=t.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return t.toLocaleDateString(void 0,n)}function Lee({exp:e,runs:t,latestRun:n,parentSlug:r,anchor:i,onOpenLogs:a,onOpenCode:l,onMouseEnter:c,onMouseLeave:u}){const h=q9(),m=i.right+U1+P1<=window.innerWidth,f=i.x-U1-P1>=0,g=m?"right":f?"left":i.y>window.innerHeight/2?"above":"below",{x:v,y:k}=G9({x:i.x,y:i.y,width:i.width,height:i.height,anchor:g,distance:U1},h),[S,y]=O.useState(null),_=e.parentExperimentId&&(n!=null&&n.commitSha)?n.id:null;O.useEffect(()=>{if(y(null),!_)return;let H=!1;return hM(_).then(V=>{let U=V.diff;if(V.truncated){const Z=U.lastIndexOf(` +diff --git `);U=Z!==-1?U.slice(0,Z+1):U.slice(0,U.lastIndexOf(` +`)+1)}let P=[];try{P=U.trim()?Ig(U):[]}catch{return}if(V.truncated&&P.every(Z=>Z.hunks.length===0))return;let K=0,W=0;for(const Z of P){const ee=W2(Z);K+=ee.additions,W+=ee.deletions}H||y({fileCount:P.length,additions:K,deletions:W,truncated:V.truncated})}).catch(()=>{}),()=>{H=!0}},[_]);const x={done:0,failed:0,cancelled:0,live:0};for(const H of t)H.status==="done"?x.done+=1:H.status==="failed"?x.failed+=1:H.status==="cancelled"?x.cancelled+=1:x.live+=1;const w=n?Z0((n.endedAt??Date.now())-n.createdAt):null,C=(n==null?void 0:n.status)==="failed"&&n.resultMarkdown?n.resultMarkdown:null,T=e.description||(C?null:n==null?void 0:n.resultMarkdown)||null,N=O.useRef(null),[j,A]=O.useState(!1),[D,B]=O.useState(!1);return O.useEffect(()=>{A(!1)},[T]),O.useEffect(()=>{const H=N.current;H&&B(H.scrollHeight>H.clientHeight+1)},[T,j]),U9.createPortal(d.jsxs("div",{ref:h.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] py-3.5 px-4 text-sm text-text [&_.hc-mono]:font-mono [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:font-mono [&_.hc-slug]:text-md [&_.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-[color-mix(in_oklab,_var(--border)_55%,_var(--text))] [&_.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-xs [&_.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]:font-mono [&_.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-2xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-mono]:min-w-0 [&_.hc-foot_.hc-mono]:overflow-hidden [&_.hc-foot_.hc-mono]:text-ellipsis [&_.hc-foot_.hc-mono]:whitespace-nowrap",style:{width:P1,left:v,top:k,visibility:h.offsetHeight===0?"hidden":void 0},onMouseEnter:c,onMouseLeave:u,children:[d.jsxs("div",{className:"hc-head",children:[d.jsx("span",{className:"hc-slug",children:e.slug}),d.jsx(Ss,{status:n?wl(n):"idle"})]}),e.title&&d.jsx("div",{className:"hc-title",children:e.title}),d.jsxs("div",{className:"hc-actions",children:[a&&d.jsxs("button",{type:"button",onClick:a,children:[d.jsx(yv,{size:13}),"Logs"]}),d.jsxs("button",{type:"button",onClick:l,children:[d.jsx(vv,{size:13}),"Code"]})]}),T&&d.jsx("div",{className:`hc-body${j?" expanded":""}`,ref:N,children:T}),T&&(D||j)&&d.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>A(H=>!H),children:j?"Show less":"Show more"}),C&&d.jsx("div",{className:"hc-failure",children:C}),d.jsxs("div",{className:"hc-stats",children:[d.jsxs("span",{children:[t.length===1?"1 run":`${t.length} runs`,x.done>0&&` · ${x.done} done`,x.failed>0&&` · ${x.failed} failed`,x.cancelled>0&&` · ${x.cancelled} cancelled`,x.live>0&&` · ${x.live} live`]}),n&&Ad(n.backend)&&d.jsx(j8,{backend:n.backend}),w&&d.jsx("span",{children:w}),n&&d.jsx("span",{children:Pi(n.createdAt)})]}),d.jsxs("div",{className:"hc-git",children:[d.jsxs("div",{className:"hc-git-row",children:[d.jsxs("span",{className:"hc-branch",title:e.branchName,children:[d.jsx(Ol,{size:12}),e.branchName]}),r&&d.jsxs("span",{children:["from ",d.jsx("span",{className:"hc-mono",children:r})]})]}),S&&S.fileCount>0&&d.jsx("div",{className:"hc-git-row",title:`Committed changes vs ${r??"parent"}${S.truncated?" (diff truncated — counts are lower bounds)":""}`,children:d.jsxs("span",{children:[S.truncated&&"≥ ",d.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",S.additions]})," ",d.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",S.deletions]})," · ",S.fileCount===1&&!S.truncated?"1 file":`${S.fileCount}${S.truncated?"+":""} files`]})})]}),d.jsxs("div",{className:"hc-foot",children:[d.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),d.jsxs("span",{children:["created ",Ree(e.createdAt)]})]})]}),document.body)}const Oee=264,x7=132,W0=44,Bee=72,zee=148,Iee=44;function Hee(e){const t=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),n=[];for(const a of e){const l=t.get(a.id),c=a.parentExperimentId?t.get(a.parentExperimentId):void 0;c?c.children.push(l):n.push(l)}const r=(a,l)=>a.exp.createdAt-l.exp.createdAt,i=a=>{a.children.sort(r),a.children.forEach(i)};return n.sort(r),n.forEach(i),n}function Fee(e,t){const n=new Map,r=c=>{const u=n.get(c)??1+c.children.reduce((h,m)=>h+r(m),0);return n.set(c,u),u},i=new Map,a=c=>{const u=i.get(c)??(t(c)||c.children.some(a));return i.set(c,u),u};function l(c){if(t(c)){const m=[];let f=0;for(const g of c.children)a(g)?m.push(...l(g)):f+=r(g);return f>0&&m.push({kind:"elided",id:`el-${c.exp.id}`,count:f,children:[]}),[{kind:"exp",exp:c.exp,children:m}]}if(!a(c))return[];let u=0;const h=[];return(function m(f){u+=1;for(const g of f.children)t(g)?h.push(...l(g)):a(g)?m(g):u+=r(g)})(c),[{kind:"elided",id:`el-${c.exp.id}`,count:u,children:h}]}return e.flatMap(l)}function pv(e){return e.kind==="exp"?Oee:zee}function M0(e){return e.kind==="exp"?e.exp.id:e.id}function Y0(e){if(e.children.length===0)return pv(e);const t=e.children.reduce((n,r)=>n+Y0(r),0)+W0*(e.children.length-1);return Math.max(pv(e),t)}function $ee(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const Pee=O.memo(function({data:t}){const{exp:n,latestRun:r,runs:i,isBaseline:a,parentSlug:l,githubOwner:c,githubRepo:u,onOpenView:h,onOpenCodeBranch:m}=t,f=r?wl(r):void 0,g=f==="running"||f==="starting"||f==="cancelling",v=a?"Idea":g?"Building":n.mergeParentExperimentId?"Merge":"Prototype",k=i.slice(-8),S=O.useRef(null),y=Dee(S,t);return d.jsxs("div",{ref:S,className:`exp-node ${g?"live":""}`,onMouseEnter:y.onMouseEnter,onMouseLeave:y.onMouseLeave,children:[d.jsx(wa,{type:"target",position:Ze.Top}),d.jsxs("div",{className:"node-eyebrow",children:[d.jsxs("span",{className:"node-eyebrow-left",children:[v,d.jsx("a",{className:"icon-btn node-gh",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:Nd(c,u,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:_=>_.stopPropagation(),children:d.jsx(R2,{size:12})})]}),d.jsxs("span",{style:{display:"inline-flex",gap:6},children:[n.verdict&&d.jsx(Ss,{status:n.verdict}),d.jsx(Ss,{status:f??"idle"})]})]}),d.jsx("div",{className:"node-head",children:d.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&d.jsx("div",{className:"node-title",children:n.title||n.description}),(()=>{var w;const _=(r==null?void 0:r.metricsAggregate)??((w=[...i].reverse().find(C=>C.metricsAggregate))==null?void 0:w.metricsAggregate),x=_?Object.entries(_).filter(([,C])=>typeof C=="number"):[];return x.length?d.jsx("div",{className:"node-metrics",children:x.slice(0,5).map(([C,T])=>d.jsxs("span",{className:"node-metric",title:C,children:[d.jsx("span",{className:"node-metric-k",children:C.replace(/_align$/,"").replace(/_/g," ")}),d.jsx("span",{className:"node-metric-v",children:T.toFixed(2).replace(/\.?0+$/,"")})]},C))}):null})(),d.jsxs("div",{className:"node-meta",children:[d.jsx("span",{children:"Runs"}),k.length>0?d.jsx("span",{className:"run-squares",children:k.map(_=>d.jsx("span",{className:`run-sq ${$ee(_.status)}`,title:_.status},_.id))}):d.jsx("span",{children:"no runs"}),d.jsx("span",{style:{flex:1}}),r&&d.jsx("span",{children:Pi(r.createdAt)})]}),d.jsxs("div",{className:"node-actions",onClick:_=>_.stopPropagation(),children:[d.jsxs("button",{className:"node-action",title:"Build & play this experiment",onClick:()=>h(n.id,"play"),children:[d.jsx(O7,{size:13}),"Play"]}),d.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>h(n.id,"changes"),children:[d.jsx(Ol,{size:13}),"Changes"]}),i.length>0&&d.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>h(n.id,"terminal"),children:[d.jsx(yv,{size:13}),"Logs"]}),d.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>m(n.branchName),children:[d.jsx(vv,{size:13}),"Code"]})]}),d.jsx(wa,{type:"source",position:Ze.Bottom}),y.rect&&d.jsx(Lee,{exp:n,runs:i,latestRun:r,parentSlug:l,anchor:y.rect,onOpenCode:()=>m(n.branchName),onMouseEnter:y.keepOpen,onMouseLeave:y.onMouseLeave})]})}),Uee=O.memo(function({data:t}){const{count:n,onShowProjectScope:r}=t;return d.jsxs("div",{className:"elided-node",role:"button",tabIndex:0,title:"Switch to Project to see all experiments",onClick:r,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r())},children:[d.jsx(wa,{type:"target",position:Ze.Top}),d.jsx(T7,{size:14}),d.jsxs("span",{className:"elided-node-label",children:[n," ",n===1?"experiment":"experiments",d.jsx("span",{className:"elided-node-sub",children:"other agents"})]}),d.jsx(wa,{type:"source",position:Ze.Bottom})]})}),qee={exp:Pee,elided:Uee},DC={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},Gee={...DC.style,strokeDasharray:"4 4"};function Vee({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:i,agentSessionId:a,onShowProjectScope:l}){const{nodes:c,edges:u}=O.useMemo(()=>{const h=new Map;for(const x of t){const w=h.get(x.experimentId);w?w.push(x):h.set(x.experimentId,[x])}for(const x of h.values())x.sort((w,C)=>w.createdAt-C.createdAt);const m=[],f=[],g=x=>!a||x.exp.chatSessionId===a,v=Fee(Hee(e),g),k=new Map(e.map(x=>[x.id,x.slug]));function S(x,w,C){const T=w-pv(x)/2;if(x.kind==="exp"){const A=h.get(x.exp.id)??[];m.push({id:x.exp.id,type:"exp",position:{x:T,y:C},data:{exp:x.exp,latestRun:A[A.length-1]??null,runs:A,isBaseline:!x.exp.parentExperimentId,parentSlug:x.exp.parentExperimentId?k.get(x.exp.parentExperimentId)??null:null,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:i}})}else m.push({id:x.id,type:"elided",position:{x:T,y:C+(x7-Iee)/2},data:{count:x.count,onShowProjectScope:l}});if(x.children.length===0)return;const N=x.children.reduce((A,D)=>A+Y0(D),0)+W0*(x.children.length-1);let j=w-N/2;for(const A of x.children){const D=Y0(A),B=x.kind==="elided"||A.kind==="elided";f.push({id:`e-${M0(x)}-${M0(A)}`,source:M0(x),target:M0(A),...B?{style:Gee}:{}}),S(A,j+D/2,C+x7+Bee),j+=D+W0}}let y=0;for(const x of v){const w=Y0(x);S(x,y+w/2,0),y+=w+W0}const _=new Set(m.map(x=>x.id));for(const x of e)x.mergeParentExperimentId&&_.has(x.mergeParentExperimentId)&&_.has(x.id)&&f.push({id:`m-${x.mergeParentExperimentId}-${x.id}`,source:x.mergeParentExperimentId,target:x.id,style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.45,strokeDasharray:"5 4"}});return{nodes:m,edges:f}},[e,t,r,i,n.githubOwner,n.githubRepo,a,l]);return e.length===0?d.jsxs("div",{className:"empty-state empty-state-cta",children:[d.jsx("p",{className:"empty-state-title",children:"No ideas yet"}),d.jsx("p",{className:"empty-state-hint",children:"Tell the producer in chat what kind of game you want to make — it'll capture your first idea."})]}):c.length===0&&a?d.jsxs("div",{className:"empty-state empty-state-cta",children:[d.jsx("p",{className:"empty-state-title",children:"No experiments from this agent yet"}),d.jsx("p",{className:"empty-state-hint",children:"Ask this agent to create one, or switch to Project to see all experiments."})]}):d.jsx(nee,{nodes:c,edges:u,nodeTypes:qee,defaultEdgeOptions:DC,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:jee,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:d.jsx(oee,{variant:_s.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const j0=(e,t)=>e.id===t.id&&e.view===t.view,D0=(e,t)=>e.path===t.path&&(e.source??"repo")===(t.source??"repo")&&e.sessionId===t.sessionId&&e.ref===t.ref,w7=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`;function Wee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yee(e,t,n,r,i){let a=e,l;const c=t==null?void 0:t.replace(/\/+$/,""),u=r==null?void 0:r.replace(/\/+$/,"");if(!a.startsWith("/"))l=n;else if(u&&(a===u||a.startsWith(`${u}/`))){const h=a.slice(u.length).replace(/^\/+/,"");return h?{path:h,source:"files"}:null}else if(c&&(a===c||a.startsWith(`${c}/`)))a=a.slice(c.length).replace(/^\/+/,"");else{const h=i?Wee(i):"[^/]+",m=a.match(new RegExp(`/files/${h}/(.+)$`)),f=m?null:a.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),g=m||f?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"files"};f?(l=f[1],a=f[2]):g&&(a=g[1])}return a?{path:a,sessionId:l}:null}const S7="orx:onboarded",RC="orx:panel-width",xd=360,Xee=10,Kee=232,Zee=380,Qee=Kee+56,Jee=80;function mv(){return Math.max(xd,window.innerWidth-Qee-Zee)}function ete(){const e=mv();try{const t=Number(localStorage.getItem(RC));if(Number.isFinite(t)&&t>=xd)return Math.min(t,e)}catch{}return Math.max(xd,Math.min(760,e,Math.round(window.innerWidth*.42)))}function qc(e,t){const n=e.findIndex(i=>i.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function tte(){var Er,jn,hr,li;const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState([]),[l,c]=O.useState([]),[u,h]=O.useState(null),[m,f]=O.useState("tree"),[g,v]=O.useState("project"),[k,S]=O.useState(null),y=i.length>0&&i.every(ge=>ge.chatSessionId),_=k&&y?g:"project",x=O.useMemo(()=>{if(_!=="agent")return l;const ge=new Set(i.filter(De=>De.chatSessionId===k).map(De=>De.id));return l.filter(De=>ge.has(De.experimentId))},[l,i,_,k]),[w,C]=O.useState(null),[T,N]=O.useState("experiments"),[j,A]=O.useState([]),[D,B]=O.useState([]),[H,V]=O.useState([]),[U,P]=O.useState([]),[K,W]=O.useState(null),[Z,ee]=O.useState(null),[z,L]=O.useState(!0),[I,Y]=O.useState(!1),[G,se]=O.useState(ete),[oe,fe]=O.useState(!0),[te,q]=O.useState(!1),[ne,le]=O.useState("chat"),[ye,ve]=O.useState(()=>{try{return localStorage.getItem(S7)==="1"}catch{return!0}}),[Ee,je]=O.useState(!1),[Pe,$e]=O.useState(!1),Be=O.useCallback(()=>{le("chat"),fe(!0),L(!0),Y(!1),$e(!0)},[]),Nt=O.useCallback(()=>{try{localStorage.setItem(f6,"1")}catch{}$e(!1)},[]);O.useEffect(()=>{if(!(!n||te||!ye)){try{if(localStorage.getItem(f6)==="1")return}catch{return}Be()}},[n,te,ye,Be]);const Rt=O.useRef(n);Rt.current=n,O.useEffect(()=>{HT().then(ge=>{t(ge),r(De=>{var it;return De??((it=ge[0])==null?void 0:it.id)??null})}).catch(()=>t([]))},[]),O.useEffect(()=>{const ge=()=>se(De=>Math.min(De,mv()));return window.addEventListener("resize",ge),()=>window.removeEventListener("resize",ge)},[]),O.useEffect(()=>{n&&(ZT(n).catch(()=>{}),a([]),c([]),h(null),C(null),A([]),B([]),V([]),P([]),W(null),ee(null),N("experiments"),v("project"),JT(n).then(a).catch(()=>{}),eM(n).then(c).catch(()=>{}),f3(n).then(h).catch(()=>{}))},[n]);const Lt=O.useCallback(()=>{const ge=Rt.current;ge&&f3(ge).then(h).catch(()=>{})},[]);Ej({onRun:ge=>{ge.projectId===Rt.current&&c(De=>qc(De,ge))},onExperiment:ge=>{ge.projectId===Rt.current&&a(De=>qc(De,ge))},onProject:ge=>{t(De=>De?qc(De,ge):[ge])},onFiles:ge=>{ge===Rt.current&&Lt()}});const Ft=O.useCallback(()=>v("project"),[]),an=O.useCallback((ge,De="changes")=>{const it={id:ge,view:De};A(Ge=>Ge.some(zt=>j0(zt,it))?Ge:[...Ge,it]),N(it),L(!0)},[]),wt=O.useCallback(ge=>{const De=j.findIndex(Ge=>j0(Ge,ge));if(De===-1)return;ge.view==="play"&&F7(ge.id).catch(()=>{});const it=j.filter((Ge,zt)=>zt!==De);A(it),typeof T=="object"&&"id"in T&&j0(T,ge)&&N(it[Math.min(De,it.length-1)]??"experiments")},[j,T]),Je=O.useCallback((ge,De,it)=>{const Ge=e==null?void 0:e.find(Wt=>Wt.id===n),zt=Yee(ge,Ge==null?void 0:Ge.repoPath,De,Ge==null?void 0:Ge.filesDir,Ge==null?void 0:Ge.slug);zt&&(it&&zt.source!=="files"&&(zt.ref=it),B(Wt=>Wt.some(dn=>D0(dn,zt))?Wt:[...Wt,zt]),N(zt),L(!0))},[e,n]),pt=O.useCallback(ge=>{const De=D.findIndex(Ge=>D0(Ge,ge));if(De===-1)return;const it=D.filter((Ge,zt)=>zt!==De);B(it),typeof T=="object"&&"path"in T&&D0(T,ge)&&N(it[Math.min(De,it.length-1)]??"experiments")},[D,T]),_e=O.useCallback((ge,De,it)=>{const Ge={kind:"plan",sessionId:De,promptId:it,plan:ge};V(zt=>{const Wt=zt.findIndex(Bt=>Bt.promptId===it);if(Wt===-1)return[...zt,Ge];const dn=zt.slice();return dn[Wt]=Ge,dn}),N(Ge),L(!0)},[]),Ne=O.useCallback(ge=>{const De=H.findIndex(Ge=>Ge.promptId===ge.promptId);if(De===-1)return;const it=H.filter((Ge,zt)=>zt!==De);V(it),typeof T=="object"&&"kind"in T&&T.kind==="plan"&&T.promptId===ge.promptId&&N(it[Math.min(De,it.length-1)]??"experiments")},[H,T]),He=O.useCallback((ge,De)=>{const it={kind:"subagent",sessionId:ge,spawnPartId:De};P(Ge=>Ge.some(zt=>zt.spawnPartId===De)?Ge:[...Ge,it]),N(it),L(!0)},[]),Qe=O.useCallback(ge=>{const De=U.findIndex(Ge=>Ge.spawnPartId===ge.spawnPartId);if(De===-1)return;const it=U.filter((Ge,zt)=>zt!==De);P(it),typeof T=="object"&&"kind"in T&&T.kind==="subagent"&&T.spawnPartId===ge.spawnPartId&&N(it[Math.min(De,it.length-1)]??"experiments")},[U,T]),rt=O.useCallback(ge=>{const De={code:!0,sel:ge,view:"files",toggled:new Set};W(it=>it?{...it,sel:ge}:De),N(De),L(!0)},[]),$t=O.useCallback(ge=>{W(De=>De&&{...De,...ge})},[]),ct=O.useCallback(()=>{W(null),N(ge=>typeof ge=="object"&&"code"in ge?"experiments":ge)},[]),Fe=O.useCallback(ge=>{ee(De=>De&&De.sessionId===ge?De:{wt:!0,sessionId:ge,view:"changes",toggled:new Set}),N({wt:!0,sessionId:ge,view:"changes",toggled:new Set}),L(!0)},[]),et=O.useCallback(ge=>{ee(De=>De&&{...De,...ge})},[]),_t=O.useCallback(()=>{ee(null),N(ge=>typeof ge=="object"&&"wt"in ge?"experiments":ge)},[]);O.useEffect(()=>iu(ge=>{ge.type==="sessionDeleted"&&ee(De=>!De||De.sessionId!==ge.sessionId?De:(N(it=>typeof it=="object"&&"wt"in it?"experiments":it),null))}),[]);const ut=ge=>{ge.preventDefault(),ge.currentTarget.setPointerCapture(ge.pointerId);const De=document.body.style.userSelect;document.body.style.userSelect="none";const it=zt=>{const Wt=Math.round(window.innerWidth-zt.clientX-Xee),dn=mv();if(Wt>dn+Jee){Y(!0);return}Y(!1);const Bt=Math.min(Math.max(Wt,xd),dn);se(Bt);try{localStorage.setItem(RC,String(Bt))}catch{}},Ge=()=>{window.removeEventListener("pointermove",it),window.removeEventListener("pointerup",Ge),window.removeEventListener("pointercancel",Ge),document.body.style.userSelect=De};window.addEventListener("pointermove",it),window.addEventListener("pointerup",Ge),window.addEventListener("pointercancel",Ge)},on=ge=>{t(De=>De?qc(De,ge):[ge]),r(ge.id),q(!1)},Gn=ge=>{t(De=>De&&De.filter(it=>it.id!==ge)),n===ge&&r(null)},hn=typeof T=="object"&&"id"in T?T:null,xn=typeof T=="object"&&"path"in T?T:null,vt=typeof T=="object"&&"kind"in T&&T.kind==="plan"?T:null,wn=typeof T=="object"&&"kind"in T&&T.kind==="subagent"?T:null,At=typeof T=="object"&&"code"in T,Vr=typeof T=="object"&&"wt"in T,Mn=(e==null?void 0:e.find(ge=>ge.id===n))??null,ki=hn?i.find(ge=>ge.id===hn.id)??null:null;if(e===null)return d.jsx("div",{className:"app",children:d.jsx("div",{className:"empty-state",children:d.jsx("span",{className:"spinner"})})});if(e.length===0)return d.jsx("div",{className:"app",children:ye?d.jsx(d6,{projects:e,onOpen:r,onCreated:on,onDeleted:Gn,openNewProject:Ee,onNewProjectOpened:()=>je(!1)}):d.jsx(tW,{onDone:()=>{try{localStorage.setItem(S7,"1")}catch{}je(!0),ve(!0)}})});const Rs=d.jsx(eW,{projectName:((Er=e.find(ge=>ge.id===n))==null?void 0:Er.name)??"",onHome:()=>q(!0),onCollapse:()=>fe(!1)});return d.jsxs("div",{className:"app",children:[te?d.jsx(d6,{projects:e,onOpen:ge=>{r(ge),q(!1)},onCreated:on,onDeleted:Gn}):d.jsxs("div",{className:"app-body",children:[n&&d.jsx(HP,{projectId:n,paperId:(jn=e.find(ge=>ge.id===n))==null?void 0:jn.paperId,persona:(hr=e.find(ge=>ge.id===n))==null?void 0:hr.persona,baselineBranch:(li=e.find(ge=>ge.id===n))==null?void 0:li.baselineBranch,railHeader:Rs,railOpen:oe,onShowRail:()=>fe(!0),mainView:ne,onSelectMainView:le,panelOpen:z,onTogglePanel:()=>{z&&Y(!1),L(!z)},onOpenFile:Je,onOpenPlan:_e,onOpenSubagent:He,onOpenWorktree:Fe,onStartTour:Be,onActiveSessionChange:S,children:ne==="skills"?d.jsx(OV,{project:e.find(ge=>ge.id===n)??null}):ne==="files"?(()=>{const ge=e.find(De=>De.id===n);return ge?d.jsx(TV,{project:ge,files:u,onChanged:Lt,onOpenStorage:()=>le("storage")},ge.id):null})():ne!=="chat"?d.jsx(fP,{tab:ne,project:Mn,onProjectUpdated:ge=>t(De=>De?qc(De,ge):[ge])}):null}),ne==="chat"&&z&&d.jsxs("aside",{className:`right-pane floating-panel ${I?"max":""}`,style:I?void 0:{width:G},"data-onboarding":"experiments",children:[!I&&d.jsx("div",{className:"panel-resizer",onPointerDown:ut}),d.jsxs("div",{className:"tabs",children:[d.jsxs("div",{className:"tab-strip",children:[d.jsx("button",{className:`tab ${T==="experiments"?"active":""}`,onClick:()=>N("experiments"),children:"Gallery"}),j.map(ge=>{const De=i.find(it=>it.id===ge.id);return d.jsx(ol,{active:hn!==null&&j0(hn,ge),label:De?De.title||De.slug:"…",icon:ge.view==="terminal"?d.jsx(yv,{size:12,style:{flexShrink:0}}):ge.view==="play"?d.jsx(O7,{size:12,style:{flexShrink:0}}):d.jsx(Ol,{size:12,style:{flexShrink:0}}),onSelect:()=>N(ge),onClose:()=>wt(ge)},`${ge.id}:${ge.view}`)}),D.map(ge=>d.jsx(ol,{active:xn!==null&&D0(xn,ge),label:ge.path.split("/").pop()||ge.path,icon:d.jsx(M7,{size:12,style:{flexShrink:0}}),onSelect:()=>N(ge),onClose:()=>pt(ge)},`file:${w7(ge)}`)),H.map(ge=>d.jsx(ol,{active:vt!==null&&vt.promptId===ge.promptId,label:"Plan",icon:d.jsx(B7,{size:12,style:{flexShrink:0}}),onSelect:()=>N(ge),onClose:()=>Ne(ge)},`plan:${ge.promptId}`)),U.map(ge=>d.jsx(ol,{active:wn!==null&&wn.spawnPartId===ge.spawnPartId,label:"Sub-agent",icon:d.jsx(z7,{size:12,style:{flexShrink:0}}),onSelect:()=>N(ge),onClose:()=>Qe(ge)},`subagent:${ge.spawnPartId}`)),K&&d.jsx(ol,{active:At,label:"Code",icon:d.jsx(vv,{size:12,style:{flexShrink:0}}),onSelect:()=>N(K),onClose:ct},"code"),Z&&d.jsx(ol,{active:Vr,label:"Worktree",icon:d.jsx(D7,{size:12,style:{flexShrink:0}}),onSelect:()=>N(Z),onClose:_t},"worktree")]}),d.jsxs("div",{className:"panel-controls",children:[d.jsx("button",{className:"icon-btn",title:I?"Restore panel":"Expand panel","aria-label":I?"Restore panel":"Expand panel",onClick:()=>Y(ge=>!ge),children:I?d.jsx(oT,{size:14}):d.jsx(sT,{size:14})}),d.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{L(!1),Y(!1)},children:d.jsx(eo,{size:14})})]})]}),T==="experiments"?d.jsxs("div",{className:"tab-body",children:[d.jsxs("div",{className:"pane-toolbar",children:[y&&d.jsxs("div",{className:"seg",children:[d.jsx("button",{className:_==="agent"?"active":"",disabled:!k,title:k?void 0:"Open a chat session to filter to its experiments",onClick:()=>v("agent"),children:"Agent"}),d.jsx("button",{className:_==="project"?"active":"",onClick:()=>v("project"),children:"Project"})]}),d.jsx("span",{style:{flex:1}}),d.jsxs("div",{className:"seg",children:[d.jsx("button",{className:m==="tree"?"active":"",onClick:()=>f("tree"),children:"Tree"}),d.jsx("button",{className:m==="table"?"active":"",onClick:()=>f("table"),children:"Table"})]})]}),d.jsx("div",{className:"pane-content",children:m==="tree"?Mn&&d.jsx(Vee,{experiments:i,runs:x,project:Mn,onOpenView:an,onOpenCodeBranch:rt,agentSessionId:_==="agent"?k:null,onShowProjectScope:Ft}):d.jsx(fW,{runs:x,emptyHint:_==="agent"&&l.length>0?"No runs from this agent's experiments yet. Switch to Project to see all runs.":void 0,experiments:i,onOpen:ge=>{C(ge.id),an(ge.experimentId,"terminal")},onOpenChanges:ge=>an(ge,"changes"),onCancel:H7})})]}):xn?d.jsx("div",{className:"tab-body",children:n&&d.jsx(JV,{projectId:n,path:xn.path,source:xn.source,sessionId:xn.sessionId,gitRef:xn.ref,onOpenFile:Je},w7(xn))}):vt?d.jsx("div",{className:"tab-body",children:d.jsx("div",{className:"pane-content plan-tab-content",children:d.jsx(ao,{text:vt.plan,onOpenFile:ge=>Je(ge,vt.sessionId)})})}):wn?d.jsx(FP,{sessionId:wn.sessionId,spawnPartId:wn.spawnPartId,onOpenFile:ge=>Je(ge,wn.sessionId),onOpenSubagent:ge=>He(wn.sessionId,ge)},wn.spawnPartId):At?d.jsx("div",{className:"tab-body",children:n&&Mn&&K&&(()=>{const ge=i.find(De=>De.branchName===K.sel);return ge?d.jsx(dV,{projectId:n,project:Mn,experiment:ge,view:K.view,toggled:K.toggled,onViewChange:De=>$t({view:De}),onToggledChange:De=>$t({toggled:De}),onOpenFile:Je},"code"):null})()}):Vr?d.jsx("div",{className:"tab-body",children:n&&Z&&d.jsx(pV,{sessionId:Z.sessionId,project:Mn,view:Z.view,toggled:Z.toggled,onViewChange:ge=>et({view:ge}),onToggledChange:ge=>et({toggled:ge}),onOpenFile:Je},`wt:${Z.sessionId}`)}):d.jsx("div",{className:"tab-body",children:hn&&ki&&Mn&&d.jsx(WV,{experiment:ki,project:Mn,view:hn.view,runs:l,selectedRunId:w,onSelectRun:C,mergeParent:ki.mergeParentExperimentId?(i==null?void 0:i.find(ge=>ge.id===ki.mergeParentExperimentId))??null:null},`${hn.id}:${hn.view}`)})]})]}),Pe&&!te&&n&&d.jsx(vW,{onClose:Nt})]})}h$();ZN.createRoot(document.getElementById("root")).render(d.jsx(O.StrictMode,{children:d.jsx(tte,{})}));export{O7 as P,Xe as c,d as j,O as r}; diff --git a/ui/dist/assets/index-CnMTLdMk.css b/ui/dist/assets/index-CnMTLdMk.css deleted file mode 100644 index f525723de..000000000 --- a/ui/dist/assets/index-CnMTLdMk.css +++ /dev/null @@ -1,32 +0,0 @@ -@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--fs-2xs: 10px;--fs-xs: 11px;--fs-sm: 12px;--fs-md: 13px;--fs-base: 14px;--fs-lg: 15px;--fs-xl: 16px;--fs-2xl: 18px;--fs-3xl: 22px;--fs-4xl: 28px;--fs-5xl: 34px;--fw-regular: 400;--fw-medium: 500;--fw-semibold: 600;--fw-display: 700;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 10px;--radius-xl: 12px;--radius-full: 999px;--modal-top: min(30vh, 260px);--term-bg: #1a1a1a;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:var(--radius-sm);border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.wordmark{display:inline-flex;align-items:center;gap:.4em;color:var(--text)}.wordmark svg{width:1em;height:1em;flex-shrink:0}.home-brand{font-weight:var(--fw-display);font-size:var(--fs-4xl);letter-spacing:-.02em;margin-bottom:36px}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:var(--fs-2xl);letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:var(--radius-sm);color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.project-card .repo{color:var(--text)}.project-card .paper,.project-card .time{font-size:var(--fs-xs);color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:var(--fw-semibold);font-size:var(--fs-md);color:var(--text);padding:4px 6px 4px 0;border-radius:var(--radius-sm)}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);right:-4px;background:var(--text);color:var(--base);font-size:var(--fs-xs);font-weight:var(--fw-medium);line-height:1;padding:5px 8px;border-radius:var(--radius-sm);white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .1s ease .3s,visibility 0s linear .4s;z-index:60}[data-tip]:hover:after{opacity:1;visibility:visible}.tip-up[data-tip]:after{top:auto;bottom:calc(100% + 6px)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--text)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:var(--fs-xs);border-radius:var(--radius-sm)}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--text);white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot,.st-done>svg{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:var(--fs-md);color:var(--text);border-radius:var(--radius-md);text-align:left}.rail-nav-item:hover{background:var(--surface)}.rail-nav-item.active{background:var(--panel);font-weight:var(--fw-semibold)}.rail-nav-item.settings-toggle{color:var(--subtext)}.rail-nav-item .settings-chev{margin-left:auto;color:var(--muted);transition:transform .12s ease}.rail-nav-item.rail-nav-sub{margin-left:12px;padding-left:12px;font-size:var(--fs-sm);color:var(--subtext);border-left:1px solid var(--border-variant);border-radius:0 var(--radius-md) var(--radius-md) 0}.rail-nav-item.rail-nav-sub.active{color:var(--text)}.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:18px;max-width:560px}.theme-card{position:relative;display:flex;flex-direction:column;gap:10px;padding:10px;border:1px solid var(--border);border-radius:var(--radius-lg, 12px);background:var(--surface-bright);cursor:pointer;text-align:left;transition:border-color .12s ease,box-shadow .12s ease,transform .06s ease}.theme-card:hover{border-color:var(--muted)}.theme-card.active{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary)}.theme-swatches{display:flex;height:46px;border-radius:8px;overflow:hidden;border:1px solid var(--border-variant);padding:7px;gap:6px;align-items:center}.theme-swatches i{flex:1;height:100%;border-radius:5px;box-shadow:inset 0 0 0 1px #0000000f}.theme-meta{display:flex;flex-direction:column;gap:1px}.theme-name{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text)}.theme-jp{font-size:var(--fs-xs);color:var(--muted)}.theme-check{position:absolute;top:8px;right:10px;color:var(--primary);font-weight:800;font-size:13px}.rail-section-label{padding:10px 10px 6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--subtext)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:var(--radius-sm)}.rail-empty{padding:6px 10px;font-size:var(--fs-sm);color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm);white-space:nowrap;flex-shrink:0}.tab.active{background:var(--surface)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.subagent-tab-content{overflow-y:auto;background:var(--base);padding:12px 16px}.subagent-tab-header{display:flex;align-items:center;gap:8px;padding-bottom:8px;margin-bottom:8px;border-bottom:1px solid var(--border-variant)}.subagent-live{flex-shrink:0;font-size:var(--fs-xs);color:var(--accent-amber)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:var(--radius-md);background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm)}.seg button:not(:disabled):hover{color:var(--text)}.seg button.active{background:var(--base);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.seg button:disabled{color:var(--muted);cursor:default}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:var(--radius-md);font-size:var(--fs-md);color:var(--text);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface)}.session-row.active{background:var(--surface);font-weight:var(--fw-medium)}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.title-reveal-char{display:inline-block;animation:title-char-in .24s ease-out both}@keyframes title-char-in{0%{opacity:0;filter:blur(4px);transform:translateY(.15em)}}@media(prefers-reduced-motion:reduce){.title-reveal-char{animation:none}}.session-row .session-time{font-size:var(--fs-2xs);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:var(--radius-sm);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:var(--radius-sm);outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--text);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:var(--fs-5xl);font-weight:var(--fw-display);letter-spacing:-.02em;color:var(--text)}.chat-empty .chat-empty-hint{font-size:var(--fs-sm);color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:var(--fs-md);max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-full);padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.chat-loading{flex:1;display:flex;align-items:center;justify-content:center;gap:12px;color:var(--subtext);font-size:var(--fs-xl);padding:20px}.chat-loading .spinner{width:22px;height:22px;border-width:3px}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:var(--fs-md);white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:var(--radius-xs);display:block}.msg-assistant{font-size:var(--fs-base);line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:var(--fs-sm);margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:var(--fw-semibold)}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:var(--fs-md);text-align:left;border-radius:var(--radius-sm)}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-group.has-error>.tool-row .tool-line{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.subagent-row{display:flex;align-items:center;gap:8px;width:100%;margin:2px 0;padding:3px 4px;cursor:pointer;color:var(--text);font-size:var(--fs-base);text-align:left;border-radius:var(--radius-sm)}.subagent-row:hover:not(:disabled){background:var(--surface)}.subagent-row:disabled{cursor:default}.subagent-row.has-error{color:var(--accent-red)}.subagent-row .tool-line{font-size:var(--fs-base);color:var(--text)}.subagent-row-chevron,.subagent-icon{flex-shrink:0;color:var(--muted)}.subagent-empty{padding:3px 4px;font-size:var(--fs-md);color:var(--muted)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:var(--radius-sm)}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-md);color:var(--subtext)}.tool-open{flex-shrink:0;font-size:var(--fs-xs);color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--text);background:var(--surface);border-radius:var(--radius-sm);white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm)}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.composer-harness-warning{padding:8px 12px;color:var(--subtext);font-size:var(--fs-xs);line-height:1.5;border-bottom:1px solid var(--border-variant)}.composer-harness-warning strong{color:var(--accent-amber);font-weight:var(--fw-medium)}.composer-harness-warning code{font-family:var(--mono);color:var(--text)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:var(--fs-md);field-sizing:content;min-height:52px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:var(--radius-sm);display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;align-items:center;gap:6px;padding:6px 8px 8px;flex-wrap:nowrap;min-width:0}.composer-actions .option-picker{flex:none}.composer-actions .model-picker{flex:0 1 auto;min-width:0;max-width:46%}.composer-actions .send-btn{flex:none}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--radius-md);background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:var(--fw-semibold)}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:var(--radius-md);padding:8px 12px;overflow-x:auto;font-size:var(--fs-sm);color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);padding:1px 5px}.md .katex{font-size:1.05em}.md .katex-display{margin:12px 0;overflow-x:auto;overflow-y:hidden;padding:2px 0}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--text);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:var(--fw-regular)}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm);opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:var(--fw-semibold);margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;display:block;width:max-content;max-width:100%;font-size:var(--fs-md);margin:10px 0;border:1px solid var(--border);border-radius:var(--radius-md);overflow-x:auto}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text);word-break:normal;overflow-wrap:break-word}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:var(--fw-medium);color:var(--text);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:var(--fs-md);transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--text);font-size:var(--fs-sm);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:var(--fs-2xs);color:var(--muted)}.exp-node .node-metrics{margin-top:8px;display:flex;flex-wrap:wrap;gap:6px}.exp-node .node-metric{display:inline-flex;align-items:baseline;gap:4px;padding:2px 7px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border);font-size:var(--fs-2xs)}.exp-node .node-metric-k{color:var(--muted)}.exp-node .node-metric-v{color:var(--text);font-weight:var(--fw-semibold);font-variant-numeric:tabular-nums}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text);border-radius:var(--radius-sm);text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.react-flow__node.react-flow__node-elided.selectable{cursor:pointer}.elided-node{width:148px;height:44px;display:flex;align-items:center;gap:8px;padding:6px 10px;border:1px dashed var(--border);border-radius:var(--radius-md);background:color-mix(in oklab,var(--text) 3%,transparent);color:var(--muted);font-size:var(--fs-2xs);font-weight:var(--fw-medium);text-align:left;transition:border-color .12s ease,color .12s ease}.elided-node:hover{border-color:var(--text);color:var(--text)}.elided-node .elided-node-label{display:flex;flex-direction:column;line-height:1.3}.elided-node .elided-node-sub{color:var(--muted)}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.exp-hover-card{position:fixed;z-index:60;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;padding:14px 16px;font-size:var(--fs-sm);color:var(--text)}.exp-hover-card .hc-mono{font-family:var(--mono)}.exp-hover-card .hc-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.exp-hover-card .hc-slug{font-family:var(--mono);font-size:var(--fs-md);font-weight:var(--fw-semibold);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-hover-card .hc-title{margin-top:3px;color:var(--text)}.exp-hover-card .hc-body{margin-top:10px;border-top:1px solid var(--border-variant);padding-top:10px;line-height:1.6;white-space:pre-line;display:-webkit-box;-webkit-line-clamp:10;-webkit-box-orient:vertical;overflow:hidden}.exp-hover-card .hc-body.expanded{display:block;-webkit-line-clamp:unset;max-height:45vh;overflow-y:auto;padding-bottom:4px}.exp-hover-card .hc-toggle{margin-top:4px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted)}.exp-hover-card .hc-toggle:hover{color:var(--text)}.exp-hover-card .hc-failure{margin-top:8px;color:var(--accent-red);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.exp-hover-card .hc-stats{margin-top:10px;border-top:1px solid var(--border-variant);padding-top:10px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:var(--fs-xs);color:var(--text)}.exp-hover-card .hc-git{margin-top:10px;padding-top:8px;border-top:1px solid var(--border-variant);font-size:var(--fs-xs);color:var(--text);display:flex;flex-direction:column;gap:4px}.exp-hover-card .hc-git-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}.exp-hover-card .hc-branch{display:inline-flex;align-items:center;gap:4px;font-family:var(--mono);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-hover-card .hc-foot{margin-top:8px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:var(--fs-2xs);color:var(--muted)}.exp-hover-card .hc-foot .hc-mono{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:var(--fs-md);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}.runs-table th{text-align:left;color:var(--text);font-size:var(--fs-xs);font-weight:var(--fw-semibold);padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:var(--fs-sm)}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--radius-md);background:var(--canvas);border:1px solid var(--border);font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--base);color:var(--subtext);font-size:var(--fs-md)}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:var(--fw-medium)}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:var(--fs-md)}.kv .k{color:var(--subtext)}.kv .v{font-family:var(--mono);font-size:var(--fs-sm);word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:var(--fs-sm);color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:var(--term-bg);padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:var(--fs-md);color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:var(--fs-sm);font-weight:var(--fw-semibold)}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-sm);border-radius:var(--radius-sm)}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:var(--fw-semibold)}.history-item .when{margin-left:auto;font-size:var(--fs-xs);color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--subtext)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm)}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:var(--fs-sm);color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:var(--fs-md);line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:var(--fs-2xl);font-weight:var(--fw-regular);color:var(--text)}.empty-state p.empty-state-hint{font-size:var(--fs-lg);color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-size:var(--fs-xl);font-weight:var(--fw-semibold);color:var(--muted);margin-bottom:18px}.onb-title{margin:0 0 6px;font-size:var(--fs-3xl);letter-spacing:-.01em}.onb-sub{color:var(--text);font-size:var(--fs-base);line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.onb-card-detail{font-size:var(--fs-sm)}.onb-card-meta{font-size:var(--fs-sm);color:var(--subtext)}.onb-card-meta code,.model-more code{font-family:var(--mono);font-size:var(--fs-xs);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);padding:1px 5px;white-space:nowrap}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:8px 0}.onb-fix{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;margin:6px 0 9px}.onb-aside{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-top:12px;padding-top:10px;border-top:1px solid var(--border-variant)}.onb-aside-text{font-size:var(--fs-xs);color:var(--muted);line-height:1.5}.onb-aside .onb-cmd-chip{max-width:100%}.onb-aside .onb-cmd-chip code{font-size:var(--fs-xs);white-space:normal;word-break:break-word}.onb-fix-label{font-size:var(--fs-md);font-weight:var(--fw-regular);color:var(--text)}.onb-fix-alt{margin-left:auto;padding:0;border:0;background:none;color:var(--muted);font-size:var(--fs-xs);text-decoration:underline;cursor:pointer}.onb-fix-alt:hover{color:var(--text)}.onb-cmd-chip{display:inline-flex;align-items:stretch;align-self:flex-start;max-width:100%;background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-sm);overflow:hidden}.onb-cmd-chip code{font-family:var(--mono);font-size:var(--fs-sm);padding:4px 9px}.onb-cmd-copy{display:inline-flex;align-items:center;flex-shrink:0;padding:0 8px;border:0;border-left:1px solid var(--border-variant);background:none;color:var(--muted);cursor:pointer}.onb-cmd-copy:hover{background:var(--surface);color:var(--text)}.onb-gate-hint{margin:18px 0 0;font-size:var(--fs-base);font-weight:var(--fw-semibold);line-height:1.5;color:var(--text)}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:var(--fs-sm)}.onb-token-form a{font-size:var(--fs-sm);color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:var(--fw-regular);font-size:var(--fs-xs);color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:var(--fs-md);font-weight:var(--fw-medium)}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:var(--fs-md);font-weight:var(--fw-semibold)}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:var(--fs-xs);color:var(--text);font-weight:var(--fw-medium)}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.settings-card>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:flex-start;justify-content:center;padding:var(--modal-top) 16px 24px;overflow-y:auto;z-index:100}.modal{width:480px;max-width:94vw;max-height:calc(100vh - var(--modal-top) - 48px);overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:var(--fs-xl)}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:4px 0}.settings-note{margin:10px 0 0;font-size:var(--fs-sm);padding:8px 10px;border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:var(--fw-medium)}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:var(--radius-full);transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:var(--fs-sm);color:var(--muted)}.progress-fill.indeterminate{width:30%;animation:progress-sweep 1.2s ease-in-out infinite}@keyframes progress-sweep{0%{margin-left:0}50%{margin-left:70%}to{margin-left:0}}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-family:var(--sans);font-size:var(--fs-xs);font-weight:var(--fw-medium);padding:1px 7px;border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;min-height:0;display:flex;background:var(--base)}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.ftree-pane{position:relative;flex-shrink:0;display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--border-variant);border-right:1px solid var(--border-variant);background:var(--base)}.ftree-resizer{position:absolute;right:-3px;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.ftree-resizer:hover,.ftree-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.ftree-scroll{flex:1;min-height:0;overflow-y:auto;padding:10px 8px}.ft-row{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:var(--radius-sm);cursor:pointer}.ft-row:hover{background:var(--surface)}.ft-row.selected,.ft-row.selected:hover{background:var(--panel)}.ft-chevron{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ft-chevron.open{transform:rotate(90deg)}.ft-chevron.spacer{visibility:hidden}.ft-title{flex:1;min-width:0;font-size:var(--fs-md);font-weight:var(--fw-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname,.ft-name{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname{color:var(--text)}.ft-thumb{width:18px;height:18px;object-fit:cover;border-radius:var(--radius-xs);border:1px solid var(--border-variant);flex-shrink:0}.ft-divider{padding:12px 8px 4px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted)}.ftree-footer{flex-shrink:0;display:flex;align-items:center;gap:2px;padding:5px 8px;border-top:1px solid var(--border-variant)}.ftree-footer code{flex:1;min-width:0;direction:rtl;text-align:left;font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-footer .icon-btn{width:22px;height:22px}.fpreview{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:var(--base)}.fpreview-none{align-items:center;justify-content:center;gap:8px;font-size:var(--fs-md);color:var(--muted)}.fpreview-head{height:40px;display:flex;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.fpreview-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fpreview-date,.fpreview-size{font-size:var(--fs-xs);color:var(--muted);white-space:nowrap;flex-shrink:0}.fpreview-body{flex:1;min-height:0;overflow:auto}.fpreview-body.doc{padding:18px 28px 48px}.fpreview-body.doc .report-md{max-width:var(--readable-col);margin:0 auto}.fpreview-image{display:flex;align-items:flex-start;justify-content:center;padding:24px}.fpreview-image img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.fpreview-pdf{display:block;width:100%;height:100%;border:0}.fpreview-video{display:block;max-width:100%;max-height:100%;margin:24px auto;border:1px solid var(--border);border-radius:var(--radius-sm);background:#0b0e18;image-rendering:pixelated}.fpreview-audio{display:block;width:calc(100% - 48px);margin:24px}.model-view{display:flex;flex-direction:column;width:100%;height:100%;min-height:320px}.model-view-canvas{flex:1;min-height:0;background:#0b0e18}.model-view-canvas canvas{display:block}.model-view-bar{display:flex;align-items:center;gap:8px;padding:6px 10px;border-top:1px solid var(--border)}.model-view-hint{flex:1;font-size:11px;color:var(--muted)}.chat-media{display:inline-flex;flex-direction:column;gap:2px;vertical-align:bottom;margin:2px 4px 2px 0}.chat-media-open{display:block;padding:0;border:1px solid var(--border);border-radius:var(--radius-sm);background:#0b0e18;cursor:pointer;overflow:hidden;line-height:0}.chat-media-open:disabled{cursor:default}.chat-media-open img,.chat-media-open video{display:block;max-width:320px;max-height:220px;image-rendering:pixelated}.chat-media-name{font-size:10px;color:var(--muted)}.model-view-clips{font-size:11px;color:var(--muted);font-family:var(--mono, ui-monospace, monospace)}.files-empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:24px;text-align:center;color:var(--muted)}.files-empty-state h3{margin:6px 0 0;font-size:var(--fs-base);font-weight:var(--fw-semibold);color:var(--text)}.files-empty-state p{margin:0;max-width:420px;font-size:var(--fs-md);line-height:1.55;color:var(--subtext)}.files-empty-state .ftree-footer{margin-top:10px;max-width:100%;border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;background:var(--base)}.files-empty-state .ftree-footer code{max-width:380px}.files-truncated{margin:0;padding:8px 14px;font-size:var(--fs-xs);color:var(--muted)}.report-md{font-size:var(--fs-lg)}.report-md h1{font-size:2em;line-height:1.18;margin:28px 0 14px}.report-md h2{font-size:1.5em;line-height:1.25;margin:28px 0 10px}.report-md h3{font-size:1.2em;line-height:1.35;margin:22px 0 8px}.report-md h4{font-size:1em;line-height:1.4;margin:18px 0 6px}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:var(--fs-sm);color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:var(--radius-md) var(--radius-md) 0 0}.diff-file-header .chev{color:var(--muted);font-size:var(--fs-2xs);flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:var(--fs-2xs);font-weight:var(--fw-medium);font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:var(--fs-md)}.truncated-notice{border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);padding:12px 14px;font-size:var(--fs-md)}.truncated-notice h4{margin:0 0 4px;font-size:var(--fs-md);color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:var(--fs-sm);line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:var(--fs-3xl)}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--text);font-size:var(--fs-md)}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:var(--fs-md);margin:4px 0 0}.muted{color:var(--muted)}:root{--persona-research: var(--accent-blue);--persona-game-designer: var(--accent-orange);--persona-idea-foundry: var(--accent-purple);--persona-analyst: var(--accent-teal);--persona-producer: var(--accent-pink);--persona-blender: var(--accent-amber);--persona-comfyui: var(--accent-green);--persona-game-artist: var(--accent-violet, #a78bfa)}.persona-swatch{flex:none;width:10px;height:10px;border-radius:var(--radius-full)}.persona-badge{display:inline-flex;align-items:center;gap:5px;flex:none;font-size:12px;font-weight:600;line-height:1;padding:3px 9px 3px 7px;border-radius:var(--radius-full);border:1px solid color-mix(in srgb,currentColor 32%,transparent);background:color-mix(in srgb,currentColor 12%,transparent);white-space:nowrap}.persona-badge svg{flex:none}.persona-badge.persona-research{color:var(--persona-research)}.persona-badge.persona-game-designer{color:var(--persona-game-designer)}.persona-badge.persona-idea-foundry{color:var(--persona-idea-foundry)}.persona-badge.persona-analyst{color:var(--persona-analyst)}.persona-badge.persona-producer{color:var(--persona-producer)}.persona-badge.persona-blender{color:var(--persona-blender)}.persona-badge.persona-comfyui{color:var(--persona-comfyui)}.persona-badge.persona-game-artist{color:var(--persona-game-artist)}.persona-badge.compact{padding:2px;border-color:transparent;background:transparent}.usage-pill-wrap{position:relative;display:inline-flex}.usage-pill{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 6px;border:1px solid var(--border);border-radius:var(--radius-full);background:var(--surface);font:inherit;font-size:var(--fs-sm);color:var(--muted);cursor:pointer;white-space:nowrap;transition:border-color .12s ease,background .12s ease}.usage-pill:hover{border-color:var(--muted)}.usage-pill b{color:var(--text);font-weight:var(--fw-semibold);font-variant-numeric:tabular-nums}.usage-pill .usage-reset{color:var(--faint, var(--muted));font-family:var(--mono);font-size:var(--fs-xs)}.usage-pill .usage-ghost{color:var(--muted)}.usage-ring{flex:none;display:block}.usage-pill.warn{border-color:color-mix(in srgb,var(--accent-amber) 45%,var(--border));background:color-mix(in srgb,var(--accent-amber) 9%,var(--surface))}.usage-pill.warn b{color:var(--accent-amber)}.usage-pill.crit{border-color:color-mix(in srgb,var(--accent-red) 50%,var(--border));background:color-mix(in srgb,var(--accent-red) 10%,var(--surface))}.usage-pill.crit b{color:var(--accent-red)}.usage-pop{position:absolute;bottom:calc(100% + 8px);right:0;z-index:60;width:288px;max-width:84vw;background:var(--surface-bright);border:1px solid var(--border);border-radius:var(--radius-lg, 12px);box-shadow:0 1px 2px #0000000f,0 12px 32px #00000024;overflow:hidden}.usage-pop-h{display:flex;align-items:center;justify-content:space-between;padding:11px 13px 8px;font-size:var(--fs-sm)}.usage-pop-h .who{font-weight:var(--fw-semibold);color:var(--text)}.usage-pop-h .obs{font-size:var(--fs-xs);color:var(--muted);font-family:var(--mono)}.usage-wrow{display:flex;align-items:center;gap:11px;padding:10px 13px;border-top:1px solid var(--border-variant)}.usage-wt{flex:1;min-width:0}.usage-wlabel{font-size:var(--fs-md);color:var(--text);font-weight:var(--fw-medium)}.usage-wsub{font-size:var(--fs-xs);color:var(--muted);font-family:var(--mono);margin-top:2px}.usage-bar{height:6px;border-radius:4px;background:var(--panel);overflow:hidden;margin-top:6px}.usage-bar i{display:block;height:100%;border-radius:4px}.usage-pct{flex:none;width:42px;text-align:right;font-size:var(--fs-base);font-weight:var(--fw-semibold);font-variant-numeric:tabular-nums}.usage-empty{padding:12px 13px;font-size:var(--fs-sm);color:var(--muted);border-top:1px solid var(--border-variant)}.usage-pop-foot{display:flex;align-items:center;justify-content:space-between;padding:8px 13px;border-top:1px solid var(--border-variant);background:var(--surface);font-size:var(--fs-sm)}.usage-refresh{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:var(--fs-sm);color:var(--subtext);background:none;border:none;cursor:pointer;padding:0}.usage-refresh:hover:not(:disabled){color:var(--text)}.usage-refresh:disabled{opacity:.6;cursor:default}.usage-pop-foot a{color:var(--primary);text-decoration:none}.usage-refresh .spin{animation:usage-spin .8s linear infinite}@keyframes usage-spin{to{transform:rotate(360deg)}}.persona-picker{position:relative;display:inline-flex}.persona-badge-btn{cursor:pointer;font:inherit;transition:filter .12s ease,box-shadow .12s ease}.persona-badge-btn:hover{filter:brightness(1.04);box-shadow:0 0 0 1px color-mix(in srgb,currentColor 30%,transparent)}.persona-badge-chev{color:currentColor;opacity:.7;margin-left:1px}.persona-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:60;width:320px;max-width:80vw;background:var(--surface-bright);border:1px solid var(--border);border-radius:var(--radius-lg, 12px);box-shadow:0 1px 2px #0000000f,0 12px 32px #00000024;overflow:hidden}.persona-menu-h{font-size:var(--fs-xs);font-weight:var(--fw-semibold);letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:11px 14px 6px}.persona-opt{display:flex;gap:11px;align-items:flex-start;width:100%;padding:9px 14px;border:none;border-top:1px solid var(--border-variant);background:transparent;cursor:pointer;text-align:left;font:inherit}.persona-opt:hover{background:var(--surface)}.persona-opt.sel{background:color-mix(in srgb,currentColor 8%,transparent)}.persona-opt-ic{flex:none;width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:color-mix(in srgb,currentColor 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,currentColor 28%,transparent)}.persona-opt-t{flex:1;min-width:0}.persona-opt-n{display:flex;align-items:center;gap:7px;font-size:var(--fs-md);font-weight:var(--fw-semibold)}.persona-opt-def{font-size:9.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:currentColor;border:1px solid color-mix(in srgb,currentColor 35%,transparent);border-radius:999px;padding:1px 6px}.persona-opt-d{display:block;font-size:var(--fs-sm);color:var(--subtext);margin-top:1px}.persona-opt-check{color:currentColor;font-weight:800;font-size:13px;align-self:center}.persona-menu-foot{font-size:var(--fs-sm);color:var(--muted);padding:9px 14px;border-top:1px solid var(--border-variant);background:var(--surface)}.persona-swatch.persona-research{background:var(--persona-research)}.persona-swatch.persona-game-designer{background:var(--persona-game-designer)}.persona-swatch.persona-idea-foundry{background:var(--persona-idea-foundry)}.persona-card.persona-research{border-left:3px solid var(--persona-research)}.persona-card.persona-game-designer{border-left:3px solid var(--persona-game-designer)}.persona-card.persona-idea-foundry{border-left:3px solid var(--persona-idea-foundry)}.persona-active-pill.persona-research{color:var(--persona-research);border-color:var(--persona-research)}.persona-active-pill.persona-game-designer{color:var(--persona-game-designer);border-color:var(--persona-game-designer)}.persona-active-pill.persona-idea-foundry{color:var(--persona-idea-foundry);border-color:var(--persona-idea-foundry)}.persona-bar{flex:none;width:4px;height:16px;border-radius:var(--radius-full)}.persona-bar.persona-research{background:var(--persona-research)}.persona-bar.persona-game-designer{background:var(--persona-game-designer)}.persona-bar.persona-idea-foundry{background:var(--persona-idea-foundry)}.persona-swatch.persona-analyst,.persona-bar.persona-analyst{background:var(--persona-analyst)}.persona-card.persona-analyst{border-left:3px solid var(--persona-analyst)}.persona-active-pill.persona-analyst{color:var(--persona-analyst);border-color:var(--persona-analyst)}.persona-swatch.persona-producer,.persona-bar.persona-producer{background:var(--persona-producer)}.persona-card.persona-producer{border-left:3px solid var(--persona-producer)}.persona-active-pill.persona-producer{color:var(--persona-producer);border-color:var(--persona-producer)}.persona-swatch.persona-blender,.persona-bar.persona-blender{background:var(--persona-blender)}.persona-card.persona-blender{border-left:3px solid var(--persona-blender)}.persona-active-pill.persona-blender{color:var(--persona-blender);border-color:var(--persona-blender)}.persona-swatch.persona-game-artist,.persona-bar.persona-game-artist{background:var(--persona-game-artist)}.persona-swatch.persona-comfyui,.persona-bar.persona-comfyui{background:var(--persona-comfyui)}.persona-card.persona-comfyui{border-left:3px solid var(--persona-comfyui)}.persona-active-pill.persona-comfyui{color:var(--persona-comfyui);border-color:var(--persona-comfyui)}.session-row .session-titlewrap{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:1px;overflow:hidden}.session-row .session-titlewrap .session-title{flex:0 0 auto}.session-row .session-sub{font-size:11px;line-height:1.2;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row.nested{border-left:2px solid var(--border);border-radius:0 var(--radius-md) var(--radius-md) 0;margin-left:6px}.session-row.nested.active{border-left-color:var(--primary)}.proposal-card{display:flex;flex-direction:column;gap:9px;padding:12px 13px;border:1px solid color-mix(in srgb,var(--accent, var(--primary)) 34%,var(--border));border-radius:var(--radius-lg, 12px);background:color-mix(in srgb,var(--accent, var(--primary)) 6%,var(--surface-bright))}.proposal-eyebrow{display:flex;align-items:center;gap:7px;font-size:var(--fs-xs);font-weight:var(--fw-semibold);letter-spacing:.05em;text-transform:uppercase;color:var(--accent, var(--primary))}.proposal-eyebrow b{font-weight:700}.proposal-task{font-size:var(--fs-md);color:var(--text);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.proposal-why{font-size:var(--fs-sm);color:var(--muted);font-style:italic}.proposal-fields{display:flex;flex-direction:column;gap:6px;padding:8px;border-radius:var(--radius-md);background:color-mix(in srgb,var(--text) 4%,transparent)}.proposal-fields label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:var(--fs-sm);color:var(--muted)}.proposal-fields select{flex:1;min-width:0;max-width:62%;padding:3px 6px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-bright);color:var(--text);font-size:var(--fs-sm)}.proposal-err{font-size:var(--fs-sm);color:var(--accent-red)}.proposal-actions{display:flex;align-items:center;gap:8px;margin-top:2px}.proposal-approve{font:inherit;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:#fff;background:var(--accent, var(--primary));border:none;border-radius:var(--radius-md);padding:7px 16px;cursor:pointer;transition:filter .12s ease}.proposal-approve:hover:not(:disabled){filter:brightness(1.06)}.proposal-approve:disabled{opacity:.55;cursor:default}.proposal-secondary{font:inherit;font-size:var(--fs-md);color:var(--subtext);background:transparent;border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 13px;cursor:pointer}.proposal-secondary:hover:not(:disabled){background:var(--surface);color:var(--text)}.proposal-secondary:disabled{opacity:.55;cursor:default}.persona-bar.sm{width:3px;height:12px;margin-right:-4px}.persona-prompt-toggles{display:flex;flex-direction:column;gap:8px;margin-top:10px}.persona-prompt-toggle{display:flex;align-items:baseline;gap:8px;font-size:var(--fs-sm);cursor:pointer}.persona-prompt-toggle input{accent-color:var(--primary)}.persona-prompt-label{font-weight:var(--fw-semibold);color:var(--text)}.persona-prompt-hint{color:var(--muted)}.persona-section-title{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);margin:14px 0 4px}.persona-section-title:first-child{margin-top:0}.persona-skill-list{display:flex;flex-direction:column;margin-bottom:6px}.persona-skill{border-top:1px solid var(--border)}.persona-skill:first-child{border-top:none}.persona-skill-head{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:8px 4px;border-radius:var(--radius-sm)}.persona-skill-head:hover{background:var(--surface)}.persona-skill-name{font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);flex:none}.persona-skill-desc{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--fs-sm)}.persona-doc{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);padding:2px 14px;margin:4px 0 10px;max-height:440px;overflow-y:auto;font-size:var(--fs-sm)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg)}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:var(--radius-lg)}.compute-row.open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--fs-sm)}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:var(--radius-sm)}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:var(--fs-sm)}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:var(--fs-sm);color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.harness-usage{display:flex;flex-direction:column;gap:4px;font-family:var(--sans);font-size:var(--fs-sm)}.usage-window{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.usage-win-label{color:var(--subtext);min-width:60px}.usage-bar{flex:0 0 88px;height:6px;border-radius:3px;background:var(--muted);overflow:hidden}.usage-bar-fill{display:block;height:100%;border-radius:3px;background:var(--accent-green);transition:width .3s ease}.usage-bar-fill.low{background:var(--accent-red)}.usage-pct{font-variant-numeric:tabular-nums}.usage-reset{color:var(--subtext);font-variant-numeric:tabular-nums;white-space:nowrap}.usage-asof{color:var(--subtext);font-size:var(--fs-xs)}.harness-usage-note{font-family:var(--sans);font-size:var(--fs-sm);word-break:normal;overflow-wrap:anywhere}.env-table{width:100%;border-collapse:collapse;font-size:var(--fs-md);table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:var(--fs-md)}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:var(--fw-medium);color:var(--text)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:var(--fs-xs)}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-sm);color:var(--text);padding:5px 8px;border-radius:var(--radius-sm);white-space:nowrap;min-width:0}.pill-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:var(--fs-sm);color:var(--text);padding:5px 4px;border-radius:var(--radius-sm);white-space:nowrap;min-width:0}.composer-bare:hover{color:var(--text)}.composer-budgets{display:flex;align-items:center;gap:8px;flex:none;white-space:nowrap}.composer-budgets:empty{display:none}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.composer-bare.context-ring{display:inline-flex;align-items:center;margin-right:8px}.context-meter-menu{width:280px;padding:10px 12px 12px}.context-meter-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:var(--fs-sm);color:var(--muted)}.context-meter-value{color:var(--text);font-variant-numeric:tabular-nums}.context-meter-menu .progress{margin:8px 0 0}.context-meter-menu .progress-track{height:5px;border:none;background:var(--border)}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 8px)}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:var(--fw-regular)}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:var(--fs-md);outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted);padding:8px 8px 4px}.model-group-status{display:inline-flex;align-items:center;gap:4px;color:var(--accent-amber);font-weight:var(--fw-regular)}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-md);border-radius:var(--radius-sm)}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:var(--fs-2xs);color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:var(--fs-xs);color:var(--muted)}.model-unavailable{line-height:1.5;border-bottom:1px solid var(--border-variant)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:var(--fs-xs);color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:var(--radius-sm)}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-size:var(--fs-sm)}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:var(--fs-xs);color:var(--subtext)}.skill-chip{display:inline-flex;align-items:center;padding:1px 7px;font-family:var(--mono);font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--primary);background:var(--primary-subtle);border:1px solid var(--border-variant);border-radius:var(--radius-sm)}.composer-input{position:relative;display:flex;overflow:hidden}.composer-input textarea{flex:1}.composer-chip{position:absolute;top:9px;left:12px;z-index:1;pointer-events:none}.msg-user .skill-chip{margin-right:2px;vertical-align:baseline}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--text);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:var(--fs-sm);line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:var(--fs-sm);color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:var(--fs-base)}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.prompt-head code{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text)}.prompt-sub{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-q{font-size:var(--fs-base);font-weight:var(--fw-semibold);line-height:1.5;color:var(--text)}.prompt-plan{font-size:var(--fs-base);line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:var(--fs-md);font-weight:var(--fw-semibold)}.prompt-option-desc{display:block;font-size:var(--fs-sm);font-weight:var(--fw-regular);line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid transparent;border-radius:var(--radius-sm);cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:var(--fs-md);margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:var(--fw-semibold);word-break:break-word}.prompt-outcome{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:var(--fs-md);color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:var(--fw-semibold)}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:var(--fs-md);cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:var(--radius-md);padding:9px 11px;font-size:var(--fs-md);font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:var(--fs-md);font-weight:var(--fw-semibold);white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--text);font-size:var(--fs-md);cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:var(--fs-sm);padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:var(--fs-sm)}.code-tab-note{padding:8px 16px;font-size:var(--fs-sm);color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:var(--fs-md)}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wt-branch-chip{display:inline-flex;align-items:center;gap:4px;min-width:0;padding:2px 8px;border-radius:var(--radius-full);background:color-mix(in oklab,var(--text) 8%,transparent);color:var(--subtext);font-size:var(--fs-xs)}.wt-branch-chip>svg{flex-shrink:0}.wt-branch-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono)}.wt-count{padding:0;border:none}.wt-changes{padding:0 16px 24px}.wt-changes>:first-child{margin-top:14px}.wt-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:48px 24px;text-align:center;color:var(--muted)}.wt-empty>svg{color:var(--subtext)}.wt-empty p{margin:0;max-width:320px;font-size:var(--fs-sm)}.tour-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200}.tour-dim{position:absolute;top:0;right:0;bottom:0;left:0;background:#0000008c}.tour-spotlight{position:absolute;border-radius:var(--radius-lg);box-shadow:0 0 0 9999px #0000008c;transition:all .3s ease}.tour-ring{position:absolute;border-radius:var(--radius-lg);border:2px solid var(--primary);transition:all .3s ease}.tour-card{position:absolute;width:390px;max-width:calc(100vw - 32px);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:21px 23px 0;transition:left .2s ease,top .2s ease}.tour-card.centered{left:50%;top:50%;transform:translate(-50%,-50%);transition:none}.tour-card h3{margin:0 26px 7px 0;font-size:var(--fs-lg);font-weight:var(--fw-semibold)}.tour-card p{margin:0;font-size:var(--fs-base);line-height:1.55;color:var(--text)}.tour-card .tour-close{position:absolute;top:12px;right:12px}.tour-footer{display:flex;align-items:center;border-top:1px solid var(--border-variant);margin-top:16px;padding:11px 0}.tour-footer-side{flex:1;display:flex}.tour-footer-side.end{justify-content:flex-end}.tour-count{font-size:var(--fs-sm);color:var(--muted);font-variant-numeric:tabular-nums}.tour-arrow{position:absolute;width:12px;height:12px;background:var(--base);rotate:45deg;pointer-events:none}.tour-arrow.above{bottom:-6.5px;left:calc(50% - 6px);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.tour-arrow.below{top:-6.5px;left:calc(50% - 6px);border-left:1px solid var(--border);border-top:1px solid var(--border)}.tour-arrow.left{right:-6.5px;top:calc(50% - 6px);border-top:1px solid var(--border);border-right:1px solid var(--border)}.tour-arrow.right{left:-6.5px;top:calc(50% - 6px);border-bottom:1px solid var(--border);border-left:1px solid var(--border)}.exp-detail{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.exp-detail-body{position:relative;flex:1;min-height:0}.exp-verdict-strip{display:flex;align-items:center;gap:8px;min-height:34px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.verdict-control{display:inline-flex;align-items:center;gap:4px}.verdict-label{font-size:var(--fs-sm);color:var(--text-dim);margin-right:2px}.verdict-chip{border:1px solid var(--border);border-radius:999px;background:transparent;color:var(--text-dim);font-size:var(--fs-sm);padding:2px 9px;cursor:pointer}.verdict-chip:hover{color:var(--text);border-color:var(--text-dim)}.verdict-chip.keep.active{background:var(--accent-green, #2e7d32);border-color:transparent;color:#fff}.verdict-chip.kill.active{background:var(--accent-red, #c62828);border-color:transparent;color:#fff}.verdict-chip.iterate.active{background:var(--accent-amber, #ef6c00);border-color:transparent;color:#fff}.verdict-notes{width:220px}.verdict-notes-preview{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-sm);color:var(--text-dim)}.results-strip{padding:8px 10px;border-bottom:1px solid var(--border);flex-shrink:0}.metric-chips{display:flex;flex-wrap:wrap;gap:6px}.metric-chip{display:inline-flex;align-items:baseline;gap:6px;border:1px solid var(--border);border-radius:8px;padding:3px 8px;font-size:var(--fs-sm);background:var(--panel)}.metric-chip .metric-key{color:var(--text-dim)}.metric-chip .metric-value{font-weight:var(--fw-semibold);color:var(--text);font-variant-numeric:tabular-nums}.metric-delta{font-size:var(--fs-xs, 11px);font-variant-numeric:tabular-nums}.metric-delta.up{color:var(--accent-green, #2e7d32)}.metric-delta.down{color:var(--accent-red, #c62828)}.artifact-gallery{padding:8px 10px;border-bottom:1px solid var(--border);flex-shrink:0;max-height:220px;overflow-y:auto}.artifact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.artifact-grid img{width:100%;height:90px;object-fit:cover;border-radius:8px;border:1px solid var(--border);background:var(--panel)}.artifact-files{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.artifact-file{font-size:var(--fs-sm);color:var(--text-dim);border:1px solid var(--border);border-radius:6px;padding:2px 8px;text-decoration:none}.artifact-file:hover{color:var(--text)}.play-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.play-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.play-entry-input{width:280px}.play-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.node-eyebrow-left{display:inline-flex;align-items:center;gap:5px}.node-eyebrow-left .node-gh{padding:1px}.session-clock{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-sm);color:var(--text-dim);font-variant-numeric:tabular-nums}.session-clock .dot{width:7px;height:7px;border-radius:50%;background:var(--accent-green, #2e7d32);animation:pulse 2s ease-in-out infinite}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative} diff --git a/ui/dist/assets/index-CyZUGDtK.css b/ui/dist/assets/index-CyZUGDtK.css new file mode 100644 index 000000000..516db18ec --- /dev/null +++ b/ui/dist/assets/index-CyZUGDtK.css @@ -0,0 +1,32 @@ +@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-outline-style:solid;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:4px;--radius-sm:6px;--radius-md:8px;--radius-lg:10px;--radius-xl:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--radius-full:999px}}@layer base,vendor,components;@layer utilities{.\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.top-0{top:0}.right-0{right:0}.bottom-\[calc\(100\%_\+_4px\)\]{bottom:calc(100% + 4px)}.bottom-\[calc\(100\%_\+_8px\)\]{bottom:calc(100% + 8px)}.left-0{left:0}.z-6{z-index:6}.z-10{z-index:10}.z-50{z-index:50}.z-60{z-index:60}.z-200{z-index:200}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-0{margin-inline:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-0{margin-block:0}.my-\[5px\]{margin-block:5px}.mt-0{margin-top:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-0{margin-bottom:0}.mb-1{margin-bottom:var(--spacing)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\.5{margin-bottom:calc(var(--spacing) * 3.5)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-4\.5{margin-bottom:calc(var(--spacing) * 4.5)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-\[7px\]{height:7px}.h-\[13px\]{height:13px}.h-\[15px\]{height:15px}.h-full{height:100%}.h-px{height:1px}.max-h-95{max-height:calc(var(--spacing) * 95)}.max-h-100{max-height:calc(var(--spacing) * 100)}.max-h-\[min\(70vh\,_720px\)\]{max-height:min(70vh,720px)}.min-h-0{min-height:0}.w-3{width:calc(var(--spacing) * 3)}.w-7{width:calc(var(--spacing) * 7)}.w-70{width:calc(var(--spacing) * 70)}.w-72{width:calc(var(--spacing) * 72)}.w-97\.5{width:calc(var(--spacing) * 97.5)}.w-\[7px\]{width:7px}.w-\[13px\]{width:13px}.w-\[15px\]{width:15px}.w-full{width:100%}.max-w-36{max-width:calc(var(--spacing) * 36)}.max-w-68{max-width:calc(var(--spacing) * 68)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-\[calc\(100vw_-_32px\)\]{max-width:calc(100vw - 32px)}.max-w-full{max-width:100%}.max-w-readable{max-width:var(--readable-col)}.min-w-0{min-width:0}.min-w-47\.5{min-width:calc(var(--spacing) * 47.5)}.min-w-80{min-width:calc(var(--spacing) * 80)}.min-w-85{min-width:calc(var(--spacing) * 85)}.min-w-max{min-width:max-content}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[settings-spin_0\.9s_linear_infinite\]{animation:.9s linear infinite settings-spin}.animate-\[spin_0\.8s_linear_infinite\]{animation:.8s linear infinite spin}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[minmax\(180px\,_260px\)_minmax\(0\,_1fr\)\]{grid-template-columns:minmax(180px,260px) minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-\[0\.4em\]{gap:.4em}.gap-\[3px\]{gap:3px}.gap-\[5px\]{gap:5px}.gap-\[7px\]{gap:7px}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-\[3px\]{row-gap:3px}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[var\(--radius-md\)_var\(--radius-md\)_0_0\]{border-radius:var(--radius-md) var(--radius-md) 0 0}.rounded-full{border-radius:999px}.rounded-lg{border-radius:10px}.rounded-md{border-radius:8px}.rounded-sm{border-radius:6px}.rounded-xl{border-radius:12px}.rounded-xs{border-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-l-\[3px\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-accent-amber{border-color:var(--accent-amber)}.border-border{border-color:var(--border)}.border-border-variant{border-color:var(--border-variant)}.border-primary{border-color:var(--primary)}.border-transparent{border-color:#0000}.border-t-border{border-top-color:var(--border)}.border-t-border-variant{border-top-color:var(--border-variant)}.border-t-primary{border-top-color:var(--primary)}.border-r-border-variant{border-right-color:var(--border-variant)}.border-b-border-variant{border-bottom-color:var(--border-variant)}.border-l-accent-blue{border-left-color:var(--accent-blue)}.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 10%,transparent)}}.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:color-mix(in srgb,var(--primary) 16%,transparent)}}.bg-\[rgba\(0\,_0\,_0\,_0\.55\)\]{background-color:#0000008c}.bg-accent{background-color:var(--accent)}.bg-accent-amber-subtle{background-color:var(--accent-amber-subtle)}.bg-background{background-color:var(--base)}.bg-border-variant{background-color:var(--border-variant)}.bg-canvas{background-color:var(--canvas)}.bg-muted{background-color:var(--muted)}.bg-surface{background-color:var(--surface)}.bg-transparent{background-color:#0000}.bg-none{background-image:none}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-\[3px\]{padding:3px}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-4\.5{padding-inline:calc(var(--spacing) * 4.5)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-\[7px\]{padding-inline:7px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[23px\]{padding-inline:23px}.py-0{padding-block:0}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6\.5{padding-block:calc(var(--spacing) * 6.5)}.py-\[3px\]{padding-block:3px}.py-\[5px\]{padding-block:5px}.py-\[7px\]{padding-block:7px}.py-\[9px\]{padding-block:9px}.py-\[11px\]{padding-block:11px}.py-px{padding-block:1px}.pt-0{padding-top:0}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-\[21px\]{padding-top:21px}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-0{padding-bottom:0}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-15{padding-bottom:calc(var(--spacing) * 15)}.pl-3\.5{padding-left:calc(var(--spacing) * 3.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-baseline{vertical-align:baseline}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-2xs{font-size:var(--fs-2xs)}.text-\[length\:inherit\]{font-size:inherit}.text-lg{font-size:var(--fs-lg)}.text-md{font-size:var(--fs-md)}.text-sm{font-size:var(--fs-sm)}.text-xs{font-size:var(--fs-xs)}.leading-\[1\.55\]{--tw-leading:1.55;line-height:1.55}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.font-normal{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\[tab-size\:4\]{-moz-tab-size:4;tab-size:4}.text-\[\#d97757\]{color:#d97757}.text-accent-amber{color:var(--accent-amber)}.text-accent-blue{color:var(--accent-blue)}.text-accent-green{color:var(--accent-green)}.text-accent-red{color:var(--accent-red)}.text-muted{color:var(--muted)}.text-primary{color:var(--primary)}.text-subtext{color:var(--subtext)}.text-text{color:var(--text)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.shadow-\[0_0_0_9999px_rgba\(0\,_0\,_0\,_0\.55\)\]{--tw-shadow:0 0 0 9999px var(--tw-shadow-color,#0000008c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_10px_rgb\(0_0_0_\/_6\%\)\]{--tw-shadow:0 2px 10px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_20px_rgb\(0_0_0_\/_12\%\)\]{--tw-shadow:0 6px 20px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_26px_rgba\(0\,_0\,_0\,_0\.16\)\]{--tw-shadow:0 10px 26px var(--tw-shadow-color,#00000029);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_32px_rgba\(0\,_0\,_0\,_0\.18\)\]{--tw-shadow:0 12px 32px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_60px_rgba\(0\,_0\,_0\,_0\.22\)\]{--tw-shadow:0 24px 60px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_2px_0_0_var\(--primary\)\]{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--primary));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[background\,border-color\,color\]{transition-property:background,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\]{transition-property:background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,background\]{transition-property:border-color,background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,top\]{transition-property:left,top;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-standard{--tw-ease:ease;transition-timing-function:ease}.select-none{-webkit-user-select:none;user-select:none}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}@media(hover:hover){.hover\:bg-surface:hover{background-color:var(--surface)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.\[\&_\.actions\]\:mt-1\.5 .actions{margin-top:calc(var(--spacing) * 1.5)}.\[\&_\.actions\]\:flex .actions{display:flex}.\[\&_\.actions\]\:justify-end .actions{justify-content:flex-end}.\[\&_\.actions\]\:gap-2\.5 .actions{gap:calc(var(--spacing) * 2.5)}.\[\&_\.backend-detail\]\:text-muted .backend-detail{color:var(--muted)}.\[\&_\.backend-name\]\:font-medium .backend-name{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.badge\]\:ml-2 .badge{margin-left:calc(var(--spacing) * 2)}.\[\&_\.badge\]\:flex-none .badge{flex:none}.\[\&_\.btn-ghost\]\:inline-flex .btn-ghost{display:inline-flex}.\[\&_\.btn-ghost\]\:cursor-pointer .btn-ghost{cursor:pointer}.\[\&_\.btn-ghost\]\:items-center .btn-ghost{align-items:center}.\[\&_\.btn-ghost\]\:gap-1\.5 .btn-ghost{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:rounded-sm .btn-ghost{border-radius:6px}.\[\&_\.btn-ghost\]\:border .btn-ghost{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-ghost\]\:border-border .btn-ghost{border-color:var(--border)}.\[\&_\.btn-ghost\]\:border-text .btn-ghost{border-color:var(--text)}.\[\&_\.btn-ghost\]\:bg-transparent .btn-ghost{background-color:#0000}.\[\&_\.btn-ghost\]\:px-\[13px\] .btn-ghost{padding-inline:13px}.\[\&_\.btn-ghost\]\:py-1\.5 .btn-ghost{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:font-\[inherit\] .btn-ghost{font-family:inherit}.\[\&_\.btn-ghost\]\:text-sm .btn-ghost{font-size:var(--fs-sm)}.\[\&_\.btn-ghost\]\:font-semibold .btn-ghost{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-ghost\]\:text-text .btn-ghost{color:var(--text)}.\[\&_\.btn-ghost\]\:transition-\[background\,border-color\] .btn-ghost{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-ghost\]\:duration-80 .btn-ghost{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-ghost\]\:ease-standard .btn-ghost{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:border-text .btn-ghost:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-ghost:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:text-text .btn-ghost:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-ghost:hover:not(:disabled){opacity:1}.\[\&_\.btn-primary\]\:inline-flex .btn-primary{display:inline-flex}.\[\&_\.btn-primary\]\:cursor-pointer .btn-primary{cursor:pointer}.\[\&_\.btn-primary\]\:items-center .btn-primary{align-items:center}.\[\&_\.btn-primary\]\:gap-1\.5 .btn-primary{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:rounded-sm .btn-primary{border-radius:6px}.\[\&_\.btn-primary\]\:border .btn-primary{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-primary\]\:border-text .btn-primary{border-color:var(--text)}.\[\&_\.btn-primary\]\:bg-transparent .btn-primary{background-color:#0000}.\[\&_\.btn-primary\]\:px-\[13px\] .btn-primary{padding-inline:13px}.\[\&_\.btn-primary\]\:py-1\.5 .btn-primary{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:font-\[inherit\] .btn-primary{font-family:inherit}.\[\&_\.btn-primary\]\:text-sm .btn-primary{font-size:var(--fs-sm)}.\[\&_\.btn-primary\]\:font-semibold .btn-primary{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-primary\]\:text-text .btn-primary{color:var(--text)}.\[\&_\.btn-primary\]\:transition-\[background\,border-color\] .btn-primary{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-primary\]\:duration-80 .btn-primary{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-primary\]\:ease-standard .btn-primary{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-primary\:first-child\]\:rounded-tr-none .btn-primary:first-child{border-top-right-radius:0}.\[\&_\.btn-primary\:first-child\]\:rounded-br-none .btn-primary:first-child{border-bottom-right-radius:0}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:border-text .btn-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-primary:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:text-text .btn-primary:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-primary:hover:not(:disabled){opacity:1}.\[\&_\.chev\]\:w-3 .chev{width:calc(var(--spacing) * 3)}.\[\&_\.chev\]\:shrink-0 .chev{flex-shrink:0}.\[\&_\.chev\]\:text-2xs .chev{font-size:var(--fs-2xs)}.\[\&_\.chev\]\:text-muted .chev{color:var(--muted)}.\[\&_\.dot\]\:h-\[7px\] .dot{height:7px}.\[\&_\.dot\]\:w-\[7px\] .dot{width:7px}.\[\&_\.dot\]\:shrink-0 .dot{flex-shrink:0}.\[\&_\.dot\]\:rounded-full .dot{border-radius:999px}.\[\&_\.dot\]\:bg-current .dot{background-color:currentColor}.\[\&_\.error\]\:basis-full .error{flex-basis:100%}.\[\&_\.error\]\:text-md .error{font-size:var(--fs-md)}.\[\&_\.error\]\:whitespace-pre-wrap .error{white-space:pre-wrap}.\[\&_\.error\]\:text-accent-red .error{color:var(--accent-red)}.\[\&_\.folder-picker-chevron\]\:flex-none .folder-picker-chevron{flex:none}.\[\&_\.folder-picker-chevron\]\:text-muted .folder-picker-chevron{color:var(--muted)}.\[\&_\.folder-picker-control\]\:flex .folder-picker-control{display:flex}.\[\&_\.folder-picker-control\]\:w-full .folder-picker-control{width:100%}.\[\&_\.folder-picker-control\]\:min-w-0 .folder-picker-control{min-width:0}.\[\&_\.folder-picker-control\]\:cursor-pointer .folder-picker-control{cursor:pointer}.\[\&_\.folder-picker-control\]\:items-center .folder-picker-control{align-items:center}.\[\&_\.folder-picker-control\]\:gap-\[9px\] .folder-picker-control{gap:9px}.\[\&_\.folder-picker-control\]\:overflow-hidden .folder-picker-control{overflow:hidden}.\[\&_\.folder-picker-control\]\:rounded-md .folder-picker-control{border-radius:8px}.\[\&_\.folder-picker-control\]\:border .folder-picker-control{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.folder-picker-control\]\:border-border .folder-picker-control{border-color:var(--border)}.\[\&_\.folder-picker-control\]\:bg-background .folder-picker-control{background-color:var(--base)}.\[\&_\.folder-picker-control\]\:px-2\.5 .folder-picker-control{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.folder-picker-control\]\:py-2 .folder-picker-control{padding-block:calc(var(--spacing) * 2)}.\[\&_\.folder-picker-control\]\:text-left .folder-picker-control{text-align:left}.\[\&_\.folder-picker-control\]\:transition-\[border-color\,box-shadow\] .folder-picker-control{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.folder-picker-control\]\:duration-120 .folder-picker-control{--tw-duration:.12s;transition-duration:.12s}.\[\&_\.folder-picker-control\]\:ease-standard .folder-picker-control{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.folder-picker-control_\.placeholder\]\:text-muted .folder-picker-control .placeholder{color:var(--muted)}.\[\&_\.folder-picker-control_span\]\:min-w-0 .folder-picker-control span{min-width:0}.\[\&_\.folder-picker-control_span\]\:flex-1 .folder-picker-control span{flex:1}.\[\&_\.folder-picker-control_span\]\:overflow-hidden .folder-picker-control span{overflow:hidden}.\[\&_\.folder-picker-control_span\]\:text-ellipsis .folder-picker-control span{text-overflow:ellipsis}.\[\&_\.folder-picker-control_span\]\:whitespace-nowrap .folder-picker-control span{white-space:nowrap}.\[\&_\.folder-picker-control\:disabled\]\:cursor-default .folder-picker-control:disabled{cursor:default}.\[\&_\.folder-picker-control\:disabled\]\:opacity-65 .folder-picker-control:disabled{opacity:.65}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-2 .folder-picker-control:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-offset-2 .folder-picker-control:focus-visible{outline-offset:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-text .folder-picker-control:focus-visible{outline-color:var(--text)}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-solid .folder-picker-control:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:border-muted .folder-picker-control:hover:not(:disabled){border-color:var(--muted)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:shadow-\[0_2px_8px_rgb\(0_0_0_\/_5\%\)\] .folder-picker-control:hover:not(:disabled){--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)_\.folder-picker-chevron\]\:text-subtext .folder-picker-control:hover:not(:disabled) .folder-picker-chevron{color:var(--subtext)}.\[\&_\.folder-picker-hint\]\:text-sm .folder-picker-hint{font-size:var(--fs-sm)}.\[\&_\.folder-picker-hint\]\:leading-\[1\.4\] .folder-picker-hint{--tw-leading:1.4;line-height:1.4}.\[\&_\.folder-picker-hint\]\:font-normal .folder-picker-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.folder-picker-hint\]\:text-subtext .folder-picker-hint{color:var(--subtext)}.\[\&_\.folder-picker-icon\]\:flex-none .folder-picker-icon{flex:none}.\[\&_\.folder-picker-icon\]\:text-current .folder-picker-icon{color:currentColor}.\[\&_\.form-seg\]\:mb-0\.5 .form-seg{margin-bottom:calc(var(--spacing) * .5)}.\[\&_\.form-seg\]\:self-start .form-seg{align-self:flex-start}.\[\&_\.form-seg_button\]\:px-3 .form-seg button{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.form-seg_button\]\:py-\[5px\] .form-seg button{padding-block:5px}.\[\&_\.hc-actions\]\:mt-2\.5 .hc-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions\]\:flex .hc-actions{display:flex}.\[\&_\.hc-actions\]\:items-center .hc-actions{align-items:center}.\[\&_\.hc-actions\]\:gap-1\.5 .hc-actions{gap:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:inline-flex .hc-actions button{display:inline-flex}.\[\&_\.hc-actions_button\]\:min-w-21 .hc-actions button{min-width:calc(var(--spacing) * 21)}.\[\&_\.hc-actions_button\]\:items-center .hc-actions button{align-items:center}.\[\&_\.hc-actions_button\]\:justify-center .hc-actions button{justify-content:center}.\[\&_\.hc-actions_button\]\:gap-\[5px\] .hc-actions button{gap:5px}.\[\&_\.hc-actions_button\]\:rounded-md .hc-actions button{border-radius:8px}.\[\&_\.hc-actions_button\]\:border .hc-actions button{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.hc-actions_button\]\:border-border .hc-actions button{border-color:var(--border)}.\[\&_\.hc-actions_button\]\:bg-background .hc-actions button{background-color:var(--base)}.\[\&_\.hc-actions_button\]\:px-2\.5 .hc-actions button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions_button\]\:py-1\.5 .hc-actions button{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:text-sm .hc-actions button{font-size:var(--fs-sm)}.\[\&_\.hc-actions_button\]\:font-medium .hc-actions button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-actions_button\]\:text-text .hc-actions button{color:var(--text)}.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:color-mix(in oklab,var(--border) 55%,var(--text))}}.\[\&_\.hc-actions_button\:hover\]\:bg-canvas .hc-actions button:hover{background-color:var(--canvas)}.\[\&_\.hc-body\]\:mt-2\.5 .hc-body{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:line-clamp-10 .hc-body{-webkit-line-clamp:10;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-body\]\:border-t .hc-body{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-body\]\:border-t-border-variant .hc-body{border-top-color:var(--border-variant)}.\[\&_\.hc-body\]\:pt-2\.5 .hc-body{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:leading-\[1\.6\] .hc-body{--tw-leading:1.6;line-height:1.6}.\[\&_\.hc-body\]\:whitespace-pre-line .hc-body{white-space:pre-line}.\[\&_\.hc-body\.expanded\]\:line-clamp-none .hc-body.expanded{-webkit-line-clamp:unset;-webkit-box-orient:horizontal;display:block;overflow:visible}.\[\&_\.hc-body\.expanded\]\:block .hc-body.expanded{display:block}.\[\&_\.hc-body\.expanded\]\:max-h-\[45vh\] .hc-body.expanded{max-height:45vh}.\[\&_\.hc-body\.expanded\]\:overflow-x-hidden .hc-body.expanded{overflow-x:hidden}.\[\&_\.hc-body\.expanded\]\:overflow-y-auto .hc-body.expanded{overflow-y:auto}.\[\&_\.hc-body\.expanded\]\:pb-1 .hc-body.expanded{padding-bottom:var(--spacing)}.\[\&_\.hc-branch\]\:inline-flex .hc-branch{display:inline-flex}.\[\&_\.hc-branch\]\:min-w-0 .hc-branch{min-width:0}.\[\&_\.hc-branch\]\:items-center .hc-branch{align-items:center}.\[\&_\.hc-branch\]\:gap-1 .hc-branch{gap:var(--spacing)}.\[\&_\.hc-branch\]\:overflow-hidden .hc-branch{overflow:hidden}.\[\&_\.hc-branch\]\:font-mono .hc-branch{font-family:var(--mono)}.\[\&_\.hc-branch\]\:text-ellipsis .hc-branch{text-overflow:ellipsis}.\[\&_\.hc-branch\]\:whitespace-nowrap .hc-branch{white-space:nowrap}.\[\&_\.hc-failure\]\:mt-2 .hc-failure{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-failure\]\:line-clamp-3 .hc-failure{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-failure\]\:text-accent-red .hc-failure{color:var(--accent-red)}.\[\&_\.hc-foot\]\:mt-2 .hc-foot{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-foot\]\:flex .hc-foot{display:flex}.\[\&_\.hc-foot\]\:items-center .hc-foot{align-items:center}.\[\&_\.hc-foot\]\:justify-between .hc-foot{justify-content:space-between}.\[\&_\.hc-foot\]\:gap-2\.5 .hc-foot{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-foot\]\:text-2xs .hc-foot{font-size:var(--fs-2xs)}.\[\&_\.hc-foot\]\:text-muted .hc-foot{color:var(--muted)}.\[\&_\.hc-foot_\.hc-mono\]\:min-w-0 .hc-foot .hc-mono{min-width:0}.\[\&_\.hc-foot_\.hc-mono\]\:overflow-hidden .hc-foot .hc-mono{overflow:hidden}.\[\&_\.hc-foot_\.hc-mono\]\:text-ellipsis .hc-foot .hc-mono{text-overflow:ellipsis}.\[\&_\.hc-foot_\.hc-mono\]\:whitespace-nowrap .hc-foot .hc-mono{white-space:nowrap}.\[\&_\.hc-git\]\:mt-2\.5 .hc-git{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-git\]\:flex .hc-git{display:flex}.\[\&_\.hc-git\]\:flex-col .hc-git{flex-direction:column}.\[\&_\.hc-git\]\:gap-1 .hc-git{gap:var(--spacing)}.\[\&_\.hc-git\]\:border-t .hc-git{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-git\]\:border-t-border-variant .hc-git{border-top-color:var(--border-variant)}.\[\&_\.hc-git\]\:pt-2 .hc-git{padding-top:calc(var(--spacing) * 2)}.\[\&_\.hc-git\]\:text-xs .hc-git{font-size:var(--fs-xs)}.\[\&_\.hc-git\]\:text-text .hc-git{color:var(--text)}.\[\&_\.hc-git-row\]\:flex .hc-git-row{display:flex}.\[\&_\.hc-git-row\]\:min-w-0 .hc-git-row{min-width:0}.\[\&_\.hc-git-row\]\:flex-wrap .hc-git-row{flex-wrap:wrap}.\[\&_\.hc-git-row\]\:items-center .hc-git-row{align-items:center}.\[\&_\.hc-git-row\]\:gap-2\.5 .hc-git-row{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-head\]\:flex .hc-head{display:flex}.\[\&_\.hc-head\]\:items-baseline .hc-head{align-items:baseline}.\[\&_\.hc-head\]\:justify-between .hc-head{justify-content:space-between}.\[\&_\.hc-head\]\:gap-2\.5 .hc-head{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-mono\]\:font-mono .hc-mono{font-family:var(--mono)}.\[\&_\.hc-slug\]\:min-w-0 .hc-slug{min-width:0}.\[\&_\.hc-slug\]\:overflow-hidden .hc-slug{overflow:hidden}.\[\&_\.hc-slug\]\:font-mono .hc-slug{font-family:var(--mono)}.\[\&_\.hc-slug\]\:text-md .hc-slug{font-size:var(--fs-md)}.\[\&_\.hc-slug\]\:font-semibold .hc-slug{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.hc-slug\]\:text-ellipsis .hc-slug{text-overflow:ellipsis}.\[\&_\.hc-slug\]\:whitespace-nowrap .hc-slug{white-space:nowrap}.\[\&_\.hc-stats\]\:mt-2\.5 .hc-stats{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:flex .hc-stats{display:flex}.\[\&_\.hc-stats\]\:flex-wrap .hc-stats{flex-wrap:wrap}.\[\&_\.hc-stats\]\:items-center .hc-stats{align-items:center}.\[\&_\.hc-stats\]\:gap-3 .hc-stats{gap:calc(var(--spacing) * 3)}.\[\&_\.hc-stats\]\:border-t .hc-stats{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-stats\]\:border-t-border-variant .hc-stats{border-top-color:var(--border-variant)}.\[\&_\.hc-stats\]\:pt-2\.5 .hc-stats{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:text-xs .hc-stats{font-size:var(--fs-xs)}.\[\&_\.hc-stats\]\:text-text .hc-stats{color:var(--text)}.\[\&_\.hc-title\]\:mt-\[3px\] .hc-title{margin-top:3px}.\[\&_\.hc-title\]\:text-text .hc-title{color:var(--text)}.\[\&_\.hc-toggle\]\:mt-1 .hc-toggle{margin-top:var(--spacing)}.\[\&_\.hc-toggle\]\:text-xs .hc-toggle{font-size:var(--fs-xs)}.\[\&_\.hc-toggle\]\:font-medium .hc-toggle{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-toggle\]\:text-muted .hc-toggle{color:var(--muted)}.\[\&_\.hc-toggle\:hover\]\:text-text .hc-toggle:hover{color:var(--text)}.\[\&_\.icon-btn\]\:ml-2 .icon-btn{margin-left:calc(var(--spacing) * 2)}.\[\&_\.icon-btn\]\:h-5\.5 .icon-btn{height:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:w-5\.5 .icon-btn{width:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:align-middle .icon-btn{vertical-align:middle}.\[\&_\.icon-btn\:hover\]\:text-accent-red .icon-btn:hover{color:var(--accent-red)}.\[\&_\.k\]\:text-subtext .k{color:var(--subtext)}.\[\&_\.kv\]\:gap-x-4\.5 .kv{column-gap:calc(var(--spacing) * 4.5)}.\[\&_\.kv\]\:gap-y-1\.5 .kv{row-gap:calc(var(--spacing) * 1.5)}.\[\&_\.model-id\]\:block .model-id{display:block}.\[\&_\.model-id\]\:font-mono .model-id{font-family:var(--mono)}.\[\&_\.model-id\]\:text-2xs .model-id{font-size:var(--fs-2xs)}.\[\&_\.model-id\]\:text-muted .model-id{color:var(--muted)}.\[\&_\.model-item\]\:pl-6 .model-item{padding-left:calc(var(--spacing) * 6)}.\[\&_\.new-project-actions\]\:mt-2\.5 .new-project-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.new-project-actions\]\:justify-start .new-project-actions{justify-content:flex-start}.\[\&_\.new-project-actions_\.primary\]\:ml-auto .new-project-actions .primary{margin-left:auto}.\[\&_\.openresearch-diff-file\]\:w-full .openresearch-diff-file{width:100%}.\[\&_\.openresearch-diff-file\]\:text-sm .openresearch-diff-file{font-size:var(--fs-sm)}.\[\&_\.openresearch-diff-file\]\:leading-\[1\.55\] .openresearch-diff-file{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file\]\:\[--diff-background-color\:var\(--base\)\] .openresearch-diff-file{--diff-background-color:var(--base)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-background-color\:var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file{--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-background-color\:var\(--openresearch-diff-delete-edit-background-color\)\] .openresearch-diff-file{--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-background-color\:var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file{--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-background-color\:var\(--openresearch-diff-insert-edit-background-color\)\] .openresearch-diff-file{--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-background-color\:var\(--diff-selection-background-color\)\] .openresearch-diff-file{--diff-code-selected-background-color:var(--diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-code-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-font-family\:var\(--mono\)\] .openresearch-diff-file{--diff-font-family:var(--mono)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-background-color\:var\(--openresearch-diff-delete-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-text-color\:var\(--accent-red\)\] .openresearch-diff-file{--diff-gutter-delete-text-color:var(--accent-red)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-background-color\:var\(--openresearch-diff-insert-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-text-color\:var\(--accent-green\)\] .openresearch-diff-file{--diff-gutter-insert-text-color:var(--accent-green)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-background-color\:var\(--openresearch-diff-gutter-selection-background-color\)\] .openresearch-diff-file{--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-gutter-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-omit-gutter-line-color\:var\(--openresearch-diff-omit-gutter-line-color\)\] .openresearch-diff-file{--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-background-color\:var\(--openresearch-diff-selection-background-color\)\] .openresearch-diff-file{--diff-selection-background-color:var(--openresearch-diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-text-color\:var\(--primary\)\] .openresearch-diff-file{--diff-selection-text-color:var(--primary)}.\[\&_\.openresearch-diff-file\]\:\[--diff-text-color\:var\(--text\)\] .openresearch-diff-file{--diff-text-color:var(--text)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:color-mix(in oklab, var(--base) 92%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:color-mix(in oklab, var(--base) 78%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:color-mix(in oklab, var(--base) 86%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-divider-color\:var\(--border\)\] .openresearch-diff-file{--openresearch-diff-divider-color:var(--border)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:color-mix(in oklab, var(--surface) 68%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:color-mix(in oklab, var(--base) 91%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:color-mix(in oklab, var(--base) 72%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:color-mix(in oklab, var(--base) 84%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:color-mix(in oklab, var(--base) 86%, var(--text))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:color-mix(in oklab, var(--surface) 76%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:color-mix(in oklab, var(--text) 45%, var(--base))}}.\[\&_\.openresearch-diff-file_\.diff-code\]\:px-4 .openresearch-diff-file .diff-code{padding-inline:calc(var(--spacing) * 4)}.\[\&_\.openresearch-diff-file_\.diff-code\]\:py-0 .openresearch-diff-file .diff-code{padding-block:0}.\[\&_\.openresearch-diff-file_\.diff-code\]\:break-normal .openresearch-diff-file .diff-code{overflow-wrap:normal;word-break:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:wrap-normal .openresearch-diff-file .diff-code{overflow-wrap:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:whitespace-pre .openresearch-diff-file .diff-code{white-space:pre}.\[\&_\.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-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.openresearch-diff-file_\.diff-hunk_\+_\.diff-hunk_\.diff-line\:first-child_\>_td\]\:border-t-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file_\.diff-line\]\:leading-\[1\.55\] .openresearch-diff-file .diff-line{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-\[var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-\[var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\.diff-unified\]\:table-auto .openresearch-diff-file.diff-unified{table-layout:auto}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:first-child\]\:hidden .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:sticky .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){position:sticky}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:left-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){left: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){z-index: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){width:1%}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:cursor-default .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){cursor:default}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-style:var(--tw-border-style);border-right-width:1px}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pt-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-top:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pr-2\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-right:calc(var(--spacing) * 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){padding-bottom:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pl-3\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-left:calc(var(--spacing) * 3.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-right .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){text-align:right}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:whitespace-nowrap .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){white-space:nowrap}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-\[var\(--openresearch-diff-unified-gutter-text-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:var(--openresearch-diff-unified-gutter-text-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:select-none .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){-webkit-user-select:none;user-select:none}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:collapse .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{visibility:collapse}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:w-0 .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{width:0}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:nth-child\(2\)\]\:w-\[1\%\] .openresearch-diff-file.diff-unified col.diff-gutter-col:nth-child(2){width:1%}.\[\&_\.paper-destination\]\:flex .paper-destination{display:flex}.\[\&_\.paper-destination\]\:items-center .paper-destination{align-items:center}.\[\&_\.paper-destination\]\:gap-2\.5 .paper-destination{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-destination\]\:rounded-md .paper-destination{border-radius:8px}.\[\&_\.paper-destination\]\:border .paper-destination{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-destination\]\:border-border .paper-destination{border-color:var(--border)}.\[\&_\.paper-destination\]\:bg-background .paper-destination{background-color:var(--base)}.\[\&_\.paper-destination\]\:pt-2 .paper-destination{padding-top:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pr-2 .paper-destination{padding-right:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pb-2 .paper-destination{padding-bottom:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pl-3 .paper-destination{padding-left:calc(var(--spacing) * 3)}.\[\&_\.paper-destination_\.btn\]\:flex-none .paper-destination .btn{flex:none}.\[\&_\.paper-destination_code\]\:min-w-0 .paper-destination code{min-width:0}.\[\&_\.paper-destination_code\]\:flex-1 .paper-destination code{flex:1}.\[\&_\.paper-destination_code\]\:overflow-hidden .paper-destination code{overflow:hidden}.\[\&_\.paper-destination_code\]\:text-sm .paper-destination code{font-size:var(--fs-sm)}.\[\&_\.paper-destination_code\]\:font-normal .paper-destination code{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.paper-destination_code\]\:text-ellipsis .paper-destination code{text-overflow:ellipsis}.\[\&_\.paper-destination_code\]\:whitespace-nowrap .paper-destination code{white-space:nowrap}.\[\&_\.paper-destination_code\]\:text-text .paper-destination code{color:var(--text)}.\[\&_\.paper-pick\]\:flex .paper-pick{display:flex}.\[\&_\.paper-pick\]\:items-center .paper-pick{align-items:center}.\[\&_\.paper-pick\]\:justify-between .paper-pick{justify-content:space-between}.\[\&_\.paper-pick\]\:gap-2\.5 .paper-pick{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick\]\:rounded-md .paper-pick{border-radius:8px}.\[\&_\.paper-pick\]\:border .paper-pick{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-pick\]\:border-border .paper-pick{border-color:var(--border)}.\[\&_\.paper-pick\]\:bg-surface .paper-pick{background-color:var(--surface)}.\[\&_\.paper-pick\]\:px-3 .paper-pick{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.paper-pick\]\:py-2\.5 .paper-pick{padding-block:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick_\.id\]\:font-mono .paper-pick .id{font-family:var(--mono)}.\[\&_\.paper-pick_\.id\]\:text-xs .paper-pick .id{font-size:var(--fs-xs)}.\[\&_\.paper-pick_\.id\]\:text-muted .paper-pick .id{color:var(--muted)}.\[\&_\.paper-pick_\.meta\]\:min-w-0 .paper-pick .meta{min-width:0}.\[\&_\.paper-pick_\.title\]\:text-md .paper-pick .title{font-size:var(--fs-md)}.\[\&_\.paper-pick_\.title\]\:font-semibold .paper-pick .title{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.paper-results\]\:flex .paper-results{display:flex}.\[\&_\.paper-results\]\:max-h-60 .paper-results{max-height:calc(var(--spacing) * 60)}.\[\&_\.paper-results\]\:flex-col .paper-results{flex-direction:column}.\[\&_\.paper-results\]\:overflow-y-auto .paper-results{overflow-y:auto}.\[\&_\.paper-results\]\:rounded-md .paper-results{border-radius:8px}.\[\&_\.paper-results\]\:border .paper-results{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-results\]\:border-border .paper-results{border-color:var(--border)}.\[\&_\.paper-results_\.id\]\:font-mono .paper-results .id{font-family:var(--mono)}.\[\&_\.paper-results_\.id\]\:text-xs .paper-results .id{font-size:var(--fs-xs)}.\[\&_\.paper-results_\.id\]\:text-muted .paper-results .id{color:var(--muted)}.\[\&_\.paper-results_\.title\]\:text-md .paper-results .title{font-size:var(--fs-md)}.\[\&_\.paper-results_\.title\]\:font-medium .paper-results .title{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.paper-results_button\]\:flex .paper-results button{display:flex}.\[\&_\.paper-results_button\]\:cursor-pointer .paper-results button{cursor:pointer}.\[\&_\.paper-results_button\]\:flex-col .paper-results button{flex-direction:column}.\[\&_\.paper-results_button\]\:items-start .paper-results button{align-items:flex-start}.\[\&_\.paper-results_button\]\:gap-0\.5 .paper-results button{gap:calc(var(--spacing) * .5)}.\[\&_\.paper-results_button\]\:border-0 .paper-results button{border-style:var(--tw-border-style);border-width:0}.\[\&_\.paper-results_button\]\:border-b .paper-results button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_\.paper-results_button\]\:border-b-border-variant .paper-results button{border-bottom-color:var(--border-variant)}.\[\&_\.paper-results_button\]\:bg-transparent .paper-results button{background-color:#0000}.\[\&_\.paper-results_button\]\:bg-none .paper-results button{background-image:none}.\[\&_\.paper-results_button\]\:px-2\.5 .paper-results button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.paper-results_button\]\:py-2 .paper-results button{padding-block:calc(var(--spacing) * 2)}.\[\&_\.paper-results_button\]\:text-left .paper-results button{text-align:left}.\[\&_\.paper-results_button\]\:text-text .paper-results button{color:var(--text)}.\[\&_\.paper-results_button\]\:\[font\:inherit\] .paper-results button{font:inherit}.\[\&_\.paper-results_button\:hover\]\:bg-surface .paper-results button:hover{background-color:var(--surface)}.\[\&_\.paper-results_button\:last-child\]\:border-b-0 .paper-results button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_\.path\]\:flex .path{display:flex}.\[\&_\.path\]\:min-w-0 .path{min-width:0}.\[\&_\.path\]\:flex-1 .path{flex:1}.\[\&_\.path\]\:items-center .path{align-items:center}.\[\&_\.path\]\:gap-2 .path{gap:calc(var(--spacing) * 2)}.\[\&_\.path_code\]\:min-w-0 .path code{min-width:0}.\[\&_\.path_code\]\:flex-1 .path code{flex:1}.\[\&_\.path_code\]\:overflow-hidden .path code{overflow:hidden}.\[\&_\.path_code\]\:font-mono .path code{font-family:var(--mono)}.\[\&_\.path_code\]\:text-xs .path code{font-size:var(--fs-xs)}.\[\&_\.path_code\]\:font-semibold .path code{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.path_code\]\:text-ellipsis .path code{text-overflow:ellipsis}.\[\&_\.path_code\]\:whitespace-nowrap .path code{white-space:nowrap}.\[\&_\.path_code\]\:text-text .path code{color:var(--text)}.\[\&_\.plan-strip-caret\]\:flex .plan-strip-caret{display:flex}.\[\&_\.plan-strip-caret\]\:items-center .plan-strip-caret{align-items:center}.\[\&_\.plan-strip-caret\]\:rounded-tl-none .plan-strip-caret{border-top-left-radius:0}.\[\&_\.plan-strip-caret\]\:rounded-bl-none .plan-strip-caret{border-bottom-left-radius:0}.\[\&_\.plan-strip-caret\]\:border-l .plan-strip-caret{border-left-style:var(--tw-border-style);border-left-width:1px}.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:color-mix(in oklab,var(--base) 35%,var(--text))}}.\[\&_\.plan-strip-caret\]\:px-1\.5 .plan-strip-caret{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.plan-strip-caret\]\:py-0 .plan-strip-caret{padding-block:0}.\[\&_\.plan-strip-primary\]\:border-text .plan-strip-primary{border-color:var(--text)}.\[\&_\.plan-strip-primary\]\:bg-text .plan-strip-primary{background-color:var(--text)}.\[\&_\.plan-strip-primary\]\:text-background .plan-strip-primary{color:var(--base)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:border-text .plan-strip-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--text) 85%,var(--base))}}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:text-background .plan-strip-primary:hover:not(:disabled){color:var(--base)}.\[\&_\.progress\]\:mx-0 .progress{margin-inline:0}.\[\&_\.progress\]\:mt-2 .progress{margin-top:calc(var(--spacing) * 2)}.\[\&_\.progress\]\:mb-0 .progress{margin-bottom:0}.\[\&_\.progress-track\]\:h-\[5px\] .progress-track{height:5px}.\[\&_\.progress-track\]\:border-0 .progress-track{border-style:var(--tw-border-style);border-width:0}.\[\&_\.progress-track\]\:bg-border .progress-track{background-color:var(--border)}.\[\&_\.project-field-label\]\:text-base .project-field-label{font-size:var(--fs-base)}.\[\&_\.project-field-label\]\:font-semibold .project-field-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-field-label\]\:text-text .project-field-label{color:var(--text)}.\[\&_\.project-location-field\]\:flex .project-location-field{display:flex}.\[\&_\.project-location-field\]\:flex-col .project-location-field{flex-direction:column}.\[\&_\.project-location-field\]\:gap-2 .project-location-field{gap:calc(var(--spacing) * 2)}.\[\&_\.project-location-label\]\:text-base .project-location-label{font-size:var(--fs-base)}.\[\&_\.project-location-label\]\:font-semibold .project-location-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-location-label\]\:text-text .project-location-label{color:var(--text)}.\[\&_\.project-path-notice\]\:rounded-sm .project-path-notice{border-radius:6px}.\[\&_\.project-path-notice\]\:border .project-path-notice{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.project-path-notice\]\:border-border-variant .project-path-notice{border-color:var(--border-variant)}.\[\&_\.project-path-notice\]\:bg-surface .project-path-notice{background-color:var(--surface)}.\[\&_\.project-path-notice\]\:px-\[11px\] .project-path-notice{padding-inline:11px}.\[\&_\.project-path-notice\]\:py-\[9px\] .project-path-notice{padding-block:9px}.\[\&_\.project-path-notice\]\:text-sm .project-path-notice{font-size:var(--fs-sm)}.\[\&_\.project-path-notice\]\:leading-\[1\.4\] .project-path-notice{--tw-leading:1.4;line-height:1.4}.\[\&_\.project-path-notice\]\:text-subtext .project-path-notice{color:var(--subtext)}.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.\[\&_\.repo-hint\]\:font-mono .repo-hint{font-family:var(--mono)}.\[\&_\.repo-hint\]\:text-xs .repo-hint{font-size:var(--fs-xs)}.\[\&_\.repo-hint\]\:font-normal .repo-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.repo-hint\]\:text-muted .repo-hint{color:var(--muted)}.\[\&_\.repo-hint\.ok\]\:text-accent-teal .repo-hint.ok{color:var(--accent-teal)}.\[\&_\.row2\]\:grid .row2{display:grid}.\[\&_\.row2\]\:grid-cols-2 .row2{grid-template-columns:repeat(2,minmax(0,1fr))}.\[\&_\.row2\]\:gap-2\.5 .row2{gap:calc(var(--spacing) * 2.5)}.\[\&_\.settings-card\]\:mt-3\.5 .settings-card{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\.settings-card\]\:mb-0 .settings-card{margin-bottom:0}.\[\&_\.settings-sub\]\:mb-3 .settings-sub{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\.skill-desc\]\:text-sm .skill-desc{font-size:var(--fs-sm)}.\[\&_\.skill-desc\]\:text-subtext .skill-desc{color:var(--subtext)}.\[\&_\.skill-hint\]\:text-muted .skill-hint{color:var(--muted)}.\[\&_\.skill-name\]\:text-md .skill-name{font-size:var(--fs-md)}.\[\&_\.stats\]\:flex .stats{display:flex}.\[\&_\.stats\]\:shrink-0 .stats{flex-shrink:0}.\[\&_\.stats\]\:items-center .stats{align-items:center}.\[\&_\.stats\]\:gap-2 .stats{gap:calc(var(--spacing) * 2)}.\[\&_\.stats\]\:font-mono .stats{font-family:var(--mono)}.\[\&_\.stats\]\:text-2xs .stats{font-size:var(--fs-2xs)}.\[\&_\.stats\]\:font-medium .stats{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.stats\]\:tabular-nums .stats{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.\[\&_\.tab-close\]\:inline-flex .tab-close{display:inline-flex}.\[\&_\.tab-close\]\:h-3\.5 .tab-close{height:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:w-3\.5 .tab-close{width:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:shrink-0 .tab-close{flex-shrink:0}.\[\&_\.tab-close\]\:items-center .tab-close{align-items:center}.\[\&_\.tab-close\]\:justify-center .tab-close{justify-content:center}.\[\&_\.tab-close\]\:rounded-xs .tab-close{border-radius:4px}.\[\&_\.tab-close\]\:text-muted .tab-close{color:var(--muted)}.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:color-mix(in oklab,var(--text) 15%,transparent)}}.\[\&_\.tab-close\:hover\]\:text-text .tab-close:hover{color:var(--text)}.\[\&_\.tab-label\]\:grid .tab-label{display:grid}.\[\&_\.tab-label\]\:min-w-0 .tab-label{min-width:0}.\[\&_\.tab-label\]\:grid-cols-\[minmax\(0\,_1fr\)\] .tab-label{grid-template-columns:minmax(0,1fr)}.\[\&_\.tab-label\]\:overflow-hidden .tab-label,.\[\&_\.tab-label_\>_span\]\:overflow-hidden .tab-label>span{overflow:hidden}.\[\&_\.tab-label_\>_span\]\:text-ellipsis .tab-label>span{text-overflow:ellipsis}.\[\&_\.tab-label_\>_span\]\:whitespace-nowrap .tab-label>span{white-space:nowrap}.\[\&_\.tab-label_\>_span\]\:\[grid-area\:1_\/_1\] .tab-label>span{grid-area:1/1}.\[\&_\.tab-label\:\:after\]\:invisible .tab-label:after{visibility:hidden}.\[\&_\.tab-label\:\:after\]\:overflow-hidden .tab-label:after{overflow:hidden}.\[\&_\.tab-label\:\:after\]\:font-medium .tab-label:after{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.tab-label\:\:after\]\:text-ellipsis .tab-label:after{text-overflow:ellipsis}.\[\&_\.tab-label\:\:after\]\:whitespace-nowrap .tab-label:after{white-space:nowrap}.\[\&_\.tab-label\:\:after\]\:content-\[attr\(data-label\)\] .tab-label:after{--tw-content:attr(data-label);content:var(--tw-content)}.\[\&_\.tab-label\:\:after\]\:\[grid-area\:1_\/_1\] .tab-label:after{grid-area:1/1}.\[\&_\.tour-close\]\:absolute .tour-close{position:absolute}.\[\&_\.tour-close\]\:top-3 .tour-close{top:calc(var(--spacing) * 3)}.\[\&_\.tour-close\]\:right-3 .tour-close{right:calc(var(--spacing) * 3)}.\[\&_\.v\]\:font-mono .v{font-family:var(--mono)}.\[\&_\.v\]\:text-sm .v{font-size:var(--fs-sm)}.\[\&_\.v\]\:break-all .v{word-break:break-all}.\[\&_\>_\.changes-note\]\:mx-4>.changes-note{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.changes-note\]\:my-3\.5>.changes-note{margin-block:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mx-4>.diff-explorer{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.diff-explorer\]\:mt-3\.5>.diff-explorer{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mb-0>.diff-explorer{margin-bottom:0}.\[\&_\>_\.error\]\:text-md>.error{font-size:var(--fs-md)}.\[\&_\>_\.error\]\:whitespace-pre-wrap>.error{white-space:pre-wrap}.\[\&_\>_\.error\]\:text-accent-red>.error{color:var(--accent-red)}.\[\&_\>_\.openresearch-diff\]\:mx-4>.openresearch-diff{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.openresearch-diff\]\:mt-3\.5>.openresearch-diff{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.openresearch-diff\]\:mb-0>.openresearch-diff{margin-bottom:0}.\[\&_\>_\.project-default-row\:first-child\]\:border-t-0>.project-default-row:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&_\>_\.project-default-row\:first-child\]\:pt-0>.project-default-row:first-child{padding-top:0}.\[\&_\>_\.seg\]\:rounded-sm>.seg{border-radius:6px}.\[\&_\>_\.seg\]\:p-0\.5>.seg{padding:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:px-2>.seg button{padding-inline:calc(var(--spacing) * 2)}.\[\&_\>_\.seg_button\]\:py-0\.5>.seg button{padding-block:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:text-sm>.seg button{font-size:var(--fs-sm)}.\[\&_\>_\.seg_button\]\:font-medium>.seg button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\>_\.truncated-notice\]\:mx-4>.truncated-notice{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.truncated-notice\]\:mt-3\.5>.truncated-notice{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.truncated-notice\]\:mb-0>.truncated-notice{margin-bottom:0}.\[\&_\>_\:first-child\]\:mt-3\.5>:first-child{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_svg\]\:shrink-0>svg{flex-shrink:0}.\[\&_\>_svg\]\:text-muted>svg{color:var(--muted)}.\[\&_\>_svg\]\:text-subtext>svg{color:var(--subtext)}.\[\&_\>_svg\.file-tree-chevron\]\:text-muted>svg.file-tree-chevron{color:var(--muted)}.\[\&_a\]\:text-sm a{font-size:var(--fs-sm)}.\[\&_a\]\:whitespace-nowrap a{white-space:nowrap}.\[\&_a\]\:text-subtext a{color:var(--subtext)}.\[\&_button\]\:-mb-px button{margin-bottom:-1px}.\[\&_button\]\:grid button{display:grid}.\[\&_button\]\:inline-flex button{display:inline-flex}.\[\&_button\]\:w-full button{width:100%}.\[\&_button\]\:cursor-pointer button{cursor:pointer}.\[\&_button\]\:grid-cols-\[18px_minmax\(0\,_1fr\)_auto_auto\] button{grid-template-columns:18px minmax(0,1fr) auto auto}.\[\&_button\]\:items-center button{align-items:center}.\[\&_button\]\:gap-\[7px\] button{gap:7px}.\[\&_button\]\:rounded-sm button{border-radius:6px}.\[\&_button\]\:border-0 button{border-style:var(--tw-border-style);border-width:0}.\[\&_button\]\:border-b button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_button\]\:border-b-2 button{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.\[\&_button\]\:border-b-border-variant button{border-bottom-color:var(--border-variant)}.\[\&_button\]\:border-b-transparent button{border-bottom-color:#0000}.\[\&_button\]\:bg-transparent button{background-color:#0000}.\[\&_button\]\:px-0 button{padding-inline:0}.\[\&_button\]\:px-3 button{padding-inline:calc(var(--spacing) * 3)}.\[\&_button\]\:px-\[9px\] button{padding-inline:9px}.\[\&_button\]\:py-0\.5 button{padding-block:calc(var(--spacing) * .5)}.\[\&_button\]\:py-2 button{padding-block:calc(var(--spacing) * 2)}.\[\&_button\]\:py-\[3px\] button{padding-block:3px}.\[\&_button\]\:py-\[7px\] button{padding-block:7px}.\[\&_button\]\:text-left button{text-align:left}.\[\&_button\]\:text-md button{font-size:var(--fs-md)}.\[\&_button\]\:text-xs button{font-size:var(--fs-xs)}.\[\&_button\]\:font-medium button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_button\]\:font-semibold button{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_button\]\:text-muted button{color:var(--muted)}.\[\&_button\]\:text-text button{color:var(--text)}.\[\&_button\.active\]\:border-b-primary button.active{border-bottom-color:var(--primary)}.\[\&_button\.active\]\:bg-background button.active{background-color:var(--base)}.\[\&_button\.active\]\:bg-surface button.active{background-color:var(--surface)}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 25%, transparent))}}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\.active\]\:shadow-\[inset_2px_0_0_var\(--text\)\] button.active{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\:disabled\]\:cursor-default button:disabled{cursor:default}.\[\&_button\:disabled\]\:text-muted button:disabled{color:var(--muted)}.\[\&_button\:disabled\]\:opacity-50 button:disabled{opacity:.5}.\[\&_button\:hover\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] button:hover{background-color:var(--surface-2,#0000000d)}.\[\&_button\:hover\]\:bg-surface button:hover{background-color:var(--surface)}.\[\&_button\:hover\]\:text-text button:hover{color:var(--text)}.\[\&_button\:hover\]\:underline button:hover{text-decoration-line:underline}.\[\&_button\:hover\]\:underline-offset-2 button:hover{text-underline-offset:2px}.\[\&_button\:last-child\]\:border-b-0 button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_button\:not\(\:disabled\)\:hover\]\:text-text button:not(:disabled):hover{color:var(--text)}.\[\&_code\]\:overflow-hidden code{overflow:hidden}.\[\&_code\]\:rounded-xs code{border-radius:4px}.\[\&_code\]\:border code{border-style:var(--tw-border-style);border-width:1px}.\[\&_code\]\:border-border-variant code{border-color:var(--border-variant)}.\[\&_code\]\:bg-panel code{background-color:var(--panel)}.\[\&_code\]\:px-\[5px\] code{padding-inline:5px}.\[\&_code\]\:py-px code{padding-block:1px}.\[\&_code\]\:font-mono code{font-family:var(--mono)}.\[\&_code\]\:text-\[0\.92em\] code{font-size:.92em}.\[\&_code\]\:text-sm code{font-size:var(--fs-sm)}.\[\&_code\]\:text-xs code{font-size:var(--fs-xs)}.\[\&_code\]\:text-ellipsis code{text-overflow:ellipsis}.\[\&_code\]\:whitespace-nowrap code{white-space:nowrap}.\[\&_code\]\:text-text code{color:var(--text)}.\[\&_h1\]\:mx-0 h1{margin-inline:0}.\[\&_h1\]\:mt-0 h1{margin-top:0}.\[\&_h1\]\:mb-1\.5 h1{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h1\]\:text-3xl h1{font-size:var(--fs-3xl)}.\[\&_h3\]\:mx-0 h3{margin-inline:0}.\[\&_h3\]\:mt-0 h3{margin-top:0}.\[\&_h3\]\:mr-6\.5 h3{margin-right:calc(var(--spacing) * 6.5)}.\[\&_h3\]\:mb-2\.5 h3{margin-bottom:calc(var(--spacing) * 2.5)}.\[\&_h3\]\:mb-\[7px\] h3{margin-bottom:7px}.\[\&_h3\]\:ml-0 h3{margin-left:0}.\[\&_h3\]\:text-lg h3{font-size:var(--fs-lg)}.\[\&_h3\]\:text-sm h3{font-size:var(--fs-sm)}.\[\&_h3\]\:font-semibold h3{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h3\]\:text-text h3{color:var(--text)}.\[\&_h4\]\:mx-0 h4{margin-inline:0}.\[\&_h4\]\:mt-0 h4{margin-top:0}.\[\&_h4\]\:mb-1 h4{margin-bottom:var(--spacing)}.\[\&_h4\]\:text-md h4{font-size:var(--fs-md)}.\[\&_h4\]\:text-accent-amber h4{color:var(--accent-amber)}.\[\&_input\]\:w-full input{width:100%}.\[\&_input\]\:min-w-55 input{min-width:calc(var(--spacing) * 55)}.\[\&_input\]\:flex-1 input{flex:1}.\[\&_input\]\:rounded-none input{border-radius:0}.\[\&_input\]\:border-0 input{border-style:var(--tw-border-style);border-width:0}.\[\&_input\]\:border-b input{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_input\]\:border-b-border-variant input{border-bottom-color:var(--border-variant)}.\[\&_input\]\:bg-transparent input{background-color:#0000}.\[\&_input\]\:bg-none input{background-image:none}.\[\&_input\]\:p-0 input{padding:0}.\[\&_input\]\:px-2\.5 input{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_input\]\:py-2 input{padding-block:calc(var(--spacing) * 2)}.\[\&_input\]\:font-mono input{font-family:var(--mono)}.\[\&_input\]\:text-sm input{font-size:var(--fs-sm)}.\[\&_input\]\:outline-none input{--tw-outline-style:none;outline-style:none}.\[\&_input\:focus\]\:shadow-\[0_1px_0_0_var\(--text\)\] input:focus{--tw-shadow:0 1px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_label\]\:flex label{display:flex}.\[\&_label\]\:max-w-80 label{max-width:calc(var(--spacing) * 80)}.\[\&_label\]\:flex-col label{flex-direction:column}.\[\&_label\]\:gap-1 label{gap:var(--spacing)}.\[\&_label\]\:text-xs label{font-size:var(--fs-xs)}.\[\&_label\]\:font-medium label{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_label\]\:text-text label{color:var(--text)}.\[\&_p\]\:m-0 p{margin:0}.\[\&_p\]\:text-base p{font-size:var(--fs-base)}.\[\&_p\]\:leading-\[1\.55\] p{--tw-leading:1.55;line-height:1.55}.\[\&_p\]\:text-subtext p{color:var(--subtext)}.\[\&_p\]\:text-text p{color:var(--text)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_strong\]\:text-text strong{color:var(--text)}.\[\&_svg\]\:mt-px svg{margin-top:1px}.\[\&_svg\]\:block svg{display:block}.\[\&_svg\]\:h-\[1em\] svg{height:1em}.\[\&_svg\]\:w-\[1em\] svg{width:1em}.\[\&_svg\]\:flex-none svg{flex:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_td\]\:h-9 td{height:calc(var(--spacing) * 9)}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:color-mix(in oklab,var(--text) 6%,transparent)}}.\[\&_td\]\:border-b-border-variant td{border-bottom-color:var(--border-variant)}.\[\&_td\]\:px-3 td{padding-inline:calc(var(--spacing) * 3)}.\[\&_td\]\:py-2 td{padding-block:calc(var(--spacing) * 2)}.\[\&_td\]\:pt-0 td{padding-top:0}.\[\&_td\]\:pt-\[5px\] td{padding-top:5px}.\[\&_td\]\:pr-2\.5 td{padding-right:calc(var(--spacing) * 2.5)}.\[\&_td\]\:pb-0 td{padding-bottom:0}.\[\&_td\]\:pb-\[5px\] td{padding-bottom:5px}.\[\&_td\]\:pl-0 td{padding-left:0}.\[\&_td\]\:align-middle td{vertical-align:middle}.\[\&_td\]\:wrap-anywhere td{overflow-wrap:anywhere}.\[\&_td\]\:whitespace-nowrap td{white-space:nowrap}.\[\&_td\:first-child\]\:w-\[32\%\] td:first-child{width:32%}.\[\&_td\:first-child\]\:wrap-anywhere td:first-child{overflow-wrap:anywhere}.\[\&_td\:last-child\]\:w-29 td:last-child{width:calc(var(--spacing) * 29)}.\[\&_td\:last-child\]\:pr-0 td:last-child{padding-right:0}.\[\&_td\:last-child\]\:text-right td:last-child{text-align:right}.\[\&_td\:last-child\]\:whitespace-nowrap td:last-child{white-space:nowrap}.\[\&_td\[colspan\]\]\:text-left td[colspan]{text-align:left}.\[\&_td\[colspan\]\]\:whitespace-normal td[colspan]{white-space:normal}.\[\&_th\]\:sticky th{position:sticky}.\[\&_th\]\:top-0 th{top:0}.\[\&_th\]\:z-1 th{z-index:1}.\[\&_th\]\:border-b th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_th\]\:border-b-border th{border-bottom-color:var(--border)}.\[\&_th\]\:bg-background th{background-color:var(--base)}.\[\&_th\]\:px-3 th{padding-inline:calc(var(--spacing) * 3)}.\[\&_th\]\:py-2 th{padding-block:calc(var(--spacing) * 2)}.\[\&_th\]\:pt-\[5px\] th{padding-top:5px}.\[\&_th\]\:pr-2\.5 th{padding-right:calc(var(--spacing) * 2.5)}.\[\&_th\]\:pb-\[5px\] th{padding-bottom:5px}.\[\&_th\]\:pl-0 th{padding-left:0}.\[\&_th\]\:text-left th{text-align:left}.\[\&_th\]\:text-xs th{font-size:var(--fs-xs)}.\[\&_th\]\:font-medium th{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_th\]\:font-semibold th{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_th\]\:text-text th{color:var(--text)}.\[\&_th\:nth-child\(1\)\]\:w-\[20\%\] th:first-child{width:20%}.\[\&_th\:nth-child\(2\)\]\:w-\[26\%\] th:nth-child(2){width:26%}.\[\&_th\:nth-child\(4\)\]\:w-27 th:nth-child(4){width:calc(var(--spacing) * 27)}.\[\&_th\:nth-child\(5\)\]\:w-13 th:nth-child(5){width:calc(var(--spacing) * 13)}.\[\&_tr\.clickable\]\:cursor-pointer tr.clickable{cursor:pointer}.\[\&_tr\.clickable\:hover_td\]\:bg-canvas tr.clickable:hover td{background-color:var(--canvas)}.\[\&_tr\:last-child_td\]\:border-b-0 tr:last-child td{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\.above\]\:-bottom-\[6\.5px\].above{bottom:-6.5px}.\[\&\.above\]\:left-\[calc\(50\%_-_6px\)\].above{left:calc(50% - 6px)}.\[\&\.above\]\:border-r.above{border-right-style:var(--tw-border-style);border-right-width:1px}.\[\&\.above\]\:border-b.above{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&\.above\]\:border-r-border.above{border-right-color:var(--border)}.\[\&\.above\]\:border-b-border.above{border-bottom-color:var(--border)}.\[\&\.active\]\:border-border.active{border-color:var(--border)}.\[\&\.active\]\:bg-background.active{background-color:var(--base)}.\[\&\.active\]\:bg-surface.active{background-color:var(--surface)}.\[\&\.active\]\:font-medium.active{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&\.active\]\:text-primary.active{color:var(--primary)}.\[\&\.active\]\:text-text.active{color:var(--text)}.\[\&\.active\:\:after\]\:absolute.active:after{position:absolute}.\[\&\.active\:\:after\]\:right-0.active:after{right:0}.\[\&\.active\:\:after\]\:-bottom-px.active:after{bottom:-1px}.\[\&\.active\:\:after\]\:left-0.active:after{left:0}.\[\&\.active\:\:after\]\:h-px.active:after{height:1px}.\[\&\.active\:\:after\]\:bg-background.active:after{background-color:var(--base)}.\[\&\.active\:\:after\]\:content-\[\'\'\].active:after{--tw-content:"";content:var(--tw-content)}.\[\&\.align-right\]\:right-0.align-right{right:0}.\[\&\.align-right\]\:left-auto.align-right{left:auto}.\[\&\.archive\]\:text-accent-amber.archive{color:var(--accent-amber)}.\[\&\.below\]\:-top-\[6\.5px\].below{top:-6.5px}.\[\&\.below\]\:left-\[calc\(50\%_-_6px\)\].below{left:calc(50% - 6px)}.\[\&\.below\]\:border-t.below{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&\.below\]\:border-l.below{border-left-style:var(--tw-border-style);border-left-width:1px}.\[\&\.below\]\:border-t-border.below{border-top-color:var(--border)}.\[\&\.below\]\:border-l-border.below{border-left-color:var(--border)}.\[\&\.centered\]\:top-1\/2.centered{top:50%}.\[\&\.centered\]\:left-1\/2.centered{left:50%}.\[\&\.centered\]\:-translate-x-1\/2.centered{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\.centered\]\:-translate-y-1\/2.centered{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\.centered\]\:transition-none.centered{transition-property:none}.\[\&\.closable\]\:max-w-37\.5.closable{max-width:calc(var(--spacing) * 37.5)}.\[\&\.closable\]\:pr-0\.5.closable{padding-right:calc(var(--spacing) * .5)}.\[\&\.code\]\:text-accent-orange.code{color:var(--accent-orange)}.\[\&\.context-ring\]\:mr-2.context-ring{margin-right:calc(var(--spacing) * 2)}.\[\&\.context-ring\]\:inline-flex.context-ring{display:inline-flex}.\[\&\.context-ring\]\:items-center.context-ring{align-items:center}.\[\&\.danger\]\:text-accent-red.danger{color:var(--accent-red)}.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 14%,transparent)}}.\[\&\.danger\:hover\]\:text-accent-red.danger:hover{color:var(--accent-red)}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 8%,transparent)}}.\[\&\.disabled\]\:opacity-52.disabled{opacity:.52}.\[\&\.disabled_\.compute-row-head\]\:cursor-default.disabled .compute-row-head{cursor:default}.\[\&\.document\]\:text-subtext.document{color:var(--subtext)}.\[\&\.drop-down\]\:top-\[calc\(100\%_\+_4px\)\].drop-down{top:calc(100% + 4px)}.\[\&\.drop-down\]\:bottom-auto.drop-down{bottom:auto}.\[\&\.end\]\:justify-end.end{justify-content:flex-end}.\[\&\.err\]\:border-accent-red.err{border-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red.err{background-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red-subtle.err{background-color:var(--accent-red-subtle)}.\[\&\.err\]\:text-accent-red.err{color:var(--accent-red)}.\[\&\.expanded_\.diff-file-header\]\:border-b.expanded .diff-file-header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&\.expanded_\.diff-file-header\]\:border-b-border.expanded .diff-file-header{border-bottom-color:var(--border)}.\[\&\.ghost\]\:border-transparent.ghost{border-color:#0000}.\[\&\.ghost\]\:text-text.ghost{color:var(--text)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:bg-surface.ghost:hover:not(:disabled){background-color:var(--surface)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:text-text.ghost:hover:not(:disabled){color:var(--text)}.\[\&\.image\]\:text-accent-purple.image{color:var(--accent-purple)}.\[\&\.left\]\:top-\[calc\(50\%_-_6px\)\].left{top:calc(50% - 6px)}.\[\&\.left\]\:-right-\[6\.5px\].left{right:-6.5px}.\[\&\.left\]\:border-t.left{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&\.left\]\:border-r.left{border-right-style:var(--tw-border-style);border-right-width:1px}.\[\&\.left\]\:border-t-border.left{border-top-color:var(--border)}.\[\&\.left\]\:border-r-border.left{border-right-color:var(--border)}.\[\&\.live_\.dot\]\:animate-\[or-pulse_1\.2s_ease-in-out_infinite\].live .dot{animation:1.2s ease-in-out infinite or-pulse}.\[\&\.markdown\]\:text-accent-blue.markdown{color:var(--accent-blue)}.\[\&\.muted\]\:text-muted.muted{color:var(--muted)}.\[\&\.ok\]\:border-accent-green.ok{border-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green.ok{background-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green-subtle.ok{background-color:var(--accent-green-subtle)}.\[\&\.ok\]\:text-accent-green.ok{color:var(--accent-green)}.\[\&\.open_\.compute-row-head\:hover\]\:rounded-\[var\(--radius-lg\)_var\(--radius-lg\)_0_0\].open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.\[\&\.pdf\]\:text-accent-red.pdf{color:var(--accent-red)}.\[\&\.primary\]\:border-primary.primary{border-color:var(--primary)}.\[\&\.primary\]\:bg-primary.primary{background-color:var(--primary)}.\[\&\.primary\]\:text-background.primary{color:var(--base)}.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.right\]\:top-\[calc\(50\%_-_6px\)\].right{top:calc(50% - 6px)}.\[\&\.right\]\:-left-\[6\.5px\].right{left:-6.5px}.\[\&\.right\]\:border-b.right{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&\.right\]\:border-l.right{border-left-style:var(--tw-border-style);border-left-width:1px}.\[\&\.right\]\:border-b-border.right{border-bottom-color:var(--border)}.\[\&\.right\]\:border-l-border.right{border-left-color:var(--border)}.\[\&\.session-menu\]\:top-\[calc\(100\%_-_2px\)\].session-menu{top:calc(100% - 2px)}.\[\&\.session-menu\]\:right-1\.5.session-menu{right:calc(var(--spacing) * 1.5)}.\[\&\.session-menu\]\:left-auto.session-menu{left:auto}.\[\&\.session-menu\]\:min-w-35.session-menu{min-width:calc(var(--spacing) * 35)}.\[\&\.sm\]\:rounded-sm.sm{border-radius:6px}.\[\&\.sm\]\:px-\[9px\].sm{padding-inline:9px}.\[\&\.sm\]\:py-\[3px\].sm{padding-block:3px}.\[\&\.sm\]\:text-xs.sm{font-size:var(--fs-xs)}.\[\&\.spreadsheet\]\:text-accent-green.spreadsheet{color:var(--accent-green)}.\[\&\.st-cancelled_\.dot\]\:text-accent-orange.st-cancelled .dot,.\[\&\.st-cancelling_\.dot\]\:text-accent-orange.st-cancelling .dot{color:var(--accent-orange)}.\[\&\.st-done_\.dot\]\:text-accent-green.st-done .dot,.\[\&\.st-done_\>_svg\]\:text-accent-green.st-done>svg{color:var(--accent-green)}.\[\&\.st-editing_\.dot\]\:text-accent-purple.st-editing .dot{color:var(--accent-purple)}.\[\&\.st-failed_\.dot\]\:text-accent-red.st-failed .dot{color:var(--accent-red)}.\[\&\.st-idle_\.dot\]\:text-muted.st-idle .dot{color:var(--muted)}.\[\&\.st-running_\.dot\]\:text-accent-teal.st-running .dot{color:var(--accent-teal)}.\[\&\.st-starting_\.dot\]\:text-accent-amber.st-starting .dot{color:var(--accent-amber)}.\[\&\.status-add\]\:text-accent-green.status-add{color:var(--accent-green)}.\[\&\.status-copy\]\:text-accent-blue.status-copy{color:var(--accent-blue)}.\[\&\.status-delete\]\:text-accent-red.status-delete{color:var(--accent-red)}.\[\&\.status-rename\]\:text-accent-blue.status-rename{color:var(--accent-blue)}.\[\&\.warn\]\:border-accent-amber.warn{border-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber.warn{background-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber-subtle.warn{background-color:var(--accent-amber-subtle)}.\[\&\.warn\]\:text-accent-amber.warn{color:var(--accent-amber)}.\[\&\:active\:not\(\:disabled\)\]\:bg-highlight:active:not(:disabled){background-color:var(--highlight)}.\[\&\:disabled\]\:cursor-default:disabled{cursor:default}.\[\&\:disabled\]\:opacity-45:disabled{opacity:.45}.\[\&\:focus\]\:border-accent-blue:focus{border-color:var(--accent-blue)}.\[\&\:hover\]\:rounded-lg:hover{border-radius:10px}.\[\&\:hover\]\:border-primary:hover{border-color:var(--primary)}.\[\&\:hover\]\:bg-panel:hover{background-color:var(--panel)}.\[\&\:hover\]\:bg-surface:hover{background-color:var(--surface)}.\[\&\:hover\]\:text-text:hover{color:var(--text)}.\[\&\:hover\]\:underline:hover{text-decoration-line:underline}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-variant:hover:not(:disabled){border-color:var(--border-variant)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-surface:hover:not(:disabled){background-color:var(--surface)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:absolute:not(.active)+.tab:not(.active):before{position:absolute}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:top-2\.5:not(.active)+.tab:not(.active):before{top:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bottom-2\.5:not(.active)+.tab:not(.active):before{bottom:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:-left-px:not(.active)+.tab:not(.active):before{left:-1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:w-px:not(.active)+.tab:not(.active):before{width:1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bg-border:not(.active)+.tab:not(.active):before{background-color:var(--border)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:content-\[\'\'\]:not(.active)+.tab:not(.active):before{--tw-content:"";content:var(--tw-content)}.chat-header .\[\.chat-header_\&\]\:min-w-0{min-width:0}.chat-header .\[\.chat-header_\&\]\:flex-1{flex:1}.chat-header .\[\.chat-header_\&\]\:overflow-hidden{overflow:hidden}.chat-header .\[\.chat-header_\&\]\:text-base{font-size:var(--fs-base)}.chat-header .\[\.chat-header_\&\]\:font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.chat-header .\[\.chat-header_\&\]\:text-ellipsis{text-overflow:ellipsis}.chat-header .\[\.chat-header_\&\]\:whitespace-nowrap{white-space:nowrap}.chat-header .\[\.chat-header_\&\]\:text-text{color:var(--text)}.chat-header.rail-hidden>.\[\.chat-header\.rail-hidden_\>_\&\:first-child\]\:mr-3:first-child{margin-right:calc(var(--spacing) * 3)}@container (max-width:960px){.\[\@container\(\(max-width\:_960px\)\)\]\:static{position:static}.\[\@container\(\(max-width\:_960px\)\)\]\:max-h-55{max-height:calc(var(--spacing) * 55)}.\[\@container\(\(max-width\:_960px\)\)\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}a.\[a\&\:hover\]\:border-muted:hover{border-color:var(--muted)}button.\[button\&\]\:inline-flex{display:inline-flex}button.\[button\&\]\:h-\[13px\]{height:13px}button.\[button\&\]\:w-\[13px\]{width:13px}button.\[button\&\]\:items-center{align-items:center}button.\[button\&\]\:justify-center{justify-content:center}button.\[button\&\]\:border-0{border-style:var(--tw-border-style);border-width:0}button.\[button\&\]\:bg-transparent{background-color:#0000}button.\[button\&\]\:p-0{padding:0}button.\[button\&_\>_svg\]\:transition-transform>svg{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}button.\[button\&_\>_svg\]\:duration-120>svg{--tw-duration:.12s;transition-duration:.12s}button.\[button\&_\>_svg\]\:ease-standard>svg{--tw-ease:ease;transition-timing-function:ease}button.\[button\&_\>_svg\.open\]\:rotate-90>svg.open{rotate:90deg}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--fs-2xs: 10px;--fs-xs: 11px;--fs-sm: 12px;--fs-md: 13px;--fs-base: 14px;--fs-lg: 15px;--fs-xl: 16px;--fs-2xl: 18px;--fs-3xl: 22px;--fs-4xl: 28px;--fs-5xl: 34px;--fw-regular: 400;--fw-medium: 500;--fw-semibold: 600;--fw-display: 700;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 10px;--radius-xl: 12px;--radius-full: 999px;--modal-top: min(30vh, 260px);--term-bg: #1a1a1a;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:var(--radius-sm);border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.wordmark{display:inline-flex;align-items:center;gap:.4em;color:var(--text)}.wordmark svg{width:1em;height:1em;flex-shrink:0}.home-brand{font-weight:var(--fw-display);font-size:var(--fs-4xl);letter-spacing:-.02em;margin-bottom:36px}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:var(--fs-2xl);letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:var(--radius-sm);color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.project-card .repo{color:var(--text)}.project-card .paper,.project-card .time{font-size:var(--fs-xs);color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:var(--fw-semibold);font-size:var(--fs-md);color:var(--text);padding:4px 6px 4px 0;border-radius:var(--radius-sm)}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);right:-4px;background:var(--text);color:var(--base);font-size:var(--fs-xs);font-weight:var(--fw-medium);line-height:1;padding:5px 8px;border-radius:var(--radius-sm);white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .1s ease .3s,visibility 0s linear .4s;z-index:60}[data-tip]:hover:after{opacity:1;visibility:visible}.tip-up[data-tip]:after{top:auto;bottom:calc(100% + 6px)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--text)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:var(--fs-xs);border-radius:var(--radius-sm)}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--text);white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot,.st-done>svg{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelling .dot,.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:var(--fs-md);color:var(--text);border-radius:var(--radius-md);text-align:left}.rail-nav-item:hover{background:var(--surface)}.rail-nav-item.active{background:var(--panel);font-weight:var(--fw-semibold)}.rail-nav-item.settings-toggle{color:var(--subtext)}.rail-nav-item .settings-chev{margin-left:auto;color:var(--muted);transition:transform .12s ease}.rail-nav-item.rail-nav-sub{margin-left:12px;padding-left:12px;font-size:var(--fs-sm);color:var(--subtext);border-left:1px solid var(--border-variant);border-radius:0 var(--radius-md) var(--radius-md) 0}.rail-nav-item.rail-nav-sub.active{color:var(--text)}.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:18px;max-width:560px}.theme-card{position:relative;display:flex;flex-direction:column;gap:10px;padding:10px;border:1px solid var(--border);border-radius:var(--radius-lg, 12px);background:var(--surface-bright);cursor:pointer;text-align:left;transition:border-color .12s ease,box-shadow .12s ease,transform .06s ease}.theme-card:hover{border-color:var(--muted)}.theme-card.active{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary)}.theme-swatches{display:flex;height:46px;border-radius:8px;overflow:hidden;border:1px solid var(--border-variant);padding:7px;gap:6px;align-items:center}.theme-swatches i{flex:1;height:100%;border-radius:5px;box-shadow:inset 0 0 0 1px #0000000f}.theme-meta{display:flex;flex-direction:column;gap:1px}.theme-name{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text)}.theme-jp{font-size:var(--fs-xs);color:var(--muted)}.theme-check{position:absolute;top:8px;right:10px;color:var(--primary);font-weight:800;font-size:13px}.rail-section-label{padding:10px 10px 6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--subtext)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:var(--radius-sm)}.rail-empty{padding:6px 10px;font-size:var(--fs-sm);color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm);white-space:nowrap;flex-shrink:0}.tab.active{background:var(--surface)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.subagent-tab-content{overflow-y:auto;background:var(--base);padding:12px 16px}.subagent-tab-header{display:flex;align-items:center;gap:8px;padding-bottom:8px;margin-bottom:8px;border-bottom:1px solid var(--border-variant)}.subagent-live{flex-shrink:0;font-size:var(--fs-xs);color:var(--accent-amber)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:var(--radius-md);background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm)}.seg button:not(:disabled):hover{color:var(--text)}.seg button.active{background:var(--base);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.seg button:disabled{color:var(--muted);cursor:default}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:var(--radius-md);font-size:var(--fs-md);color:var(--text);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface)}.session-row.active{background:var(--surface);font-weight:var(--fw-medium)}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.title-reveal-char{display:inline-block;animation:title-char-in .24s ease-out both}@keyframes title-char-in{0%{opacity:0;filter:blur(4px);transform:translateY(.15em)}}@media(prefers-reduced-motion:reduce){.title-reveal-char{animation:none}}.session-row .session-time{font-size:var(--fs-2xs);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:var(--radius-sm);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:var(--radius-sm);outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--text);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:var(--fs-5xl);font-weight:var(--fw-display);letter-spacing:-.02em;color:var(--text)}.chat-empty .chat-empty-hint{font-size:var(--fs-sm);color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:var(--fs-md);max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-full);padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.chat-loading{flex:1;display:flex;align-items:center;justify-content:center;gap:12px;color:var(--subtext);font-size:var(--fs-xl);padding:20px}.chat-loading .spinner{width:22px;height:22px;border-width:3px}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:var(--fs-md);white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:var(--radius-xs);display:block}.msg-assistant{font-size:var(--fs-base);line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:var(--fs-sm);margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:var(--fw-semibold)}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:var(--fs-md);text-align:left;border-radius:var(--radius-sm)}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-group.has-error>.tool-row .tool-line{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.subagent-row{display:flex;align-items:center;gap:8px;width:100%;margin:2px 0;padding:3px 4px;cursor:pointer;color:var(--text);font-size:var(--fs-base);text-align:left;border-radius:var(--radius-sm)}.subagent-row:hover:not(:disabled){background:var(--surface)}.subagent-row:disabled{cursor:default}.subagent-row.has-error{color:var(--accent-red)}.subagent-row .tool-line{font-size:var(--fs-base);color:var(--text)}.subagent-row-chevron,.subagent-icon{flex-shrink:0;color:var(--muted)}.subagent-empty{padding:3px 4px;font-size:var(--fs-md);color:var(--muted)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:var(--radius-sm)}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-md);color:var(--subtext)}.tool-open{flex-shrink:0;font-size:var(--fs-xs);color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--text);background:var(--surface);border-radius:var(--radius-sm);white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm)}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.path-row{display:flex;gap:6px;align-items:stretch}.path-row input{flex:1;min-width:0}.path-row .btn{flex-shrink:0;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}.composer-queued{display:flex;flex-direction:column;gap:4px;margin-bottom:6px}.queued-chip{display:flex;align-items:center;gap:8px;padding:6px 10px;color:var(--subtext);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);font-size:var(--fs-sm)}.queued-chip-icon{flex-shrink:0;color:var(--muted)}.queued-chip-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.queued-chip-label{flex-shrink:0;color:var(--muted);font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.04em}.queued-chip-cancel{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:999px;color:var(--muted);background:transparent;cursor:pointer}.queued-chip-cancel:hover{color:var(--base);background:var(--text)}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.composer-harness-warning{padding:8px 12px;color:var(--subtext);font-size:var(--fs-xs);line-height:1.5;border-bottom:1px solid var(--border-variant)}.composer-harness-warning strong{color:var(--accent-amber);font-weight:var(--fw-medium)}.composer-harness-warning code{font-family:var(--mono);color:var(--text)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:var(--fs-md);field-sizing:content;min-height:52px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:var(--radius-sm);display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;align-items:center;gap:6px;padding:6px 8px 8px;flex-wrap:nowrap;min-width:0}.composer-actions .option-picker{flex:none}.composer-actions .model-picker{flex:0 1 auto;min-width:0;max-width:46%}.composer-actions .send-btn{flex:none}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--radius-md);background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:var(--fw-semibold)}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:var(--radius-md);padding:8px 12px;overflow-x:auto;font-size:var(--fs-sm);color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);padding:1px 5px}.md .katex{font-size:1.05em}.md .katex-display{margin:12px 0;overflow-x:auto;overflow-y:hidden;padding:2px 0}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--text);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:var(--fw-regular)}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm);opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:var(--fw-semibold);margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;display:block;width:max-content;max-width:100%;font-size:var(--fs-md);margin:10px 0;border:1px solid var(--border);border-radius:var(--radius-md);overflow-x:auto}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text);word-break:normal;overflow-wrap:break-word}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:var(--fw-medium);color:var(--text);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:var(--fs-md);transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--text);font-size:var(--fs-sm);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:var(--fs-2xs);color:var(--muted)}.exp-node .node-metrics{margin-top:8px;display:flex;flex-wrap:wrap;gap:6px}.exp-node .node-metric{display:inline-flex;align-items:baseline;gap:4px;padding:2px 7px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border);font-size:var(--fs-2xs)}.exp-node .node-metric-k{color:var(--muted)}.exp-node .node-metric-v{color:var(--text);font-weight:var(--fw-semibold);font-variant-numeric:tabular-nums}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text);border-radius:var(--radius-sm);text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.react-flow__node.react-flow__node-elided.selectable{cursor:pointer}.elided-node{width:148px;height:44px;display:flex;align-items:center;gap:8px;padding:6px 10px;border:1px dashed var(--border);border-radius:var(--radius-md);background:color-mix(in oklab,var(--text) 3%,transparent);color:var(--muted);font-size:var(--fs-2xs);font-weight:var(--fw-medium);text-align:left;transition:border-color .12s ease,color .12s ease}.elided-node:hover{border-color:var(--text);color:var(--text)}.elided-node .elided-node-label{display:flex;flex-direction:column;line-height:1.3}.elided-node .elided-node-sub{color:var(--muted)}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.exp-hover-card .hc-body{margin-top:10px;border-top:1px solid var(--border-variant);padding-top:10px;line-height:1.6;white-space:pre-line;display:-webkit-box;-webkit-line-clamp:10;-webkit-box-orient:vertical;overflow:hidden}.exp-hover-card .hc-body.expanded{display:block;-webkit-line-clamp:unset;max-height:45vh;overflow-y:auto;padding-bottom:4px}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table-error{padding:8px 12px;color:var(--accent-red);font-size:var(--fs-sm);border-bottom:1px solid var(--border)}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:var(--fs-md);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}.runs-table th{text-align:left;color:var(--text);font-size:var(--fs-xs);font-weight:var(--fw-semibold);padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:var(--fs-sm)}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--radius-md);background:var(--canvas);border:1px solid var(--border);font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--base);color:var(--subtext);font-size:var(--fs-md)}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:var(--fw-medium)}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:var(--fs-md)}.kv .k{color:var(--subtext)}.kv .v{font-family:var(--mono);font-size:var(--fs-sm);word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:var(--fs-sm);color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:var(--term-bg);padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:var(--fs-md);color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:var(--fs-sm);font-weight:var(--fw-semibold)}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-sm);border-radius:var(--radius-sm)}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:var(--fw-semibold)}.history-item .when{margin-left:auto;font-size:var(--fs-xs);color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--subtext)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm)}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:var(--fs-sm);color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:var(--fs-md);line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:var(--fs-2xl);font-weight:var(--fw-regular);color:var(--text)}.empty-state p.empty-state-hint{font-size:var(--fs-lg);color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-size:var(--fs-xl);font-weight:var(--fw-semibold);color:var(--muted);margin-bottom:18px}.onb-title{margin:0 0 6px;font-size:var(--fs-3xl);letter-spacing:-.01em}.onb-sub{color:var(--text);font-size:var(--fs-base);line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.onb-card-detail{font-size:var(--fs-sm)}.onb-card-meta{font-size:var(--fs-sm);color:var(--subtext)}.onb-card-meta code,.model-more code{font-family:var(--mono);font-size:var(--fs-xs);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);padding:1px 5px;white-space:nowrap}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:8px 0}.onb-fix{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;margin:6px 0 9px}.onb-aside{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-top:12px;padding-top:10px;border-top:1px solid var(--border-variant)}.onb-aside-text{font-size:var(--fs-xs);color:var(--muted);line-height:1.5}.onb-aside .onb-cmd-chip{max-width:100%}.onb-aside .onb-cmd-chip code{font-size:var(--fs-xs);white-space:normal;word-break:break-word}.onb-fix-label{font-size:var(--fs-md);font-weight:var(--fw-regular);color:var(--text)}.onb-fix-alt{margin-left:auto;padding:0;border:0;background:none;color:var(--muted);font-size:var(--fs-xs);text-decoration:underline;cursor:pointer}.onb-fix-alt:hover{color:var(--text)}.onb-cmd-chip{display:inline-flex;align-items:stretch;align-self:flex-start;max-width:100%;background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-sm);overflow:hidden}.onb-cmd-chip code{font-family:var(--mono);font-size:var(--fs-sm);padding:4px 9px}.onb-cmd-copy{display:inline-flex;align-items:center;flex-shrink:0;padding:0 8px;border:0;border-left:1px solid var(--border-variant);background:none;color:var(--muted);cursor:pointer}.onb-cmd-copy:hover{background:var(--surface);color:var(--text)}.onb-gate-hint{margin:18px 0 0;font-size:var(--fs-base);font-weight:var(--fw-semibold);line-height:1.5;color:var(--text)}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:var(--fw-regular);font-size:var(--fs-xs);color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:var(--fs-md);font-weight:var(--fw-medium)}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:var(--fs-md);font-weight:var(--fw-semibold)}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:var(--fs-xs);color:var(--text);font-weight:var(--fw-medium)}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.settings-card>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:flex-start;justify-content:center;padding:var(--modal-top) 16px 24px;overflow-y:auto;z-index:100}.modal{width:480px;max-width:94vw;max-height:calc(100vh - var(--modal-top) - 48px);overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:var(--fs-xl)}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:4px 0}.settings-note{margin:10px 0 0;font-size:var(--fs-sm);padding:8px 10px;border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:var(--fw-medium)}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:var(--radius-full);transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:var(--fs-sm);color:var(--muted)}.progress-fill.indeterminate{width:30%;animation:progress-sweep 1.2s ease-in-out infinite}@keyframes progress-sweep{0%{margin-left:0}50%{margin-left:70%}to{margin-left:0}}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-family:var(--sans);font-size:var(--fs-xs);font-weight:var(--fw-medium);padding:1px 7px;border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;min-height:0;display:flex;background:var(--base)}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.ftree-pane{position:relative;flex-shrink:0;display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--border-variant);border-right:1px solid var(--border-variant);background:var(--base)}.ftree-resizer{position:absolute;right:-3px;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.ftree-resizer:hover,.ftree-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.ftree-scroll{flex:1;min-height:0;overflow-y:auto;padding:10px 8px}.ft-row{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:var(--radius-sm);cursor:pointer}.ft-row:hover{background:var(--surface)}.ft-row.selected,.ft-row.selected:hover{background:var(--panel)}.ft-chevron{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ft-chevron.open{transform:rotate(90deg)}.ft-chevron.spacer{visibility:hidden}.ft-title{flex:1;min-width:0;font-size:var(--fs-md);font-weight:var(--fw-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname,.ft-name{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname{color:var(--text)}.ft-thumb{width:18px;height:18px;object-fit:cover;border-radius:var(--radius-xs);border:1px solid var(--border-variant);flex-shrink:0}.ft-divider{padding:12px 8px 4px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted)}.ftree-footer{flex-shrink:0;display:flex;align-items:center;gap:2px;padding:5px 8px;border-top:1px solid var(--border-variant)}.ftree-footer code{flex:1;min-width:0;direction:rtl;text-align:left;font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-footer .icon-btn{width:22px;height:22px}.fpreview{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:var(--base)}.fpreview-none{align-items:center;justify-content:center;gap:8px;font-size:var(--fs-md);color:var(--muted)}.fpreview-head{height:40px;display:flex;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.fpreview-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fpreview-date,.fpreview-size{font-size:var(--fs-xs);color:var(--muted);white-space:nowrap;flex-shrink:0}.fpreview-body{flex:1;min-height:0;overflow:auto}.fpreview-body.doc{padding:18px 28px 48px}.fpreview-body.doc .report-md{max-width:var(--readable-col);margin:0 auto}.fpreview-image{display:flex;align-items:flex-start;justify-content:center;padding:24px}.fpreview-image img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.fpreview-pdf{display:block;width:100%;height:100%;border:0}.fpreview-video{display:block;max-width:100%;max-height:100%;margin:24px auto;border:1px solid var(--border);border-radius:var(--radius-sm);background:#0b0e18;image-rendering:pixelated}.fpreview-audio{display:block;width:calc(100% - 48px);margin:24px}.model-view{display:flex;flex-direction:column;width:100%;height:100%;min-height:320px}.model-view-canvas{flex:1;min-height:0;background:#0b0e18}.model-view-canvas canvas{display:block}.model-view-bar{display:flex;align-items:center;gap:8px;padding:6px 10px;border-top:1px solid var(--border)}.model-view-hint{flex:1;font-size:11px;color:var(--muted)}.chat-media{display:inline-flex;flex-direction:column;gap:2px;vertical-align:bottom;margin:2px 4px 2px 0}.chat-media-open{display:block;padding:0;border:1px solid var(--border);border-radius:var(--radius-sm);background:#0b0e18;cursor:pointer;overflow:hidden;line-height:0}.chat-media-open:disabled{cursor:default}.chat-media-open img,.chat-media-open video{display:block;max-width:320px;max-height:220px;image-rendering:pixelated}.chat-media-name{font-size:10px;color:var(--muted)}.model-view-clips{font-size:11px;color:var(--muted);font-family:var(--mono, ui-monospace, monospace)}.files-empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:24px;text-align:center;color:var(--muted)}.files-empty-state h3{margin:6px 0 0;font-size:var(--fs-base);font-weight:var(--fw-semibold);color:var(--text)}.files-empty-state p{margin:0;max-width:420px;font-size:var(--fs-md);line-height:1.55;color:var(--subtext)}.files-empty-state .ftree-footer{margin-top:10px;max-width:100%;border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;background:var(--base)}.files-empty-state .ftree-footer code{max-width:380px}.files-truncated{margin:0;padding:8px 14px;font-size:var(--fs-xs);color:var(--muted)}.report-md{font-size:var(--fs-lg)}.report-md h1{font-size:2em;line-height:1.18;margin:28px 0 14px}.report-md h2{font-size:1.5em;line-height:1.25;margin:28px 0 10px}.report-md h3{font-size:1.2em;line-height:1.35;margin:22px 0 8px}.report-md h4{font-size:1em;line-height:1.4;margin:18px 0 6px}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:var(--fs-sm);color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.diff-file-header .chev{color:var(--muted);font-size:var(--fs-2xs);flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:var(--fs-md)}.truncated-notice{border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);padding:12px 14px;font-size:var(--fs-md)}.truncated-notice h4{margin:0 0 4px;font-size:var(--fs-md);color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:var(--fs-sm);line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:var(--fs-3xl)}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--text);font-size:var(--fs-md)}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:var(--fs-md);margin:4px 0 0}.muted{color:var(--muted)}:root{--persona-research: var(--accent-blue);--persona-game-designer: var(--accent-orange);--persona-idea-foundry: var(--accent-purple);--persona-analyst: var(--accent-teal);--persona-producer: var(--accent-pink);--persona-blender: var(--accent-amber);--persona-comfyui: var(--accent-green);--persona-game-artist: var(--accent-violet, #a78bfa)}.persona-swatch{flex:none;width:10px;height:10px;border-radius:var(--radius-full)}.persona-badge{display:inline-flex;align-items:center;gap:5px;flex:none;font-size:12px;font-weight:600;line-height:1;padding:3px 9px 3px 7px;border-radius:var(--radius-full);border:1px solid color-mix(in srgb,currentColor 32%,transparent);background:color-mix(in srgb,currentColor 12%,transparent);white-space:nowrap}.persona-badge svg{flex:none}.persona-badge.persona-research{color:var(--persona-research)}.persona-badge.persona-game-designer{color:var(--persona-game-designer)}.persona-badge.persona-idea-foundry{color:var(--persona-idea-foundry)}.persona-badge.persona-analyst{color:var(--persona-analyst)}.persona-badge.persona-producer{color:var(--persona-producer)}.persona-badge.persona-blender{color:var(--persona-blender)}.persona-badge.persona-comfyui{color:var(--persona-comfyui)}.persona-badge.persona-game-artist{color:var(--persona-game-artist)}.persona-badge.compact{padding:2px;border-color:transparent;background:transparent}.usage-pill-wrap{position:relative;display:inline-flex}.usage-pill{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 6px;border:1px solid var(--border);border-radius:var(--radius-full);background:var(--surface);font:inherit;font-size:var(--fs-sm);color:var(--muted);cursor:pointer;white-space:nowrap;transition:border-color .12s ease,background .12s ease}.usage-pill:hover{border-color:var(--muted)}.usage-pill b{color:var(--text);font-weight:var(--fw-semibold);font-variant-numeric:tabular-nums}.usage-pill .usage-reset{color:var(--faint, var(--muted));font-family:var(--mono);font-size:var(--fs-xs)}.usage-pill .usage-ghost{color:var(--muted)}.usage-ring{flex:none;display:block}.usage-pill.warn{border-color:color-mix(in srgb,var(--accent-amber) 45%,var(--border));background:color-mix(in srgb,var(--accent-amber) 9%,var(--surface))}.usage-pill.warn b{color:var(--accent-amber)}.usage-pill.crit{border-color:color-mix(in srgb,var(--accent-red) 50%,var(--border));background:color-mix(in srgb,var(--accent-red) 10%,var(--surface))}.usage-pill.crit b{color:var(--accent-red)}.usage-pop{position:absolute;bottom:calc(100% + 8px);right:0;z-index:60;width:288px;max-width:84vw;background:var(--surface-bright);border:1px solid var(--border);border-radius:var(--radius-lg, 12px);box-shadow:0 1px 2px #0000000f,0 12px 32px #00000024;overflow:hidden}.usage-pop-h{display:flex;align-items:center;justify-content:space-between;padding:11px 13px 8px;font-size:var(--fs-sm)}.usage-pop-h .who{font-weight:var(--fw-semibold);color:var(--text)}.usage-pop-h .obs{font-size:var(--fs-xs);color:var(--muted);font-family:var(--mono)}.usage-wrow{display:flex;align-items:center;gap:11px;padding:10px 13px;border-top:1px solid var(--border-variant)}.usage-wt{flex:1;min-width:0}.usage-wlabel{font-size:var(--fs-md);color:var(--text);font-weight:var(--fw-medium)}.usage-wsub{font-size:var(--fs-xs);color:var(--muted);font-family:var(--mono);margin-top:2px}.usage-bar{height:6px;border-radius:4px;background:var(--panel);overflow:hidden;margin-top:6px}.usage-bar i{display:block;height:100%;border-radius:4px}.usage-pct{flex:none;width:42px;text-align:right;font-size:var(--fs-base);font-weight:var(--fw-semibold);font-variant-numeric:tabular-nums}.usage-empty{padding:12px 13px;font-size:var(--fs-sm);color:var(--muted);border-top:1px solid var(--border-variant)}.usage-pop-foot{display:flex;align-items:center;justify-content:space-between;padding:8px 13px;border-top:1px solid var(--border-variant);background:var(--surface);font-size:var(--fs-sm)}.usage-refresh{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:var(--fs-sm);color:var(--subtext);background:none;border:none;cursor:pointer;padding:0}.usage-refresh:hover:not(:disabled){color:var(--text)}.usage-refresh:disabled{opacity:.6;cursor:default}.usage-pop-foot a{color:var(--primary);text-decoration:none}.usage-refresh .spin{animation:usage-spin .8s linear infinite}@keyframes usage-spin{to{transform:rotate(360deg)}}.persona-picker{position:relative;display:inline-flex}.persona-badge-btn{cursor:pointer;font:inherit;transition:filter .12s ease,box-shadow .12s ease}.persona-badge-btn:hover{filter:brightness(1.04);box-shadow:0 0 0 1px color-mix(in srgb,currentColor 30%,transparent)}.persona-badge-chev{color:currentColor;opacity:.7;margin-left:1px}.persona-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:60;width:320px;max-width:80vw;background:var(--surface-bright);border:1px solid var(--border);border-radius:var(--radius-lg, 12px);box-shadow:0 1px 2px #0000000f,0 12px 32px #00000024;overflow:hidden}.persona-menu-h{font-size:var(--fs-xs);font-weight:var(--fw-semibold);letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:11px 14px 6px}.persona-opt{display:flex;gap:11px;align-items:flex-start;width:100%;padding:9px 14px;border:none;border-top:1px solid var(--border-variant);background:transparent;cursor:pointer;text-align:left;font:inherit}.persona-opt:hover{background:var(--surface)}.persona-opt.sel{background:color-mix(in srgb,currentColor 8%,transparent)}.persona-opt-ic{flex:none;width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:color-mix(in srgb,currentColor 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,currentColor 28%,transparent)}.persona-opt-t{flex:1;min-width:0}.persona-opt-n{display:flex;align-items:center;gap:7px;font-size:var(--fs-md);font-weight:var(--fw-semibold)}.persona-opt-def{font-size:9.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:currentColor;border:1px solid color-mix(in srgb,currentColor 35%,transparent);border-radius:999px;padding:1px 6px}.persona-opt-d{display:block;font-size:var(--fs-sm);color:var(--subtext);margin-top:1px}.persona-opt-check{color:currentColor;font-weight:800;font-size:13px;align-self:center}.persona-menu-foot{font-size:var(--fs-sm);color:var(--muted);padding:9px 14px;border-top:1px solid var(--border-variant);background:var(--surface)}.persona-swatch.persona-research{background:var(--persona-research)}.persona-swatch.persona-game-designer{background:var(--persona-game-designer)}.persona-swatch.persona-idea-foundry{background:var(--persona-idea-foundry)}.persona-card.persona-research{border-left:3px solid var(--persona-research)}.persona-card.persona-game-designer{border-left:3px solid var(--persona-game-designer)}.persona-card.persona-idea-foundry{border-left:3px solid var(--persona-idea-foundry)}.persona-active-pill.persona-research{color:var(--persona-research);border-color:var(--persona-research)}.persona-active-pill.persona-game-designer{color:var(--persona-game-designer);border-color:var(--persona-game-designer)}.persona-active-pill.persona-idea-foundry{color:var(--persona-idea-foundry);border-color:var(--persona-idea-foundry)}.persona-bar{flex:none;width:4px;height:16px;border-radius:var(--radius-full)}.persona-bar.persona-research{background:var(--persona-research)}.persona-bar.persona-game-designer{background:var(--persona-game-designer)}.persona-bar.persona-idea-foundry{background:var(--persona-idea-foundry)}.persona-swatch.persona-analyst,.persona-bar.persona-analyst{background:var(--persona-analyst)}.persona-card.persona-analyst{border-left:3px solid var(--persona-analyst)}.persona-active-pill.persona-analyst{color:var(--persona-analyst);border-color:var(--persona-analyst)}.persona-swatch.persona-producer,.persona-bar.persona-producer{background:var(--persona-producer)}.persona-card.persona-producer{border-left:3px solid var(--persona-producer)}.persona-active-pill.persona-producer{color:var(--persona-producer);border-color:var(--persona-producer)}.persona-swatch.persona-blender,.persona-bar.persona-blender{background:var(--persona-blender)}.persona-card.persona-blender{border-left:3px solid var(--persona-blender)}.persona-active-pill.persona-blender{color:var(--persona-blender);border-color:var(--persona-blender)}.persona-swatch.persona-game-artist,.persona-bar.persona-game-artist{background:var(--persona-game-artist)}.persona-swatch.persona-comfyui,.persona-bar.persona-comfyui{background:var(--persona-comfyui)}.persona-card.persona-comfyui{border-left:3px solid var(--persona-comfyui)}.persona-active-pill.persona-comfyui{color:var(--persona-comfyui);border-color:var(--persona-comfyui)}.session-row .session-titlewrap{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:1px;overflow:hidden}.session-row .session-titlewrap .session-title{flex:0 0 auto}.session-row .session-sub{font-size:11px;line-height:1.2;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row.nested{border-left:2px solid var(--border);border-radius:0 var(--radius-md) var(--radius-md) 0;margin-left:6px}.session-row.nested.active{border-left-color:var(--primary)}.proposal-card{display:flex;flex-direction:column;gap:9px;padding:12px 13px;border:1px solid color-mix(in srgb,var(--accent, var(--primary)) 34%,var(--border));border-radius:var(--radius-lg, 12px);background:color-mix(in srgb,var(--accent, var(--primary)) 6%,var(--surface-bright))}.proposal-eyebrow{display:flex;align-items:center;gap:7px;font-size:var(--fs-xs);font-weight:var(--fw-semibold);letter-spacing:.05em;text-transform:uppercase;color:var(--accent, var(--primary))}.proposal-eyebrow b{font-weight:700}.proposal-task{font-size:var(--fs-md);color:var(--text);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.proposal-why{font-size:var(--fs-sm);color:var(--muted);font-style:italic}.proposal-fields{display:flex;flex-direction:column;gap:6px;padding:8px;border-radius:var(--radius-md);background:color-mix(in srgb,var(--text) 4%,transparent)}.proposal-fields label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:var(--fs-sm);color:var(--muted)}.proposal-fields select{flex:1;min-width:0;max-width:62%;padding:3px 6px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-bright);color:var(--text);font-size:var(--fs-sm)}.proposal-err{font-size:var(--fs-sm);color:var(--accent-red)}.proposal-actions{display:flex;align-items:center;gap:8px;margin-top:2px}.proposal-approve{font:inherit;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:#fff;background:var(--accent, var(--primary));border:none;border-radius:var(--radius-md);padding:7px 16px;cursor:pointer;transition:filter .12s ease}.proposal-approve:hover:not(:disabled){filter:brightness(1.06)}.proposal-approve:disabled{opacity:.55;cursor:default}.proposal-secondary{font:inherit;font-size:var(--fs-md);color:var(--subtext);background:transparent;border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 13px;cursor:pointer}.proposal-secondary:hover:not(:disabled){background:var(--surface);color:var(--text)}.proposal-secondary:disabled{opacity:.55;cursor:default}.persona-bar.sm{width:3px;height:12px;margin-right:-4px}.persona-prompt-toggles{display:flex;flex-direction:column;gap:8px;margin-top:10px}.persona-prompt-toggle{display:flex;align-items:baseline;gap:8px;font-size:var(--fs-sm);cursor:pointer}.persona-prompt-toggle input{accent-color:var(--primary)}.persona-prompt-label{font-weight:var(--fw-semibold);color:var(--text)}.persona-prompt-hint{color:var(--muted)}.persona-section-title{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);margin:14px 0 4px}.persona-section-title:first-child{margin-top:0}.persona-skill-list{display:flex;flex-direction:column;margin-bottom:6px}.persona-skill{border-top:1px solid var(--border)}.persona-skill:first-child{border-top:none}.persona-skill-head{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:8px 4px;border-radius:var(--radius-sm)}.persona-skill-head:hover{background:var(--surface)}.persona-skill-name{font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);flex:none}.persona-skill-desc{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--fs-sm)}.persona-doc{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);padding:2px 14px;margin:4px 0 10px;max-height:440px;overflow-y:auto;font-size:var(--fs-sm)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg)}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:var(--radius-lg)}.compute-row.open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--fs-sm)}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:var(--radius-sm)}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:var(--fs-sm)}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:var(--fs-sm);color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.harness-usage{display:flex;flex-direction:column;gap:4px;font-family:var(--sans);font-size:var(--fs-sm)}.usage-window{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.usage-win-label{color:var(--subtext);min-width:60px}.usage-bar{flex:0 0 88px;height:6px;border-radius:3px;background:var(--muted);overflow:hidden}.usage-bar-fill{display:block;height:100%;border-radius:3px;background:var(--accent-green);transition:width .3s ease}.usage-bar-fill.low{background:var(--accent-red)}.usage-pct{font-variant-numeric:tabular-nums}.usage-reset{color:var(--subtext);font-variant-numeric:tabular-nums;white-space:nowrap}.usage-asof{color:var(--subtext);font-size:var(--fs-xs)}.harness-usage-note{font-family:var(--sans);font-size:var(--fs-sm);word-break:normal;overflow-wrap:anywhere}.env-table{width:100%;border-collapse:collapse;font-size:var(--fs-md);table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:var(--fs-md)}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:var(--fw-medium);color:var(--text)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:var(--fs-xs)}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-sm);color:var(--text);padding:5px 8px;border-radius:var(--radius-sm);white-space:nowrap;min-width:0}.pill-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:var(--fs-sm);color:var(--text);padding:5px 4px;border-radius:var(--radius-sm);white-space:nowrap;min-width:0}.composer-bare:hover{color:var(--text)}.composer-budgets{display:flex;align-items:center;gap:8px;flex:none;white-space:nowrap}.composer-budgets:empty{display:none}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.composer-bare.context-ring{display:inline-flex;align-items:center;margin-right:8px}.context-meter-menu .progress{margin:8px 0 0}.context-meter-menu .progress-track{height:5px;border:none;background:var(--border)}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 8px)}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:var(--fw-regular)}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:var(--fs-md);outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted);padding:8px 8px 4px}.model-group-status{display:inline-flex;align-items:center;gap:4px;color:var(--accent-amber);font-weight:var(--fw-regular)}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-md);border-radius:var(--radius-sm)}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:var(--fs-2xs);color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:var(--fs-xs);color:var(--muted)}.model-unavailable{line-height:1.5;border-bottom:1px solid var(--border-variant)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:var(--fs-xs);color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:var(--radius-sm)}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-size:var(--fs-sm)}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:var(--fs-xs);color:var(--subtext)}.skill-chip{display:inline-flex;align-items:center;padding:1px 7px;font-family:var(--mono);font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--primary);background:var(--primary-subtle);border:1px solid var(--border-variant);border-radius:var(--radius-sm)}.composer-input{position:relative;display:flex;overflow:hidden}.composer-input textarea{flex:1}.composer-chip{position:absolute;top:9px;left:12px;z-index:1;pointer-events:none}.msg-user .skill-chip{margin-right:2px;vertical-align:baseline}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--text);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-note{padding:10px 16px;font-size:var(--fs-sm);color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:var(--fs-base)}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.prompt-head code{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text)}.prompt-sub{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-q{font-size:var(--fs-base);font-weight:var(--fw-semibold);line-height:1.5;color:var(--text)}.prompt-plan{font-size:var(--fs-base);line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:var(--fs-md);font-weight:var(--fw-semibold)}.prompt-option-desc{display:block;font-size:var(--fs-sm);font-weight:var(--fw-regular);line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid transparent;border-radius:var(--radius-sm);cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:var(--fs-md);margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:var(--fw-semibold);word-break:break-word}.prompt-outcome{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:var(--fs-md);color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:var(--fw-semibold)}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:var(--fs-md);cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:var(--radius-md);padding:9px 11px;font-size:var(--fs-md);font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:var(--fs-md);font-weight:var(--fw-semibold);white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--text);font-size:var(--fs-md);cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:var(--fs-sm);padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-note{padding:8px 16px;font-size:var(--fs-sm);color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:var(--fs-md)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.wt-branch-chip{display:inline-flex;align-items:center;gap:4px;min-width:0;padding:2px 8px;border-radius:var(--radius-full);background:color-mix(in oklab,var(--text) 8%,transparent);color:var(--subtext);font-size:var(--fs-xs)}.wt-branch-chip>svg{flex-shrink:0}.wt-branch-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono)}.wt-changes{padding:0 16px 24px}.wt-changes>:first-child{margin-top:14px}.tour-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200}.tour-dim{position:absolute;top:0;right:0;bottom:0;left:0;background:#0000008c}.tour-spotlight{position:absolute;border-radius:var(--radius-lg);box-shadow:0 0 0 9999px #0000008c;transition:all .3s ease}.tour-ring{position:absolute;border-radius:var(--radius-lg);border:2px solid var(--primary);transition:all .3s ease}.tour-card{position:absolute;width:390px;max-width:calc(100vw - 32px);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:21px 23px 0;transition:left .2s ease,top .2s ease}.tour-card.centered{left:50%;top:50%;transform:translate(-50%,-50%);transition:none}.tour-card h3{margin:0 26px 7px 0;font-size:var(--fs-lg);font-weight:var(--fw-semibold)}.tour-card p{margin:0;font-size:var(--fs-base);line-height:1.55;color:var(--text)}.tour-card .tour-close{position:absolute;top:12px;right:12px}.tour-footer{display:flex;align-items:center;border-top:1px solid var(--border-variant);margin-top:16px;padding:11px 0}.tour-footer-side{flex:1;display:flex}.tour-footer-side.end{justify-content:flex-end}.tour-count{font-size:var(--fs-sm);color:var(--muted);font-variant-numeric:tabular-nums}.tour-arrow{position:absolute;width:12px;height:12px;background:var(--base);rotate:45deg;pointer-events:none}.tour-arrow.above{bottom:-6.5px;left:calc(50% - 6px);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.tour-arrow.below{top:-6.5px;left:calc(50% - 6px);border-left:1px solid var(--border);border-top:1px solid var(--border)}.tour-arrow.left{right:-6.5px;top:calc(50% - 6px);border-top:1px solid var(--border);border-right:1px solid var(--border)}.tour-arrow.right{left:-6.5px;top:calc(50% - 6px);border-bottom:1px solid var(--border);border-left:1px solid var(--border)}.exp-detail{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.exp-detail-body{position:relative;flex:1;min-height:0}.exp-verdict-strip{display:flex;align-items:center;gap:8px;min-height:34px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.verdict-control{display:inline-flex;align-items:center;gap:4px}.verdict-label{font-size:var(--fs-sm);color:var(--text-dim);margin-right:2px}.verdict-chip{border:1px solid var(--border);border-radius:999px;background:transparent;color:var(--text-dim);font-size:var(--fs-sm);padding:2px 9px;cursor:pointer}.verdict-chip:hover{color:var(--text);border-color:var(--text-dim)}.verdict-chip.keep.active{background:var(--accent-green, #2e7d32);border-color:transparent;color:#fff}.verdict-chip.kill.active{background:var(--accent-red, #c62828);border-color:transparent;color:#fff}.verdict-chip.iterate.active{background:var(--accent-amber, #ef6c00);border-color:transparent;color:#fff}.verdict-notes{width:220px}.verdict-notes-preview{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-sm);color:var(--text-dim)}.results-strip{padding:8px 10px;border-bottom:1px solid var(--border);flex-shrink:0}.metric-chips{display:flex;flex-wrap:wrap;gap:6px}.metric-chip{display:inline-flex;align-items:baseline;gap:6px;border:1px solid var(--border);border-radius:8px;padding:3px 8px;font-size:var(--fs-sm);background:var(--panel)}.metric-chip .metric-key{color:var(--text-dim)}.metric-chip .metric-value{font-weight:var(--fw-semibold);color:var(--text);font-variant-numeric:tabular-nums}.metric-delta{font-size:var(--fs-xs, 11px);font-variant-numeric:tabular-nums}.metric-delta.up{color:var(--accent-green, #2e7d32)}.metric-delta.down{color:var(--accent-red, #c62828)}.artifact-gallery{padding:8px 10px;border-bottom:1px solid var(--border);flex-shrink:0;max-height:220px;overflow-y:auto}.artifact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.artifact-grid img{width:100%;height:90px;object-fit:cover;border-radius:8px;border:1px solid var(--border);background:var(--panel)}.artifact-files{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.artifact-file{font-size:var(--fs-sm);color:var(--text-dim);border:1px solid var(--border);border-radius:6px;padding:2px 8px;text-decoration:none}.artifact-file:hover{color:var(--text)}.play-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.play-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.play-entry-input{width:280px}.play-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.node-eyebrow-left{display:inline-flex;align-items:center;gap:5px}.node-eyebrow-left .node-gh{padding:1px}.session-clock{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-sm);color:var(--text-dim);font-variant-numeric:tabular-nums}.session-clock .dot{width:7px;height:7px;border-radius:50%;background:var(--accent-green, #2e7d32);animation:pulse 2s ease-in-out infinite}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** + * Copyright (c) 2014 The xterm.js authors. All rights reserved. + * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) + * https://github.com/chjj/term.js + * @license MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Originally forked from (with the author's permission): + * Fabrice Bellard's javascript vt100 for jslinux: + * http://bellard.org/jslinux/ + * Copyright (c) 2011 Fabrice Bellard + * The original design remains. The terminal itself + * has been extended to include xterm CSI codes, among + * other features. + */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative} diff --git a/ui/dist/assets/index-wQaJeB0S.js b/ui/dist/assets/index-wQaJeB0S.js deleted file mode 100644 index d1fd230f0..000000000 --- a/ui/dist/assets/index-wQaJeB0S.js +++ /dev/null @@ -1,731 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelViewer-D3HqfNbT.js","assets/OrbitControls-m56-zQrj.js","assets/SplatViewer-Bz_PebWi.js"])))=>i.map(i=>d[i]); -var QE=Object.defineProperty;var C3=e=>{throw TypeError(e)};var JE=(e,t,n)=>t in e?QE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ra=(e,t,n)=>JE(e,typeof t!="symbol"?t+"":t,n),eA=(e,t,n)=>t.has(e)||C3("Cannot "+n);var k3=(e,t,n)=>t.has(e)?C3("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var La=(e,t,n)=>(eA(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function id(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lm={exports:{}},_c={};/** - * @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 E3;function tA(){if(E3)return _c;E3=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var c=null;if(a!==void 0&&(c=""+a),i.key!==void 0&&(c=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:a}}return _c.Fragment=t,_c.jsx=n,_c.jsxs=n,_c}var A3;function nA(){return A3||(A3=1,lm.exports=tA()),lm.exports}var f=nA(),cm={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 N3;function rA(){if(N3)return ft;N3=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),g=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function _(I,Y,q){this.props=I,this.context=Y,this.refs=b,this.updater=q||C}_.prototype.isReactComponent={},_.prototype.setState=function(I,Y){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,Y,"setState")},_.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function x(){}x.prototype=_.prototype;function S(I,Y,q){this.props=I,this.context=Y,this.refs=b,this.updater=q||C}var k=S.prototype=new x;k.constructor=S,w(k,_.prototype),k.isPureReactComponent=!0;var N=Array.isArray;function A(){}var j={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function D(I,Y,q){var se=q.ref;return{$$typeof:e,type:I,key:Y,ref:se!==void 0?se:null,props:q}}function B(I,Y){return D(I.type,Y,I.props)}function F(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function G(I){var Y={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(q){return Y[q]})}var U=/\/+/g;function $(I,Y){return typeof I=="object"&&I!==null&&I.key!=null?G(""+I.key):Y.toString(36)}function K(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function(Y){I.status==="pending"&&(I.status="fulfilled",I.value=Y)},function(Y){I.status==="pending"&&(I.status="rejected",I.reason=Y)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function W(I,Y,q,se,de){var fe=typeof I;(fe==="undefined"||fe==="boolean")&&(I=null);var te=!1;if(I===null)te=!0;else switch(fe){case"bigint":case"string":case"number":te=!0;break;case"object":switch(I.$$typeof){case e:case t:te=!0;break;case m:return te=I._init,W(te(I._payload),Y,q,se,de)}}if(te)return de=de(I),te=se===""?"."+$(I,0):se,N(de)?(q="",te!=null&&(q=te.replace(U,"$&/")+"/"),W(de,Y,q,"",function(oe){return oe})):de!=null&&(F(de)&&(de=B(de,q+(de.key==null||I&&I.key===de.key?"":(""+de.key).replace(U,"$&/")+"/")+te)),Y.push(de)),1;te=0;var V=se===""?".":se+":";if(N(I))for(var re=0;re>>1,L=W[z];if(0>>1;zi(q,ee))sei(de,q)?(W[z]=de,W[se]=ee,z=se):(W[z]=q,W[Y]=ee,z=Y);else if(sei(de,ee))W[z]=de,W[se]=ee,z=se;else break e}}return Z}function i(W,Z){var ee=W.sortIndex-Z.sortIndex;return ee!==0?ee:W.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,l=c.now();e.unstable_now=function(){return c.now()-l}}var u=[],h=[],m=1,d=null,g=3,y=!1,C=!1,w=!1,b=!1,_=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(W){for(var Z=n(h);Z!==null;){if(Z.callback===null)r(h);else if(Z.startTime<=W)r(h),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=n(h)}}function N(W){if(w=!1,k(W),!C)if(n(u)!==null)C=!0,A||(A=!0,G());else{var Z=n(h);Z!==null&&K(N,Z.startTime-W)}}var A=!1,j=-1,T=5,D=-1;function B(){return b?!0:!(e.unstable_now()-DW&&B());){var z=d.callback;if(typeof z=="function"){d.callback=null,g=d.priorityLevel;var L=z(d.expirationTime<=W);if(W=e.unstable_now(),typeof L=="function"){d.callback=L,k(W),Z=!0;break t}d===n(u)&&r(u),k(W)}else r(u);d=n(u)}if(d!==null)Z=!0;else{var I=n(h);I!==null&&K(N,I.startTime-W),Z=!1}}break e}finally{d=null,g=ee,y=!1}Z=void 0}}finally{Z?G():A=!1}}}var G;if(typeof S=="function")G=function(){S(F)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,$=U.port2;U.port1.onmessage=F,G=function(){$.postMessage(null)}}else G=function(){_(F,0)};function K(W,Z){j=_(function(){W(e.unstable_now())},Z)}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(W){W.callback=null},e.unstable_forceFrameRate=function(W){0>W||125z?(W.sortIndex=ee,t(h,W),n(u)===null&&W===n(h)&&(w?(x(j),j=-1):w=!0,K(N,ee-z))):(W.sortIndex=L,t(u,W),C||y||(C=!0,A||(A=!0,G()))),W},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(W){var Z=g;return function(){var ee=g;g=Z;try{return W.apply(this,arguments)}finally{g=ee}}}})(dm)),dm}var j3;function aA(){return j3||(j3=1,hm.exports=sA()),hm.exports}var fm={exports:{}},Zn={};/** - * @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 D3;function oA(){if(D3)return Zn;D3=1;var e=lu();function t(u){var h="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fm.exports=oA(),fm.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 L3;function lA(){if(L3)return xc;L3=1;var e=aA(),t=lu(),n=Gx();function r(s){var o="https://react.dev/errors/"+s;if(1L||(s.current=z[L],z[L]=null,L--)}function q(s,o){L++,z[L]=s.current,s.current=o}var se=I(null),de=I(null),fe=I(null),te=I(null);function V(s,o){switch(q(fe,o),q(de,s),q(se,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?Wb(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=Wb(o),s=Yb(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Y(se),q(se,s)}function re(){Y(se),Y(de),Y(fe)}function oe(s){s.memoizedState!==null&&q(te,s);var o=se.current,p=Yb(o,s.type);o!==p&&(q(de,s),q(se,p))}function _e(s){de.current===s&&(Y(se),Y(de)),te.current===s&&(Y(te),gc._currentValue=ee)}var ye,ke;function Me(s){if(ye===void 0)try{throw Error()}catch(p){var o=p.stack.trim().match(/\n( *(at )?)/);ye=o&&o[1]||"",ke=-1)":-1E||ae[v]!==ge[E]){var Se=` -`+ae[v].replace(" at new "," at ");return s.displayName&&Se.includes("")&&(Se=Se.replace("",s.displayName)),Se}while(1<=v&&0<=E);break}}}finally{Ue=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Me(p):""}function Le(s,o){switch(s.tag){case 26:case 27:case 5:return Me(s.type);case 16:return Me("Lazy");case 13:return s.child!==o&&o!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return Fe(s.type,!1);case 11:return Fe(s.type.render,!1);case 1:return Fe(s.type,!0);case 31:return Me("Activity");default:return""}}function At(s){try{var o="",p=null;do o+=Le(s,p),p=s,s=s.return;while(s);return o}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}var Dt=Object.prototype.hasOwnProperty,Rt=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,an=e.unstable_shouldYield,wt=e.unstable_requestPaint,Je=e.unstable_now,pt=e.unstable_getCurrentPriorityLevel,be=e.unstable_ImmediatePriority,Ae=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,Ke=e.unstable_LowPriority,rt=e.unstable_IdlePriority,Pt=e.log,ot=e.unstable_setDisableYieldValue,Pe=null,et=null;function _t(s){if(typeof Pt=="function"&&ot(s),et&&typeof et.setStrictMode=="function")try{et.setStrictMode(Pe,s)}catch{}}var ct=Math.clz32?Math.clz32:hn,on=Math.log,$n=Math.LN2;function hn(s){return s>>>=0,s===0?32:31-(on(s)/$n|0)|0}var bn=256,xt=262144,_n=4194304;function zt(s){var o=s&42;if(o!==0)return o;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Pr(s,o,p){var v=s.pendingLanes;if(v===0)return 0;var E=0,M=s.suspendedLanes,P=s.pingedLanes;s=s.warmLanes;var Q=v&134217727;return Q!==0?(v=Q&~M,v!==0?E=zt(v):(P&=Q,P!==0?E=zt(P):p||(p=Q&~s,p!==0&&(E=zt(p))))):(Q=v&~M,Q!==0?E=zt(Q):P!==0?E=zt(P):p||(p=v&~s,p!==0&&(E=zt(p)))),E===0?0:o!==0&&o!==E&&(o&M)===0&&(M=E&-E,p=o&-o,M>=p||M===32&&(p&4194048)!==0)?o:E}function zn(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function fi(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 ws(){var s=_n;return _n<<=1,(_n&62914560)===0&&(_n=4194304),s}function xr(s){for(var o=[],p=0;31>p;p++)o.push(s);return o}function An(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function or(s,o,p,v,E,M){var P=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var Q=s.entanglements,ae=s.expirationTimes,ge=s.hiddenUpdates;for(p=P&~p;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var ut=/[\n"\\]/g;function Bt(s){return s.replace(ut,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Yt(s,o,p,v,E,M,P,Q){s.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.type=P:s.removeAttribute("type"),o!=null?P==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Gn(o)):s.value!==""+Gn(o)&&(s.value=""+Gn(o)):P!=="submit"&&P!=="reset"||s.removeAttribute("value"),o!=null?As(s,P,Gn(o)):p!=null?As(s,P,Gn(p)):v!=null&&s.removeAttribute("value"),E==null&&M!=null&&(s.defaultChecked=!!M),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?s.name=""+Gn(Q):s.removeAttribute("name")}function Kn(s,o,p,v,E,M,P,Q){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.type=M),o!=null||p!=null){if(!(M!=="submit"&&M!=="reset"||o!=null)){Oe(s);return}p=p!=null?""+Gn(p):"",o=o!=null?""+Gn(o):p,Q||o===s.value||(s.value=o),s.defaultValue=o}v=v??E,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=Q?s.checked:!!v,s.defaultChecked=!!v,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(s.name=P),Oe(s)}function As(s,o,p){o==="number"&&Ze(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function bi(s,o,p,v){if(s=s.options,o){o={};for(var E=0;E"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lf=!1;if(qi)try{var Ll={};Object.defineProperty(Ll,"passive",{get:function(){lf=!0}}),window.addEventListener("test",Ll,Ll),window.removeEventListener("test",Ll,Ll)}catch{lf=!1}var Ns=null,cf=null,Nu=null;function Y2(){if(Nu)return Nu;var s,o=cf,p=o.length,v,E="value"in Ns?Ns.value:Ns.textContent,M=E.length;for(s=0;s=zl),ey=" ",ty=!1;function ny(s,o){switch(s){case"keyup":return _k.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ry(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var go=!1;function Sk(s,o){switch(s){case"compositionend":return ry(o);case"keypress":return o.which!==32?null:(ty=!0,ey);case"textInput":return s=o.data,s===ey&&ty?null:s;default:return null}}function wk(s,o){if(go)return s==="compositionend"||!pf&&ny(s,o)?(s=Y2(),Nu=cf=Ns=null,go=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:p,offset:o-s};s=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=hy(p)}}function fy(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?fy(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function py(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Ze(s.document);o instanceof s.HTMLIFrameElement;){try{var p=typeof o.contentWindow.location.href=="string"}catch{p=!1}if(p)s=o.contentWindow;else break;o=Ze(s.document)}return o}function vf(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var jk=qi&&"documentMode"in document&&11>=document.documentMode,vo=null,yf=null,Pl=null,bf=!1;function my(s,o,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;bf||vo==null||vo!==Ze(v)||(v=vo,"selectionStart"in v&&vf(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Pl&&Fl(Pl,v)||(Pl=v,v=xh(yf,"onSelect"),0>=P,E-=P,_i=1<<32-ct(o)+E|p<yt?(Tt=We,We=null):Tt=We.sibling;var Ht=ve(he,We,pe[yt],we);if(Ht===null){We===null&&(We=Tt);break}s&&We&&Ht.alternate===null&&o(he,We),ce=M(Ht,ce,yt),It===null?nt=Ht:It.sibling=Ht,It=Ht,We=Tt}if(yt===pe.length)return p(he,We),Mt&&Vi(he,yt),nt;if(We===null){for(;ytyt?(Tt=We,We=null):Tt=We.sibling;var Ks=ve(he,We,Ht.value,we);if(Ks===null){We===null&&(We=Tt);break}s&&We&&Ks.alternate===null&&o(he,We),ce=M(Ks,ce,yt),It===null?nt=Ks:It.sibling=Ks,It=Ks,We=Tt}if(Ht.done)return p(he,We),Mt&&Vi(he,yt),nt;if(We===null){for(;!Ht.done;yt++,Ht=pe.next())Ht=Ce(he,Ht.value,we),Ht!==null&&(ce=M(Ht,ce,yt),It===null?nt=Ht:It.sibling=Ht,It=Ht);return Mt&&Vi(he,yt),nt}for(We=v(We);!Ht.done;yt++,Ht=pe.next())Ht=xe(We,he,yt,Ht.value,we),Ht!==null&&(s&&Ht.alternate!==null&&We.delete(Ht.key===null?yt:Ht.key),ce=M(Ht,ce,yt),It===null?nt=Ht:It.sibling=Ht,It=Ht);return s&&We.forEach(function(ZE){return o(he,ZE)}),Mt&&Vi(he,yt),nt}function Zt(he,ce,pe,we){if(typeof pe=="object"&&pe!==null&&pe.type===w&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case y:e:{for(var nt=pe.key;ce!==null;){if(ce.key===nt){if(nt=pe.type,nt===w){if(ce.tag===7){p(he,ce.sibling),we=E(ce,pe.props.children),we.return=he,he=we;break e}}else if(ce.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===T&&Ea(nt)===ce.type){p(he,ce.sibling),we=E(ce,pe.props),Wl(we,pe),we.return=he,he=we;break e}p(he,ce);break}else o(he,ce);ce=ce.sibling}pe.type===w?(we=xa(pe.props.children,he.mode,we,pe.key),we.return=he,he=we):(we=Iu(pe.type,pe.key,pe.props,null,he.mode,we),Wl(we,pe),we.return=he,he=we)}return P(he);case C:e:{for(nt=pe.key;ce!==null;){if(ce.key===nt)if(ce.tag===4&&ce.stateNode.containerInfo===pe.containerInfo&&ce.stateNode.implementation===pe.implementation){p(he,ce.sibling),we=E(ce,pe.children||[]),we.return=he,he=we;break e}else{p(he,ce);break}else o(he,ce);ce=ce.sibling}we=Ef(pe,he.mode,we),we.return=he,he=we}return P(he);case T:return pe=Ea(pe),Zt(he,ce,pe,we)}if(K(pe))return Ve(he,ce,pe,we);if(G(pe)){if(nt=G(pe),typeof nt!="function")throw Error(r(150));return pe=nt.call(pe),st(he,ce,pe,we)}if(typeof pe.then=="function")return Zt(he,ce,Gu(pe),we);if(pe.$$typeof===S)return Zt(he,ce,Pu(he,pe),we);Vu(he,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,ce!==null&&ce.tag===6?(p(he,ce.sibling),we=E(ce,pe),we.return=he,he=we):(p(he,ce),we=kf(pe,he.mode,we),we.return=he,he=we),P(he)):p(he,ce)}return function(he,ce,pe,we){try{Vl=0;var nt=Zt(he,ce,pe,we);return No=null,nt}catch(We){if(We===Ao||We===Uu)throw We;var It=Cr(29,We,null,he.mode);return It.lanes=we,It.return=he,It}finally{}}}var Na=Iy(!0),Hy=Iy(!1),Rs=!1;function If(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hf(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ls(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Os(s,o,p){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,($t&2)!==0){var E=v.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),v.pending=o,o=zu(s),Sy(s,null,p),o}return Bu(s,v,o,p),zu(s)}function Yl(s,o,p){if(o=o.updateQueue,o!==null&&(o=o.shared,(p&4194048)!==0)){var v=o.lanes;v&=s.pendingLanes,p|=v,o.lanes=p,me(s,p)}}function Ff(s,o){var p=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var E=null,M=null;if(p=p.firstBaseUpdate,p!==null){do{var P={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};M===null?E=M=P:M=M.next=P,p=p.next}while(p!==null);M===null?E=M=o:M=M.next=o}else E=M=o;p={baseState:v.baseState,firstBaseUpdate:E,lastBaseUpdate:M,shared:v.shared,callbacks:v.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=o:s.next=o,p.lastBaseUpdate=o}var Pf=!1;function Xl(){if(Pf){var s=Eo;if(s!==null)throw s}}function Kl(s,o,p,v){Pf=!1;var E=s.updateQueue;Rs=!1;var M=E.firstBaseUpdate,P=E.lastBaseUpdate,Q=E.shared.pending;if(Q!==null){E.shared.pending=null;var ae=Q,ge=ae.next;ae.next=null,P===null?M=ge:P.next=ge,P=ae;var Se=s.alternate;Se!==null&&(Se=Se.updateQueue,Q=Se.lastBaseUpdate,Q!==P&&(Q===null?Se.firstBaseUpdate=ge:Q.next=ge,Se.lastBaseUpdate=ae))}if(M!==null){var Ce=E.baseState;P=0,Se=ge=ae=null,Q=M;do{var ve=Q.lane&-536870913,xe=ve!==Q.lane;if(xe?(Nt&ve)===ve:(v&ve)===ve){ve!==0&&ve===ko&&(Pf=!0),Se!==null&&(Se=Se.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var Ve=s,st=Q;ve=o;var Zt=p;switch(st.tag){case 1:if(Ve=st.payload,typeof Ve=="function"){Ce=Ve.call(Zt,Ce,ve);break e}Ce=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=st.payload,ve=typeof Ve=="function"?Ve.call(Zt,Ce,ve):Ve,ve==null)break e;Ce=d({},Ce,ve);break e;case 2:Rs=!0}}ve=Q.callback,ve!==null&&(s.flags|=64,xe&&(s.flags|=8192),xe=E.callbacks,xe===null?E.callbacks=[ve]:xe.push(ve))}else xe={lane:ve,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},Se===null?(ge=Se=xe,ae=Ce):Se=Se.next=xe,P|=ve;if(Q=Q.next,Q===null){if(Q=E.shared.pending,Q===null)break;xe=Q,Q=xe.next,xe.next=null,E.lastBaseUpdate=xe,E.shared.pending=null}}while(!0);Se===null&&(ae=Ce),E.baseState=ae,E.firstBaseUpdate=ge,E.lastBaseUpdate=Se,M===null&&(E.shared.lanes=0),Fs|=P,s.lanes=P,s.memoizedState=Ce}}function Fy(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function Py(s,o){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;sM?M:8;var P=W.T,Q={};W.T=Q,ap(s,!1,o,p);try{var ae=E(),ge=W.S;if(ge!==null&&ge(Q,ae),ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var Se=Fk(ae,v);Jl(s,o,Se,Tr(s))}else Jl(s,o,v,Tr(s))}catch(Ce){Jl(s,o,{then:function(){},status:"rejected",reason:Ce},Tr())}finally{Z.p=M,P!==null&&Q.types!==null&&(P.types=Q.types),W.T=P}}function Vk(){}function ip(s,o,p,v){if(s.tag!==5)throw Error(r(476));var E=b4(s).queue;y4(s,E,o,ee,p===null?Vk:function(){return _4(s),p(v)})}function b4(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:ee},next:null};var p={};return o.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:p},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function _4(s){var o=b4(s);o.next===null&&(o=s.alternate.memoizedState),Jl(s,o.next.queue,{},Tr())}function sp(){return Wn(gc)}function x4(){return En().memoizedState}function S4(){return En().memoizedState}function Wk(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var p=Tr();s=Ls(p);var v=Os(o,s,p);v!==null&&(mr(v,o,p),Yl(v,o,p)),o={cache:Lf()},s.payload=o;return}o=o.return}}function Yk(s,o,p){var v=Tr();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},nh(s)?C4(o,p):(p=wf(s,o,p,v),p!==null&&(mr(p,s,v),k4(p,o,v)))}function w4(s,o,p){var v=Tr();Jl(s,o,p,v)}function Jl(s,o,p,v){var E={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(nh(s))C4(o,E);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=o.lastRenderedReducer,M!==null))try{var P=o.lastRenderedState,Q=M(P,p);if(E.hasEagerState=!0,E.eagerState=Q,wr(Q,P))return Bu(s,o,E,0),en===null&&Ou(),!1}catch{}finally{}if(p=wf(s,o,E,v),p!==null)return mr(p,s,v),k4(p,o,v),!0}return!1}function ap(s,o,p,v){if(v={lane:2,revertLane:Ip(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},nh(s)){if(o)throw Error(r(479))}else o=wf(s,p,v,2),o!==null&&mr(o,s,2)}function nh(s){var o=s.alternate;return s===gt||o!==null&&o===gt}function C4(s,o){Mo=Xu=!0;var p=s.pending;p===null?o.next=o:(o.next=p.next,p.next=o),s.pending=o}function k4(s,o,p){if((p&4194048)!==0){var v=o.lanes;v&=s.pendingLanes,p|=v,o.lanes=p,me(s,p)}}var ec={readContext:Wn,use:Qu,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn};ec.useEffectEvent=Sn;var E4={readContext:Wn,use:Qu,useCallback:function(s,o){return tr().memoizedState=[s,o===void 0?null:o],s},useContext:Wn,useEffect:c4,useImperativeHandle:function(s,o,p){p=p!=null?p.concat([s]):null,eh(4194308,4,f4.bind(null,o,s),p)},useLayoutEffect:function(s,o){return eh(4194308,4,s,o)},useInsertionEffect:function(s,o){eh(4,2,s,o)},useMemo:function(s,o){var p=tr();o=o===void 0?null:o;var v=s();if(Ta){_t(!0);try{s()}finally{_t(!1)}}return p.memoizedState=[v,o],v},useReducer:function(s,o,p){var v=tr();if(p!==void 0){var E=p(o);if(Ta){_t(!0);try{p(o)}finally{_t(!1)}}}else E=o;return v.memoizedState=v.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},v.queue=s,s=s.dispatch=Yk.bind(null,gt,s),[v.memoizedState,s]},useRef:function(s){var o=tr();return s={current:s},o.memoizedState=s},useState:function(s){s=Jf(s);var o=s.queue,p=w4.bind(null,gt,o);return o.dispatch=p,[s.memoizedState,p]},useDebugValue:np,useDeferredValue:function(s,o){var p=tr();return rp(p,s,o)},useTransition:function(){var s=Jf(!1);return s=y4.bind(null,gt,s.queue,!0,!1),tr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,p){var v=gt,E=tr();if(Mt){if(p===void 0)throw Error(r(407));p=p()}else{if(p=o(),en===null)throw Error(r(349));(Nt&127)!==0||Wy(v,o,p)}E.memoizedState=p;var M={value:p,getSnapshot:o};return E.queue=M,c4(Xy.bind(null,v,M,s),[s]),v.flags|=2048,Do(9,{destroy:void 0},Yy.bind(null,v,M,p,o),null),p},useId:function(){var s=tr(),o=en.identifierPrefix;if(Mt){var p=xi,v=_i;p=(v&~(1<<32-ct(v)-1)).toString(32)+p,o="_"+o+"R_"+p,p=Ku++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof v.is=="string"?P.createElement("select",{is:v.is}):P.createElement("select"),v.multiple?M.multiple=!0:v.size&&(M.size=v.size);break;default:M=typeof v.is=="string"?P.createElement(E,{is:v.is}):P.createElement(E)}}M[Jt]=o,M[In]=v;e:for(P=o.child;P!==null;){if(P.tag===5||P.tag===6)M.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===o)break e;for(;P.sibling===null;){if(P.return===null||P.return===o)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}o.stateNode=M;e:switch(Xn(M,E,v),E){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Qi(o)}}return cn(o),_p(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,p),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==v&&Qi(o);else{if(typeof v!="string"&&o.stateNode===null)throw Error(r(166));if(s=fe.current,wo(o)){if(s=o.stateNode,p=o.memoizedProps,v=null,E=Vn,E!==null)switch(E.tag){case 27:case 5:v=E.memoizedProps}s[Jt]=o,s=!!(s.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||Gb(s.nodeValue,p)),s||js(o,!0)}else s=Sh(s).createTextNode(v),s[Jt]=o,o.stateNode=s}return cn(o),null;case 31:if(p=o.memoizedState,s===null||s.memoizedState!==null){if(v=wo(o),p!==null){if(s===null){if(!v)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Jt]=o}else Sa(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),s=!1}else p=Mf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return o.flags&256?(Er(o),o):(Er(o),null);if((o.flags&128)!==0)throw Error(r(558))}return cn(o),null;case 13:if(v=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=wo(o),v!==null&&v.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=o.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[Jt]=o}else Sa(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),E=!1}else E=Mf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return o.flags&256?(Er(o),o):(Er(o),null)}return Er(o),(o.flags&128)!==0?(o.lanes=p,o):(p=v!==null,s=s!==null&&s.memoizedState!==null,p&&(v=o.child,E=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(E=v.alternate.memoizedState.cachePool.pool),M=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(M=v.memoizedState.cachePool.pool),M!==E&&(v.flags|=2048)),p!==s&&p&&(o.child.flags|=8192),oh(o,o.updateQueue),cn(o),null);case 4:return re(),s===null&&$p(o.stateNode.containerInfo),cn(o),null;case 10:return Yi(o.type),cn(o),null;case 19:if(Y(kn),v=o.memoizedState,v===null)return cn(o),null;if(E=(o.flags&128)!==0,M=v.rendering,M===null)if(E)nc(v,!1);else{if(wn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(M=Yu(s),M!==null){for(o.flags|=128,nc(v,!1),s=M.updateQueue,o.updateQueue=s,oh(o,s),o.subtreeFlags=0,s=p,p=o.child;p!==null;)wy(p,s),p=p.sibling;return q(kn,kn.current&1|2),Mt&&Vi(o,v.treeForkCount),o.child}s=s.sibling}v.tail!==null&&Je()>dh&&(o.flags|=128,E=!0,nc(v,!1),o.lanes=4194304)}else{if(!E)if(s=Yu(M),s!==null){if(o.flags|=128,E=!0,s=s.updateQueue,o.updateQueue=s,oh(o,s),nc(v,!0),v.tail===null&&v.tailMode==="hidden"&&!M.alternate&&!Mt)return cn(o),null}else 2*Je()-v.renderingStartTime>dh&&p!==536870912&&(o.flags|=128,E=!0,nc(v,!1),o.lanes=4194304);v.isBackwards?(M.sibling=o.child,o.child=M):(s=v.last,s!==null?s.sibling=M:o.child=M,v.last=M)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=Je(),s.sibling=null,p=kn.current,q(kn,E?p&1|2:p&1),Mt&&Vi(o,v.treeForkCount),s):(cn(o),null);case 22:case 23:return Er(o),Uf(),v=o.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(o.flags|=8192):v&&(o.flags|=8192),v?(p&536870912)!==0&&(o.flags&128)===0&&(cn(o),o.subtreeFlags&6&&(o.flags|=8192)):cn(o),p=o.updateQueue,p!==null&&oh(o,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),v=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(v=o.memoizedState.cachePool.pool),v!==p&&(o.flags|=2048),s!==null&&Y(ka),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),Yi(Nn),cn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function Jk(s,o){switch(Nf(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Yi(Nn),re(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return _e(o),null;case 31:if(o.memoizedState!==null){if(Er(o),o.alternate===null)throw Error(r(340));Sa()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Er(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Sa()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return Y(kn),null;case 4:return re(),null;case 10:return Yi(o.type),null;case 22:case 23:return Er(o),Uf(),s!==null&&Y(ka),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return Yi(Nn),null;case 25:return null;default:return null}}function K4(s,o){switch(Nf(o),o.tag){case 3:Yi(Nn),re();break;case 26:case 27:case 5:_e(o);break;case 4:re();break;case 31:o.memoizedState!==null&&Er(o);break;case 13:Er(o);break;case 19:Y(kn);break;case 10:Yi(o.type);break;case 22:case 23:Er(o),Uf(),s!==null&&Y(ka);break;case 24:Yi(Nn)}}function rc(s,o){try{var p=o.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var E=v.next;p=E;do{if((p.tag&s)===s){v=void 0;var M=p.create,P=p.inst;v=M(),P.destroy=v}p=p.next}while(p!==E)}}catch(Q){Wt(o,o.return,Q)}}function Is(s,o,p){try{var v=o.updateQueue,E=v!==null?v.lastEffect:null;if(E!==null){var M=E.next;v=M;do{if((v.tag&s)===s){var P=v.inst,Q=P.destroy;if(Q!==void 0){P.destroy=void 0,E=o;var ae=p,ge=Q;try{ge()}catch(Se){Wt(E,ae,Se)}}}v=v.next}while(v!==M)}}catch(Se){Wt(o,o.return,Se)}}function Z4(s){var o=s.updateQueue;if(o!==null){var p=s.stateNode;try{Py(o,p)}catch(v){Wt(s,s.return,v)}}}function Q4(s,o,p){p.props=Ma(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(v){Wt(s,o,v)}}function ic(s,o){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof p=="function"?s.refCleanup=p(v):p.current=v}}catch(E){Wt(s,o,E)}}function Si(s,o){var p=s.ref,v=s.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(E){Wt(s,o,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(E){Wt(s,o,E)}else p.current=null}function J4(s){var o=s.type,p=s.memoizedProps,v=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":p.autoFocus&&v.focus();break e;case"img":p.src?v.src=p.src:p.srcSet&&(v.srcset=p.srcSet)}}catch(E){Wt(s,s.return,E)}}function xp(s,o,p){try{var v=s.stateNode;xE(v,s.type,p,o),v[In]=o}catch(E){Wt(s,s.return,E)}}function eb(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Gs(s.type)||s.tag===4}function Sp(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||eb(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Gs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function wp(s,o,p){var v=s.tag;if(v===5||v===6)s=s.stateNode,o?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,o):(o=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,o.appendChild(s),p=p._reactRootContainer,p!=null||o.onclick!==null||(o.onclick=Ui));else if(v!==4&&(v===27&&Gs(s.type)&&(p=s.stateNode,o=null),s=s.child,s!==null))for(wp(s,o,p),s=s.sibling;s!==null;)wp(s,o,p),s=s.sibling}function lh(s,o,p){var v=s.tag;if(v===5||v===6)s=s.stateNode,o?p.insertBefore(s,o):p.appendChild(s);else if(v!==4&&(v===27&&Gs(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(lh(s,o,p),s=s.sibling;s!==null;)lh(s,o,p),s=s.sibling}function tb(s){var o=s.stateNode,p=s.memoizedProps;try{for(var v=s.type,E=o.attributes;E.length;)o.removeAttributeNode(E[0]);Xn(o,v,p),o[Jt]=s,o[In]=p}catch(M){Wt(s,s.return,M)}}var Ji=!1,jn=!1,Cp=!1,nb=typeof WeakSet=="function"?WeakSet:Set,Un=null;function eE(s,o){if(s=s.containerInfo,Gp=Th,s=py(s),vf(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var E=v.anchorOffset,M=v.focusNode;v=v.focusOffset;try{p.nodeType,M.nodeType}catch{p=null;break e}var P=0,Q=-1,ae=-1,ge=0,Se=0,Ce=s,ve=null;t:for(;;){for(var xe;Ce!==p||E!==0&&Ce.nodeType!==3||(Q=P+E),Ce!==M||v!==0&&Ce.nodeType!==3||(ae=P+v),Ce.nodeType===3&&(P+=Ce.nodeValue.length),(xe=Ce.firstChild)!==null;)ve=Ce,Ce=xe;for(;;){if(Ce===s)break t;if(ve===p&&++ge===E&&(Q=P),ve===M&&++Se===v&&(ae=P),(xe=Ce.nextSibling)!==null)break;Ce=ve,ve=Ce.parentNode}Ce=xe}p=Q===-1||ae===-1?null:{start:Q,end:ae}}else p=null}p=p||{start:0,end:0}}else p=null;for(Vp={focusedElem:s,selectionRange:p},Th=!1,Un=o;Un!==null;)if(o=Un,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,Un=s;else for(;Un!==null;){switch(o=Un,M=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p title"))),Xn(M,v,p),M[Jt]=s,sn(M),v=M;break e;case"link":var P=l3("link","href",E).get(v+(p.href||""));if(P){for(var Q=0;QZt&&(P=Zt,Zt=st,st=P);var he=dy(Q,st),ce=dy(Q,Zt);if(he&&ce&&(xe.rangeCount!==1||xe.anchorNode!==he.node||xe.anchorOffset!==he.offset||xe.focusNode!==ce.node||xe.focusOffset!==ce.offset)){var pe=Ce.createRange();pe.setStart(he.node,he.offset),xe.removeAllRanges(),st>Zt?(xe.addRange(pe),xe.extend(ce.node,ce.offset)):(pe.setEnd(ce.node,ce.offset),xe.addRange(pe))}}}}for(Ce=[],xe=Q;xe=xe.parentNode;)xe.nodeType===1&&Ce.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Qp?32:p,W.T=null,p=jp,jp=null;var M=$s,P=is;if(Hn=0,zo=$s=null,is=0,($t&6)!==0)throw Error(r(331));var Q=$t;if($t|=4,fb(M.current),ub(M,M.current,P,p),$t=Q,uc(0,!1),et&&typeof et.onPostCommitFiberRoot=="function")try{et.onPostCommitFiberRoot(Pe,M)}catch{}return!0}finally{Z.p=E,W.T=v,jb(s,o)}}function Rb(s,o,p){o=Ur(p,o),o=up(s.stateNode,o,2),s=Os(s,o,2),s!==null&&(An(s,2),wi(s))}function Wt(s,o,p){if(s.tag===3)Rb(s,s,p);else for(;o!==null;){if(o.tag===3){Rb(o,s,p);break}else if(o.tag===1){var v=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ps===null||!Ps.has(v))){s=Ur(p,s),p=L4(2),v=Os(o,p,2),v!==null&&(O4(p,v,o,s),An(v,2),wi(v));break}}o=o.return}}function Op(s,o,p){var v=s.pingCache;if(v===null){v=s.pingCache=new rE;var E=new Set;v.set(o,E)}else E=v.get(o),E===void 0&&(E=new Set,v.set(o,E));E.has(p)||(Ap=!0,E.add(p),s=lE.bind(null,s,o,p),o.then(s,s))}function lE(s,o,p){var v=s.pingCache;v!==null&&v.delete(o),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,en===s&&(Nt&p)===p&&(wn===4||wn===3&&(Nt&62914560)===Nt&&300>Je()-hh?($t&2)===0&&Io(s,0):Np|=p,Bo===Nt&&(Bo=0)),wi(s)}function Lb(s,o){o===0&&(o=ws()),s=_a(s,o),s!==null&&(An(s,o),wi(s))}function cE(s){var o=s.memoizedState,p=0;o!==null&&(p=o.retryLane),Lb(s,p)}function uE(s,o){var p=0;switch(s.tag){case 31:case 13:var v=s.stateNode,E=s.memoizedState;E!==null&&(p=E.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(o),Lb(s,p)}function hE(s,o){return Rt(s,o)}var yh=null,Fo=null,Bp=!1,bh=!1,zp=!1,qs=0;function wi(s){s!==Fo&&s.next===null&&(Fo===null?yh=Fo=s:Fo=Fo.next=s),bh=!0,Bp||(Bp=!0,fE())}function uc(s,o){if(!zp&&bh){zp=!0;do for(var p=!1,v=yh;v!==null;){if(s!==0){var E=v.pendingLanes;if(E===0)var M=0;else{var P=v.suspendedLanes,Q=v.pingedLanes;M=(1<<31-ct(42|s)+1)-1,M&=E&~(P&~Q),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(p=!0,Ib(v,M))}else M=Nt,M=Pr(v,v===en?M:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(M&3)===0||zn(v,M)||(p=!0,Ib(v,M));v=v.next}while(p);zp=!1}}function dE(){Ob()}function Ob(){bh=Bp=!1;var s=0;qs!==0&&wE()&&(s=qs);for(var o=Je(),p=null,v=yh;v!==null;){var E=v.next,M=Bb(v,o);M===0?(v.next=null,p===null?yh=E:p.next=E,E===null&&(Fo=p)):(p=v,(s!==0||(M&3)!==0)&&(bh=!0)),v=E}Hn!==0&&Hn!==5||uc(s),qs!==0&&(qs=0)}function Bb(s,o){for(var p=s.suspendedLanes,v=s.pingedLanes,E=s.expirationTimes,M=s.pendingLanes&-62914561;0Q)break;var Se=ae.transferSize,Ce=ae.initiatorType;Se&&Vb(Ce)&&(ae=ae.responseEnd,P+=Se*(ae"u"?null:document;function i3(s,o,p){var v=Po;if(v&&typeof o=="string"&&o){var E=Bt(o);E='link[rel="'+s+'"][href="'+E+'"]',typeof p=="string"&&(E+='[crossorigin="'+p+'"]'),r3.has(E)||(r3.add(E),s={rel:s,crossOrigin:p,href:o},v.querySelector(E)===null&&(o=v.createElement("link"),Xn(o,"link",s),sn(o),v.head.appendChild(o)))}}function DE(s){ss.D(s),i3("dns-prefetch",s,null)}function RE(s,o){ss.C(s,o),i3("preconnect",s,o)}function LE(s,o,p){ss.L(s,o,p);var v=Po;if(v&&s&&o){var E='link[rel="preload"][as="'+Bt(o)+'"]';o==="image"&&p&&p.imageSrcSet?(E+='[imagesrcset="'+Bt(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(E+='[imagesizes="'+Bt(p.imageSizes)+'"]')):E+='[href="'+Bt(s)+'"]';var M=E;switch(o){case"style":M=$o(s);break;case"script":M=Uo(s)}Xr.has(M)||(s=d({rel:"preload",href:o==="image"&&p&&p.imageSrcSet?void 0:s,as:o},p),Xr.set(M,s),v.querySelector(E)!==null||o==="style"&&v.querySelector(pc(M))||o==="script"&&v.querySelector(mc(M))||(o=v.createElement("link"),Xn(o,"link",s),sn(o),v.head.appendChild(o)))}}function OE(s,o){ss.m(s,o);var p=Po;if(p&&s){var v=o&&typeof o.as=="string"?o.as:"script",E='link[rel="modulepreload"][as="'+Bt(v)+'"][href="'+Bt(s)+'"]',M=E;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=Uo(s)}if(!Xr.has(M)&&(s=d({rel:"modulepreload",href:s},o),Xr.set(M,s),p.querySelector(E)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(mc(M)))return}v=p.createElement("link"),Xn(v,"link",s),sn(v),p.head.appendChild(v)}}}function BE(s,o,p){ss.S(s,o,p);var v=Po;if(v&&s){var E=yi(v).hoistableStyles,M=$o(s);o=o||"default";var P=E.get(M);if(!P){var Q={loading:0,preload:null};if(P=v.querySelector(pc(M)))Q.loading=5;else{s=d({rel:"stylesheet",href:s,"data-precedence":o},p),(p=Xr.get(M))&&Jp(s,p);var ae=P=v.createElement("link");sn(ae),Xn(ae,"link",s),ae._p=new Promise(function(ge,Se){ae.onload=ge,ae.onerror=Se}),ae.addEventListener("load",function(){Q.loading|=1}),ae.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,Ch(P,o,v)}P={type:"stylesheet",instance:P,count:1,state:Q},E.set(M,P)}}}function zE(s,o){ss.X(s,o);var p=Po;if(p&&s){var v=yi(p).hoistableScripts,E=Uo(s),M=v.get(E);M||(M=p.querySelector(mc(E)),M||(s=d({src:s,async:!0},o),(o=Xr.get(E))&&em(s,o),M=p.createElement("script"),sn(M),Xn(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},v.set(E,M))}}function IE(s,o){ss.M(s,o);var p=Po;if(p&&s){var v=yi(p).hoistableScripts,E=Uo(s),M=v.get(E);M||(M=p.querySelector(mc(E)),M||(s=d({src:s,async:!0,type:"module"},o),(o=Xr.get(E))&&em(s,o),M=p.createElement("script"),sn(M),Xn(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},v.set(E,M))}}function s3(s,o,p,v){var E=(E=fe.current)?wh(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(o=$o(p.href),p=yi(E).hoistableStyles,v=p.get(o),v||(v={type:"style",instance:null,count:0,state:null},p.set(o,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=$o(p.href);var M=yi(E).hoistableStyles,P=M.get(s);if(P||(E=E.ownerDocument||E,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(s,P),(M=E.querySelector(pc(s)))&&!M._p&&(P.instance=M,P.state.loading=5),Xr.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},Xr.set(s,p),M||HE(E,s,p,P.state))),o&&v===null)throw Error(r(528,""));return P}if(o&&v!==null)throw Error(r(529,""));return null;case"script":return o=p.async,p=p.src,typeof p=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Uo(p),p=yi(E).hoistableScripts,v=p.get(o),v||(v={type:"script",instance:null,count:0,state:null},p.set(o,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function $o(s){return'href="'+Bt(s)+'"'}function pc(s){return'link[rel="stylesheet"]['+s+"]"}function a3(s){return d({},s,{"data-precedence":s.precedence,precedence:null})}function HE(s,o,p,v){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?v.loading=1:(o=s.createElement("link"),v.preload=o,o.addEventListener("load",function(){return v.loading|=1}),o.addEventListener("error",function(){return v.loading|=2}),Xn(o,"link",p),sn(o),s.head.appendChild(o))}function Uo(s){return'[src="'+Bt(s)+'"]'}function mc(s){return"script[async]"+s}function o3(s,o,p){if(o.count++,o.instance===null)switch(o.type){case"style":var v=s.querySelector('style[data-href~="'+Bt(p.href)+'"]');if(v)return o.instance=v,sn(v),v;var E=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),sn(v),Xn(v,"style",E),Ch(v,p.precedence,s),o.instance=v;case"stylesheet":E=$o(p.href);var M=s.querySelector(pc(E));if(M)return o.state.loading|=4,o.instance=M,sn(M),M;v=a3(p),(E=Xr.get(E))&&Jp(v,E),M=(s.ownerDocument||s).createElement("link"),sn(M);var P=M;return P._p=new Promise(function(Q,ae){P.onload=Q,P.onerror=ae}),Xn(M,"link",v),o.state.loading|=4,Ch(M,p.precedence,s),o.instance=M;case"script":return M=Uo(p.src),(E=s.querySelector(mc(M)))?(o.instance=E,sn(E),E):(v=p,(E=Xr.get(M))&&(v=d({},p),em(v,E)),s=s.ownerDocument||s,E=s.createElement("script"),sn(E),Xn(E,"link",v),s.head.appendChild(E),o.instance=E);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(v=o.instance,o.state.loading|=4,Ch(v,p.precedence,s));return o.instance}function Ch(s,o,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=v.length?v[v.length-1]:null,M=E,P=0;P title"):null)}function FE(s,o,p){if(p===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function u3(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function PE(s,o,p,v){if(p.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var E=$o(v.href),M=o.querySelector(pc(E));if(M){o=M._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=Eh.bind(s),o.then(s,s)),p.state.loading|=4,p.instance=M,sn(M);return}M=o.ownerDocument||o,v=a3(v),(E=Xr.get(E))&&Jp(v,E),M=M.createElement("link"),sn(M);var P=M;P._p=new Promise(function(Q,ae){P.onload=Q,P.onerror=ae}),Xn(M,"link",v),p.instance=M}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,o),(o=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Eh.bind(s),o.addEventListener("load",p),o.addEventListener("error",p))}}var tm=0;function $E(s,o){return s.stylesheets&&s.count===0&&Nh(s,s.stylesheets),0tm?50:800)+o);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(E)}}:null}function Eh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Ah=null;function Nh(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Ah=new Map,o.forEach(UE,s),Ah=null,Eh.call(s))}function UE(s,o){if(!(o.state.loading&4)){var p=Ah.get(s);if(p)var v=p.get(null);else{p=new Map,Ah.set(s,p);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),um.exports=lA(),um.exports}var uA=cA();/** - * @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 Vx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).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 hA=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 dA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.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 B3=e=>{const t=dA(e);return t.charAt(0).toUpperCase()+t.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 pm={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 fA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},pA=O.createContext({}),mA=()=>O.useContext(pA),gA=O.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:c,...l},u)=>{const{size:h=24,strokeWidth:m=2,absoluteStrokeWidth:d=!1,color:g="currentColor",className:y=""}=mA()??{},C=r??d?Number(n??m)*24/Number(t??h):n??m;return O.createElement("svg",{ref:u,...pm,width:t??h??pm.width,height:t??h??pm.height,stroke:e??g,strokeWidth:C,className:Vx("lucide",y,i),...!a&&!fA(l)&&{"aria-hidden":"true"},...l},[...c.map(([w,b])=>O.createElement(w,b)),...Array.isArray(a)?a:[a]])});/** - * @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 Qe=(e,t)=>{const n=O.forwardRef(({className:r,...i},a)=>O.createElement(gA,{ref:a,iconNode:t,className:Vx(`lucide-${hA(B3(e))}`,`lucide-${e}`,r),...i}));return n.displayName=B3(e),n};/** - * @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 vA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],S1=Qe("arrow-left",vA);/** - * @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 yA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],mm=Qe("arrow-right",yA);/** - * @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 bA=[["circle",{cx:"9",cy:"9",r:"7",key:"p2h5vp"}],["circle",{cx:"15",cy:"15",r:"7",key:"19ennj"}]],_A=Qe("blend",bA);/** - * @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 xA=[["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"}]],SA=Qe("blocks",xA);/** - * @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 wA=[["path",{d:"M21 8a2 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.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],CA=Qe("box",wA);/** - * @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 kA=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],EA=Qe("boxes",kA);/** - * @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 AA=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],NA=Qe("chart-line",AA);/** - * @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 TA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Qr=Qe("check",TA);/** - * @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 MA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ti=Qe("chevron-down",MA);/** - * @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 jA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xl=Qe("chevron-right",jA);/** - * @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 DA=[["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"}]],RA=Qe("circle-question-mark",DA);/** - * @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 LA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],OA=Qe("circle-stop",LA);/** - * @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 BA=[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]],z3=Qe("clapperboard",BA);/** - * @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 zA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Wx=Qe("code",zA);/** - * @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 IA=[["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"}]],Ug=Qe("copy",IA);/** - * @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 HA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Yx=Qe("corner-down-left",HA);/** - * @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 FA=[["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"}]],PA=Qe("cpu",FA);/** - * @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 $A=[["path",{d:"M10 11h.01",key:"d2at3l"}],["path",{d:"M14 6h.01",key:"k028ub"}],["path",{d:"M18 6h.01",key:"1v4wsw"}],["path",{d:"M6.5 13.1h.01",key:"1748ia"}],["path",{d:"M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3",key:"172yzv"}],["path",{d:"M17.4 9.9c-.8.8-2 .8-2.8 0",key:"1obv0w"}],["path",{d:"M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7",key:"rqjl8i"}],["path",{d:"M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4",key:"1mr6wy"}]],UA=Qe("drama",$A);/** - * @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 qA=[["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"}]],Xx=Qe("ellipsis",qA);/** - * @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 GA=[["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"}]],cu=Qe("external-link",GA);/** - * @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 VA=[["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"}]],Kx=Qe("file-code",VA);/** - * @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 WA=[["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"}]],Zx=Qe("file-text",WA);/** - * @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 YA=[["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"}]],XA=Qe("file",YA);/** - * @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 KA=[["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"}]],ZA=Qe("flask-conical",KA);/** - * @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 QA=[["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"}]],qg=Qe("folder-git-2",QA);/** - * @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 JA=[["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"}]],Gg=Qe("folder-open",JA);/** - * @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 eN=[["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"}]],Qx=Qe("folder-tree",eN);/** - * @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 tN=[["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"}]],nN=Qe("folder",tN);/** - * @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 rN=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],Jx=Qe("gamepad-2",rN);/** - * @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 iN=[["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"}]],Sl=Qe("git-branch",iN);/** - * @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 sN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],aN=Qe("hard-drive",sN);/** - * @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 oN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lN=Qe("info",oN);/** - * @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 cN=[["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"}]],uN=Qe("laptop",cN);/** - * @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 hN=[["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"}]],dN=Qe("lightbulb",hN);/** - * @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 fN=[["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"}]],I3=Qe("lock",fN);/** - * @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 pN=[["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"}]],mN=Qe("maximize-2",pN);/** - * @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 gN=[["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"}]],vN=Qe("minimize-2",gN);/** - * @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 yN=[["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"}]],bN=Qe("mouse-pointer-click",yN);/** - * @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 _N=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],xN=Qe("notebook-pen",_N);/** - * @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 SN=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],wN=Qe("palette",SN);/** - * @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 CN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],e7=Qe("panel-left",CN);/** - * @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 kN=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],t7=Qe("play",kN);/** - * @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 EN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Vg=Qe("plus",EN);/** - * @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 AN=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],NN=Qe("radio-tower",AN);/** - * @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 TN=[["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"}]],Mi=Qe("refresh-cw",TN);/** - * @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 MN=[["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"}]],uu=Qe("rotate-cw",MN);/** - * @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 jN=[["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"}]],n7=Qe("scroll-text",jN);/** - * @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 DN=[["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"}]],w1=Qe("server",DN);/** - * @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 RN=[["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"}]],LN=Qe("settings-2",RN);/** - * @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 ON=[["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"}]],BN=Qe("settings",ON);/** - * @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 zN=[["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"}]],IN=Qe("sliders-horizontal",zN);/** - * @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 HN=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],FN=Qe("sparkles",HN);/** - * @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 PN=[["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"}]],$N=Qe("square-terminal",PN);/** - * @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 UN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],r7=Qe("terminal",UN);/** - * @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=[["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"}]],Wg=Qe("trash-2",qN);/** - * @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 GN=[["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"}]],i7=Qe("users",GN);/** - * @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 VN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ll=Qe("x",VN);async function to(e){if(!e.ok){const t=await e.text().catch(()=>"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const vt=e=>fetch(e).then(t=>to(t)),Ot=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>to(n)),sd=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>to(n)),WN=()=>vt("/api/projects").then(e=>e.projects),YN=e=>vt(`/api/local-repo?path=${encodeURIComponent(e)}`),XN=e=>Ot("/api/projects",e).then(t=>t.project),KN=e=>vt(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),ZN=()=>vt("/api/github/account"),QN=(e,t)=>vt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`),JN=e=>vt(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),C1=(e,t)=>sd(`/api/projects/${e}`,t).then(n=>n.project),eT=e=>vt(`/api/projects/${e}/branches`),tT=()=>vt("/api/github/repos").then(e=>e.repos),s7=()=>vt("/api/personas").then(e=>e.personas),H3=e=>vt(`/api/projects/${e}/proposals`).then(t=>t.proposals),nT=(e,t)=>Ot(`/api/agent/proposals/${e}/approve`,t).then(n=>n.session),rT=e=>Ot(`/api/agent/proposals/${e}/dismiss`,{}),iT=e=>Ot(`/api/projects/${e}/open`).then(t=>t.project),sT=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),aT=e=>vt(`/api/projects/${e}/experiments`).then(t=>t.experiments),oT=e=>vt(`/api/projects/${e}/runs`).then(t=>t.runs),lT=()=>vt("/api/instances").then(e=>e.instances),cT=()=>Ot("/api/instances/reconcile").then(e=>e.reattached),a7=e=>Ot(`/api/runs/${e}/cancel`),uT=(e,t,n)=>Ot(`/api/runs/${e}/verdict`,{verdict:t,notes:n}).then(r=>r.run),hT=(e,t,n)=>Ot(`/api/experiments/${e}/verdict`,{verdict:t,notes:n}).then(r=>r.experiment),dT=e=>vt(`/api/runs/${e}/artifacts`).then(t=>t.artifacts),gm=(e,t)=>`/api/runs/${e}/artifacts/file?path=${encodeURIComponent(t)}`,fT=e=>Ot(`/api/experiments/${e}/play-build`),pT=e=>`/play/${e.id}/${e.playEntry??""}`,mT=(e,t)=>sd(`/api/experiments/${e}`,{playEntry:t}).then(n=>n.experiment),gT=e=>Ot(`/api/experiments/${e}/play-session/beat`).then(t=>t.run),o7=(e,t,n)=>Ot(`/api/experiments/${e}/play-session/end`,{verdict:t??null,notes:n}).then(r=>r.run),vT=(e,t)=>vt(`/api/runs/${e}/log?offset=${t}`),yT=e=>vt(`/api/runs/${e}/diff`),bT=e=>vt(`/api/experiments/${e}/commits`).then(t=>t.commits),_T=(e,t)=>vt(`/api/experiments/${e}/commits/${t}/diff`),F3=e=>vt(`/api/projects/${e}/working-tree`),l7=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),xT=(e,t,n={})=>vt(`/api/projects/${e}/file?${l7(n,new URLSearchParams({path:t}))}`),c7=(e,t={})=>{const n=l7(t).toString();return vt(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},ST=e=>vt(`/api/chat/sessions/${e}/worktree`),Yg=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,wT=()=>vt("/api/settings/hf"),CT=e=>Ot("/api/settings/hf",{token:e}),kT=()=>vt("/api/settings/k8s"),ET=e=>Ot("/api/settings/k8s",e),AT=()=>vt("/api/settings/modal"),NT=()=>Ot("/api/settings/modal/provision"),TT=()=>Ot("/api/settings/scenario/connect"),MT=()=>Ot("/api/settings/scenario/disconnect"),jT=()=>Ot("/api/settings/comfyui/start"),DT=(e=!1)=>vt(`/api/settings/genai${e?"?refresh=1":""}`).then(t=>t.providers),RT=()=>vt("/api/settings/env").then(e=>e.vars),u7=(e,t)=>Ot("/api/settings/env",{key:e,value:t}).then(n=>n.vars),LT=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>to(t)).then(t=>t.vars),OT=()=>vt("/api/settings/data-dir"),BT=e=>Ot("/api/settings/data-dir/validate",{path:e}),zT=e=>Ot("/api/settings/data-dir/move",{path:e}),IT=()=>vt("/api/settings/ssh").then(e=>e.hosts),HT=e=>Ot("/api/settings/ssh/preflight",{host:e}),FT=()=>vt("/api/settings/slurm"),PT=e=>Ot("/api/settings/slurm",e),$T=e=>Ot("/api/settings/slurm/preflight",{host:e}),UT=()=>vt("/api/settings/ray"),qT=e=>Ot("/api/settings/ray",e),GT=e=>Ot("/api/settings/ray/preflight",{address:e??null}),VT=()=>vt("/api/settings/compute"),h7=e=>Ot("/api/settings/compute/default",e),WT=()=>vt("/api/settings/local"),YT=()=>vt("/api/settings/openresearch"),P3=e=>vt(`/api/projects/${e}/files`),d7=(e,t)=>vt(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),XT=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>to(n)),no=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,KT=(e,t)=>fetch(no(e,t)).then(n=>{if(n.status===404)return null;if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.text()}),f7=()=>vt("/api/settings/git"),ZT=e=>Ot("/api/settings/git",e),QT=e=>Ot("/api/settings/git/token",{token:e}),JT=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>to(e)),eM=()=>vt("/api/settings/telemetry"),tM=e=>Ot("/api/settings/telemetry",{enabled:e}),nM=e=>Ot("/api/settings/telemetry/consent",{enabled:e}),j0=e=>e.displayName??Kg(e.id),D0="default";function Xg(e,t){var c,l,u;const n=e==null?void 0:e.models.find(h=>h.id===t),r=(n==null?void 0:n.reasoningLevels)??((c=e==null?void 0:e.options)==null?void 0:c.reasoningLevels)??[],i=n==null?void 0:n.defaultReasoningLevel,a=i&&r.some(h=>h.id===i)?i:r.some(h=>h.id===D0)?D0:((l=e==null?void 0:e.options)==null?void 0:l.defaultReasoningLevel)??((u=r[0])==null?void 0:u.id)??null;return{choices:r,defaultId:a}}function p7(e,t,n){if(!e)return n;const{choices:r,defaultId:i}=Xg(e,t);return r.length===0?D0:n&&r.some(a=>a.id===n)?n:i}const cl=(e=!1,t=!1)=>{const n=new URLSearchParams;e&&n.set("refresh","1"),t&&n.set("retry","1");const r=n.size>0?`?${n.toString()}`:"";return vt(`/api/harnesses${r}`).then(i=>i.harnesses)},rM=()=>vt("/api/skills").then(e=>e.skills);function Kg(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const i of t.split("-"))/^\d+(\.\d+)?$/.test(i)?r.push(i):(r.length&&n.push(r.splice(0).join(".")),n.push(i==="gpt"?"GPT":i.charAt(0).toUpperCase()+i.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const m0=e=>vt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),iM=(e,t,n={})=>Ot("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),sM=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>to(t)),aM=(e,t)=>sd(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),oM=(e,t)=>sd(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),g0=e=>vt(`/api/chat/sessions/${e}/messages`).then(t=>t.messages),lM=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,cM=(e,t,n={},r)=>Ot(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),uM=e=>Ot(`/api/chat/sessions/${e}/interrupt`),hM=(e,t)=>Ot(`/api/chat/sessions/${e}/respond`,t);function gs(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function R0(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function $a(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function ad(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function m7(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:ad(e)==="ray_job"?"":typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}const U3={producer:{id:"producer",label:"Producer",Icon:z3,color:"var(--persona-producer)",cls:"persona-producer",role:"Orchestrates the funnel; suggests the next agent for you to approve."},"idea-foundry":{id:"idea-foundry",label:"Idea foundry",Icon:dN,color:"var(--persona-idea-foundry)",cls:"persona-idea-foundry",role:"Interviews a vague seed into a thesis with a real hook."},analyst:{id:"analyst",label:"Analyst",Icon:NA,color:"var(--persona-analyst)",cls:"persona-analyst",role:"Scores an idea against the 35-signal market-fit rubric."},"game-designer":{id:"game-designer",label:"Game designer",Icon:Jx,color:"var(--persona-game-designer)",cls:"persona-game-designer",role:"Builds the playable prototype — loop first, then polish."},blender:{id:"blender",label:"Blender artist",Icon:CA,color:"var(--persona-blender)",cls:"persona-blender",role:"Models 3D assets in your open Blender and exports them for the build."},comfyui:{id:"comfyui",label:"ComfyUI artist",Icon:_A,color:"var(--persona-comfyui)",cls:"persona-comfyui",role:"Generates 2D art on your local ComfyUI and checks the result."},"game-artist":{id:"game-artist",label:"Game artist",Icon:z3,color:"var(--persona-game-artist)",cls:"persona-game-artist",role:"Animates characters — walk, idle, attack — by whichever local route fits."},research:{id:"research",label:"Research",Icon:ZA,color:"var(--persona-research)",cls:"persona-research",role:"The general base agent. Fallback for non-game work."}};function Wa(e){return U3[e??"research"]??U3.research}const dM=["producer","idea-foundry","analyst","game-designer","blender","comfyui","game-artist","research"],g7="producer";function v7({persona:e,showLabel:t=!0,compact:n=!1,size:r=14}){const i=Wa(e),a=i.Icon;return f.jsxs("span",{className:`persona-badge ${i.cls}${n?" compact":""}`,title:`${i.label} persona`,children:[f.jsx(a,{size:r,style:{color:i.color}}),t&&!n&&f.jsx("span",{className:"persona-badge-label",children:i.label})]})}function fM({value:e,onChange:t,locked:n=!1}){const[r,i]=O.useState(!1),a=O.useRef(null);if(O.useEffect(()=>{if(!r)return;const h=d=>{a.current&&!a.current.contains(d.target)&&i(!1)},m=d=>d.key==="Escape"&&i(!1);return document.addEventListener("mousedown",h),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",m)}},[r]),n)return f.jsx(v7,{persona:e});const c=Wa(e),l=c.Icon,u=e??"research";return f.jsxs("div",{className:"persona-picker",ref:a,children:[f.jsxs("button",{className:`persona-badge ${c.cls} persona-badge-btn`,onClick:()=>i(h=>!h),title:"Change persona","aria-haspopup":"listbox","aria-expanded":r,children:[f.jsx(l,{size:14,style:{color:c.color}}),f.jsx("span",{className:"persona-badge-label",children:c.label}),f.jsx(Ti,{size:13,className:"persona-badge-chev"})]}),r&&f.jsxs("div",{className:"persona-menu",role:"listbox",children:[f.jsx("div",{className:"persona-menu-h",children:"Start this session as"}),dM.map(h=>{const m=Wa(h),d=m.Icon,g=h===u;return f.jsxs("button",{className:`persona-opt ${m.cls} ${g?"sel":""}`,role:"option","aria-selected":g,onClick:()=>{t(h),i(!1)},children:[f.jsx("span",{className:"persona-opt-ic",children:f.jsx(d,{size:15,style:{color:m.color}})}),f.jsxs("span",{className:"persona-opt-t",children:[f.jsxs("span",{className:"persona-opt-n",style:{color:m.color},children:[m.label,h===g7&&f.jsx("span",{className:"persona-opt-def",children:"default"})]}),f.jsx("span",{className:"persona-opt-d",children:m.role})]}),g&&f.jsx("span",{className:"persona-opt-check",children:"✓"})]},h)}),f.jsx("div",{className:"persona-menu-foot",children:"You rarely need this — the Producer routes you to the others as you go."})]})]})}function y7(e){return e<=10?"crit":e<=25?"warn":"ok"}function vm(e){const t=y7(e);return t==="crit"?"var(--accent-red)":t==="warn"?"var(--accent-amber)":"var(--accent-green)"}function pM(e){const t=e-Date.now();return t>0&&t<18*36e5}function b7(e){if(!e)return"";const t=e-Date.now();if(t<=0)return"now";const n=Math.floor(t/6e4);if(n<60)return`${n}m`;const r=Math.floor(n/60);if(r<18)return`${r}h ${n%60}m`;const i=new Date(e);return`${i.toLocaleDateString(void 0,{weekday:"short"})} ${i.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`}function mM(e){return e?`resets ${pM(e)?"in ":""}${b7(e)}`:""}function gM(e){if(!e)return"";const t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function vM({pct:e,color:t,size:n=18}){const r=n/2-1.3,i=2*Math.PI*r;return f.jsxs("svg",{className:"usage-ring",width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":"true",children:[f.jsx("circle",{cx:n/2,cy:n/2,r,fill:"none",stroke:"var(--border-variant)",strokeWidth:"2.6"}),f.jsx("circle",{cx:n/2,cy:n/2,r,fill:"none",stroke:t,strokeWidth:"2.6",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:i*(1-Math.max(0,Math.min(100,e))/100),transform:`rotate(-90 ${n/2} ${n/2})`})]})}function yM({harness:e}){const[t,n]=O.useState(!1),[r,i]=O.useState(!1),[a,c]=O.useState(e),l=O.useRef(null);O.useEffect(()=>c(e),[e]),O.useEffect(()=>{if(!t)return;const C=b=>{l.current&&!l.current.contains(b.target)&&n(!1)},w=b=>b.key==="Escape"&&n(!1);return document.addEventListener("mousedown",C),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",w)}},[t]);async function u(){if(a){i(!0);try{const w=(await cl(!0)).find(b=>b.id===a.id);w&&c(w)}catch{}finally{i(!1)}}}const h=()=>{n(C=>!C),!t&&!(a!=null&&a.usage)&&u()};if(!a)return null;const m=a.usage,d=(m==null?void 0:m.windows)??[],g=d.length?d.reduce((C,w)=>w.remainingPercent0?d.map((C,w)=>f.jsxs("div",{className:"usage-wrow",children:[f.jsxs("div",{className:"usage-wt",children:[f.jsx("div",{className:"usage-wlabel",children:C.label}),C.resetsAtMs&&f.jsx("div",{className:"usage-wsub",children:mM(C.resetsAtMs)}),f.jsx("div",{className:"usage-bar",children:f.jsx("i",{style:{width:`${C.remainingPercent}%`,background:vm(C.remainingPercent)}})})]}),f.jsxs("div",{className:"usage-pct",style:{color:vm(C.remainingPercent)},children:[Math.round(C.remainingPercent),"%"]})]},w)):f.jsx("div",{className:"usage-empty",children:(m==null?void 0:m.note)??(r?"Checking usage…":"No usage limits reported.")}),f.jsxs("div",{className:"usage-pop-foot",children:[f.jsxs("button",{className:"usage-refresh",onClick:u,disabled:r,children:[f.jsx(Mi,{size:12,className:r?"spin":""})," ",r?"Refreshing…":"Refresh"]}),(m==null?void 0:m.manageUrl)&&f.jsx("a",{href:m.manageUrl,target:"_blank",rel:"noreferrer",children:"Manage ↗"})]})]})]})}const bM="M0 -9 L2.4 -2.4 L9 0 L2.4 2.4 L0 9 L-2.4 2.4 L-9 0 L-2.4 -2.4 Z",_M=[[52,23,.82],[49,79,1.06],[25,49,.72],[77,55,.78]];function Rc(){return f.jsxs("span",{className:"wordmark",children:[f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"24",fill:"var(--primary)"}),f.jsxs("g",{stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",opacity:"0.4",children:[f.jsx("line",{x1:"52",y1:"23",x2:"49",y2:"79"}),f.jsx("line",{x1:"25",y1:"49",x2:"77",y2:"55"})]}),f.jsx("g",{fill:"#fff",children:_M.map(([e,t,n],r)=>f.jsx("path",{transform:`translate(${e} ${t}) scale(${n})`,d:bM},r))})]}),"Crux"]})}const v0=new Map;function xM(e,t){let n=v0.get(e);return n||(n=new Set,v0.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&v0.delete(e)}}function SM(e){var t;(t=v0.get(e.runId))==null||t.forEach(n=>n(e))}const E1=new Set;function $c(e){return E1.add(e),()=>{E1.delete(e)}}function Go(e){E1.forEach(t=>t(e))}const A1=new Set;function Zg(e){return A1.add(e),()=>{A1.delete(e)}}function q3(e){A1.forEach(t=>t(e))}const N1=new Set;function wM(e){return N1.add(e),()=>{N1.delete(e)}}function ym(e){N1.forEach(t=>t(e))}const T1=new Set;function CM(e){return T1.add(e),()=>{T1.delete(e)}}function kM(e){T1.forEach(t=>t(e))}const M1=new Set;function EM(e){return M1.add(e),()=>{M1.delete(e)}}function G3(e){M1.forEach(t=>t(e))}function AM(e){const t=O.useRef(e);t.current=e,O.useEffect(()=>{const n=new EventSource("/api/events");let r=!1;n.onerror=()=>{r=!0},n.onopen=()=>{r&&(Go({type:"reconnected"}),q3({harness:"*",authState:"unknown"})),r=!0};const i=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const c=i(a);c!=null&&c.run&&t.current.onRun(c.run)}),n.addEventListener("experiment.updated",a=>{const c=i(a);c!=null&&c.experiment&&t.current.onExperiment(c.experiment)}),n.addEventListener("project.updated",a=>{const c=i(a);c!=null&&c.project&&t.current.onProject(c.project)}),n.addEventListener("files.updated",a=>{var l,u;const c=i(a);c!=null&&c.projectId&&((u=(l=t.current).onFiles)==null||u.call(l,c.projectId))}),n.addEventListener("run.log",a=>{const c=i(a);c!=null&&c.runId&&SM(c)}),n.addEventListener("chat.session",a=>{const c=i(a);c!=null&&c.session&&Go({type:"session",session:c.session})}),n.addEventListener("chat.session.deleted",a=>{const c=i(a);c!=null&&c.sessionId&&Go({type:"sessionDeleted",sessionId:c.sessionId})}),n.addEventListener("chat.message",a=>{const c=i(a);c!=null&&c.message&&Go({type:"message",sessionId:c.sessionId,message:c.message})}),n.addEventListener("chat.busy",a=>{const c=i(a);c!=null&&c.sessionId&&Go({type:"busy",sessionId:c.sessionId,busy:c.busy})}),n.addEventListener("chat.usage",a=>{const c=i(a);c!=null&&c.sessionId&&c.usage&&Go({type:"usage",sessionId:c.sessionId,usage:c.usage})}),n.addEventListener("harness.auth",a=>{const c=i(a);c!=null&&c.harness&&c.authState&&q3(c)}),n.addEventListener("datadir.move.progress",a=>{const c=i(a);c&&ym({type:"progress",...c})}),n.addEventListener("datadir.move.done",a=>{const c=i(a);c&&ym({type:"done",path:c.path,oldPathLeft:c.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const c=i(a);c&&ym({type:"error",error:c.error})}),n.addEventListener("scenario.connect.done",a=>{const c=i(a);c&&G3({type:"done",scopes:c.scopes??[]})}),n.addEventListener("scenario.connect.error",a=>{const c=i(a);c!=null&&c.error&&G3({type:"error",error:c.error})}),n.addEventListener("project.clone.progress",a=>{const c=i(a);c!=null&&c.phase&&kM(c)}),()=>n.close()},[])}function V3(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const c=n.slice(i,r).trim();(c||!a)&&t.push(c),i=r+1,r=n.indexOf(",",i)}return t}function NM(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jM={};function W3(e,t){return(jM.jsx?MM:TM).test(e)}const DM=/[ \t\n\f\r]/g;function RM(e){return typeof e=="object"?e.type==="text"?Y3(e.value):!1:Y3(e)}function Y3(e){return e.replace(DM,"")===""}class hu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}hu.prototype.normal={};hu.prototype.property={};hu.prototype.space=void 0;function _7(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new hu(n,r,t)}function Uc(e){return e.toLowerCase()}class _r{constructor(t,n){this.attribute=n,this.property=t}}_r.prototype.attribute="";_r.prototype.booleanish=!1;_r.prototype.boolean=!1;_r.prototype.commaOrSpaceSeparated=!1;_r.prototype.commaSeparated=!1;_r.prototype.defined=!1;_r.prototype.mustUseProperty=!1;_r.prototype.number=!1;_r.prototype.overloadedBoolean=!1;_r.prototype.property="";_r.prototype.spaceSeparated=!1;_r.prototype.space=void 0;let LM=0;const ht=ro(),Dn=ro(),j1=ro(),je=ro(),tn=ro(),qa=ro(),Mr=ro();function ro(){return 2**++LM}const D1=Object.freeze(Object.defineProperty({__proto__:null,boolean:ht,booleanish:Dn,commaOrSpaceSeparated:Mr,commaSeparated:qa,number:je,overloadedBoolean:j1,spaceSeparated:tn},Symbol.toStringTag,{value:"Module"})),bm=Object.keys(D1);class Qg extends _r{constructor(t,n,r,i){let a=-1;if(super(t,n),X3(this,"space",i),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&HM.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(K3,PM);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!K3.test(a)){let c=a.replace(IM,FM);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}i=Qg}return new i(r,t)}function FM(e){return"-"+e.toLowerCase()}function PM(e){return e.charAt(1).toUpperCase()}const N7=_7([x7,OM,C7,k7,E7],"html"),od=_7([x7,BM,C7,k7,E7],"svg");function Z3(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $M(e){return e.join(" ").trim()}var Vo={},_m,Q3;function UM(){if(Q3)return _m;Q3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,h="/",m="*",d="",g="comment",y="declaration";function C(b,_){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];_=_||{};var x=1,S=1;function k($){var K=$.match(t);K&&(x+=K.length);var W=$.lastIndexOf(u);S=~W?$.length-W:S+$.length}function N(){var $={line:x,column:S};return function(K){return K.position=new A($),D(),K}}function A($){this.start=$,this.end={line:x,column:S},this.source=_.source}A.prototype.content=b;function j($){var K=new Error(_.source+":"+x+":"+S+": "+$);if(K.reason=$,K.filename=_.source,K.line=x,K.column=S,K.source=b,!_.silent)throw K}function T($){var K=$.exec(b);if(K){var W=K[0];return k(W),b=b.slice(W.length),K}}function D(){T(n)}function B($){var K;for($=$||[];K=F();)K!==!1&&$.push(K);return $}function F(){var $=N();if(!(h!=b.charAt(0)||m!=b.charAt(1))){for(var K=2;d!=b.charAt(K)&&(m!=b.charAt(K)||h!=b.charAt(K+1));)++K;if(K+=2,d===b.charAt(K-1))return j("End of comment missing");var W=b.slice(2,K-2);return S+=2,k(W),b=b.slice(K),S+=2,$({type:g,comment:W})}}function G(){var $=N(),K=T(r);if(K){if(F(),!T(i))return j("property missing ':'");var W=T(a),Z=$({type:y,property:w(K[0].replace(e,d)),value:W?w(W[0].replace(e,d)):d});return T(c),Z}}function U(){var $=[];B($);for(var K;K=G();)K!==!1&&($.push(K),B($));return $}return D(),U()}function w(b){return b?b.replace(l,d):d}return _m=C,_m}var J3;function qM(){if(J3)return Vo;J3=1;var e=Vo&&Vo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.default=n;const t=e(UM());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const c=(0,t.default)(r),l=typeof i=="function";return c.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:m}=u;l?i(h,m,u):m&&(a=a||{},a[h]=m)}),a}return Vo}var Sc={},e5;function GM(){if(e5)return Sc;e5=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},c=function(h,m){return m.toUpperCase()},l=function(h,m){return"".concat(m,"-")},u=function(h,m){return m===void 0&&(m={}),a(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(i,l):h=h.replace(r,l),h.replace(t,c))};return Sc.camelCase=u,Sc}var wc,t5;function VM(){if(t5)return wc;t5=1;var e=wc&&wc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(qM()),n=GM();function r(i,a){var c={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(c[(0,n.camelCase)(l,a)]=u)}),c}return r.default=r,wc=r,wc}var WM=VM();const YM=id(WM),T7=M7("end"),Jg=M7("start");function M7(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function XM(e){const t=Jg(e),n=T7(e);if(t&&n)return{start:t,end:n}}function Lc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?n5(e.position):"start"in e||"end"in e?n5(e):"line"in e||"column"in e?R1(e):""}function R1(e){return r5(e&&e.line)+":"+r5(e&&e.column)}function n5(e){return R1(e&&e.start)+"-"+R1(e&&e.end)}function r5(e){return e&&typeof e=="number"?e:1}class er extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},c=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(c=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Lc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=c&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}er.prototype.file="";er.prototype.name="";er.prototype.reason="";er.prototype.message="";er.prototype.stack="";er.prototype.column=void 0;er.prototype.line=void 0;er.prototype.ancestors=void 0;er.prototype.cause=void 0;er.prototype.fatal=void 0;er.prototype.place=void 0;er.prototype.ruleId=void 0;er.prototype.source=void 0;const ev={}.hasOwnProperty,KM=new Map,ZM=/[A-Z]/g,QM=new Set(["table","tbody","thead","tfoot","tr"]),JM=new Set(["td","th"]),j7="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ej(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=lj(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=oj(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?od:N7,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=D7(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function D7(e,t,n){if(t.type==="element")return tj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nj(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ij(e,t,n);if(t.type==="mdxjsEsm")return rj(e,t);if(t.type==="root")return sj(e,t,n);if(t.type==="text")return aj(e,t)}function tj(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=od,e.schema=i),e.ancestors.push(t);const a=L7(e,t.tagName,!1),c=cj(e,t);let l=nv(e,t);return QM.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!RM(u):!0})),R7(e,c,a,t),tv(c,l),e.ancestors.pop(),e.schema=r,e.create(t,a,c,n)}function nj(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}qc(e,t.position)}function rj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qc(e,t.position)}function ij(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=od,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:L7(e,t.name,!0),c=uj(e,t),l=nv(e,t);return R7(e,c,a,t),tv(c,l),e.ancestors.pop(),e.schema=r,e.create(t,a,c,n)}function sj(e,t,n){const r={};return tv(r,nv(e,t)),e.create(t,e.Fragment,r,n)}function aj(e,t){return t.value}function R7(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function oj(e,t,n){return r;function r(i,a,c,l){const h=Array.isArray(c.children)?n:t;return l?h(a,c,l):h(a,c)}}function lj(e,t){return n;function n(r,i,a,c){const l=Array.isArray(a.children),u=Jg(r);return t(i,a,c,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function cj(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ev.call(t.properties,i)){const a=hj(e,i,t.properties[i]);if(a){const[c,l]=a;e.tableCellAlignToStyle&&c==="align"&&typeof l=="string"&&JM.has(t.tagName)?r=l:n[c]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function uj(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const c=a.expression;c.type;const l=c.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else qc(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else qc(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function nv(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:KM;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)c=Array.from(r),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);a0?(Rr(e,e.length,0,t),e):t}const a5={}.hasOwnProperty;function B7(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function li(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ir=da(/[A-Za-z]/),Qn=da(/[\dA-Za-z]/),_j=da(/[#-'*+\--9=?A-Z^-~]/);function L0(e){return e!==null&&(e<32||e===127)}const L1=da(/\d/),xj=da(/[\dA-Fa-f]/),Sj=da(/[!-/:-@[-`{-~]/);function Ye(e){return e!==null&&e<-2}function nn(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const ld=da(new RegExp("\\p{P}|\\p{S}","u")),Ya=da(/\s/);function da(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Cl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(c=String.fromCharCode(a,l),i=1):c="�"}else c=String.fromCharCode(a);c&&(t.push(e.slice(r,n),encodeURIComponent(c)),r=n+i+1,c=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function St(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return c;function c(u){return Et(u)?(e.enter(n),l(u)):t(u)}function l(u){return Et(u)&&a++c))return;const j=t.events.length;let T=j,D,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){B=t.events[T][1].end;break}D=!0}for(_(r),A=j;AS;){const N=n[k];t.containerState=N[1],N[0].exit.call(t,e)}n.length=S}function x(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Aj(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ul(e){if(e===null||nn(e)||Ya(e))return 1;if(ld(e))return 2}function cd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},g={...e[n][1].start};l5(d,-u),l5(g,u),c={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...c.start},end:{...l.end}},e[r][1].end={...c.start},e[n][1].start={...l.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Kr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Kr(h,[["enter",i,t],["enter",c,t],["exit",c,t],["enter",a,t]]),h=Kr(h,cd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Kr(h,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=Kr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Rr(e,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n0&&Et(A)?St(e,x,"linePrefix",a+1)(A):x(A)}function x(A){return A===null||Ye(A)?e.check(c5,w,k)(A):(e.enter("codeFlowValue"),S(A))}function S(A){return A===null||Ye(A)?(e.exit("codeFlowValue"),x(A)):(e.consume(A),S)}function k(A){return e.exit("codeFenced"),t(A)}function N(A,j,T){let D=0;return B;function B(K){return A.enter("lineEnding"),A.consume(K),A.exit("lineEnding"),F}function F(K){return A.enter("codeFencedFence"),Et(K)?St(A,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):G(K)}function G(K){return K===l?(A.enter("codeFencedFenceSequence"),U(K)):T(K)}function U(K){return K===l?(D++,A.consume(K),U):D>=c?(A.exit("codeFencedFenceSequence"),Et(K)?St(A,$,"whitespace")(K):$(K)):T(K)}function $(K){return K===null||Ye(K)?(A.exit("codeFencedFence"),j(K)):T(K)}}}function Hj(e,t,n){const r=this;return i;function i(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a)}function a(c){return r.parser.lazy[r.now().line]?n(c):t(c)}}const Sm={name:"codeIndented",tokenize:Pj},Fj={partial:!0,tokenize:$j};function Pj(e,t,n){const r=this;return i;function i(h){return e.enter("codeIndented"),St(e,a,"linePrefix",5)(h)}function a(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?u(h):Ye(h)?e.attempt(Fj,c,u)(h):(e.enter("codeFlowValue"),l(h))}function l(h){return h===null||Ye(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),l)}function u(h){return e.exit("codeIndented"),t(h)}}function $j(e,t,n){const r=this;return i;function i(c){return r.parser.lazy[r.now().line]?n(c):Ye(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i):St(e,a,"linePrefix",5)(c)}function a(c){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(c):Ye(c)?i(c):n(c)}}const Uj={name:"codeText",previous:Gj,resolve:qj,tokenize:Vj};function qj(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Cc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Cc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Cc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(c):e.interrupt(r.parser.constructs.flow,n,t)(c)}}function $7(e,t,n,r,i,a,c,l,u){const h=u||Number.POSITIVE_INFINITY;let m=0;return d;function d(_){return _===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(_),e.exit(a),g):_===null||_===32||_===41||L0(_)?n(_):(e.enter(r),e.enter(c),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(_))}function g(_){return _===62?(e.enter(a),e.consume(_),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===62?(e.exit("chunkString"),e.exit(l),g(_)):_===null||_===60||Ye(_)?n(_):(e.consume(_),_===92?C:y)}function C(_){return _===60||_===62||_===92?(e.consume(_),y):y(_)}function w(_){return!m&&(_===null||_===41||nn(_))?(e.exit("chunkString"),e.exit(l),e.exit(c),e.exit(r),t(_)):m999||y===null||y===91||y===93&&!u||y===94&&!l&&"_hiddenFootnoteSupport"in c.parser.constructs?n(y):y===93?(e.exit(a),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):Ye(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===null||y===91||y===93||Ye(y)||l++>999?(e.exit("chunkString"),m(y)):(e.consume(y),u||(u=!Et(y)),y===92?g:d)}function g(y){return y===91||y===92||y===93?(e.consume(y),l++,d):d(y)}}function q7(e,t,n,r,i,a){let c;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),c=g===40?41:g,u):n(g)}function u(g){return g===c?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),h(g))}function h(g){return g===c?(e.exit(a),u(c)):g===null?n(g):Ye(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),St(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===c||g===null||Ye(g)?(e.exit("chunkString"),h(g)):(e.consume(g),g===92?d:m)}function d(g){return g===c||g===92?(e.consume(g),m):m(g)}}function Oc(e,t){let n;return r;function r(i){return Ye(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Et(i)?St(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const eD={name:"definition",tokenize:nD},tD={partial:!0,tokenize:rD};function nD(e,t,n){const r=this;let i;return a;function a(y){return e.enter("definition"),c(y)}function c(y){return U7.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=li(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),u):n(y)}function u(y){return nn(y)?Oc(e,h)(y):h(y)}function h(y){return $7(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(tD,d,d)(y)}function d(y){return Et(y)?St(e,g,"whitespace")(y):g(y)}function g(y){return y===null||Ye(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function rD(e,t,n){return r;function r(l){return nn(l)?Oc(e,i)(l):n(l)}function i(l){return q7(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Et(l)?St(e,c,"whitespace")(l):c(l)}function c(l){return l===null||Ye(l)?t(l):n(l)}}const iD={name:"hardBreakEscape",tokenize:sD};function sD(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ye(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const aD={name:"headingAtx",resolve:oD,tokenize:lD};function oD(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Rr(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function lD(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&r++<6?(e.consume(m),c):m===null||nn(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||Ye(m)?(e.exit("atxHeading"),t(m)):Et(m)?St(e,l,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),l(m))}function h(m){return m===null||m===35||nn(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),h)}}const cD=["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"],h5=["pre","script","style","textarea"],uD={concrete:!0,name:"htmlFlow",resolveTo:fD,tokenize:pD},hD={partial:!0,tokenize:gD},dD={partial:!0,tokenize:mD};function fD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function pD(e,t,n){const r=this;let i,a,c,l,u;return h;function h(q){return m(q)}function m(q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(q),d}function d(q){return q===33?(e.consume(q),g):q===47?(e.consume(q),a=!0,w):q===63?(e.consume(q),i=3,r.interrupt?t:L):ir(q)?(e.consume(q),c=String.fromCharCode(q),b):n(q)}function g(q){return q===45?(e.consume(q),i=2,y):q===91?(e.consume(q),i=5,l=0,C):ir(q)?(e.consume(q),i=4,r.interrupt?t:L):n(q)}function y(q){return q===45?(e.consume(q),r.interrupt?t:L):n(q)}function C(q){const se="CDATA[";return q===se.charCodeAt(l++)?(e.consume(q),l===se.length?r.interrupt?t:G:C):n(q)}function w(q){return ir(q)?(e.consume(q),c=String.fromCharCode(q),b):n(q)}function b(q){if(q===null||q===47||q===62||nn(q)){const se=q===47,de=c.toLowerCase();return!se&&!a&&h5.includes(de)?(i=1,r.interrupt?t(q):G(q)):cD.includes(c.toLowerCase())?(i=6,se?(e.consume(q),_):r.interrupt?t(q):G(q)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(q):a?x(q):S(q))}return q===45||Qn(q)?(e.consume(q),c+=String.fromCharCode(q),b):n(q)}function _(q){return q===62?(e.consume(q),r.interrupt?t:G):n(q)}function x(q){return Et(q)?(e.consume(q),x):B(q)}function S(q){return q===47?(e.consume(q),B):q===58||q===95||ir(q)?(e.consume(q),k):Et(q)?(e.consume(q),S):B(q)}function k(q){return q===45||q===46||q===58||q===95||Qn(q)?(e.consume(q),k):N(q)}function N(q){return q===61?(e.consume(q),A):Et(q)?(e.consume(q),N):S(q)}function A(q){return q===null||q===60||q===61||q===62||q===96?n(q):q===34||q===39?(e.consume(q),u=q,j):Et(q)?(e.consume(q),A):T(q)}function j(q){return q===u?(e.consume(q),u=null,D):q===null||Ye(q)?n(q):(e.consume(q),j)}function T(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||nn(q)?N(q):(e.consume(q),T)}function D(q){return q===47||q===62||Et(q)?S(q):n(q)}function B(q){return q===62?(e.consume(q),F):n(q)}function F(q){return q===null||Ye(q)?G(q):Et(q)?(e.consume(q),F):n(q)}function G(q){return q===45&&i===2?(e.consume(q),W):q===60&&i===1?(e.consume(q),Z):q===62&&i===4?(e.consume(q),I):q===63&&i===3?(e.consume(q),L):q===93&&i===5?(e.consume(q),z):Ye(q)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hD,Y,U)(q)):q===null||Ye(q)?(e.exit("htmlFlowData"),U(q)):(e.consume(q),G)}function U(q){return e.check(dD,$,Y)(q)}function $(q){return e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),K}function K(q){return q===null||Ye(q)?U(q):(e.enter("htmlFlowData"),G(q))}function W(q){return q===45?(e.consume(q),L):G(q)}function Z(q){return q===47?(e.consume(q),c="",ee):G(q)}function ee(q){if(q===62){const se=c.toLowerCase();return h5.includes(se)?(e.consume(q),I):G(q)}return ir(q)&&c.length<8?(e.consume(q),c+=String.fromCharCode(q),ee):G(q)}function z(q){return q===93?(e.consume(q),L):G(q)}function L(q){return q===62?(e.consume(q),I):q===45&&i===2?(e.consume(q),L):G(q)}function I(q){return q===null||Ye(q)?(e.exit("htmlFlowData"),Y(q)):(e.consume(q),I)}function Y(q){return e.exit("htmlFlow"),t(q)}}function mD(e,t,n){const r=this;return i;function i(c){return Ye(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):n(c)}function a(c){return r.parser.lazy[r.now().line]?n(c):t(c)}}function gD(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(du,t,n)}}const vD={name:"htmlText",tokenize:yD};function yD(e,t,n){const r=this;let i,a,c;return l;function l(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),u}function u(L){return L===33?(e.consume(L),h):L===47?(e.consume(L),N):L===63?(e.consume(L),S):ir(L)?(e.consume(L),T):n(L)}function h(L){return L===45?(e.consume(L),m):L===91?(e.consume(L),a=0,C):ir(L)?(e.consume(L),x):n(L)}function m(L){return L===45?(e.consume(L),y):n(L)}function d(L){return L===null?n(L):L===45?(e.consume(L),g):Ye(L)?(c=d,Z(L)):(e.consume(L),d)}function g(L){return L===45?(e.consume(L),y):d(L)}function y(L){return L===62?W(L):L===45?g(L):d(L)}function C(L){const I="CDATA[";return L===I.charCodeAt(a++)?(e.consume(L),a===I.length?w:C):n(L)}function w(L){return L===null?n(L):L===93?(e.consume(L),b):Ye(L)?(c=w,Z(L)):(e.consume(L),w)}function b(L){return L===93?(e.consume(L),_):w(L)}function _(L){return L===62?W(L):L===93?(e.consume(L),_):w(L)}function x(L){return L===null||L===62?W(L):Ye(L)?(c=x,Z(L)):(e.consume(L),x)}function S(L){return L===null?n(L):L===63?(e.consume(L),k):Ye(L)?(c=S,Z(L)):(e.consume(L),S)}function k(L){return L===62?W(L):S(L)}function N(L){return ir(L)?(e.consume(L),A):n(L)}function A(L){return L===45||Qn(L)?(e.consume(L),A):j(L)}function j(L){return Ye(L)?(c=j,Z(L)):Et(L)?(e.consume(L),j):W(L)}function T(L){return L===45||Qn(L)?(e.consume(L),T):L===47||L===62||nn(L)?D(L):n(L)}function D(L){return L===47?(e.consume(L),W):L===58||L===95||ir(L)?(e.consume(L),B):Ye(L)?(c=D,Z(L)):Et(L)?(e.consume(L),D):W(L)}function B(L){return L===45||L===46||L===58||L===95||Qn(L)?(e.consume(L),B):F(L)}function F(L){return L===61?(e.consume(L),G):Ye(L)?(c=F,Z(L)):Et(L)?(e.consume(L),F):D(L)}function G(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,U):Ye(L)?(c=G,Z(L)):Et(L)?(e.consume(L),G):(e.consume(L),$)}function U(L){return L===i?(e.consume(L),i=void 0,K):L===null?n(L):Ye(L)?(c=U,Z(L)):(e.consume(L),U)}function $(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||nn(L)?D(L):(e.consume(L),$)}function K(L){return L===47||L===62||nn(L)?D(L):n(L)}function W(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function Z(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ee}function ee(L){return Et(L)?St(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):z(L)}function z(L){return e.enter("htmlTextData"),c(L)}}const iv={name:"labelEnd",resolveAll:SD,resolveTo:wD,tokenize:CD},bD={tokenize:kD},_D={tokenize:ED},xD={tokenize:AD};function SD(e){let t=-1;const n=[];for(;++t=3&&(h===null||Ye(h))?(e.exit("thematicBreak"),t(h)):n(h)}function u(h){return h===i?(e.consume(h),r++,u):(e.exit("thematicBreakSequence"),Et(h)?St(e,l,"whitespace")(h):l(h))}}const gr={continuation:{tokenize:zD},exit:HD,name:"list",tokenize:BD},LD={partial:!0,tokenize:FD},OD={partial:!0,tokenize:ID};function BD(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,c=0;return l;function l(y){const C=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:L1(y)){if(r.containerState.type||(r.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(y0,n,h)(y):h(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(y)}return n(y)}function u(y){return L1(y)&&++c<10?(e.consume(y),u):(!r.interrupt||c<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):n(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(du,r.interrupt?n:m,e.attempt(LD,g,d))}function m(y){return r.containerState.initialBlankLine=!0,a++,g(y)}function d(y){return Et(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),g):n(y)}function g(y){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function zD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(du,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,St(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Et(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(OD,t,c)(l))}function c(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,St(e,e.attempt(gr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function ID(e,t,n){const r=this;return St(e,i,"listItemIndent",r.containerState.size+1);function i(a){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?t(a):n(a)}}function HD(e){e.exit(this.containerState.type)}function FD(e,t,n){const r=this;return St(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const c=r.events[r.events.length-1];return!Et(a)&&c&&c[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const d5={name:"setextUnderline",resolveTo:PD,tokenize:$D};function PD(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const c={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",c,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=c,e.push(["exit",c,t]),e}function $D(e,t,n){const r=this;let i;return a;function a(h){let m=r.events.length,d;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){d=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),l(h)}function l(h){return h===i?(e.consume(h),l):(e.exit("setextHeadingLineSequence"),Et(h)?St(e,u,"lineSuffix")(h):u(h))}function u(h){return h===null||Ye(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const UD={tokenize:qD};function qD(e){const t=this,n=e.attempt(du,r,e.attempt(this.parser.constructs.flowInitial,i,St(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Xj,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const GD={resolveAll:V7()},VD=G7("string"),WD=G7("text");function G7(e){return{resolveAll:V7(e==="text"?YD:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,c,l);return c;function c(m){return h(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return h(m)?(n.exit("data"),a(m)):(n.consume(m),u)}function h(m){if(m===null)return!0;const d=i[m];let g=-1;if(d)for(;++g-1){const l=c[0];typeof l=="string"?c[0]=l.slice(r):c.shift()}a>0&&c.push(e[i].slice(0,a))}return c}function oR(e,t){let n=-1;const r=[];let i;for(;++n0){const Pt=He.tokenStack[He.tokenStack.length-1];(Pt[1]||p5).call(He,void 0,Pt[0])}for(Ae.position={start:Zs(be.length>0?be[0][1].start:{line:1,column:1,offset:0}),end:Zs(be.length>0?be[be.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function xR(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SR(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wR(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Cl(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let c,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),c=e.footnoteOrder.length):c=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,u);const h={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,h),e.applyData(t,h)}function CR(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function X7(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const c=i[i.length-1];return c&&c.type==="text"?c.value+=r:i.push({type:"text",value:r}),i}function ER(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return X7(e,t);const i={src:Cl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function AR(e,t){const n={src:Cl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function NR(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function TR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return X7(e,t);const i={href:Cl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function MR(e,t){const n={href:Cl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function jR(e,t,n){const r=e.all(t),i=n?DR(n):K7(t),a={},c=[];if(typeof t.checked=="boolean"){const m=r[0];let d;m&&m.type==="element"&&m.tagName==="p"?d=m:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function RR(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Jg(t.children[1]),u=T7(t.children[t.children.length-1]);l&&u&&(c.position={start:l,end:u}),i.push(c)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function IR(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,l=c?c.length:t.children.length;let u=-1;const h=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(v5(t.slice(i),i>0,!1)),a.join("")}function v5(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===m5||a===g5;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===m5||a===g5;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function PR(e,t){const n={type:"text",value:FR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $R(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const UR={blockquote:yR,break:bR,code:_R,delete:xR,emphasis:SR,footnoteReference:wR,heading:CR,html:kR,imageReference:ER,image:AR,inlineCode:NR,linkReference:TR,link:MR,listItem:jR,list:RR,paragraph:LR,root:OR,strong:BR,table:zR,tableCell:HR,tableRow:IR,text:PR,thematicBreak:$R,toml:zh,yaml:zh,definition:zh,footnoteDefinition:zh};function zh(){}const Z7=-1,ud=0,Bc=1,O0=2,sv=3,av=4,ov=5,lv=6,Q7=7,J7=8,qR=typeof self=="object"?self:globalThis,y5=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new qR[e](t)},GR=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,c]=t[i];switch(a){case ud:case Z7:return n(c,i);case Bc:{const l=n([],i);for(const u of c)l.push(r(u));return l}case O0:{const l=n({},i);for(const[u,h]of c)l[r(u)]=r(h);return l}case sv:return n(new Date(c),i);case av:{const{source:l,flags:u}=c;return n(new RegExp(l,u),i)}case ov:{const l=n(new Map,i);for(const[u,h]of c)l.set(r(u),r(h));return l}case lv:{const l=n(new Set,i);for(const u of c)l.add(r(u));return l}case Q7:{const{name:l,message:u}=c;return n(y5(l,u),i)}case J7:return n(BigInt(c),i);case"BigInt":return n(Object(BigInt(c)),i);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:l}=new Uint8Array(c);return n(new DataView(l),c)}}return n(y5(a,c),i)};return r},b5=e=>GR(new Map,e)(0),Ia="",{toString:VR}={},{keys:WR}=Object,kc=e=>{const t=typeof e;if(t!=="object"||!e)return[ud,t];const n=VR.call(e).slice(8,-1);switch(n){case"Array":return[Bc,Ia];case"Object":return[O0,Ia];case"Date":return[sv,Ia];case"RegExp":return[av,Ia];case"Map":return[ov,Ia];case"Set":return[lv,Ia];case"DataView":return[Bc,n]}return n.includes("Array")?[Bc,n]:n.includes("Error")?[Q7,n]:[O0,n]},Ih=([e,t])=>e===ud&&(t==="function"||t==="symbol"),YR=(e,t,n,r)=>{const i=(c,l)=>{const u=r.push(c)-1;return n.set(l,u),u},a=c=>{if(n.has(c))return n.get(c);let[l,u]=kc(c);switch(l){case ud:{let m=c;switch(u){case"bigint":l=J7,m=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([Z7],c)}return i([l,m],c)}case Bc:{if(u){let g=c;return u==="DataView"?g=new Uint8Array(c.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(c)),i([u,[...g]],c)}const m=[],d=i([l,m],c);for(const g of c)m.push(a(g));return d}case O0:{if(u)switch(u){case"BigInt":return i([u,c.toString()],c);case"Boolean":case"Number":case"String":return i([u,c.valueOf()],c)}if(t&&"toJSON"in c)return a(c.toJSON());const m=[],d=i([l,m],c);for(const g of WR(c))(e||!Ih(kc(c[g])))&&m.push([a(g),a(c[g])]);return d}case sv:return i([l,isNaN(c.getTime())?Ia:c.toISOString()],c);case av:{const{source:m,flags:d}=c;return i([l,{source:m,flags:d}],c)}case ov:{const m=[],d=i([l,m],c);for(const[g,y]of c)(e||!(Ih(kc(g))||Ih(kc(y))))&&m.push([a(g),a(y)]);return d}case lv:{const m=[],d=i([l,m],c);for(const g of c)(e||!Ih(kc(g)))&&m.push(a(g));return d}}const{message:h}=c;return i([l,{name:u,message:h}],c)};return a},_5=(e,{json:t,lossy:n}={})=>{const r=[];return YR(!(t||n),!!t,new Map,r)(e),r},B0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?b5(_5(e,t)):structuredClone(e):(e,t)=>b5(_5(e,t));function XR(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function KR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ZR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||XR,r=e.options.footnoteBackLabel||KR,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&C.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,y);typeof x=="string"&&(x={type:"text",value:x}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,y),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=m[m.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...C)}else m.push(...C);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(h,_),l.push(_)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...B0(c),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const fu=(function(e){if(e==null)return tL;if(typeof e=="function")return hd(e);if(typeof e=="object")return Array.isArray(e)?QR(e):JR(e);if(typeof e=="string")return eL(e);throw new Error("Expected function, string, or object as test")});function QR(e){const t=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let y=eS,C,w,b;if((!t||a(u,h,m[m.length-1]||void 0))&&(y=iL(n(u,m)),y[0]===B1))return y;if("children"in u&&u.children){const _=u;if(_.children&&y[0]!==tS)for(w=(r?_.children.length:-1)+c,b=m.concat(_);w>-1&&w<_.children.length;){const x=_.children[w];if(C=l(x,w,b)(),C[0]===B1)return C;w=typeof C[1]=="number"?C[1]:w+c}}return y}}}function iL(e){return Array.isArray(e)?e:typeof e=="number"?[rL,e]:e==null?eS:[e]}function uv(e,t,n,r){let i,a,c;typeof t=="function"&&typeof n!="function"?(a=void 0,c=t,i=n):(a=t,c=n,i=r),cv(e,a,l,i);function l(u,h){const m=h[h.length-1],d=m?m.children.indexOf(u):void 0;return c(u,d,m)}}const z1={}.hasOwnProperty,sL={};function aL(e,t){const n=t||sL,r=new Map,i=new Map,a=new Map,c={...UR,...n.handlers},l={all:h,applyData:lL,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:c,one:u,options:n,patch:oL,wrap:uL};return uv(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const d=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();d.has(g)||d.set(g,m)}}),l;function u(m,d){const g=m.type,y=l.handlers[g];if(z1.call(l.handlers,g)&&y)return y(l,m,d);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:w,...b}=m,_=B0(b);return _.children=l.all(m),_}return B0(m)}return(l.options.unknownHandler||cL)(l,m,d)}function h(m){const d=[];if("children"in m){const g=m.children;let y=-1;for(;++y0&&n.push({type:"text",value:` -`}),n}function x5(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function S5(e,t){const n=aL(e,t),r=n.one(e,void 0),i=ZR(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` -`},i),a}function hL(e,t){return e&&"run"in e?async function(n,r){const i=S5(n,{file:r,...t});await e.run(i,r)}:function(n,r){return S5(n,{file:r,...e||t})}}function w5(e){if(e)throw e}var Cm,C5;function dL(){if(C5)return Cm;C5=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),d=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!d)return!1;var g;for(g in h);return typeof g>"u"||e.call(h,g)},c=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},l=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return Cm=function u(){var h,m,d,g,y,C,w=arguments[0],b=1,_=arguments.length,x=!1;for(typeof w=="boolean"&&(x=w,w=arguments[1]||{},b=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});b<_;++b)if(h=arguments[b],h!=null)for(m in h)d=l(w,m),g=l(h,m),w!==g&&(x&&g&&(a(g)||(y=i(g)))?(y?(y=!1,C=d&&i(d)?d:[]):C=d&&a(d)?d:{},c(w,{name:m,newValue:u(x,C,g)})):typeof g<"u"&&c(w,{name:m,newValue:g}));return w},Cm}var fL=dL();const km=id(fL);function I1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pL(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const c=i.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);l(null,...i);function l(u,...h){const m=e[++a];let d=-1;if(u){c(u);return}for(;++dc.length;let u;l&&c.push(i);try{u=e.apply(this,c)}catch(h){const m=h;if(l&&n)throw m;return i(m)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(c,...l){n||(n=!0,t(c,...l))}function a(c){i(null,c)}}const Ci={basename:gL,dirname:vL,extname:yL,join:bL,sep:"/"};function gL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let c=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else c<0&&(a=!0,c=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=c));return n===r?r=c:r<0&&(r=e.length),e.slice(n,r)}function vL(e){if(pu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function yL(e){pu(e);let t=e.length,n=-1,r=0,i=-1,a=0,c;for(;t--;){const l=e.codePointAt(t);if(l===47){if(c){r=t+1;break}continue}n<0&&(c=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function bL(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function xL(e,t){let n="",r=0,i=-1,a=0,c=-1,l,u;for(;++c<=e.length;){if(c2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=c,a=0;continue}}else if(n.length>0){n="",r=0,i=c,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,c):n=e.slice(i+1,c),r=c-i-1;i=c,a=0}else l===46&&a>-1?a++:a=-1}return n}function pu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const SL={cwd:wL};function wL(){return"/"}function H1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function CL(e){if(typeof e=="string")e=new URL(e);else if(!H1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kL(e)}function kL(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[y,...C]=m;const w=r[g][1];I1(w)&&I1(y)&&(y=km(!0,w,y)),r[g]=[h,y,...C]}}}}const TL=new hv().freeze();function Tm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Mm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function E5(e){if(!I1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function A5(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Hh(e){return ML(e)?e:new nS(e)}function ML(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jL(e){return typeof e=="string"||DL(e)}function DL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",N5=[],T5={allowDangerousHtml:!0},LL=/^(https?|ircs?|mailto|xmpp)$/i,OL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rS(e){const t=BL(e),n=zL(e);return IL(t.runSync(t.parse(n),n),e)}function BL(e){const t=e.rehypePlugins||N5,n=e.remarkPlugins||N5,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...T5}:T5;return TL().use(vR).use(n).use(hL,r).use(t)}function zL(e){const t=e.children||"",n=new nS;return typeof t=="string"&&(n.value=t),n}function IL(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,c=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||HL;for(const m of OL)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+RL+m.id,void 0);return uv(e,h),ej(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function h(m,d,g){if(m.type==="raw"&&g&&typeof d=="number")return c?g.children.splice(d,1):g.children[d]={type:"text",value:m.value},d;if(m.type==="element"){let y;for(y in xm)if(Object.hasOwn(xm,y)&&Object.hasOwn(m.properties,y)){const C=m.properties[y],w=xm[y];(w===null||w.includes(m.tagName))&&(m.properties[y]=u(String(C||""),y,m))}}if(m.type==="element"){let y=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!y&&r&&typeof d=="number"&&(y=!r(m,d,g)),y&&g&&typeof d=="number")return l&&m.children?g.children.splice(d,1,...m.children):g.children.splice(d,1),d}}}function HL(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||LL.test(e.slice(0,t))?e:""}const M5=/[#.]/g;function FL(e,t){const n=e||"",r={};let i=0,a,c;for(;ih&&(h=m):m&&(h!==void 0&&h>-1&&u.push(` -`.repeat(h)||" "),h=-1,u.push(m))}return u.join("")}function cS(e,t,n){return e.type==="element"?lO(e,t,n):e.type==="text"?n.whitespace==="normal"?uS(e,n):cO(e):[]}function lO(e,t,n){const r=hS(e,n),i=e.children||[];let a=-1,c=[];if(aO(e))return c;let l,u;for(P1(e)||z5(e)&&R5(t,e,z5)?u=` -`:sO(e)?(l=2,u=2):lS(e)&&(l=1,u=1);++a15?h="…"+l.slice(i-15,i):h=l.slice(0,i);var m;a+15e.replace(pO,"-$1").toLowerCase(),gO={"&":"&",">":">","<":"<",'"':""","'":"'"},vO=/[&><"']/g,Jn=e=>String(e).replace(vO,t=>gO[t]),b0=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?b0(e.body[0]):e:e.type==="font"?b0(e.body):e,yO=new Set(["mathord","textord","atom"]),vs=e=>yO.has(b0(e).type),bO=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},$1={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,t)=>(t.push(e),t)},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 _O(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 xO(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return _O(t)}function SO(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:xO(r)}class fv{constructor(t){t===void 0&&(t={}),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,t=t||{};for(var n of Object.keys($1)){var r=$1[n];r&&SO(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new De("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=bO(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class Qs{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return ki[wO[this.id]]}sub(){return ki[CO[this.id]]}fracNum(){return ki[kO[this.id]]}fracDen(){return ki[EO[this.id]]}cramp(){return ki[AO[this.id]]}text(){return ki[NO[this.id]]}isTight(){return this.size>=2}}var pv=0,z0=1,sl=2,us=3,Vc=4,Zr=5,hl=6,sr=7,ki=[new Qs(pv,0,!1),new Qs(z0,0,!0),new Qs(sl,1,!1),new Qs(us,1,!0),new Qs(Vc,2,!1),new Qs(Zr,2,!0),new Qs(hl,3,!1),new Qs(sr,3,!0)],wO=[Vc,Zr,Vc,Zr,hl,sr,hl,sr],CO=[Zr,Zr,Zr,Zr,sr,sr,sr,sr],kO=[sl,us,Vc,Zr,hl,sr,hl,sr],EO=[us,us,Zr,Zr,sr,sr,sr,sr],AO=[z0,z0,us,us,Zr,Zr,sr,sr],NO=[pv,z0,sl,us,sl,us,sl,us],dt={DISPLAY:ki[pv],TEXT:ki[sl],SCRIPT:ki[Vc],SCRIPTSCRIPT:ki[hl]},U1=[{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 TO(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var _0=[];U1.forEach(e=>e.blocks.forEach(t=>_0.push(...t)));function dS(e){for(var t=0;t<_0.length;t+=2)if(e>=_0[t]&&e<=_0[t+1])return!0;return!1}var Fn=e=>e+" "+e,Wo=80,MO=function(t,n){return"M95,"+(622+t+n)+` -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`+t/2.075+" -"+t+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+t)+`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+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},jO=function(t,n){return"M263,"+(601+t+n)+`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`+t/2.084+" -"+t+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+t)+`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+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},DO=function(t,n){return"M983 "+(10+t+n)+` -l`+t/3.13+" -"+t+` -c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` -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+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},RO=function(t,n){return"M424,"+(2398+t+n)+` -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`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+t)+`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+t)+" "+n+` -h400000v`+(40+t)+"h-400000z"},LO=function(t,n){return"M473,"+(2713+t+n)+` -c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` -c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`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+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},OO=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},BO=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` -H742v`+i+`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 `+n+"H400000v"+(40+t)+"H742z"},zO=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=MO(n,Wo);break;case"sqrtSize1":i=jO(n,Wo);break;case"sqrtSize2":i=DO(n,Wo);break;case"sqrtSize3":i=RO(n,Wo);break;case"sqrtSize4":i=LO(n,Wo);break;case"sqrtTall":i=BO(n,Wo,r)}return i},IO=function(t,n){switch(t){case"⎜":return Fn("M291 0 H417 V"+n+" H291z");case"∣":return Fn("M145 0 H188 V"+n+" H145z");case"∥":return Fn("M145 0 H188 V"+n+" H145z")+Fn("M367 0 H410 V"+n+" H367z");case"⎟":return Fn("M457 0 H583 V"+n+" H457z");case"⎢":return Fn("M319 0 H403 V"+n+" H319z");case"⎥":return Fn("M263 0 H347 V"+n+" H263z");case"⎪":return Fn("M384 0 H504 V"+n+" H384z");case"⏐":return Fn("M312 0 H355 V"+n+" H312z");case"‖":return Fn("M257 0 H300 V"+n+" H257z")+Fn("M478 0 H521 V"+n+" H478z");default:return""}},I5={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:Fn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Fn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Fn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Fn("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:Fn("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:Fn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Fn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Fn("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`},HO=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84 -H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z -M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z -M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z -M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z -M347 1759 V0 h-84 V1759 v`+n+" 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,`+(n+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,-`+(n+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,`+(n+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,-`+(n+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 FO(e){return"toText"in e}class kl{constructor(t){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=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n{if(FO(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var q1={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},PO={ex:!0,em:!0,mu:!0},fS=function(t){return typeof t!="string"&&(t=t.unit),t in q1||t in PO||t==="ex"},yn=function(t,n){var r;if(t.unit in q1)r=q1[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new De("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},Be=function(t){return+t.toFixed(4)+"em"},aa=function(t){return t.filter(n=>n).join(" ")},mv=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=mO(r)+":"+i+";")}return n},pS=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},mS=function(t){var n=document.createElement(t);n.className=aa(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,gS=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Jn(aa(this.classes))+'"');var r=mv(this.style);r&&(n+=' style="'+Jn(r)+'"');for(var i of Object.keys(this.attributes)){if($O.test(i))throw new De("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Jn(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class El{constructor(t,n,r,i){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,pS.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return mS.call(this,"span")}toMarkup(){return gS.call(this,"span")}}class dd{constructor(t,n,r,i){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,pS.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return mS.call(this,"a")}toMarkup(){return gS.call(this,"a")}}class UO{constructor(t,n,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=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t=''+Jn(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=Be(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=aa(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+Be(this.italic)+";"),r+=mv(this.style),r&&(t=!0,n+=' style="'+Jn(r)+'"');var i=Jn(this.text);return t?(n+=">",n+=i,n+="",n):i}}class ds{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class G1{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var WO=e=>e instanceof El||e instanceof dd||e instanceof kl,Ai={"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]}},Fh={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]},H5={Å:"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 YO(e,t){Ai[e]=t}function gv(e,t,n){if(!Ai[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Ai[t][r];if(!i&&e[0]in H5&&(r=H5[e[0]].charCodeAt(0),i=Ai[t][r]),!i&&n==="text"&&dS(r)&&(i=Ai[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Rm={};function XO(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Rm[t]){var n=Rm[t]={cssEmPerMu:Fh.quad[t]/18};for(var r in Fh)Fh.hasOwnProperty(r)&&(n[r]=Fh[r][t])}return Rm[t]}var fn={math:{},text:{}};function R(e,t,n,r,i,a){fn[e][i]={font:t,group:n,replace:r},a&&r&&(fn[e][r]=fn[e][i])}var H="math",Ne="text",X="main",ne="ams",mn="accent-token",Ge="bin",ar="close",Al="inner",it="mathord",On="op-token",Hr="open",mu="punct",ie="rel",ys="spacing",ue="textord";R(H,X,ie,"≡","\\equiv",!0);R(H,X,ie,"≺","\\prec",!0);R(H,X,ie,"≻","\\succ",!0);R(H,X,ie,"∼","\\sim",!0);R(H,X,ie,"⊥","\\perp");R(H,X,ie,"⪯","\\preceq",!0);R(H,X,ie,"⪰","\\succeq",!0);R(H,X,ie,"≃","\\simeq",!0);R(H,X,ie,"∣","\\mid",!0);R(H,X,ie,"≪","\\ll",!0);R(H,X,ie,"≫","\\gg",!0);R(H,X,ie,"≍","\\asymp",!0);R(H,X,ie,"∥","\\parallel");R(H,X,ie,"⋈","\\bowtie",!0);R(H,X,ie,"⌣","\\smile",!0);R(H,X,ie,"⊑","\\sqsubseteq",!0);R(H,X,ie,"⊒","\\sqsupseteq",!0);R(H,X,ie,"≐","\\doteq",!0);R(H,X,ie,"⌢","\\frown",!0);R(H,X,ie,"∋","\\ni",!0);R(H,X,ie,"∝","\\propto",!0);R(H,X,ie,"⊢","\\vdash",!0);R(H,X,ie,"⊣","\\dashv",!0);R(H,X,ie,"∋","\\owns");R(H,X,mu,".","\\ldotp");R(H,X,mu,"⋅","\\cdotp");R(H,X,mu,"⋅","·");R(Ne,X,ue,"⋅","·");R(H,X,ue,"#","\\#");R(Ne,X,ue,"#","\\#");R(H,X,ue,"&","\\&");R(Ne,X,ue,"&","\\&");R(H,X,ue,"ℵ","\\aleph",!0);R(H,X,ue,"∀","\\forall",!0);R(H,X,ue,"ℏ","\\hbar",!0);R(H,X,ue,"∃","\\exists",!0);R(H,X,ue,"∇","\\nabla",!0);R(H,X,ue,"♭","\\flat",!0);R(H,X,ue,"ℓ","\\ell",!0);R(H,X,ue,"♮","\\natural",!0);R(H,X,ue,"♣","\\clubsuit",!0);R(H,X,ue,"℘","\\wp",!0);R(H,X,ue,"♯","\\sharp",!0);R(H,X,ue,"♢","\\diamondsuit",!0);R(H,X,ue,"ℜ","\\Re",!0);R(H,X,ue,"♡","\\heartsuit",!0);R(H,X,ue,"ℑ","\\Im",!0);R(H,X,ue,"♠","\\spadesuit",!0);R(H,X,ue,"§","\\S",!0);R(Ne,X,ue,"§","\\S");R(H,X,ue,"¶","\\P",!0);R(Ne,X,ue,"¶","\\P");R(H,X,ue,"†","\\dag");R(Ne,X,ue,"†","\\dag");R(Ne,X,ue,"†","\\textdagger");R(H,X,ue,"‡","\\ddag");R(Ne,X,ue,"‡","\\ddag");R(Ne,X,ue,"‡","\\textdaggerdbl");R(H,X,ar,"⎱","\\rmoustache",!0);R(H,X,Hr,"⎰","\\lmoustache",!0);R(H,X,ar,"⟯","\\rgroup",!0);R(H,X,Hr,"⟮","\\lgroup",!0);R(H,X,Ge,"∓","\\mp",!0);R(H,X,Ge,"⊖","\\ominus",!0);R(H,X,Ge,"⊎","\\uplus",!0);R(H,X,Ge,"⊓","\\sqcap",!0);R(H,X,Ge,"∗","\\ast");R(H,X,Ge,"⊔","\\sqcup",!0);R(H,X,Ge,"◯","\\bigcirc",!0);R(H,X,Ge,"∙","\\bullet",!0);R(H,X,Ge,"‡","\\ddagger");R(H,X,Ge,"≀","\\wr",!0);R(H,X,Ge,"⨿","\\amalg");R(H,X,Ge,"&","\\And");R(H,X,ie,"⟵","\\longleftarrow",!0);R(H,X,ie,"⇐","\\Leftarrow",!0);R(H,X,ie,"⟸","\\Longleftarrow",!0);R(H,X,ie,"⟶","\\longrightarrow",!0);R(H,X,ie,"⇒","\\Rightarrow",!0);R(H,X,ie,"⟹","\\Longrightarrow",!0);R(H,X,ie,"↔","\\leftrightarrow",!0);R(H,X,ie,"⟷","\\longleftrightarrow",!0);R(H,X,ie,"⇔","\\Leftrightarrow",!0);R(H,X,ie,"⟺","\\Longleftrightarrow",!0);R(H,X,ie,"↦","\\mapsto",!0);R(H,X,ie,"⟼","\\longmapsto",!0);R(H,X,ie,"↗","\\nearrow",!0);R(H,X,ie,"↩","\\hookleftarrow",!0);R(H,X,ie,"↪","\\hookrightarrow",!0);R(H,X,ie,"↘","\\searrow",!0);R(H,X,ie,"↼","\\leftharpoonup",!0);R(H,X,ie,"⇀","\\rightharpoonup",!0);R(H,X,ie,"↙","\\swarrow",!0);R(H,X,ie,"↽","\\leftharpoondown",!0);R(H,X,ie,"⇁","\\rightharpoondown",!0);R(H,X,ie,"↖","\\nwarrow",!0);R(H,X,ie,"⇌","\\rightleftharpoons",!0);R(H,ne,ie,"≮","\\nless",!0);R(H,ne,ie,"","\\@nleqslant");R(H,ne,ie,"","\\@nleqq");R(H,ne,ie,"⪇","\\lneq",!0);R(H,ne,ie,"≨","\\lneqq",!0);R(H,ne,ie,"","\\@lvertneqq");R(H,ne,ie,"⋦","\\lnsim",!0);R(H,ne,ie,"⪉","\\lnapprox",!0);R(H,ne,ie,"⊀","\\nprec",!0);R(H,ne,ie,"⋠","\\npreceq",!0);R(H,ne,ie,"⋨","\\precnsim",!0);R(H,ne,ie,"⪹","\\precnapprox",!0);R(H,ne,ie,"≁","\\nsim",!0);R(H,ne,ie,"","\\@nshortmid");R(H,ne,ie,"∤","\\nmid",!0);R(H,ne,ie,"⊬","\\nvdash",!0);R(H,ne,ie,"⊭","\\nvDash",!0);R(H,ne,ie,"⋪","\\ntriangleleft");R(H,ne,ie,"⋬","\\ntrianglelefteq",!0);R(H,ne,ie,"⊊","\\subsetneq",!0);R(H,ne,ie,"","\\@varsubsetneq");R(H,ne,ie,"⫋","\\subsetneqq",!0);R(H,ne,ie,"","\\@varsubsetneqq");R(H,ne,ie,"≯","\\ngtr",!0);R(H,ne,ie,"","\\@ngeqslant");R(H,ne,ie,"","\\@ngeqq");R(H,ne,ie,"⪈","\\gneq",!0);R(H,ne,ie,"≩","\\gneqq",!0);R(H,ne,ie,"","\\@gvertneqq");R(H,ne,ie,"⋧","\\gnsim",!0);R(H,ne,ie,"⪊","\\gnapprox",!0);R(H,ne,ie,"⊁","\\nsucc",!0);R(H,ne,ie,"⋡","\\nsucceq",!0);R(H,ne,ie,"⋩","\\succnsim",!0);R(H,ne,ie,"⪺","\\succnapprox",!0);R(H,ne,ie,"≆","\\ncong",!0);R(H,ne,ie,"","\\@nshortparallel");R(H,ne,ie,"∦","\\nparallel",!0);R(H,ne,ie,"⊯","\\nVDash",!0);R(H,ne,ie,"⋫","\\ntriangleright");R(H,ne,ie,"⋭","\\ntrianglerighteq",!0);R(H,ne,ie,"","\\@nsupseteqq");R(H,ne,ie,"⊋","\\supsetneq",!0);R(H,ne,ie,"","\\@varsupsetneq");R(H,ne,ie,"⫌","\\supsetneqq",!0);R(H,ne,ie,"","\\@varsupsetneqq");R(H,ne,ie,"⊮","\\nVdash",!0);R(H,ne,ie,"⪵","\\precneqq",!0);R(H,ne,ie,"⪶","\\succneqq",!0);R(H,ne,ie,"","\\@nsubseteqq");R(H,ne,Ge,"⊴","\\unlhd");R(H,ne,Ge,"⊵","\\unrhd");R(H,ne,ie,"↚","\\nleftarrow",!0);R(H,ne,ie,"↛","\\nrightarrow",!0);R(H,ne,ie,"⇍","\\nLeftarrow",!0);R(H,ne,ie,"⇏","\\nRightarrow",!0);R(H,ne,ie,"↮","\\nleftrightarrow",!0);R(H,ne,ie,"⇎","\\nLeftrightarrow",!0);R(H,ne,ie,"△","\\vartriangle");R(H,ne,ue,"ℏ","\\hslash");R(H,ne,ue,"▽","\\triangledown");R(H,ne,ue,"◊","\\lozenge");R(H,ne,ue,"Ⓢ","\\circledS");R(H,ne,ue,"®","\\circledR");R(Ne,ne,ue,"®","\\circledR");R(H,ne,ue,"∡","\\measuredangle",!0);R(H,ne,ue,"∄","\\nexists");R(H,ne,ue,"℧","\\mho");R(H,ne,ue,"Ⅎ","\\Finv",!0);R(H,ne,ue,"⅁","\\Game",!0);R(H,ne,ue,"‵","\\backprime");R(H,ne,ue,"▲","\\blacktriangle");R(H,ne,ue,"▼","\\blacktriangledown");R(H,ne,ue,"■","\\blacksquare");R(H,ne,ue,"⧫","\\blacklozenge");R(H,ne,ue,"★","\\bigstar");R(H,ne,ue,"∢","\\sphericalangle",!0);R(H,ne,ue,"∁","\\complement",!0);R(H,ne,ue,"ð","\\eth",!0);R(Ne,X,ue,"ð","ð");R(H,ne,ue,"╱","\\diagup");R(H,ne,ue,"╲","\\diagdown");R(H,ne,ue,"□","\\square");R(H,ne,ue,"□","\\Box");R(H,ne,ue,"◊","\\Diamond");R(H,ne,ue,"¥","\\yen",!0);R(Ne,ne,ue,"¥","\\yen",!0);R(H,ne,ue,"✓","\\checkmark",!0);R(Ne,ne,ue,"✓","\\checkmark");R(H,ne,ue,"ℶ","\\beth",!0);R(H,ne,ue,"ℸ","\\daleth",!0);R(H,ne,ue,"ℷ","\\gimel",!0);R(H,ne,ue,"ϝ","\\digamma",!0);R(H,ne,ue,"ϰ","\\varkappa");R(H,ne,Hr,"┌","\\@ulcorner",!0);R(H,ne,ar,"┐","\\@urcorner",!0);R(H,ne,Hr,"└","\\@llcorner",!0);R(H,ne,ar,"┘","\\@lrcorner",!0);R(H,ne,ie,"≦","\\leqq",!0);R(H,ne,ie,"⩽","\\leqslant",!0);R(H,ne,ie,"⪕","\\eqslantless",!0);R(H,ne,ie,"≲","\\lesssim",!0);R(H,ne,ie,"⪅","\\lessapprox",!0);R(H,ne,ie,"≊","\\approxeq",!0);R(H,ne,Ge,"⋖","\\lessdot");R(H,ne,ie,"⋘","\\lll",!0);R(H,ne,ie,"≶","\\lessgtr",!0);R(H,ne,ie,"⋚","\\lesseqgtr",!0);R(H,ne,ie,"⪋","\\lesseqqgtr",!0);R(H,ne,ie,"≑","\\doteqdot");R(H,ne,ie,"≓","\\risingdotseq",!0);R(H,ne,ie,"≒","\\fallingdotseq",!0);R(H,ne,ie,"∽","\\backsim",!0);R(H,ne,ie,"⋍","\\backsimeq",!0);R(H,ne,ie,"⫅","\\subseteqq",!0);R(H,ne,ie,"⋐","\\Subset",!0);R(H,ne,ie,"⊏","\\sqsubset",!0);R(H,ne,ie,"≼","\\preccurlyeq",!0);R(H,ne,ie,"⋞","\\curlyeqprec",!0);R(H,ne,ie,"≾","\\precsim",!0);R(H,ne,ie,"⪷","\\precapprox",!0);R(H,ne,ie,"⊲","\\vartriangleleft");R(H,ne,ie,"⊴","\\trianglelefteq");R(H,ne,ie,"⊨","\\vDash",!0);R(H,ne,ie,"⊪","\\Vvdash",!0);R(H,ne,ie,"⌣","\\smallsmile");R(H,ne,ie,"⌢","\\smallfrown");R(H,ne,ie,"≏","\\bumpeq",!0);R(H,ne,ie,"≎","\\Bumpeq",!0);R(H,ne,ie,"≧","\\geqq",!0);R(H,ne,ie,"⩾","\\geqslant",!0);R(H,ne,ie,"⪖","\\eqslantgtr",!0);R(H,ne,ie,"≳","\\gtrsim",!0);R(H,ne,ie,"⪆","\\gtrapprox",!0);R(H,ne,Ge,"⋗","\\gtrdot");R(H,ne,ie,"⋙","\\ggg",!0);R(H,ne,ie,"≷","\\gtrless",!0);R(H,ne,ie,"⋛","\\gtreqless",!0);R(H,ne,ie,"⪌","\\gtreqqless",!0);R(H,ne,ie,"≖","\\eqcirc",!0);R(H,ne,ie,"≗","\\circeq",!0);R(H,ne,ie,"≜","\\triangleq",!0);R(H,ne,ie,"∼","\\thicksim");R(H,ne,ie,"≈","\\thickapprox");R(H,ne,ie,"⫆","\\supseteqq",!0);R(H,ne,ie,"⋑","\\Supset",!0);R(H,ne,ie,"⊐","\\sqsupset",!0);R(H,ne,ie,"≽","\\succcurlyeq",!0);R(H,ne,ie,"⋟","\\curlyeqsucc",!0);R(H,ne,ie,"≿","\\succsim",!0);R(H,ne,ie,"⪸","\\succapprox",!0);R(H,ne,ie,"⊳","\\vartriangleright");R(H,ne,ie,"⊵","\\trianglerighteq");R(H,ne,ie,"⊩","\\Vdash",!0);R(H,ne,ie,"∣","\\shortmid");R(H,ne,ie,"∥","\\shortparallel");R(H,ne,ie,"≬","\\between",!0);R(H,ne,ie,"⋔","\\pitchfork",!0);R(H,ne,ie,"∝","\\varpropto");R(H,ne,ie,"◀","\\blacktriangleleft");R(H,ne,ie,"∴","\\therefore",!0);R(H,ne,ie,"∍","\\backepsilon");R(H,ne,ie,"▶","\\blacktriangleright");R(H,ne,ie,"∵","\\because",!0);R(H,ne,ie,"⋘","\\llless");R(H,ne,ie,"⋙","\\gggtr");R(H,ne,Ge,"⊲","\\lhd");R(H,ne,Ge,"⊳","\\rhd");R(H,ne,ie,"≂","\\eqsim",!0);R(H,X,ie,"⋈","\\Join");R(H,ne,ie,"≑","\\Doteq",!0);R(H,ne,Ge,"∔","\\dotplus",!0);R(H,ne,Ge,"∖","\\smallsetminus");R(H,ne,Ge,"⋒","\\Cap",!0);R(H,ne,Ge,"⋓","\\Cup",!0);R(H,ne,Ge,"⩞","\\doublebarwedge",!0);R(H,ne,Ge,"⊟","\\boxminus",!0);R(H,ne,Ge,"⊞","\\boxplus",!0);R(H,ne,Ge,"⋇","\\divideontimes",!0);R(H,ne,Ge,"⋉","\\ltimes",!0);R(H,ne,Ge,"⋊","\\rtimes",!0);R(H,ne,Ge,"⋋","\\leftthreetimes",!0);R(H,ne,Ge,"⋌","\\rightthreetimes",!0);R(H,ne,Ge,"⋏","\\curlywedge",!0);R(H,ne,Ge,"⋎","\\curlyvee",!0);R(H,ne,Ge,"⊝","\\circleddash",!0);R(H,ne,Ge,"⊛","\\circledast",!0);R(H,ne,Ge,"⋅","\\centerdot");R(H,ne,Ge,"⊺","\\intercal",!0);R(H,ne,Ge,"⋒","\\doublecap");R(H,ne,Ge,"⋓","\\doublecup");R(H,ne,Ge,"⊠","\\boxtimes",!0);R(H,ne,ie,"⇢","\\dashrightarrow",!0);R(H,ne,ie,"⇠","\\dashleftarrow",!0);R(H,ne,ie,"⇇","\\leftleftarrows",!0);R(H,ne,ie,"⇆","\\leftrightarrows",!0);R(H,ne,ie,"⇚","\\Lleftarrow",!0);R(H,ne,ie,"↞","\\twoheadleftarrow",!0);R(H,ne,ie,"↢","\\leftarrowtail",!0);R(H,ne,ie,"↫","\\looparrowleft",!0);R(H,ne,ie,"⇋","\\leftrightharpoons",!0);R(H,ne,ie,"↶","\\curvearrowleft",!0);R(H,ne,ie,"↺","\\circlearrowleft",!0);R(H,ne,ie,"↰","\\Lsh",!0);R(H,ne,ie,"⇈","\\upuparrows",!0);R(H,ne,ie,"↿","\\upharpoonleft",!0);R(H,ne,ie,"⇃","\\downharpoonleft",!0);R(H,X,ie,"⊶","\\origof",!0);R(H,X,ie,"⊷","\\imageof",!0);R(H,ne,ie,"⊸","\\multimap",!0);R(H,ne,ie,"↭","\\leftrightsquigarrow",!0);R(H,ne,ie,"⇉","\\rightrightarrows",!0);R(H,ne,ie,"⇄","\\rightleftarrows",!0);R(H,ne,ie,"↠","\\twoheadrightarrow",!0);R(H,ne,ie,"↣","\\rightarrowtail",!0);R(H,ne,ie,"↬","\\looparrowright",!0);R(H,ne,ie,"↷","\\curvearrowright",!0);R(H,ne,ie,"↻","\\circlearrowright",!0);R(H,ne,ie,"↱","\\Rsh",!0);R(H,ne,ie,"⇊","\\downdownarrows",!0);R(H,ne,ie,"↾","\\upharpoonright",!0);R(H,ne,ie,"⇂","\\downharpoonright",!0);R(H,ne,ie,"⇝","\\rightsquigarrow",!0);R(H,ne,ie,"⇝","\\leadsto");R(H,ne,ie,"⇛","\\Rrightarrow",!0);R(H,ne,ie,"↾","\\restriction");R(H,X,ue,"‘","`");R(H,X,ue,"$","\\$");R(Ne,X,ue,"$","\\$");R(Ne,X,ue,"$","\\textdollar");R(H,X,ue,"%","\\%");R(Ne,X,ue,"%","\\%");R(H,X,ue,"_","\\_");R(Ne,X,ue,"_","\\_");R(Ne,X,ue,"_","\\textunderscore");R(H,X,ue,"∠","\\angle",!0);R(H,X,ue,"∞","\\infty",!0);R(H,X,ue,"′","\\prime");R(H,X,ue,"△","\\triangle");R(H,X,ue,"Γ","\\Gamma",!0);R(H,X,ue,"Δ","\\Delta",!0);R(H,X,ue,"Θ","\\Theta",!0);R(H,X,ue,"Λ","\\Lambda",!0);R(H,X,ue,"Ξ","\\Xi",!0);R(H,X,ue,"Π","\\Pi",!0);R(H,X,ue,"Σ","\\Sigma",!0);R(H,X,ue,"Υ","\\Upsilon",!0);R(H,X,ue,"Φ","\\Phi",!0);R(H,X,ue,"Ψ","\\Psi",!0);R(H,X,ue,"Ω","\\Omega",!0);R(H,X,ue,"A","Α");R(H,X,ue,"B","Β");R(H,X,ue,"E","Ε");R(H,X,ue,"Z","Ζ");R(H,X,ue,"H","Η");R(H,X,ue,"I","Ι");R(H,X,ue,"K","Κ");R(H,X,ue,"M","Μ");R(H,X,ue,"N","Ν");R(H,X,ue,"O","Ο");R(H,X,ue,"P","Ρ");R(H,X,ue,"T","Τ");R(H,X,ue,"X","Χ");R(H,X,ue,"¬","\\neg",!0);R(H,X,ue,"¬","\\lnot");R(H,X,ue,"⊤","\\top");R(H,X,ue,"⊥","\\bot");R(H,X,ue,"∅","\\emptyset");R(H,ne,ue,"∅","\\varnothing");R(H,X,it,"α","\\alpha",!0);R(H,X,it,"β","\\beta",!0);R(H,X,it,"γ","\\gamma",!0);R(H,X,it,"δ","\\delta",!0);R(H,X,it,"ϵ","\\epsilon",!0);R(H,X,it,"ζ","\\zeta",!0);R(H,X,it,"η","\\eta",!0);R(H,X,it,"θ","\\theta",!0);R(H,X,it,"ι","\\iota",!0);R(H,X,it,"κ","\\kappa",!0);R(H,X,it,"λ","\\lambda",!0);R(H,X,it,"μ","\\mu",!0);R(H,X,it,"ν","\\nu",!0);R(H,X,it,"ξ","\\xi",!0);R(H,X,it,"ο","\\omicron",!0);R(H,X,it,"π","\\pi",!0);R(H,X,it,"ρ","\\rho",!0);R(H,X,it,"σ","\\sigma",!0);R(H,X,it,"τ","\\tau",!0);R(H,X,it,"υ","\\upsilon",!0);R(H,X,it,"ϕ","\\phi",!0);R(H,X,it,"χ","\\chi",!0);R(H,X,it,"ψ","\\psi",!0);R(H,X,it,"ω","\\omega",!0);R(H,X,it,"ε","\\varepsilon",!0);R(H,X,it,"ϑ","\\vartheta",!0);R(H,X,it,"ϖ","\\varpi",!0);R(H,X,it,"ϱ","\\varrho",!0);R(H,X,it,"ς","\\varsigma",!0);R(H,X,it,"φ","\\varphi",!0);R(H,X,Ge,"∗","*",!0);R(H,X,Ge,"+","+");R(H,X,Ge,"−","-",!0);R(H,X,Ge,"⋅","\\cdot",!0);R(H,X,Ge,"∘","\\circ",!0);R(H,X,Ge,"÷","\\div",!0);R(H,X,Ge,"±","\\pm",!0);R(H,X,Ge,"×","\\times",!0);R(H,X,Ge,"∩","\\cap",!0);R(H,X,Ge,"∪","\\cup",!0);R(H,X,Ge,"∖","\\setminus",!0);R(H,X,Ge,"∧","\\land");R(H,X,Ge,"∨","\\lor");R(H,X,Ge,"∧","\\wedge",!0);R(H,X,Ge,"∨","\\vee",!0);R(H,X,ue,"√","\\surd");R(H,X,Hr,"⟨","\\langle",!0);R(H,X,Hr,"∣","\\lvert");R(H,X,Hr,"∥","\\lVert");R(H,X,ar,"?","?");R(H,X,ar,"!","!");R(H,X,ar,"⟩","\\rangle",!0);R(H,X,ar,"∣","\\rvert");R(H,X,ar,"∥","\\rVert");R(H,X,ie,"=","=");R(H,X,ie,":",":");R(H,X,ie,"≈","\\approx",!0);R(H,X,ie,"≅","\\cong",!0);R(H,X,ie,"≥","\\ge");R(H,X,ie,"≥","\\geq",!0);R(H,X,ie,"←","\\gets");R(H,X,ie,">","\\gt",!0);R(H,X,ie,"∈","\\in",!0);R(H,X,ie,"","\\@not");R(H,X,ie,"⊂","\\subset",!0);R(H,X,ie,"⊃","\\supset",!0);R(H,X,ie,"⊆","\\subseteq",!0);R(H,X,ie,"⊇","\\supseteq",!0);R(H,ne,ie,"⊈","\\nsubseteq",!0);R(H,ne,ie,"⊉","\\nsupseteq",!0);R(H,X,ie,"⊨","\\models");R(H,X,ie,"←","\\leftarrow",!0);R(H,X,ie,"≤","\\le");R(H,X,ie,"≤","\\leq",!0);R(H,X,ie,"<","\\lt",!0);R(H,X,ie,"→","\\rightarrow",!0);R(H,X,ie,"→","\\to");R(H,ne,ie,"≱","\\ngeq",!0);R(H,ne,ie,"≰","\\nleq",!0);R(H,X,ys," ","\\ ");R(H,X,ys," ","\\space");R(H,X,ys," ","\\nobreakspace");R(Ne,X,ys," ","\\ ");R(Ne,X,ys," "," ");R(Ne,X,ys," ","\\space");R(Ne,X,ys," ","\\nobreakspace");R(H,X,ys,"","\\nobreak");R(H,X,ys,"","\\allowbreak");R(H,X,mu,",",",");R(H,X,mu,";",";");R(H,ne,Ge,"⊼","\\barwedge",!0);R(H,ne,Ge,"⊻","\\veebar",!0);R(H,X,Ge,"⊙","\\odot",!0);R(H,X,Ge,"⊕","\\oplus",!0);R(H,X,Ge,"⊗","\\otimes",!0);R(H,X,ue,"∂","\\partial",!0);R(H,X,Ge,"⊘","\\oslash",!0);R(H,ne,Ge,"⊚","\\circledcirc",!0);R(H,ne,Ge,"⊡","\\boxdot",!0);R(H,X,Ge,"△","\\bigtriangleup");R(H,X,Ge,"▽","\\bigtriangledown");R(H,X,Ge,"†","\\dagger");R(H,X,Ge,"⋄","\\diamond");R(H,X,Ge,"⋆","\\star");R(H,X,Ge,"◃","\\triangleleft");R(H,X,Ge,"▹","\\triangleright");R(H,X,Hr,"{","\\{");R(Ne,X,ue,"{","\\{");R(Ne,X,ue,"{","\\textbraceleft");R(H,X,ar,"}","\\}");R(Ne,X,ue,"}","\\}");R(Ne,X,ue,"}","\\textbraceright");R(H,X,Hr,"{","\\lbrace");R(H,X,ar,"}","\\rbrace");R(H,X,Hr,"[","\\lbrack",!0);R(Ne,X,ue,"[","\\lbrack",!0);R(H,X,ar,"]","\\rbrack",!0);R(Ne,X,ue,"]","\\rbrack",!0);R(H,X,Hr,"(","\\lparen",!0);R(H,X,ar,")","\\rparen",!0);R(Ne,X,ue,"<","\\textless",!0);R(Ne,X,ue,">","\\textgreater",!0);R(H,X,Hr,"⌊","\\lfloor",!0);R(H,X,ar,"⌋","\\rfloor",!0);R(H,X,Hr,"⌈","\\lceil",!0);R(H,X,ar,"⌉","\\rceil",!0);R(H,X,ue,"\\","\\backslash");R(H,X,ue,"∣","|");R(H,X,ue,"∣","\\vert");R(Ne,X,ue,"|","\\textbar",!0);R(H,X,ue,"∥","\\|");R(H,X,ue,"∥","\\Vert");R(Ne,X,ue,"∥","\\textbardbl");R(Ne,X,ue,"~","\\textasciitilde");R(Ne,X,ue,"\\","\\textbackslash");R(Ne,X,ue,"^","\\textasciicircum");R(H,X,ie,"↑","\\uparrow",!0);R(H,X,ie,"⇑","\\Uparrow",!0);R(H,X,ie,"↓","\\downarrow",!0);R(H,X,ie,"⇓","\\Downarrow",!0);R(H,X,ie,"↕","\\updownarrow",!0);R(H,X,ie,"⇕","\\Updownarrow",!0);R(H,X,On,"∐","\\coprod");R(H,X,On,"⋁","\\bigvee");R(H,X,On,"⋀","\\bigwedge");R(H,X,On,"⨄","\\biguplus");R(H,X,On,"⋂","\\bigcap");R(H,X,On,"⋃","\\bigcup");R(H,X,On,"∫","\\int");R(H,X,On,"∫","\\intop");R(H,X,On,"∬","\\iint");R(H,X,On,"∭","\\iiint");R(H,X,On,"∏","\\prod");R(H,X,On,"∑","\\sum");R(H,X,On,"⨂","\\bigotimes");R(H,X,On,"⨁","\\bigoplus");R(H,X,On,"⨀","\\bigodot");R(H,X,On,"∮","\\oint");R(H,X,On,"∯","\\oiint");R(H,X,On,"∰","\\oiiint");R(H,X,On,"⨆","\\bigsqcup");R(H,X,On,"∫","\\smallint");R(Ne,X,Al,"…","\\textellipsis");R(H,X,Al,"…","\\mathellipsis");R(Ne,X,Al,"…","\\ldots",!0);R(H,X,Al,"…","\\ldots",!0);R(H,X,Al,"⋯","\\@cdots",!0);R(H,X,Al,"⋱","\\ddots",!0);R(H,X,ue,"⋮","\\varvdots");R(Ne,X,ue,"⋮","\\varvdots");R(H,X,mn,"ˊ","\\acute");R(H,X,mn,"ˋ","\\grave");R(H,X,mn,"¨","\\ddot");R(H,X,mn,"~","\\tilde");R(H,X,mn,"ˉ","\\bar");R(H,X,mn,"˘","\\breve");R(H,X,mn,"ˇ","\\check");R(H,X,mn,"^","\\hat");R(H,X,mn,"⃗","\\vec");R(H,X,mn,"˙","\\dot");R(H,X,mn,"˚","\\mathring");R(H,X,it,"","\\@imath");R(H,X,it,"","\\@jmath");R(H,X,ue,"ı","ı");R(H,X,ue,"ȷ","ȷ");R(Ne,X,ue,"ı","\\i",!0);R(Ne,X,ue,"ȷ","\\j",!0);R(Ne,X,ue,"ß","\\ss",!0);R(Ne,X,ue,"æ","\\ae",!0);R(Ne,X,ue,"œ","\\oe",!0);R(Ne,X,ue,"ø","\\o",!0);R(Ne,X,ue,"Æ","\\AE",!0);R(Ne,X,ue,"Œ","\\OE",!0);R(Ne,X,ue,"Ø","\\O",!0);R(Ne,X,mn,"ˊ","\\'");R(Ne,X,mn,"ˋ","\\`");R(Ne,X,mn,"ˆ","\\^");R(Ne,X,mn,"˜","\\~");R(Ne,X,mn,"ˉ","\\=");R(Ne,X,mn,"˘","\\u");R(Ne,X,mn,"˙","\\.");R(Ne,X,mn,"¸","\\c");R(Ne,X,mn,"˚","\\r");R(Ne,X,mn,"ˇ","\\v");R(Ne,X,mn,"¨",'\\"');R(Ne,X,mn,"˝","\\H");R(Ne,X,mn,"◯","\\textcircled");var vS={"--":!0,"---":!0,"``":!0,"''":!0};R(Ne,X,ue,"–","--",!0);R(Ne,X,ue,"–","\\textendash");R(Ne,X,ue,"—","---",!0);R(Ne,X,ue,"—","\\textemdash");R(Ne,X,ue,"‘","`",!0);R(Ne,X,ue,"‘","\\textquoteleft");R(Ne,X,ue,"’","'",!0);R(Ne,X,ue,"’","\\textquoteright");R(Ne,X,ue,"“","``",!0);R(Ne,X,ue,"“","\\textquotedblleft");R(Ne,X,ue,"”","''",!0);R(Ne,X,ue,"”","\\textquotedblright");R(H,X,ue,"°","\\degree",!0);R(Ne,X,ue,"°","\\degree");R(Ne,X,ue,"°","\\textdegree",!0);R(H,X,ue,"£","\\pounds");R(H,X,ue,"£","\\mathsterling",!0);R(Ne,X,ue,"£","\\pounds");R(Ne,X,ue,"£","\\textsterling",!0);R(H,ne,ue,"✠","\\maltese");R(Ne,ne,ue,"✠","\\maltese");var F5='0123456789/@."';for(var Lm=0;Lm{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return K5[i]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return ZO[a]}else{if(r===120485||r===120486)return K5[0];if(120486{if(aa(e.classes)!==aa(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},yS=e=>{for(var t=0;tn&&(n=c.height),c.depth>r&&(r=c.depth),c.maxFontSize>i&&(i=c.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},Te=function(t,n,r,i){var a=new El(t,n,r,i);return yv(a),a},la=(e,t,n,r)=>new El(e,t,n,r),dl=function(t,n,r){var i=Te([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=Be(i.height),i.maxFontSize=1,i},tB=function(t,n,r,i){var a=new dd(t,n,r,i);return yv(a),a},bs=function(t){var n=new kl(t);return yv(n),n},fl=function(t,n){return t instanceof kl?Te([],[t],n):t},nB=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,c=1;c{var n=Te(["mspace"],[],t),r=yn(e,t);return n.style.marginRight=Be(r),n},Uh=(e,t,n)=>{var r,i;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 t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},Z1={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"}},_S={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},xS=function(t,n){var[r,i,a]=_S[t],c=new oa(r),l=new ds([c],{width:Be(i),height:Be(a),style:"width:"+Be(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=la(["overlay"],[l],n);return u.height=a,u.style.height=Be(a),u.style.width=Be(i),u},vn={number:3,unit:"mu"},Ba={number:4,unit:"mu"},as={number:5,unit:"mu"},rB={mord:{mop:vn,mbin:Ba,mrel:as,minner:vn},mop:{mord:vn,mop:vn,mrel:as,minner:vn},mbin:{mord:Ba,mop:Ba,mopen:Ba,minner:Ba},mrel:{mord:as,mop:as,mopen:as,minner:as},mopen:{},mclose:{mop:vn,mbin:Ba,mrel:as,minner:vn},mpunct:{mord:vn,mop:vn,mrel:as,mopen:vn,mclose:vn,mpunct:vn,minner:vn},minner:{mord:vn,mop:vn,mbin:Ba,mrel:as,mopen:vn,mpunct:vn,minner:vn}},iB={mord:{mop:vn},mop:{mord:vn,mop:vn},mbin:{},mrel:{},mopen:{},mclose:{mop:vn},mpunct:{},minner:{mop:vn}},SS={},H0={},F0={};function $e(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:c}=e,l={type:t,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:i},u=0;u{var b=w.classes[0],_=C.classes[0];b==="mbin"&&aB.has(_)?w.classes[0]="mord":_==="mbin"&&sB.has(b)&&(C.classes[0]="mord")},{node:d},g,y),Q1(a,(C,w)=>{var b,_,x=eg(w),S=eg(C),k=x&&S?C.hasClass("mtight")?(b=iB[x])==null?void 0:b[S]:(_=rB[x])==null?void 0:_[S]:null;if(k)return bS(k,h)},{node:d},g,y),a},Q1=function(t,n,r,i,a){i&&t.push(i);for(var c=0;cg=>{t.splice(d+1,0,g),c++})(c)}i&&t.pop()},wS=function(t){return t instanceof kl||t instanceof dd||t instanceof El&&t.hasClass("enclosing")?t:null},J1=function(t,n){var r=wS(t);if(r){var i=r.children;if(i.length){if(n==="right")return J1(i[i.length-1],"right");if(n==="left")return J1(i[0],"left")}}return t},eg=function(t,n){if(!t)return null;n&&(t=J1(t,n));var r=t.classes[0];return lB[r]||null},Wc=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Te(n.concat(r))},Gt=function(t,n,r){if(!t)return Te();if(H0[t.type]){var i=H0[t.type](t,n);if(r&&n.size!==r.size){i=Te(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new De("Got group of unknown type: '"+t.type+"'")};function qh(e,t){var n=Te(["base"],e,t),r=Te(["strut"]);return r.style.height=Be(n.height+n.depth),n.depth&&(r.style.verticalAlign=Be(-n.depth)),n.children.unshift(r),n}function tg(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=Pn(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],c=[],l=0;l0&&(a.push(qh(c,t)),c=[]),a.push(r[l]));c.length>0&&a.push(qh(c,t));var h;n?(h=qh(Pn(n,t,!0),t),h.classes=["tag"],a.push(h)):i&&a.push(i);var m=Te(["katex-html"],a);if(m.setAttribute("aria-hidden","true"),h){var d=h.children[0];d.style.height=Be(m.height+m.depth),m.depth&&(d.style.verticalAlign=Be(-m.depth))}return m}function CS(e){return new kl(e)}class Re{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=aa(this.classes));for(var r=0;r0&&(t+=' class ="'+Jn(aa(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Ln{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Jn(this.toText())}toText(){return this.text}}class kS{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Be(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var cB=new Set(["\\imath","\\jmath"]),uB=new Set(["mrow","mtable"]),Jr=function(t,n,r){return fn[n][t]&&fn[n][t].replace&&t.charCodeAt(0)!==55349&&!(vS.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=fn[n][t].replace),new Ln(t)},bv=function(t){return t.length===1?t[0]:new Re("mrow",t)},hB={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"},_v=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=hB[n];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(cB.has(a))return null;if(fn[r][a]){var c=fn[r][a].replace;c&&(a=c)}var l=Z1[n].fontName;return gv(a,l,r)?Z1[n].variant:null};function Im(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Ln&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Ln&&n.text===","}else return!1}var Fr=function(t,n,r){if(t.length===1){var i=rn(t[0],n);return r&&i instanceof Re&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],c,l=0;l=1&&(c.type==="mn"||Im(c))){var h=u.children[0];h instanceof Re&&h.type==="mn"&&(h.children=[...c.children,...h.children],a.pop())}else if(c.type==="mi"&&c.children.length===1){var m=c.children[0];if(m instanceof Ln&&m.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var d=u.children[0];d instanceof Ln&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(u),c=u}return a},ca=function(t,n,r){return bv(Fr(t,n,r))},rn=function(t,n){if(!t)return new Re("mrow");if(F0[t.type])return F0[t.type](t,n);throw new De("Got group of unknown type: '"+t.type+"'")};function Z5(e,t,n,r,i){var a=Fr(e,n),c;a.length===1&&a[0]instanceof Re&&uB.has(a[0].type)?c=a[0]:c=new Re("mrow",a);var l=new Re("annotation",[new Ln(t)]);l.setAttribute("encoding","application/x-tex");var u=new Re("semantics",[c,l]),h=new Re("math",[u]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&h.setAttribute("display","block");var m=i?"katex":"katex-mathml";return Te([m],[h])}var dB=[[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]],Q5=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],J5=function(t,n){return n.size<2?t:dB[t-1][n.size-1]};class ls{constructor(t){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=t.style,this.color=t.color,this.size=t.size||ls.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Q5[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={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(n,t),new ls(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:J5(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Q5[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=J5(ls.BASESIZE,t);return this.size===n&&this.textSize===ls.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==ls.BASESIZE?["sizing","reset-size"+this.size,"size"+ls.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=XO(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}ls.BASESIZE=6;var ES=function(t){return new ls({style:t.displayMode?dt.DISPLAY:dt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},AS=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=Te(r,[t])}return t},fB=function(t,n,r){var i=ES(r),a;if(r.output==="mathml")return Z5(t,n,i,r.displayMode,!0);if(r.output==="html"){var c=tg(t,i);a=Te(["katex"],[c])}else{var l=Z5(t,n,i,r.displayMode,!1),u=tg(t,i);a=Te(["katex"],[l,u])}return AS(a,r)},pB=function(t,n,r){var i=ES(r),a=tg(t,i),c=Te(["katex"],[a]);return AS(c,r)},mB={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":"="},md=function(t){var n=new Re("mo",[new Ln(mB[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},gB={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]},vB=new Set(["widehat","widecheck","widetilde","utilde"]),gd=function(t,n){function r(){var l=4e5,u=t.label.slice(1);if(vB.has(u)&&"base"in t){var h=t.base.type==="ordgroup"?t.base.body.length:1,m,d,g;if(h>5)u==="widehat"||u==="widecheck"?(m=420,l=2364,g=.42,d=u+"4"):(m=312,l=2340,g=.34,d="tilde4");else{var y=[1,1,2,2,3,3][h];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][y],m=[0,239,300,360,420][y],g=[0,.24,.3,.3,.36,.42][y],d=u+y):(l=[0,600,1033,2339,2340][y],m=[0,260,286,306,312][y],g=[0,.26,.286,.3,.306,.34][y],d="tilde"+y)}var C=new oa(d),w=new ds([C],{width:"100%",height:Be(g),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:la([],[w],n),minWidth:0,height:g}}else{var b=[],_=gB[u];if(!_)throw new Error('No SVG data for "'+u+'".');var[x,S,k]=_,N=k/1e3,A=x.length,j,T;if(A===1){if(_.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');j=["hide-tail"],T=[_[3]]}else if(A===2)j=["halfarrow-left","halfarrow-right"],T=["xMinYMin","xMaxYMin"];else if(A===3)j=["brace-left","brace-center","brace-right"],T=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+A+" children.");for(var D=0;D0&&(i.style.minWidth=Be(a)),i},yB=function(t,n,r,i,a){var c,l=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(c=Te(["stretchy",n],[],a),n==="fbox"){var u=a.color&&a.getColor();u&&(c.style.borderColor=u)}}else{var h=[];/^[bx]cancel$/.test(n)&&h.push(new G1({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&h.push(new G1({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new ds(h,{width:"100%",height:Be(l)});c=la([],[m],a)}return c.height=l,c.style.height=Be(l),c},bB={bin:1,close:1,inner:1,open:1,punct:1,rel:1},_B={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function xB(e){return e in bB}function bt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function vd(e){var t=yd(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function yd(e){return e&&(e.type==="atom"||_B.hasOwnProperty(e.type))?e:null}var NS=e=>{if(e instanceof Br)return e;if(WO(e)&&e.children.length===1)return NS(e.children[0])},xv=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=bt(e.base,"accent"),n=r.base,e.base=n,i=VO(Gt(e,t)),e.base=r):(r=bt(e,"accent"),n=r.base);var a=Gt(n,t.havingCrampedStyle()),c=r.isShifty&&vs(n),l=0;if(c){var u,h;l=(u=(h=NS(a))==null?void 0:h.skew)!=null?u:0}var m=r.label==="\\c",d=m?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),g;if(r.isStretchy)g=gd(r,t),g=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Be(2*l)+")",marginLeft:Be(2*l)}:void 0}]});else{var y,C;r.label==="\\vec"?(y=xS("vec",t),C=_S.vec[1]):(y=pd({mode:r.mode,text:r.label},t,"textord"),y=GO(y),y.italic=0,C=y.width,m&&(d+=y.depth)),g=Te(["accent-body"],[y]);var w=r.label==="\\textcircled";w&&(g.classes.push("accent-full"),d=a.height);var b=l;w||(b-=C/2),g.style.left=Be(b),r.label==="\\textcircled"&&(g.style.top=".2em"),g=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:g}]})}var _=Te(["mord","accent"],[g],t);return i?(i.children[0]=_,i.height=Math.max(_.height,i.height),i.classes[0]="mord",i):_},TS=(e,t)=>{var n=e.isStretchy?md(e.label):new Re("mo",[Jr(e.label,e.mode)]),r=new Re("mover",[rn(e.base,t),n]);return r.setAttribute("accent","true"),r},SB=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));$e({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,t)=>{var n=P0(t[0]),r=!SB.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:xv,mathmlBuilder:TS});$e({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[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:n}},htmlBuilder:xv,mathmlBuilder:TS});$e({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Gt(e.base,t),r=gd(e,t),i=e.label==="\\utilde"?.12:0,a=Ut({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return Te(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=md(e.label),r=new Re("munder",[rn(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Gh=e=>{var t=new Re("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};$e({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,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=fl(Gt(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var c;e.below&&(r=t.havingStyle(n.sub()),c=fl(Gt(e.below,r,t),t),c.classes.push(a+"-arrow-pad"));var l=gd(e,t),u=-t.fontMetrics().axisHeight+.5*l.height,h=-t.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(h-=i.depth);var m;if(c){var d=-t.fontMetrics().axisHeight+c.height+.5*l.height+.111;m=Ut({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:d}]})}else m=Ut({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]}]});return Te(["mrel","x-arrow"],[m],t)},mathmlBuilder(e,t){var n=md(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=Gh(rn(e.body,t));if(e.below){var a=Gh(rn(e.below,t));r=new Re("munderover",[n,a,i])}else r=new Re("mover",[n,i])}else if(e.below){var c=Gh(rn(e.below,t));r=new Re("munder",[n,c])}else r=Gh(),r=new Re("mover",[n,r]);return r}});function MS(e,t){var n=Pn(e.body,t,!0);return Te([e.mclass],n,t)}function jS(e,t){var n,r=Fr(e.body,t);return e.mclass==="minner"?n=new Re("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new Re("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new Re("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}$e({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Rn(i),isCharacterBox:vs(i)}},htmlBuilder:MS,mathmlBuilder:jS});var bd=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};$e({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:bd(t[0]),body:Rn(t[1]),isCharacterBox:vs(t[1])}}});$e({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],c;r!=="\\stackrel"?c=bd(i):c="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Rn(i)},u={type:"supsub",mode:a.mode,base:l,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:c,body:[u],isCharacterBox:vs(u)}},htmlBuilder:MS,mathmlBuilder:jS});$e({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:bd(t[0]),body:Rn(t[0])}},htmlBuilder(e,t){var n=Pn(e.body,t,!0),r=Te([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Fr(e.body,t),r=new Re("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var wB={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},e_=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),t_=e=>e.type==="textord"&&e.text==="@",CB=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function kB(e,t,n){var r=wB[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},c=n.callFunction("\\Big",[a],[]),l=n.callFunction("\\\\cdright",[t[1]],[]),u={type:"ordgroup",mode:"math",body:[i,c,l]};return n.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function EB(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new De("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;aAV".includes(h))for(var d=0;d<2;d++){for(var g=!0,y=u+1;yAV=|." after @',c[u]);var C=kB(h,m,e),w={type:"styling",body:[C],mode:"math",style:"display",resetFont:!0};r.push(w),l=e_()}a%2===0?r.push(l):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var b=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:b,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}$e({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=fl(Gt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Be(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Re("mrow",[rn(e.label,t)]);return n=new Re("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Re("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});$e({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=fl(Gt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Re("mrow",[rn(e.fragment,t)])}});$e({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=bt(t[0],"ordgroup"),i=r.body,a="",c=0;c=1114111)throw new De("\\@char with invalid code point "+a);return u<=65535?h=String.fromCharCode(u):(u-=65536,h=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:n.mode,text:h}}});var DS=(e,t)=>{var n=Pn(e.body,t.withColor(e.color),!1);return bs(n)},RS=(e,t)=>{var n=Fr(e.body,t.withColor(e.color)),r=new Re("mstyle",n);return r.setAttribute("mathcolor",e.color),r};$e({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=bt(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:Rn(i)}},htmlBuilder:DS,mathmlBuilder:RS});$e({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=bt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:DS,mathmlBuilder:RS});$e({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&bt(i,"size").value}},htmlBuilder(e,t){var n=Te(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Be(yn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Re("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Be(yn(e.size,t)))),n}});var ng={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},LS=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new De("Expected a control sequence",e);return t},AB=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},OS=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};$e({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(ng[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=ng[r.text]),bt(t.parseFunction(),"internal");throw new De("Invalid token after macro prefix",r)}});$e({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new De("Expected a control sequence",r);for(var a=0,c,l=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),l[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new De('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new De('Argument number "'+r.text+'" out of order');a++,l.push([])}else{if(r.text==="EOF")throw new De("Expected a macro definition");l[a].push(r.text)}var{tokens:u}=t.gullet.consumeArg();return c&&u.unshift(c),(n==="\\edef"||n==="\\xdef")&&(u=t.gullet.expandTokens(u),u.reverse()),t.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:l},n===ng[n]),{type:"internal",mode:t.mode}}});$e({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=LS(t.gullet.popToken());t.gullet.consumeSpaces();var i=AB(t);return OS(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});$e({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=LS(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return OS(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var Mc=function(t,n,r){var i=fn.math[t]&&fn.math[t].replace,a=gv(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},Sv=function(t,n,r,i){var a=r.havingBaseStyle(n),c=Te(i.concat(a.sizingClasses(r)),[t],r),l=a.sizeMultiplier/r.sizeMultiplier;return c.height*=l,c.depth*=l,c.maxFontSize=a.sizeMultiplier,c},BS=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Be(a),t.height-=a,t.depth+=a},NB=function(t,n,r,i,a,c){var l=rr(t,"Main-Regular",a,i),u=Sv(l,n,i,c);return BS(u,i,n),u},TB=function(t,n,r,i){return rr(t,"Size"+n+"-Regular",r,i)},zS=function(t,n,r,i,a,c){var l=TB(t,n,a,i),u=Sv(Te(["delimsizing","size"+n],[l],i),dt.TEXT,i,c);return r&&BS(u,i,dt.TEXT),u},Hm=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Te(["delimsizinginner",i],[Te([],[rr(t,n,r)])]);return{type:"elem",elem:a}},Fm=function(t,n,r){var i=Ai["Size4-Regular"][t.charCodeAt(0)]?Ai["Size4-Regular"][t.charCodeAt(0)][4]:Ai["Size1-Regular"][t.charCodeAt(0)][4],a=new oa("inner",IO(t,Math.round(1e3*n))),c=new ds([a],{width:Be(i),height:Be(n),style:"width:"+Be(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=la([],[c],r);return l.height=n,l.style.height=Be(n),l.style.width=Be(i),{type:"elem",elem:l}},rg=.008,Vh={type:"kern",size:-1*rg},MB=new Set(["|","\\lvert","\\rvert","\\vert"]),jB=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),IS=function(t,n,r,i,a,c){var l,u,h,m,d="",g=0;l=h=m=t,u=null;var y="Size1-Regular";t==="\\uparrow"?h=m="⏐":t==="\\Uparrow"?h=m="‖":t==="\\downarrow"?l=h="⏐":t==="\\Downarrow"?l=h="‖":t==="\\updownarrow"?(l="\\uparrow",h="⏐",m="\\downarrow"):t==="\\Updownarrow"?(l="\\Uparrow",h="‖",m="\\Downarrow"):MB.has(t)?(h="∣",d="vert",g=333):jB.has(t)?(h="∥",d="doublevert",g=556):t==="["||t==="\\lbrack"?(l="⎡",h="⎢",m="⎣",y="Size4-Regular",d="lbrack",g=667):t==="]"||t==="\\rbrack"?(l="⎤",h="⎥",m="⎦",y="Size4-Regular",d="rbrack",g=667):t==="\\lfloor"||t==="⌊"?(h=l="⎢",m="⎣",y="Size4-Regular",d="lfloor",g=667):t==="\\lceil"||t==="⌈"?(l="⎡",h=m="⎢",y="Size4-Regular",d="lceil",g=667):t==="\\rfloor"||t==="⌋"?(h=l="⎥",m="⎦",y="Size4-Regular",d="rfloor",g=667):t==="\\rceil"||t==="⌉"?(l="⎤",h=m="⎥",y="Size4-Regular",d="rceil",g=667):t==="("||t==="\\lparen"?(l="⎛",h="⎜",m="⎝",y="Size4-Regular",d="lparen",g=875):t===")"||t==="\\rparen"?(l="⎞",h="⎟",m="⎠",y="Size4-Regular",d="rparen",g=875):t==="\\{"||t==="\\lbrace"?(l="⎧",u="⎨",m="⎩",h="⎪",y="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(l="⎫",u="⎬",m="⎭",h="⎪",y="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(l="⎧",m="⎩",h="⎪",y="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(l="⎫",m="⎭",h="⎪",y="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(l="⎧",m="⎭",h="⎪",y="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(l="⎫",m="⎩",h="⎪",y="Size4-Regular");var C=Mc(l,y,a),w=C.height+C.depth,b=Mc(h,y,a),_=b.height+b.depth,x=Mc(m,y,a),S=x.height+x.depth,k=0,N=1;if(u!==null){var A=Mc(u,y,a);k=A.height+A.depth,N=2}var j=w+S+k,T=Math.max(0,Math.ceil((n-j)/(N*_))),D=j+T*N*_,B=i.fontMetrics().axisHeight;r&&(B*=i.sizeMultiplier);var F=D/2-B,G=[];if(d.length>0){var U=D-w-S,$=Math.round(D*1e3),K=HO(d,Math.round(U*1e3)),W=new oa(d,K),Z=Be(g/1e3),ee=Be($/1e3),z=new ds([W],{width:Z,height:ee,viewBox:"0 0 "+g+" "+$}),L=la([],[z],i);L.height=$/1e3,L.style.width=Z,L.style.height=ee,G.push({type:"elem",elem:L})}else{if(G.push(Hm(m,y,a)),G.push(Vh),u===null){var I=D-w-S+2*rg;G.push(Fm(h,I,i))}else{var Y=(D-w-S-k)/2+2*rg;G.push(Fm(h,Y,i)),G.push(Vh),G.push(Hm(u,y,a)),G.push(Vh),G.push(Fm(h,Y,i))}G.push(Vh),G.push(Hm(l,y,a))}var q=i.havingBaseStyle(dt.TEXT),se=Ut({positionType:"bottom",positionData:F,children:G});return Sv(Te(["delimsizing","mult"],[se],q),dt.TEXT,i,c)},Pm=80,$m=.08,Um=function(t,n,r,i,a){var c=zO(t,i,r),l=new oa(t,c),u=new ds([l],{width:"400em",height:Be(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return la(["hide-tail"],[u],a)},DB=function(t,n){var r=n.havingBaseSizing(),i=US("\\surd",t*r.sizeMultiplier,$S,r),a=r.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,u,h,m,d;return i.type==="small"?(m=1e3+1e3*c+Pm,t<1?a=1:t<1.4&&(a=.7),u=(1+c+$m)/a,h=(1+c)/a,l=Um("sqrtMain",u,m,c,n),l.style.minWidth="0.853em",d=.833/a):i.type==="large"?(m=(1e3+Pm)*zc[i.size],h=(zc[i.size]+c)/a,u=(zc[i.size]+c+$m)/a,l=Um("sqrtSize"+i.size,u,m,c,n),l.style.minWidth="1.02em",d=1/a):(u=t+c+$m,h=t+c,m=Math.floor(1e3*t+c)+Pm,l=Um("sqrtTall",u,m,c,n),l.style.minWidth="0.742em",d=1.056),l.height=h,l.style.height=Be(u),{span:l,advanceWidth:d,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*a}},HS=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),RB=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),FS=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),zc=[0,1.2,1.8,2.4,3],PS=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),HS.has(t)||FS.has(t))return zS(t,n,!1,r,i,a);if(RB.has(t))return IS(t,zc[n],!1,r,i,a);throw new De("Illegal delimiter: '"+t+"'")},LB=[{type:"small",style:dt.SCRIPTSCRIPT},{type:"small",style:dt.SCRIPT},{type:"small",style:dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],OB=[{type:"small",style:dt.SCRIPTSCRIPT},{type:"small",style:dt.SCRIPT},{type:"small",style:dt.TEXT},{type:"stack"}],$S=[{type:"small",style:dt.SCRIPTSCRIPT},{type:"small",style:dt.SCRIPT},{type:"small",style:dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],BB=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},US=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),c=a;cn)return l}return r[r.length-1]},ig=function(t,n,r,i,a,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var l;FS.has(t)?l=LB:HS.has(t)?l=$S:l=OB;var u=US(t,n,l,i);return u.type==="small"?NB(t,u.style,r,i,a,c):u.type==="large"?zS(t,u.size,r,i,a,c):IS(t,n,r,i,a,c)},qm=function(t,n,r,i,a,c){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,h=5/i.fontMetrics().ptPerEm,m=Math.max(n-l,r+l),d=Math.max(m/500*u,2*m-h);return ig(t,d,!0,i,a,c)},n_={"\\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}},zB=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 r_(e){return"isMiddle"in e}function _d(e,t){var n=yd(e);if(n&&zB.has(n.text))return n;throw n?new De("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new De("Invalid delimiter type '"+e.type+"'",e)}$e({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,t)=>{var n=_d(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:n_[e.funcName].size,mclass:n_[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Te([e.mclass]):PS(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Jr(e.delim,e.mode));var n=new Re("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Be(zc[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function i_(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}$e({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new De("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:_d(t[0],e).text,color:n}}});$e({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=_d(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=bt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{i_(e);for(var n=Pn(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,c=0;c{i_(e);var n=Fr(e.body,t);if(e.left!=="."){var r=new Re("mo",[Jr(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new Re("mo",[Jr(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return bv(n)}});$e({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=_d(t[0],e);if(!e.parser.leftrightDepth)throw new De("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Wc(t,[]):(n=PS(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Jr("|","text"):Jr(e.delim,e.mode),r=new Re("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var xd=(e,t)=>{var n=fl(Gt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,c,l=vs(e.body);if(r==="sout")a=Te(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,c=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var u=yn({number:.6,unit:"pt"},t),h=yn({number:.35,unit:"ex"},t),m=t.havingBaseSizing();i=i/m.sizeMultiplier;var d=n.height+n.depth+u+h;n.style.paddingLeft=Be(d/2+u);var g=Math.floor(1e3*d*i),y=OO(g),C=new ds([new oa("phase",y)],{width:"400em",height:Be(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});a=la(["hide-tail"],[C],t),a.style.height=Be(d),c=n.depth+u+h}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var w,b,_=0;/box/.test(r)?(_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),w=t.fontMetrics().fboxsep+(r==="colorbox"?0:_),b=w):r==="angl"?(_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),w=4*_,b=Math.max(0,.25-n.depth)):(w=l?.2:0,b=w),a=yB(n,r,w,b,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=Be(_)):r==="angl"&&_!==.049&&(a.style.borderTopWidth=Be(_),a.style.borderRightWidth=Be(_)),c=n.depth+b,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var x;if(e.backgroundColor)x=Ut({positionType:"individualShift",children:[{type:"elem",elem:a,shift:c},{type:"elem",elem:n,shift:0}]});else{var S=/cancel|phase/.test(r)?["svg-align"]:[];x=Ut({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:c,wrapperClasses:S}]})}return/cancel/.test(r)&&(x.height=n.height,x.depth=n.depth),/cancel/.test(r)&&!l?Te(["mord","cancel-lap"],[x],t):Te(["mord"],[x],t)},Sd=(e,t)=>{var n,r=new Re(e.label.includes("colorbox")?"mpadded":"menclose",[rn(e.body,t)]);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(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+Be(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};$e({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=bt(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:c}},htmlBuilder:xd,mathmlBuilder:Sd});$e({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=bt(t[0],"color-token").color,c=bt(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:c,borderColor:a,body:l}},htmlBuilder:xd,mathmlBuilder:Sd});$e({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});$e({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:xd,mathmlBuilder:Sd});$e({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:xd,mathmlBuilder:Sd});$e({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var qS={};function Di(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:c}=e,l={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u{var t=e.parser.settings;if(!t.displayMode)throw new De("{"+e.envName+"} can be used only in display mode.")},IB=new Set(["gather","gather*"]);function wv(e){if(!e.includes("ed"))return!e.includes("*")}function fa(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:c,colSeparationType:l,autoTag:u,singleRow:h,emptySingleRow:m,maxNumCols:d,leqno:g}=t;if(e.gullet.beginGroup(),h||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var y=e.gullet.expandMacroAsText("\\arraystretch");if(y==null)c=1;else if(c=parseFloat(y),!c||c<0)throw new De("Invalid \\arraystretch: "+y)}e.gullet.beginGroup();var C=[],w=[C],b=[],_=[],x=u!=null?[]:void 0;function S(){u&&e.gullet.macros.set("\\@eqnsw","1",!0)}function k(){x&&(e.gullet.macros.get("\\df@tag")?(x.push(e.subparse([new ci("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!u&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(S(),_.push(s_(e));;){var N=e.parseExpression(!1,h?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var A={type:"ordgroup",mode:e.mode,body:N};n&&(A={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[A]}),C.push(A);var j=e.fetch().text;if(j==="&"){if(d&&C.length===d){if(h||l)throw new De("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(j==="\\end"){k(),C.length===1&&A.type==="styling"&&A.body.length===1&&A.body[0].type==="ordgroup"&&A.body[0].body.length===0&&(w.length>1||!m)&&w.pop(),_.length0&&(S+=.25),h.push({pos:S,isDashed:He[Ke]})}for(k(c[0]),r=0;r0&&(F+=x,jHe))for(r=0;r=l)){var re=void 0;if(i>0||t.hskipBeforeAndAfter){var oe,_e;re=(oe=(_e=q)==null?void 0:_e.pregap)!=null?oe:g,re!==0&&(K=Te(["arraycolsep"],[]),K.style.width=Be(re),$.push(K))}var ye=[];for(r=0;r0){for(var Ft=dl("hline",n,m),an=dl("hdashline",n,m),wt=[{type:"elem",elem:Rt,shift:0}];h.length>0;){var Je=h.pop(),pt=Je.pos-G;Je.isDashed?wt.push({type:"elem",elem:an,shift:pt}):wt.push({type:"elem",elem:Ft,shift:pt})}Rt=Ut({positionType:"individualShift",children:wt})}if(Z.length===0)return Te(["mord"],[Rt],n);var be=Ut({positionType:"individualShift",children:Z}),Ae=Te(["tag"],[be],n);return bs([Rt,Ae])},HB={c:"center ",l:"left ",r:"right "},Li=function(t,n){for(var r=[],i=new Re("mtd",[],["mtr-glue"]),a=new Re("mtd",[],["mml-eqn-num"]),c=0;c0){var C=t.cols,w="",b=!1,_=0,x=C.length;C[0].type==="separator"&&(g+="top ",_=1),C[C.length-1].type==="separator"&&(g+="bottom ",x-=1);for(var S=_;S0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var B=1;B0&&y&&(b=1),r[C]={type:"align",align:w,pregap:b,postgap:0}}return c.colSeparationType=y?"align":"alignat",c};Di({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=yd(t[0]),r=n?[t[0]]:bt(t[0],"ordgroup").body,i=r.map(function(c){var l=vd(c),u=l.text;if("lcr".includes(u))return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new De("Unknown column alignment: "+u,c)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return fa(e.parser,a,Cv(e.envName))},htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new De("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=fa(e.parser,r,Cv(e.envName)),c=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=fa(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=yd(t[0]),r=n?[t[0]]:bt(t[0],"ordgroup").body,i=r.map(function(l){var u=vd(l),h=u.text;if("lc".includes(h))return{type:"align",align:h};throw new De("Unknown column alignment: "+h,l)});if(i.length>1)throw new De("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},c=fa(e.parser,a,"script");if(c.body.length>0&&c.body[0].length>1)throw new De("{subarray} can contain only one column");return c},htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=fa(e.parser,t,Cv(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:WS,htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){IB.has(e.envName)&&wd(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:wv(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return fa(e.parser,t,"display")},htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:WS,htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){wd(e);var t={autoTag:wv(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return fa(e.parser,t,"display")},htmlBuilder:Ri,mathmlBuilder:Li});Di({type:"array",names:["CD"],props:{numArgs:0},handler(e){return wd(e),EB(e.parser)},htmlBuilder:Ri,mathmlBuilder:Li});J("\\nonumber","\\gdef\\@eqnsw{0}");J("\\notag","\\nonumber");$e({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new De(e.funcName+" valid only within array environment")}});var a_=qS;$e({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new De("Invalid environment name",i);for(var a="",c=0;c{var n=e.font,r=t.withFont(n);return Gt(e.body,r)},XS=(e,t)=>{var n=e.font,r=t.withFont(n);return rn(e.body,r)},o_={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};$e({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=P0(t[0]),a=r;return a in o_&&(a=o_[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:YS,mathmlBuilder:XS});$e({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:bd(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:vs(r)}}});$e({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,c=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:YS,mathmlBuilder:XS});var FB=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var c=Gt(e.numer,a,t);if(e.continued){var l=8.5/t.fontMetrics().ptPerEm,u=3.5/t.fontMetrics().ptPerEm;c.height=c.height0?C=3*g:C=7*g,w=t.fontMetrics().denom1):(d>0?(y=t.fontMetrics().num2,C=g):(y=t.fontMetrics().num3,C=3*g),w=t.fontMetrics().denom2);var b;if(m){var x=t.fontMetrics().axisHeight;y-c.depth-(x+.5*d){var n=new Re("mfrac",[rn(e.numer,t),rn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=yn(e.barSize,t);n.setAttribute("linethickness",Be(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Re("mo",[new Ln(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),e.rightDelim!=null){var c=new Re("mo",[new Ln(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),i.push(c)}return bv(i)}return n},KS=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};$e({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],c,l=null,u=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,l="(",u=")";break;case"\\\\bracefrac":c=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":c=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}var h=r==="\\cfrac",m=null;return h||r.startsWith("\\d")?m="display":r.startsWith("\\t")&&(m="text"),KS({type:"genfrac",mode:n.mode,numer:i,denom:a,continued:h,hasBarLine:c,leftDelim:l,rightDelim:u,barSize:null},m)},htmlBuilder:FB,mathmlBuilder:PB});$e({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var l_=["display","text","script","scriptscript"],c_=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};$e({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=P0(t[0]),c=a.type==="atom"&&a.family==="open"?c_(a.text):null,l=P0(t[1]),u=l.type==="atom"&&l.family==="close"?c_(l.text):null,h=bt(t[2],"size"),m,d=null;h.isBlank?m=!0:(d=h.value,m=d.number>0);var g=null,y=t[3];if(y.type==="ordgroup"){if(y.body.length>0){var C=bt(y.body[0],"textord");g=l_[Number(C.text)]}}else y=bt(y,"textord"),g=l_[Number(y.text)];return KS({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:m,barSize:d,leftDelim:c,rightDelim:u},g)}});$e({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:bt(t[0],"size").value,token:i}}});$e({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=bt(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var c=t[2],l=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:c,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null}}});var ZS=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?Gt(e.sup,t.havingStyle(n.sup()),t):Gt(e.sub,t.havingStyle(n.sub()),t),i=bt(e.base,"horizBrace")):i=bt(e,"horizBrace");var a=Gt(i.base,t.havingBaseStyle(dt.DISPLAY)),c=gd(i,t),l;if(i.isOver?l=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):l=Ut({positionType:"bottom",positionData:a.depth+.1+c.height,children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var u=Te(["minner",i.isOver?"mover":"munder"],[l],t);i.isOver?l=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]}):l=Ut({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]})}return Te(["minner",i.isOver?"mover":"munder"],[l],t)},$B=(e,t)=>{var n=md(e.label);return new Re(e.isOver?"mover":"munder",[rn(e.base,t),n])};$e({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:ZS,mathmlBuilder:$B});$e({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=bt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:Rn(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Pn(e.body,t,!1);return tB(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=ca(e.body,t);return n instanceof Re||(n=new Re("mrow",[n])),n.setAttribute("href",e.href),n}});$e({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=bt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=bt(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(r){case"\\htmlClass":u.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var h=a.split(","),m=0;m{var n=Pn(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Te(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>ca(e.body,t)});$e({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Rn(t[0]),mathml:Rn(t[1])}},htmlBuilder:(e,t)=>{var n=Pn(e.html,t,!1);return bs(n)},mathmlBuilder:(e,t)=>ca(e.mathml,t)});var Gm=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new De("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!fS(r))throw new De("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};$e({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},c={number:0,unit:"em"},l="";if(n[0])for(var u=bt(n[0],"raw").string,h=u.split(","),m=0;m{var n=yn(e.height,t),r=0;e.totalheight.number>0&&(r=yn(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=yn(e.width,t));var a={height:Be(n+r)};i>0&&(a.width=Be(i)),r>0&&(a.verticalAlign=Be(-r));var c=new UO(e.src,e.alt,a);return c.height=n,c.depth=r,c},mathmlBuilder:(e,t)=>{var n=new Re("mglyph",[]);n.setAttribute("alt",e.alt);var r=yn(e.height,t),i=0;if(e.totalheight.number>0&&(i=yn(e.totalheight,t)-r,n.setAttribute("valign",Be(-i))),n.setAttribute("height",Be(r+i)),e.width.number>0){var a=yn(e.width,t);n.setAttribute("width",Be(a))}return n.setAttribute("src",e.src),n}});$e({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=bt(t[0],"size");if(n.settings.strict){var a=r[1]==="m",c=i.value.unit==="mu";a?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return bS(e.dimension,t)},mathmlBuilder(e,t){var n=yn(e.dimension,t);return new kS(n)}});$e({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Te([],[Gt(e.body,t)]),n=Te(["inner"],[n],t)):n=Te(["inner"],[Gt(e.body,t)]);var r=Te(["fix"],[]),i=Te([e.alignment],[n,r],t),a=Te(["strut"]);return a.style.height=Be(i.height+i.depth),i.depth&&(a.style.verticalAlign=Be(-i.depth)),i.children.unshift(a),i=Te(["thinbox"],[i],t),Te(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Re("mpadded",[rn(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});$e({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",c=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:c}}});$e({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new De("Mismatched "+e.funcName)}});var u_=(e,t)=>{switch(t.style.size){case dt.DISPLAY.size:return e.display;case dt.TEXT.size:return e.text;case dt.SCRIPT.size:return e.script;case dt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};$e({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Rn(t[0]),text:Rn(t[1]),script:Rn(t[2]),scriptscript:Rn(t[3])}},htmlBuilder:(e,t)=>{var n=u_(e,t),r=Pn(n,t,!1);return bs(r)},mathmlBuilder:(e,t)=>{var n=u_(e,t);return ca(n,t)}});var QS=(e,t,n,r,i,a,c)=>{e=Te([],[e]);var l=n&&vs(n),u,h;if(t){var m=Gt(t,r.havingStyle(i.sup()),r);h={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-m.depth)}}if(n){var d=Gt(n,r.havingStyle(i.sub()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var g;if(h&&u){var y=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+e.depth+c;g=Ut({positionType:"bottom",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Be(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(u){var C=e.height-c;g=Ut({positionType:"top",positionData:C,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Be(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e}]})}else if(h){var w=e.depth+c;g=Ut({positionType:"bottom",positionData:w,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var b=[g];if(u&&a!==0&&!l){var _=Te(["mspace"],[],r);_.style.marginRight=Be(a),b.unshift(_)}return Te(["mop","op-limits"],b,r)},JS=new Set(["\\smallint"]),Nl=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=bt(e.base,"op"),i=!0):a=bt(e,"op");var c=t.style,l=!1;c.size===dt.DISPLAY.size&&a.symbol&&!JS.has(a.name)&&(l=!0);var u,h;if(a.symbol){var m=l?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),u=rr(a.name,m,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),h=u.italic,d.length>0){var g=xS(d+"Size"+(l?"2":"1"),t);u=Ut({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:g,shift:l?.08:0}]}),a.name="\\"+d,u.classes.unshift("mop"),u.italic=h}}else if(a.body){var y=Pn(a.body,t,!0);y.length===1&&y[0]instanceof Br?(u=y[0],u.classes[0]="mop"):u=Te(["mop"],y,t)}else{for(var C=[],w=1;w{var n;if(e.symbol)n=new Re("mo",[Jr(e.name,e.mode)]),JS.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Re("mo",Fr(e.body,t));else{n=new Re("mi",[new Ln(e.name.slice(1))]);var r=new Re("mo",[Jr("⁡","text")]);e.parentIsSupSub?n=new Re("mrow",[n,r]):n=CS([n,r])}return n},UB={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};$e({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=UB[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Nl,mathmlBuilder:gu});$e({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Rn(r)}},htmlBuilder:Nl,mathmlBuilder:gu});var qB={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};$e({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:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Nl,mathmlBuilder:gu});$e({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Nl,mathmlBuilder:gu});$e({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=qB[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Nl,mathmlBuilder:gu});var ew=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=bt(e.base,"operatorname"),i=!0):a=bt(e,"operatorname");var c;if(a.body.length>0){for(var l=a.body.map(d=>{var g="text"in d?d.text:void 0;return typeof g=="string"?{type:"textord",mode:d.mode,text:g}:d}),u=Pn(l,t.withFont("mathrm"),!0),h=0;h{for(var n=Fr(e.body,t.withFont("mathrm")),r=!0,i=0;im.toText()).join("");n=[new Ln(l)]}var u=new Re("mi",n);u.setAttribute("mathvariant","normal");var h=new Re("mo",[Jr("⁡","text")]);return e.parentIsSupSub?new Re("mrow",[u,h]):CS([u,h])};$e({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:Rn(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:ew,mathmlBuilder:GB});J("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");so({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?bs(Pn(e.body,t,!1)):Te(["mord"],Pn(e.body,t,!0),t)},mathmlBuilder(e,t){return ca(e.body,t,!0)}});$e({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Gt(e.body,t.havingCrampedStyle()),r=dl("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return Te(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new Re("mo",[new Ln("‾")]);n.setAttribute("stretchy","true");var r=new Re("mover",[rn(e.body,t),n]);return r.setAttribute("accent","true"),r}});$e({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Rn(r)}},htmlBuilder:(e,t)=>{var n=Pn(e.body,t.withPhantom(),!1);return bs(n)},mathmlBuilder:(e,t)=>{var n=Fr(e.body,t);return new Re("mphantom",n)}});J("\\hphantom","\\smash{\\phantom{#1}}");$e({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Te(["inner"],[Gt(e.body,t.withPhantom())]),r=Te(["fix"],[]);return Te(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Fr(Rn(e.body),t),r=new Re("mphantom",n),i=new Re("mpadded",[r]);return i.setAttribute("width","0px"),i}});$e({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=bt(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Gt(e.body,t),r=yn(e.dy,t);return Ut({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Re("mpadded",[rn(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});$e({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});$e({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=bt(t[0],"size"),c=bt(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&bt(i,"size").value,width:a.value,height:c.value}},htmlBuilder(e,t){var n=Te(["mord","rule"],[],t),r=yn(e.width,t),i=yn(e.height,t),a=e.shift?yn(e.shift,t):0;return n.style.borderRightWidth=Be(r),n.style.borderTopWidth=Be(i),n.style.bottom=Be(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=yn(e.width,t),r=yn(e.height,t),i=e.shift?yn(e.shift,t):0,a=t.color&&t.getColor()||"black",c=new Re("mspace");c.setAttribute("mathbackground",a),c.setAttribute("width",Be(n)),c.setAttribute("height",Be(r));var l=new Re("mpadded",[c]);return i>=0?l.setAttribute("height",Be(i)):(l.setAttribute("height",Be(i)),l.setAttribute("depth",Be(-i))),l.setAttribute("voffset",Be(i)),l}});function tw(e,t,n){for(var r=Pn(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=t.havingSize(e.size);return tw(e.body,n,t)};$e({type:"sizing",names:h_,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:h_.indexOf(r)+1,body:a}},htmlBuilder:VB,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Fr(e.body,n),i=new Re("mstyle",r);return i.setAttribute("mathsize",Be(n.sizeMultiplier)),i}});$e({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,c=n[0]&&bt(n[0],"ordgroup");if(c)for(var l,u=0;u{var n=Te([],[Gt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Te(["mord","smash"],[n],t);if(n.children)for(var r=0;r{var n=new Re("mpadded",[rn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});$e({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Gt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=fl(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.idn.height+n.depth+c&&(c=(c+d-n.height-n.depth)/2);var g=u.height-n.height-c-h;n.style.paddingLeft=Be(m);var y=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:h}]});if(e.index){var C=t.havingStyle(dt.SCRIPTSCRIPT),w=Gt(e.index,C,t),b=.6*(y.height-y.depth),_=Ut({positionType:"shift",positionData:-b,children:[{type:"elem",elem:w}]}),x=Te(["root"],[_]);return Te(["mord","sqrt"],[x,y],t)}else return Te(["mord","sqrt"],[y],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Re("mroot",[rn(n,t),rn(r,t)]):new Re("msqrt",[rn(n,t)])}});var sg={display:dt.DISPLAY,text:dt.TEXT,script:dt.SCRIPT,scriptscript:dt.SCRIPTSCRIPT};function WB(e){return e in sg}$e({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),c=r.slice(1,r.length-5);if(!WB(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:i.mode,style:c,body:a}},htmlBuilder(e,t){var n=sg[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),tw(e.body,r,t)},mathmlBuilder(e,t){var n=sg[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=Fr(e.body,r),a=new Re("mstyle",i),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=c[e.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});var YB=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===dt.DISPLAY.size||r.alwaysHandleSupSub);return i?Nl:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===dt.DISPLAY.size||r.limits);return a?ew:null}else{if(r.type==="accent")return vs(r.base)?xv:null;if(r.type==="horizBrace"){var c=!t.sub;return c===r.isOver?ZS:null}else return null}else return null};so({type:"supsub",htmlBuilder(e,t){var n=YB(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,c=Gt(r,t),l,u,h=t.fontMetrics(),m=0,d=0,g=r&&vs(r);if(i){var y=t.havingStyle(t.style.sup());l=Gt(i,y,t),g||(m=c.height-y.fontMetrics().supDrop*y.sizeMultiplier/t.sizeMultiplier)}if(a){var C=t.havingStyle(t.style.sub());u=Gt(a,C,t),g||(d=c.depth+C.fontMetrics().subDrop*C.sizeMultiplier/t.sizeMultiplier)}var w;t.style===dt.DISPLAY?w=h.sup1:t.style.cramped?w=h.sup3:w=h.sup2;var b=t.sizeMultiplier,_=Be(.5/h.ptPerEm/b),x=null;if(u){var S=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof Br||S){var k;x=Be(-((k=c.italic)!=null?k:0))}}var N;if(l&&u){m=Math.max(m,w,l.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var A=h.defaultRuleThickness,j=4*A;if(m-l.depth-(u.height-d)0&&(m+=T,d-=T)}var D=[{type:"elem",elem:u,shift:d,marginRight:_,marginLeft:x},{type:"elem",elem:l,shift:-m,marginRight:_}];N=Ut({positionType:"individualShift",children:D})}else if(u){d=Math.max(d,h.sub1,u.height-.8*h.xHeight);var B=[{type:"elem",elem:u,marginLeft:x,marginRight:_}];N=Ut({positionType:"shift",positionData:d,children:B})}else if(l)m=Math.max(m,w,l.depth+.25*h.xHeight),N=Ut({positionType:"shift",positionData:-m,children:[{type:"elem",elem:l,marginRight:_}]});else throw new Error("supsub must have either sup or sub.");var F=eg(c,"right")||"mord";return Te([F],[c,Te(["msupsub"],[N])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[rn(e.base,t)];e.sub&&a.push(rn(e.sub,t)),e.sup&&a.push(rn(e.sup,t));var c;if(n)c=r?"mover":"munder";else if(e.sub)if(e.sup){var h=e.base;h&&h.type==="op"&&h.limits&&t.style===dt.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(t.style===dt.DISPLAY||h.limits)?c="munderover":c="msubsup"}else{var u=e.base;u&&u.type==="op"&&u.limits&&(t.style===dt.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||t.style===dt.DISPLAY)?c="munder":c="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===dt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===dt.DISPLAY)?c="mover":c="msup"}return new Re(c,a)}});so({type:"atom",htmlBuilder(e,t){return vv(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Re("mo",[Jr(e.text,e.mode)]);if(e.family==="bin"){var r=_v(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var nw={mi:"italic",mn:"normal",mtext:"normal"};so({type:"mathord",htmlBuilder(e,t){return pd(e,t,"mathord")},mathmlBuilder(e,t){var n=new Re("mi",[Jr(e.text,e.mode,t)]),r=_v(e,t)||"italic";return r!==nw[n.type]&&n.setAttribute("mathvariant",r),n}});so({type:"textord",htmlBuilder(e,t){return pd(e,t,"textord")},mathmlBuilder(e,t){var n=Jr(e.text,e.mode,t),r=_v(e,t)||"normal",i;return e.mode==="text"?i=new Re("mtext",[n]):/[0-9]/.test(e.text)?i=new Re("mn",[n]):e.text==="\\prime"?i=new Re("mo",[n]):i=new Re("mi",[n]),r!==nw[i.type]&&i.setAttribute("mathvariant",r),i}});var Vm={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Wm={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};so({type:"spacing",htmlBuilder(e,t){if(Wm.hasOwnProperty(e.text)){var n=Wm[e.text].className||"";if(e.mode==="text"){var r=pd(e,t,"textord");return r.classes.push(n),r}else return Te(["mspace",n],[vv(e.text,e.mode,t)],t)}else{if(Vm.hasOwnProperty(e.text))return Te(["mspace",Vm[e.text]],[],t);throw new De('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Wm.hasOwnProperty(e.text))n=new Re("mtext",[new Ln(" ")]);else{if(Vm.hasOwnProperty(e.text))return new Re("mspace");throw new De('Unknown type of space "'+e.text+'"')}return n}});var d_=()=>{var e=new Re("mtd",[]);return e.setAttribute("width","50%"),e};so({type:"tag",mathmlBuilder(e,t){var n=new Re("mtable",[new Re("mtr",[d_(),new Re("mtd",[ca(e.body,t)]),d_(),new Re("mtd",[ca(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var f_={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},p_={"\\textbf":"textbf","\\textmd":"textmd"},XB={"\\textit":"textit","\\textup":"textup"},m_=(e,t)=>{var n=e.font;if(n){if(f_[n])return t.withTextFontFamily(f_[n]);if(p_[n])return t.withTextFontWeight(p_[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(XB[n])};$e({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:Rn(i),font:r}},htmlBuilder(e,t){var n=m_(e,t),r=Pn(e.body,n,!0);return Te(["mord","text"],r,n)},mathmlBuilder(e,t){var n=m_(e,t);return ca(e.body,n)}});$e({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Gt(e.body,t),r=dl("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Ut({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return Te(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new Re("mo",[new Ln("‾")]);n.setAttribute("stretchy","true");var r=new Re("munder",[rn(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});$e({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Gt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Ut({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Re("mpadded",[rn(e.body,t)],["vcenter"]);return new Re("mrow",[n])}});$e({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new De("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=g_(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),ra=SS,rw=`[ \r - ]`,KB="\\\\[a-zA-Z@]+",ZB="\\\\[^\uD800-\uDFFF]",QB="("+KB+")"+rw+"*",JB=`\\\\( -|[ \r ]+ -?)[ \r ]*`,ag="[̀-ͯ]",ez=new RegExp(ag+"+$"),tz="("+rw+"+)|"+(JB+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(ag+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ag+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+QB)+("|"+ZB+")");class v_{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(tz,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new ci("EOF",new yr(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new De("Unexpected character: '"+t[n]+"'",new ci(t[n],new yr(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.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=a+1,this.lex()}return new ci(i,new yr(this,n,this.tokenRegex.lastIndex))}}class nz{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new De("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var rz=GS;J("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});J("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});J("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});J("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});J("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});J("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");J("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var y_={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};J("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new De("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=y_[t.text],r==null||r>=n)throw new De("Invalid base-"+n+" digit "+t.text);for(var i;(i=y_[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new De("\\newcommand's first argument must be a macro name");var a=i[0].text,c=e.isDefined(a);if(c&&!t)throw new De("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!c&&!n)throw new De("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var l=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var u="",h=e.expandNextToken();h.text!=="]"&&h.text!=="EOF";)u+=h.text,h=e.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new De("Invalid number of arguments: "+u);l=parseInt(u),i=e.consumeArg().tokens}return c&&r||e.macros.set(a,{tokens:i,numArgs:l}),""};J("\\newcommand",e=>kv(e,!1,!0,!1));J("\\renewcommand",e=>kv(e,!0,!1,!1));J("\\providecommand",e=>kv(e,!0,!0,!0));J("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});J("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});J("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),ra[n],fn.math[n],fn.text[n]),""});J("\\bgroup","{");J("\\egroup","}");J("~","\\nobreakspace");J("\\lq","`");J("\\rq","'");J("\\aa","\\r a");J("\\AA","\\r A");J("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");J("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");J("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");J("ℬ","\\mathscr{B}");J("ℰ","\\mathscr{E}");J("ℱ","\\mathscr{F}");J("ℋ","\\mathscr{H}");J("ℐ","\\mathscr{I}");J("ℒ","\\mathscr{L}");J("ℳ","\\mathscr{M}");J("ℛ","\\mathscr{R}");J("ℭ","\\mathfrak{C}");J("ℌ","\\mathfrak{H}");J("ℨ","\\mathfrak{Z}");J("\\Bbbk","\\Bbb{k}");J("\\llap","\\mathllap{\\textrm{#1}}");J("\\rlap","\\mathrlap{\\textrm{#1}}");J("\\clap","\\mathclap{\\textrm{#1}}");J("\\mathstrut","\\vphantom{(}");J("\\underbar","\\underline{\\text{#1}}");J("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');J("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");J("\\ne","\\neq");J("≠","\\neq");J("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");J("∉","\\notin");J("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");J("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");J("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");J("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");J("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");J("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");J("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");J("⟂","\\perp");J("‼","\\mathclose{!\\mkern-0.8mu!}");J("∌","\\notni");J("⌜","\\ulcorner");J("⌝","\\urcorner");J("⌞","\\llcorner");J("⌟","\\lrcorner");J("©","\\copyright");J("®","\\textregistered");J("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');J("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');J("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');J("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');J("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");J("⋮","\\vdots");J("\\varGamma","\\mathit{\\Gamma}");J("\\varDelta","\\mathit{\\Delta}");J("\\varTheta","\\mathit{\\Theta}");J("\\varLambda","\\mathit{\\Lambda}");J("\\varXi","\\mathit{\\Xi}");J("\\varPi","\\mathit{\\Pi}");J("\\varSigma","\\mathit{\\Sigma}");J("\\varUpsilon","\\mathit{\\Upsilon}");J("\\varPhi","\\mathit{\\Phi}");J("\\varPsi","\\mathit{\\Psi}");J("\\varOmega","\\mathit{\\Omega}");J("\\substack","\\begin{subarray}{c}#1\\end{subarray}");J("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");J("\\boxed","\\fbox{$\\displaystyle{#1}$}");J("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");J("\\implies","\\DOTSB\\;\\Longrightarrow\\;");J("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");J("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");J("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var b_={",":"\\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"},iz=new Set(["bin","rel"]);J("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in b_?t=b_[n]:(n.slice(0,4)==="\\not"||n in fn.math&&iz.has(fn.math[n].group))&&(t="\\dotsb"),t});var Ev={")":!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};J("\\dotso",function(e){var t=e.future().text;return t in Ev?"\\ldots\\,":"\\ldots"});J("\\dotsc",function(e){var t=e.future().text;return t in Ev&&t!==","?"\\ldots\\,":"\\ldots"});J("\\cdots",function(e){var t=e.future().text;return t in Ev?"\\@cdots\\,":"\\@cdots"});J("\\dotsb","\\cdots");J("\\dotsm","\\cdots");J("\\dotsi","\\!\\cdots");J("\\dotsx","\\ldots\\,");J("\\DOTSI","\\relax");J("\\DOTSB","\\relax");J("\\DOTSX","\\relax");J("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");J("\\,","\\tmspace+{3mu}{.1667em}");J("\\thinspace","\\,");J("\\>","\\mskip{4mu}");J("\\:","\\tmspace+{4mu}{.2222em}");J("\\medspace","\\:");J("\\;","\\tmspace+{5mu}{.2777em}");J("\\thickspace","\\;");J("\\!","\\tmspace-{3mu}{.1667em}");J("\\negthinspace","\\!");J("\\negmedspace","\\tmspace-{4mu}{.2222em}");J("\\negthickspace","\\tmspace-{5mu}{.277em}");J("\\enspace","\\kern.5em ");J("\\enskip","\\hskip.5em\\relax");J("\\quad","\\hskip1em\\relax");J("\\qquad","\\hskip2em\\relax");J("\\tag","\\@ifstar\\tag@literal\\tag@paren");J("\\tag@paren","\\tag@literal{({#1})}");J("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new De("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});J("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");J("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");J("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");J("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");J("\\newline","\\\\\\relax");J("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var iw=Be(Ai["Main-Regular"][84][1]-.7*Ai["Main-Regular"][65][1]);J("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+iw+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");J("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+iw+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");J("\\hspace","\\@ifstar\\@hspacer\\@hspace");J("\\@hspace","\\hskip #1\\relax");J("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");J("\\ordinarycolon",":");J("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");J("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');J("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');J("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');J("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');J("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');J("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');J("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');J("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');J("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');J("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');J("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');J("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');J("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');J("∷","\\dblcolon");J("∹","\\eqcolon");J("≔","\\coloneqq");J("≕","\\eqqcolon");J("⩴","\\Coloneqq");J("\\ratio","\\vcentcolon");J("\\coloncolon","\\dblcolon");J("\\colonequals","\\coloneqq");J("\\coloncolonequals","\\Coloneqq");J("\\equalscolon","\\eqqcolon");J("\\equalscoloncolon","\\Eqqcolon");J("\\colonminus","\\coloneq");J("\\coloncolonminus","\\Coloneq");J("\\minuscolon","\\eqcolon");J("\\minuscoloncolon","\\Eqcolon");J("\\coloncolonapprox","\\Colonapprox");J("\\coloncolonsim","\\Colonsim");J("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");J("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");J("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");J("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");J("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");J("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");J("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");J("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");J("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");J("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");J("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");J("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");J("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");J("\\nleqq","\\html@mathml{\\@nleqq}{≰}");J("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");J("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");J("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");J("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");J("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");J("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");J("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");J("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");J("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");J("\\imath","\\html@mathml{\\@imath}{ı}");J("\\jmath","\\html@mathml{\\@jmath}{ȷ}");J("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");J("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");J("⟦","\\llbracket");J("⟧","\\rrbracket");J("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");J("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");J("⦃","\\lBrace");J("⦄","\\rBrace");J("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");J("⦵","\\minuso");J("\\darr","\\downarrow");J("\\dArr","\\Downarrow");J("\\Darr","\\Downarrow");J("\\lang","\\langle");J("\\rang","\\rangle");J("\\uarr","\\uparrow");J("\\uArr","\\Uparrow");J("\\Uarr","\\Uparrow");J("\\N","\\mathbb{N}");J("\\R","\\mathbb{R}");J("\\Z","\\mathbb{Z}");J("\\alef","\\aleph");J("\\alefsym","\\aleph");J("\\Alpha","\\mathrm{A}");J("\\Beta","\\mathrm{B}");J("\\bull","\\bullet");J("\\Chi","\\mathrm{X}");J("\\clubs","\\clubsuit");J("\\cnums","\\mathbb{C}");J("\\Complex","\\mathbb{C}");J("\\Dagger","\\ddagger");J("\\diamonds","\\diamondsuit");J("\\empty","\\emptyset");J("\\Epsilon","\\mathrm{E}");J("\\Eta","\\mathrm{H}");J("\\exist","\\exists");J("\\harr","\\leftrightarrow");J("\\hArr","\\Leftrightarrow");J("\\Harr","\\Leftrightarrow");J("\\hearts","\\heartsuit");J("\\image","\\Im");J("\\infin","\\infty");J("\\Iota","\\mathrm{I}");J("\\isin","\\in");J("\\Kappa","\\mathrm{K}");J("\\larr","\\leftarrow");J("\\lArr","\\Leftarrow");J("\\Larr","\\Leftarrow");J("\\lrarr","\\leftrightarrow");J("\\lrArr","\\Leftrightarrow");J("\\Lrarr","\\Leftrightarrow");J("\\Mu","\\mathrm{M}");J("\\natnums","\\mathbb{N}");J("\\Nu","\\mathrm{N}");J("\\Omicron","\\mathrm{O}");J("\\plusmn","\\pm");J("\\rarr","\\rightarrow");J("\\rArr","\\Rightarrow");J("\\Rarr","\\Rightarrow");J("\\real","\\Re");J("\\reals","\\mathbb{R}");J("\\Reals","\\mathbb{R}");J("\\Rho","\\mathrm{P}");J("\\sdot","\\cdot");J("\\sect","\\S");J("\\spades","\\spadesuit");J("\\sub","\\subset");J("\\sube","\\subseteq");J("\\supe","\\supseteq");J("\\Tau","\\mathrm{T}");J("\\thetasym","\\vartheta");J("\\weierp","\\wp");J("\\Zeta","\\mathrm{Z}");J("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");J("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");J("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");J("\\bra","\\mathinner{\\langle{#1}|}");J("\\ket","\\mathinner{|{#1}\\rangle}");J("\\braket","\\mathinner{\\langle{#1}\\rangle}");J("\\Bra","\\left\\langle#1\\right|");J("\\Ket","\\left|#1\\right\\rangle");var sw=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,c=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();var u=d=>g=>{e&&(g.macros.set("|",c),i.length&&g.macros.set("\\|",l));var y=d;if(!d&&i.length){var C=g.future();C.text==="|"&&(g.popToken(),y=!0)}return{tokens:y?i:r,numArgs:0}};t.macros.set("|",u(!1)),i.length&&t.macros.set("\\|",u(!0));var h=t.consumeArg().tokens,m=t.expandTokens([...a,...h,...n]);return t.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};J("\\bra@ket",sw(!1));J("\\bra@set",sw(!0));J("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");J("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");J("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");J("\\angln","{\\angl n}");J("\\blue","\\textcolor{##6495ed}{#1}");J("\\orange","\\textcolor{##ffa500}{#1}");J("\\pink","\\textcolor{##ff00af}{#1}");J("\\red","\\textcolor{##df0030}{#1}");J("\\green","\\textcolor{##28ae7b}{#1}");J("\\gray","\\textcolor{gray}{#1}");J("\\purple","\\textcolor{##9d38bd}{#1}");J("\\blueA","\\textcolor{##ccfaff}{#1}");J("\\blueB","\\textcolor{##80f6ff}{#1}");J("\\blueC","\\textcolor{##63d9ea}{#1}");J("\\blueD","\\textcolor{##11accd}{#1}");J("\\blueE","\\textcolor{##0c7f99}{#1}");J("\\tealA","\\textcolor{##94fff5}{#1}");J("\\tealB","\\textcolor{##26edd5}{#1}");J("\\tealC","\\textcolor{##01d1c1}{#1}");J("\\tealD","\\textcolor{##01a995}{#1}");J("\\tealE","\\textcolor{##208170}{#1}");J("\\greenA","\\textcolor{##b6ffb0}{#1}");J("\\greenB","\\textcolor{##8af281}{#1}");J("\\greenC","\\textcolor{##74cf70}{#1}");J("\\greenD","\\textcolor{##1fab54}{#1}");J("\\greenE","\\textcolor{##0d923f}{#1}");J("\\goldA","\\textcolor{##ffd0a9}{#1}");J("\\goldB","\\textcolor{##ffbb71}{#1}");J("\\goldC","\\textcolor{##ff9c39}{#1}");J("\\goldD","\\textcolor{##e07d10}{#1}");J("\\goldE","\\textcolor{##a75a05}{#1}");J("\\redA","\\textcolor{##fca9a9}{#1}");J("\\redB","\\textcolor{##ff8482}{#1}");J("\\redC","\\textcolor{##f9685d}{#1}");J("\\redD","\\textcolor{##e84d39}{#1}");J("\\redE","\\textcolor{##bc2612}{#1}");J("\\maroonA","\\textcolor{##ffbde0}{#1}");J("\\maroonB","\\textcolor{##ff92c6}{#1}");J("\\maroonC","\\textcolor{##ed5fa6}{#1}");J("\\maroonD","\\textcolor{##ca337c}{#1}");J("\\maroonE","\\textcolor{##9e034e}{#1}");J("\\purpleA","\\textcolor{##ddd7ff}{#1}");J("\\purpleB","\\textcolor{##c6b9fc}{#1}");J("\\purpleC","\\textcolor{##aa87ff}{#1}");J("\\purpleD","\\textcolor{##7854ab}{#1}");J("\\purpleE","\\textcolor{##543b78}{#1}");J("\\mintA","\\textcolor{##f5f9e8}{#1}");J("\\mintB","\\textcolor{##edf2df}{#1}");J("\\mintC","\\textcolor{##e0e5cc}{#1}");J("\\grayA","\\textcolor{##f6f7f7}{#1}");J("\\grayB","\\textcolor{##f0f1f2}{#1}");J("\\grayC","\\textcolor{##e3e5e6}{#1}");J("\\grayD","\\textcolor{##d6d8da}{#1}");J("\\grayE","\\textcolor{##babec2}{#1}");J("\\grayF","\\textcolor{##888d93}{#1}");J("\\grayG","\\textcolor{##626569}{#1}");J("\\grayH","\\textcolor{##3b3e40}{#1}");J("\\grayI","\\textcolor{##21242c}{#1}");J("\\kaBlue","\\textcolor{##314453}{#1}");J("\\kaGreen","\\textcolor{##71B307}{#1}");var aw={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class sz{constructor(t,n,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=n,this.expansionCount=0,this.feed(t),this.macros=new nz(rz,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new v_(t,this.settings)}switchMode(t){this.mode=t}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(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new ci("EOF",r.loc)),this.pushTokens(i),new ci("",yr.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,c=0,l=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++c;else if(a.text==="}"){if(--c,c===-1)throw new De("Extra }",a)}else if(a.text==="EOF")throw new De("Unexpected end of input in a macro argument, expected '"+(t&&r?t[l]:"}")+"'",a);if(t&&r)if((c===0||c===1&&t[l]==="{")&&a.text===t[l]){if(++l,l===t.length){n.splice(-l,l);break}}else l=0}while(c!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new De("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new De("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new De("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,c=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var u=a[l];if(u.text==="#"){if(l===0)throw new De("Incomplete placeholder at end of macro body",u);if(u=a[--l],u.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(u.text))a.splice(l,2,...c[+u.text-1]);else throw new De("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new ci(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var c=i.replace(/##/g,"");c.includes("#"+(a+1));)++a;for(var l=new v_(i,this.settings),u=[],h=l.lex();h.text!=="EOF";)u.push(h),h=l.lex();u.reverse();var m={tokens:u,numArgs:a};return m}return i}isDefined(t){return this.macros.has(t)||ra.hasOwnProperty(t)||fn.math.hasOwnProperty(t)||fn.text.hasOwnProperty(t)||aw.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:ra.hasOwnProperty(t)&&!ra[t].primitive}}var __=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Wh=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ym={"́":{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"}},x_={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Cd{constructor(t,n){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 sz(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new De("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new ci("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Cd.endOfExpression.has(i.text)||n&&i.text===n||t&&ra[i.text]&&ra[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=128)this.settings.strict&&(dS(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:yr.range(t),text:n};else return null;if(this.consume(),a)for(var m=0;m0?{type:"text",value:A}:void 0),A===!1?g.lastIndex=k+1:(C!==k&&x.push({type:"text",value:h.value.slice(C,k)}),Array.isArray(A)?x.push(...A):A&&x.push(A),C=k+S[0].length,_=!0),!g.global)break;S=g.exec(h.value)}return _?(C?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=w_(e,"(");let a=w_(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function uw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ya(n)||ld(n))&&(!t||n!==47)}hw.peek=Iz;function Mz(){this.buffer()}function jz(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Dz(){this.buffer()}function Rz(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Lz(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=li(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Oz(e){this.exit(e)}function Bz(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=li(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zz(e){this.exit(e)}function Iz(){return"["}function hw(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const c=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),c(),a+=i.move("]"),a}function Hz(){return{enter:{gfmFootnoteCallString:Mz,gfmFootnoteCall:jz,gfmFootnoteDefinitionLabelString:Dz,gfmFootnoteDefinition:Rz},exit:{gfmFootnoteCallString:Lz,gfmFootnoteCall:Oz,gfmFootnoteDefinitionLabelString:Bz,gfmFootnoteDefinition:zz}}}function Fz(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:hw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,c){const l=a.createTracker(c);let u=l.move("[^");const h=a.enter("footnoteDefinition"),m=a.enter("label");return u+=l.move(a.safe(a.associationId(r),{before:u,after:"]"})),m(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?` -`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?dw:Pz))),h(),u}}function Pz(e,t,n){return t===0?e:dw(e,t,n)}function dw(e,t,n){return(n?"":" ")+e}const $z=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fw.peek=Wz;function Uz(){return{canContainEols:["delete"],enter:{strikethrough:Gz},exit:{strikethrough:Vz}}}function qz(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$z}],handlers:{delete:fw}}}function Gz(e){this.enter({type:"delete",children:[]},e)}function Vz(e){this.exit(e)}function fw(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let c=i.move("~~");return c+=n.containerPhrasing(e,{...i.current(),before:c,after:"~"}),c+=i.move("~~"),a(),c}function Wz(){return"~"}function Yz(e){return e.length}function Xz(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Yz,a=[],c=[],l=[],u=[];let h=0,m=-1;for(;++mh&&(h=e[m].length);++_u[_])&&(u[_]=S)}w.push(x)}c[m]=w,l[m]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++du[d]&&(u[d]=x),y[d]=x),g[d]=S}c.splice(1,0,g),l.splice(1,0,y),m=-1;const C=[];for(;++m "),a.shift(2);const c=n.indentLines(n.containerFlow(e,a.current()),Qz);return i(),c}function Qz(e,t,n){return">"+(n?"":" ")+e}function Jz(e,t){return k_(e,t.inConstruct,!0)&&!k_(e,t.notInConstruct,!1)}function k_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rc&&(c=a):a=1,i=r+t.length,r=n.indexOf(t,i);return c}function eI(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function tI(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function nI(e,t,n,r){const i=tI(n),a=e.value||"",c=i==="`"?"GraveAccent":"Tilde";if(eI(e,n)){const d=n.enter("codeIndented"),g=n.indentLines(a,rI);return d(),g}const l=n.createTracker(r),u=i.repeat(Math.max(pw(a,i)+1,3)),h=n.enter("codeFenced");let m=l.move(u);if(e.lang){const d=n.enter(`codeFencedLang${c}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${c}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:` -`,encode:["`"],...l.current()})),d()}return m+=l.move(` -`),a&&(m+=l.move(a+` -`)),m+=l.move(u),h(),m}function rI(e,t,n){return(n?"":" ")+e}function Tv(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function iI(e,t,n,r){const i=Tv(n),a=i==='"'?"Quote":"Apostrophe",c=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("[");return h+=u.move(n.safe(n.associationId(e),{before:h,after:"]",...u.current()})),h+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(l=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":` -`,...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),h+=u.move(" "+i),h+=u.move(n.safe(e.title,{before:h,after:i,...u.current()})),h+=u.move(i),l()),c(),h}function sI(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Yc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $0(e,t,n){const r=ul(e),i=ul(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}mw.peek=aI;function mw(e,t,n,r){const i=sI(n),a=n.enter("emphasis"),c=n.createTracker(r),l=c.move(i);let u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()}));const h=u.charCodeAt(0),m=$0(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(u=Yc(h)+u.slice(1));const d=u.charCodeAt(u.length-1),g=$0(r.after.charCodeAt(0),d,i);g.inside&&(u=u.slice(0,-1)+Yc(d));const y=c.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+y}function aI(e,t,n){return n.options.emphasis||"*"}function oI(e,t){let n=!1;return uv(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,B1}),!!((!e.depth||e.depth<3)&&rv(e)&&(t.options.setext||n))}function lI(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(oI(e,n)){const m=n.enter("headingSetext"),d=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:` -`,after:` -`});return d(),m(),g+` -`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` -`))+1))}const c="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");a.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:` -`,...a.current()});return/^[\t ]/.test(h)&&(h=Yc(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),u(),l(),h}gw.peek=cI;function gw(e){return e.value||""}function cI(){return"<"}vw.peek=uI;function vw(e,t,n,r){const i=Tv(n),a=i==='"'?"Quote":"Apostrophe",c=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("![");return h+=u.move(n.safe(e.alt,{before:h,after:"]",...u.current()})),h+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(l=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),h+=u.move(" "+i),h+=u.move(n.safe(e.title,{before:h,after:i,...u.current()})),h+=u.move(i),l()),h+=u.move(")"),c(),h}function uI(){return"!"}yw.peek=hI;function yw(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let c=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const h=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(h+"]["),c();const m=n.stack;n.stack=[],c=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return c(),n.stack=m,a(),i==="full"||!h||h!==d?u+=l.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function hI(){return"!"}bw.peek=dI;function bw(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}xw.peek=fI;function xw(e,t,n,r){const i=Tv(n),a=i==='"'?"Quote":"Apostrophe",c=n.createTracker(r);let l,u;if(_w(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let d=c.move("<");return d+=c.move(n.containerPhrasing(e,{before:d,after:">",...c.current()})),d+=c.move(">"),l(),n.stack=m,d}l=n.enter("link"),u=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(u=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=c.move(" "+i),h+=c.move(n.safe(e.title,{before:h,after:i,...c.current()})),h+=c.move(i),u()),h+=c.move(")"),l(),h}function fI(e,t,n){return _w(e,n)?"<":"["}Sw.peek=pI;function Sw(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let c=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const h=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(h+"]["),c();const m=n.stack;n.stack=[],c=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return c(),n.stack=m,a(),i==="full"||!h||h!==d?u+=l.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function pI(){return"["}function Mv(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function mI(e){const t=Mv(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gI(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ww(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vI(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let c=e.ordered?gI(n):Mv(n);const l=e.ordered?c==="."?")":".":mI(n);let u=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),ww(n)===c&&m){let d=-1;for(;++d-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let c=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(c-a.length)),l.shift(c);const u=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,l.current()),m);return u(),h;function m(d,g,y){return g?(y?"":" ".repeat(c))+d:(y?a:a+" ".repeat(c-a.length))+d}}function _I(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),c=n.containerPhrasing(e,r);return a(),i(),c}const xI=fu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SI(e,t,n,r){return(e.children.some(function(c){return xI(c)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wI(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Cw.peek=CI;function Cw(e,t,n,r){const i=wI(n),a=n.enter("strong"),c=n.createTracker(r),l=c.move(i+i);let u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()}));const h=u.charCodeAt(0),m=$0(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(u=Yc(h)+u.slice(1));const d=u.charCodeAt(u.length-1),g=$0(r.after.charCodeAt(0),d,i);g.inside&&(u=u.slice(0,-1)+Yc(d));const y=c.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+y}function CI(e,t,n){return n.options.strong||"*"}function kI(e,t,n,r){return n.safe(e.value,r)}function EI(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function AI(e,t,n){const r=(ww(n)+(n.options.ruleSpaces?" ":"")).repeat(EI(n));return n.options.ruleSpaces?r.slice(0,-1):r}const kw={blockquote:Zz,break:E_,code:nI,definition:iI,emphasis:mw,hardBreak:E_,heading:lI,html:gw,image:vw,imageReference:yw,inlineCode:bw,link:xw,linkReference:Sw,list:vI,listItem:bI,paragraph:_I,root:SI,strong:Cw,text:kI,thematicBreak:AI};function NI(){return{enter:{table:TI,tableData:A_,tableHeader:A_,tableRow:jI},exit:{codeText:DI,table:MI,tableData:Qm,tableHeader:Qm,tableRow:Qm}}}function TI(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function MI(e){this.exit(e),this.data.inTable=void 0}function jI(e){this.enter({type:"tableRow",children:[]},e)}function Qm(e){this.exit(e)}function A_(e){this.enter({type:"tableCell",children:[]},e)}function DI(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RI));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RI(e,t){return t==="|"?t:e}function LI(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:c,tableCell:u,tableRow:l}};function c(y,C,w,b){return h(m(y,w,b),y.align)}function l(y,C,w,b){const _=d(y,w,b),x=h([_]);return x.slice(0,x.indexOf(` -`))}function u(y,C,w,b){const _=w.enter("tableCell"),x=w.enter("phrasing"),S=w.containerPhrasing(y,{...b,before:a,after:a});return x(),_(),S}function h(y,C){return Xz(y,{align:C,alignDelimiters:r,padding:n,stringLength:i})}function m(y,C,w){const b=y.children;let _=-1;const x=[],S=C.enter("table");for(;++_0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const QI={tokenize:aH,partial:!0};function JI(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rH,continuation:{tokenize:iH},exit:sH}},text:{91:{name:"gfmFootnoteCall",tokenize:nH},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eH,resolveTo:tH}}}}function eH(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){c=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!c||!c._balanced)return n(u);const h=li(r.sliceSerialize({start:c.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function tH(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",c,t],["exit",c,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function nH(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,c;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(d){if(a>999||d===93&&!c||d===null||d===91||nn(d))return n(d);if(d===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(li(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return nn(d)||(c=!0),a++,e.consume(d),d===92?m:h}function m(d){return d===91||d===92||d===93?(e.consume(d),a++,h):h(d)}}function rH(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,c=0,l;return u;function u(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(C)}function m(C){if(c>999||C===93&&!l||C===null||C===91||nn(C))return n(C);if(C===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=li(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return nn(C)||(l=!0),c++,e.consume(C),C===92?d:m}function d(C){return C===91||C===92||C===93?(e.consume(C),c++,m):m(C)}function g(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),i.includes(a)||i.push(a),St(e,y,"gfmFootnoteDefinitionWhitespace")):n(C)}function y(C){return t(C)}}function iH(e,t,n){return e.check(du,t,e.attempt(QI,t,n))}function sH(e){e.exit("gfmFootnoteDefinition")}function aH(e,t,n){const r=this;return St(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(a):n(a)}}function oH(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(c,l){let u=-1;for(;++u1?u(C):(c.consume(C),d++,y);if(d<2&&!n)return u(C);const b=c.exit("strikethroughSequenceTemporary"),_=ul(C);return b._open=!_||_===2&&!!w,b._close=!w||w===2&&!!_,l(C)}}}class lH{constructor(){this.map=[]}add(t,n,r){cH(this,t,n,r)}consume(t){if(this.map.sort(function(a,c){return a[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function cH(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const $=r.events[F][1].type;if($==="lineEnding"||$==="linePrefix")F--;else break}const G=F>-1?r.events[F][1].type:null,U=G==="tableHead"||G==="tableRow"?A:u;return U===A&&r.parser.lazy[r.now().line]?n(B):U(B)}function u(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(c=!0,a+=1),m(B)}function m(B){return B===null?n(B):Ye(B)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),y):n(B):Et(B)?St(e,m,"whitespace")(B):(a+=1,c&&(c=!1,i+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),c=!0,m):(e.enter("data"),d(B)))}function d(B){return B===null||B===124||nn(B)?(e.exit("data"),m(B)):(e.consume(B),B===92?g:d)}function g(B){return B===92||B===124?(e.consume(B),d):d(B)}function y(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),c=!1,Et(B)?St(e,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):C(B))}function C(B){return B===45||B===58?b(B):B===124?(c=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),w):N(B)}function w(B){return Et(B)?St(e,b,"whitespace")(B):b(B)}function b(B){return B===58?(a+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),_):B===45?(a+=1,_(B)):B===null||Ye(B)?k(B):N(B)}function _(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):N(B)}function x(B){return B===45?(e.consume(B),x):B===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(B))}function S(B){return Et(B)?St(e,k,"whitespace")(B):k(B)}function k(B){return B===124?C(B):B===null||Ye(B)?!c||i!==a?N(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):N(B)}function N(B){return n(B)}function A(B){return e.enter("tableRow"),j(B)}function j(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),j):B===null||Ye(B)?(e.exit("tableRow"),t(B)):Et(B)?St(e,j,"whitespace")(B):(e.enter("data"),T(B))}function T(B){return B===null||B===124||nn(B)?(e.exit("data"),j(B)):(e.consume(B),B===92?D:T)}function D(B){return B===92||B===124?(e.consume(B),T):T(B)}}function fH(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],c=[0,0,0,0],l=!1,u=0,h,m,d;const g=new lH;for(;++nn[2]+1){const C=n[2]+1,w=n[3]-n[2]-1;e.add(C,w,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(a.end=Object.assign({},Zo(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function T_(e,t,n,r,i){const a=[],c=Zo(t.events,n);i&&(i.end=Object.assign({},c),a.push(["exit",i,t])),r.end=Object.assign({},c),a.push(["exit",r,t]),e.add(n+1,0,a)}function Zo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const pH={name:"tasklistCheck",tokenize:gH};function mH(){return{text:{91:pH}}}function gH(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return nn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),c):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),c):n(u)}function c(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return Ye(u)?t(u):Et(u)?e.check({tokenize:vH},t,n)(u):n(u)}}function vH(e,t,n){return St(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function yH(e){return B7([UI(),JI(),oH(e),hH(),mH()])}const bH={};function Lw(e){const t=this,n=e||bH,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(yH(n)),a.push(HI()),c.push(FI(n))}function _H(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:c,mathTextData:l}};function e(u){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},u)}function t(){this.buffer()}function n(){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(u){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=h;const d=m.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function a(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function c(u){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=h,m.data.hChildren.push({type:"text",value:h})}function l(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function xH(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(a,c,l,u){const h=a.value||"",m=l.createTracker(u),d="$".repeat(Math.max(pw(h,"$")+1,2)),g=l.enter("mathFlow");let y=m.move(d);if(a.meta){const C=l.enter("mathFlowMeta");y+=m.move(l.safe(a.meta,{after:` -`,before:y,encode:["$"],...m.current()})),C()}return y+=m.move(` -`),h&&(y+=m.move(h+` -`)),y+=m.move(d),g(),y}function r(a,c,l){let u=a.value||"",h=1;for(t||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(u);)h++;const m="$".repeat(h);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let d=-1;for(;++d]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}vu.displayName="c";vu.aliases=[];function vu(e){e.register(Bi),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}kd.displayName="cpp";kd.aliases=[];function kd(e){e.register(vu),(function(t){var n=/\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 n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return n.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:n,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/}),t.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}}),t.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:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Dv.displayName="arduino";Dv.aliases=["ino"];function Dv(e){e.register(kd),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}Rv.displayName="bash";Rv.aliases=["sh","shell"];function Rv(e){(function(t){var n="\\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},i={bash:r,environment:{pattern:RegExp("\\$"+n),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("(\\{)"+n),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})/};t.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;|&]|[<>]\\()"+n),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:i},{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:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.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=t.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],c=i.variable[1].inside,l=0;l>/g,function(Y,q){return"(?:"+I[+q]+")"})}function r(L,I,Y){return RegExp(n(L,I),"")}function i(L,I){for(var Y=0;Y>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var a={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 c(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var l=c(a.typeDeclaration),u=RegExp(c(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),h=c(a.typeDeclaration+" "+a.contextual+" "+a.other),m=c(a.type+" "+a.typeDeclaration+" "+a.other),d=i(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),g=i(/\((?:[^()]|<>)*\)/.source,2),y=/@?\b[A-Za-z_]\w*\b/.source,C=n(/<<0>>(?:\s*<<1>>)?/.source,[y,d]),w=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[h,C]),b=/\[\s*(?:,\s*)*\]/.source,_=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[w,b]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,g,b]),S=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),k=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[S,w,b]),N={keyword:u,punctuation:/[<>()?,.:[\]]/},A=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,j=/"(?:\\.|[^\\"\r\n])*"/.source,T=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[w]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[y,k]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[y]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,C]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[w]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[y]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[_]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[k,m,y]),inside:N}],keyword:u,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:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[y]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[y]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[g]),lookbehind:!0,alias:"class-name",inside:N},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[k,w]),inside:N,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[k]),lookbehind:!0,inside:N,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[y,d]),inside:{function:r(/^<<0>>/.source,[y]),generic:{pattern:RegExp(d),alias:"class-name",inside:N}}},"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,[l,C,y,k,u.source,g,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[C,g]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(k),greedy:!0,inside:N},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=j+"|"+A,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),F=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),G=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[w,F]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[G,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[G]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[F]),inside:t.languages.csharp},"class-name":{pattern:RegExp(w),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var $=/:[^}\r\n]+/.source,K=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),W=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[K,$]),Z=i(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),ee=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,$]);function z(L,I){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[I,$]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[W]),lookbehind:!0,greedy:!0,inside:z(W,K)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[ee]),lookbehind:!0,greedy:!0,inside:z(ee,Z)}],char:{pattern:RegExp(A),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}yu.displayName="markup";yu.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function yu(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(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var i={};i["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:i}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var c={};c[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",c)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\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:[n,"language-"+n],inside:e.languages[n]},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}Tl.displayName="css";Tl.aliases=[];function Tl(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}Ov.displayName="diff";Ov.aliases=[];function Ov(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var i=n[r],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+i+`].*(?:\r -?| -|(?![\\s\\S])))+`,"m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}Bv.displayName="go";Bv.aliases=[];function Bv(e){e.register(Bi),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"]}zv.displayName="ini";zv.aliases=[];function zv(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:/=/}}Iv.displayName="java";Iv.aliases=[];function Iv(e){e.register(Bi),(function(t){var n=/\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,i={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:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[i,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:i.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:i.inside}],keyword:n,function:[t.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/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.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":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:i.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:i.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 n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}Hv.displayName="regex";Hv.aliases=[];function Hv(e){(function(t){var n={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]|.)/,i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},c="(?:[^\\\\-]|"+r.source+")",l=RegExp(c+"-"+c),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.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:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":a,escape:r}},"special-escape":n,"char-set":i,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],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}Fv.displayName="json";Fv.aliases=["webmanifest"];function Fv(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}Pv.displayName="kotlin";Pv.aliases=["kt","kts"];function Pv(e){e.register(Bi),(function(t){t.languages.kotlin=t.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 t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}$v.displayName="less";$v.aliases=[];function $v(e){e.register(Tl),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"}})}Uv.displayName="lua";Uv.aliases=[];function Uv(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:/[\[\](){},;]|\.+|:+/}}qv.displayName="makefile";qv.aliases=[];function qv(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:/[:;(){}]/}}Gv.displayName="yaml";Gv.aliases=["yml"];function Gv(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\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}),c=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(u,h){h=(h||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return u});return RegExp(m,h)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+a+"|"+c+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\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:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(c),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}Vv.displayName="markdown";Vv.aliases=["md"];function Vv(e){e.register(yu),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),c=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.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:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+c+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+c+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+c+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(i),alias:"important",inside:t.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(l){["url","bold","italic","strike","code-snippet"].forEach(function(u){l!==u&&(t.languages.markdown[l].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function u(h){if(!(!h||typeof h=="string"))for(var m=0,d=h.length;m]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}Yv.displayName="perl";Yv.aliases=[];function Yv(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.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,n].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,n].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,n+/\s*/.source+n].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)}Ad.displayName="markup-templating";Ad.aliases=[];function Ad(e){e.register(yu),(function(t){function n(r,i){return"___"+r.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,i,a,c){if(r.language===i){var l=r.tokenStack=[];r.code=r.code.replace(a,function(u){if(typeof c=="function"&&!c(u))return u;for(var h=l.length,m;r.code.indexOf(m=n(i,h))!==-1;)++h;return l[h]=u,m}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,i){if(r.language!==i||!r.tokenStack)return;r.grammar=t.languages[i];var a=0,c=Object.keys(r.tokenStack);function l(u){for(var h=0;h=c.length);h++){var m=u[h];if(typeof m=="string"||m.content&&typeof m.content=="string"){var d=c[a],g=r.tokenStack[d],y=typeof m=="string"?m:m.content,C=n(i,d),w=y.indexOf(C);if(w>-1){++a;var b=y.substring(0,w),_=new t.Token(i,t.tokenize(g,r.grammar),"language-"+i,g),x=y.substring(w+C.length),S=[];b&&S.push.apply(S,l([b])),S.push(_),x&&S.push.apply(S,l([x])),typeof m=="string"?u.splice.apply(u,[h,1].concat(S)):m.content=S}}else m.content&&l(m.content)}return u}l(r.tokens)}}})})(e)}Xv.displayName="php";Xv.aliases=[];function Xv(e){e.register(Ad),(function(t){var n=/\/\*[\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*\()/],i=/\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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,c=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,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:i,operator:a,punctuation:c};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},u=[{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:l}},{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:l}}];t.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:u,"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:i,operator:a,punctuation:c}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(h){if(/<\?/.test(h.code)){var m=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(h,"php",m)}}),t.hooks.add("after-tokenize",function(h){t.languages["markup-templating"].tokenizePlaceholders(h,"php")})})(e)}Kv.displayName="python";Kv.aliases=["py"];function Kv(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}Zv.displayName="r";Zv.aliases=[];function Zv(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:/[(){}\[\],;]/}}Qv.displayName="ruby";Qv.aliases=["rb"];function Qv(e){e.register(Bi),(function(t){t.languages.ruby=t.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:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.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("|")+")",i=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+i),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+i+/(?=:(?!:))/.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:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,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:n,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:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.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)/}),t.languages.rb=t.languages.ruby})(e)}Jv.displayName="rust";Jv.aliases=[];function Jv(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}e2.displayName="sass";e2.aliases=[];function e2(e){e.register(Tl),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.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)}t2.displayName="scss";t2.aliases=[];function t2(e){e.register(Tl),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}n2.displayName="sql";n2.aliases=[];function n2(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:/[;[\]()`,.]/}}r2.displayName="swift";r2.aliases=[];function r2(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(t){t.inside.interpolation.inside=e.languages.swift})}i2.displayName="typescript";i2.aliases=["ts"];function i2(e){e.register(Ed),(function(t){t.languages.typescript=t.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/}),t.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 t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.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:n}}}}),t.languages.ts=t.languages.typescript})(e)}Nd.displayName="basic";Nd.aliases=[];function Nd(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:/[,;:()]/}}s2.displayName="vbnet";s2.aliases=[];function s2(e){e.register(Nd),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 DH=["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"],j_={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 zw(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function RH(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function LH(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function D_(e){return LH(e)||zw(e)}const OH=["","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 BH(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let a=0,c=-1,l="",u,h;n.position&&("start"in n.position||"indent"in n.position?(h=n.position.indent,u=n.position.start):u=n.position);let m=(u?u.line:0)||1,d=(u?u.column:0)||1,g=C(),y;for(a--;++a<=e.length;)if(y===10&&(d=(h?h[c]:0)||1),y=e.charCodeAt(a),y===38){const _=e.charCodeAt(a+1);if(_===9||_===10||_===12||_===32||_===38||_===60||Number.isNaN(_)||r&&_===r){l+=String.fromCharCode(y),d++;continue}const x=a+1;let S=x,k=x,N;if(_===35){k=++S;const U=e.charCodeAt(k);U===88||U===120?(N="hexadecimal",k=++S):N="decimal"}else N="named";let A="",j="",T="";const D=N==="named"?D_:N==="decimal"?zw:RH;for(k--;++k<=e.length;){const U=e.charCodeAt(k);if(!D(U))break;T+=String.fromCharCode(U),N==="named"&&DH.includes(T)&&(A=T,j=Gc(T))}let B=e.charCodeAt(k)===59;if(B){k++;const U=N==="named"?Gc(T):!1;U&&(A=T,j=U)}let F=1+k-x,G="";if(!(!B&&n.nonTerminated===!1))if(!T)N!=="named"&&w(4,F);else if(N==="named"){if(B&&!j)w(5,1);else if(A!==T&&(k=S+A.length,F=1+k-S,B=!1),!B){const U=A?1:3;if(n.attribute){const $=e.charCodeAt(k);$===61?(w(U,F),j=""):D_($)?j="":w(U,F)}else w(U,F)}G=j}else{B||w(2,F);let U=Number.parseInt(T,N==="hexadecimal"?16:10);if(zH(U))w(7,F),G="�";else if(U in j_)w(6,F),G=j_[U];else{let $="";IH(U)&&w(6,F),U>65535&&(U-=65536,$+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),G=$+String.fromCharCode(U)}}if(G){b(),g=C(),a=k-1,d+=k-x+1,i.push(G);const U=C();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,G,{start:g,end:U},e.slice(x-1,k)),g=U}else T=e.slice(x-1,k),l+=T,d+=T.length,a=k-1}else y===10&&(m++,c++,d=0),Number.isNaN(y)?b():(l+=String.fromCharCode(y),d++);return i.join("");function C(){return{line:m,column:d,offset:a+((u?u.offset:0)||0)}}function w(_,x){let S;n.warning&&(S=C(),S.column+=x,S.offset+=x,n.warning.call(n.warningContext||void 0,OH[_],S,_))}function b(){l&&(i.push(l),n.text&&n.text.call(n.textContext||void 0,l,{start:g,end:C()}),l="")}}function zH(e){return e>=55296&&e<=57343||e>1114111}function IH(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 HH=0,Xh={},qn={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++HH}),e.__id},clone:function e(t,n){n=n||{};var r,i;switch(qn.util.type(t)){case"Object":if(i=qn.util.objId(t),n[i])return n[i];r={},n[i]=r;for(var a in t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=qn.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(c,l){r[l]=e(c,n)}),r);default:return t}}},languages:{plain:Xh,plaintext:Xh,text:Xh,txt:Xh,extend:function(e,t){var n=qn.util.clone(qn.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||qn.languages;var i=r[e],a={};for(var c in i)if(i.hasOwnProperty(c)){if(c==t)for(var l in n)n.hasOwnProperty(l)&&(a[l]=n[l]);n.hasOwnProperty(c)||(a[c]=i[c])}var u=r[e];return r[e]=a,qn.languages.DFS(qn.languages,function(h,m){m===u&&h!=e&&(this[h]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=qn.util.objId;for(var c in t)if(t.hasOwnProperty(c)){n.call(t,c,t[c],r||c);var l=t[c],u=qn.util.type(l);u==="Object"&&!i[a(l)]?(i[a(l)]=!0,e(l,n,null,i)):u==="Array"&&!i[a(l)]&&(i[a(l)]=!0,e(l,n,c,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(qn.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=qn.tokenize(r.code,r.grammar),qn.hooks.run("after-tokenize",r),Ic.stringify(qn.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new FH;return x0(i,i.head,e),Iw(e,i,t,i.head,0),$H(i)},hooks:{all:{},add:function(e,t){var n=qn.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=qn.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:Ic};function Ic(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function R_(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function Iw(e,t,n,r,i,a){for(var c in n)if(!(!n.hasOwnProperty(c)||!n[c])){var l=n[c];l=Array.isArray(l)?l:[l];for(var u=0;u=a.reach);_+=b.value.length,b=b.next){var x=b.value;if(t.length>e.length)return;if(!(x instanceof Ic)){var S=1,k;if(g){if(k=R_(w,_,e,d),!k||k.index>=e.length)break;var T=k.index,N=k.index+k[0].length,A=_;for(A+=b.value.length;T>=A;)b=b.next,A+=b.value.length;if(A-=b.value.length,_=A,b.value instanceof Ic)continue;for(var j=b;j!==t.tail&&(Aa.reach&&(a.reach=G);var U=b.prev;B&&(U=x0(t,U,B),_+=B.length),PH(t,U,S);var $=new Ic(c,m?qn.tokenize(D,m):D,y,D);if(b=x0(t,U,$),F&&x0(t,b,F),S>1){var K={cause:c+","+u,reach:G};Iw(e,t,n,b.prev,_,K),a&&K.reach>a.reach&&(a.reach=K.reach)}}}}}}function FH(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function x0(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function PH(e,t,n){for(var r=t.next,i=0;in)return e;try{return tt.highlight(e,t).children.map(Pw)}catch{return e}}const Uw=/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i,KH=/\.(mp4|webm|mov|m4v)$/i,ZH=/\.(mp3|ogg|wav|flac|m4a)$/i,QH=/\.(glb|gltf)$/i,JH=/\.(ply|spz|splat|ksplat)$/i,eF=/\.pdf$/i,tF=/\.(md|mdx|markdown)$/i;function a2(e){return Uw.test(e)?"image":KH.test(e)?"video":ZH.test(e)?"audio":QH.test(e)?"model":JH.test(e)?"splat":eF.test(e)?"pdf":null}const nF=1e5;function rF({code:e,lang:t}){const[n,r]=O.useState(!1),i=()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code",children:[f.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:i,children:n?f.jsx(Qr,{size:13}):f.jsx(Ug,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:$w(e,t,nF)})})]})}function iF(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function sF(e){const t=/]*?)\/?>/gi,n=[];let r=0,i=!1;for(const a of e.matchAll(t)){const c=iF(a[1]??"");c.path&&(i=!0,a.index>r&&n.push({type:"text",value:e.slice(r,a.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:c},type:"fileMention"}),r=a.index+a[0].length)}return i?(rqw(e)}function L_({path:e,lines:t,onOpenFile:n,fileSrc:r}){const i=e.split("/").pop()||e,a=a2(e),c=a&&r?r(e):null,[l,u]=O.useState(!1);if(c&&!l&&(a==="image"||a==="video"))return f.jsxs("span",{className:"chat-media",children:[f.jsx("button",{className:"chat-media-open",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:a==="image"?f.jsx("img",{src:c,alt:i,loading:"lazy",onError:()=>u(!0)}):f.jsx("video",{src:c,controls:!0,loop:!0,muted:!0,playsInline:!0,onError:()=>u(!0)})}),f.jsx("span",{className:"chat-media-name",children:i})]});const h=t&&Number.parseInt(t,10)||void 0,m=h!=null?`${i}:${h}`:i;return f.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[f.jsx(Kx,{size:12}),f.jsx("span",{className:"file-chip-label",children:m})]})}const oF=/(```[\s\S]*?(?:```|$)|~~~[\s\S]*?(?:~~~|$)|`[^`\n]*`)/g,Gw={singleDollarTextMath:!1};function Vw(e){return!e.includes("\\(")&&!e.includes("\\[")?e:e.split(oF).map((t,n)=>n%2===1?t:t.replace(/\\\[([\s\S]+?)\\\]/g,(r,i)=>`$$${i}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,i)=>`$$${i}$$`)).join("")}function lF(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const Ww={code:({node:e,className:t,children:n,...r})=>{const i=t??"",a=/language-(\w+)/.exec(i),c=String(n??"").replace(/\n$/,"");if(!(a!=null||c.includes(` -`)))return f.jsx("code",{className:i,...r,children:n});const u=a?lg(a[1]):null;return f.jsx(rF,{code:c,lang:u})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Xa=O.memo(function({text:t,onOpenFile:n,fileSrc:r}){const i={"file-mention":a=>f.jsx(L_,{path:a.path,lines:a.lines,onOpenFile:n,fileSrc:r}),a:({node:a,href:c,children:l,...u})=>c&&lF(c)&&n?f.jsx(L_,{path:decodeURI(c),onOpenFile:n,fileSrc:r}):f.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",...u,children:l}),...Ww};return f.jsx("div",{className:"md",children:f.jsx(rS,{remarkPlugins:[Lw,[Ow,Gw],aF],rehypePlugins:[cw],components:i,children:Vw(t)})})});function cF({synthesized:e,agentLabel:t,onView:n,onApprove:r,onReject:i,onRevise:a}){const[c,l]=O.useState(!1),u=O.useRef(null),[h,m]=O.useState(!1),[d,g]=O.useState(""),y=O.useRef(null);O.useEffect(()=>{if(!c)return;const w=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)},[c]),O.useEffect(()=>{var w;h&&((w=y.current)==null||w.focus())},[h]);const C=()=>{a(d.trim()||"no specific feedback — use your judgment"),g(""),m(!1)};return f.jsxs("div",{className:"plan-strip",children:[f.jsxs("div",{className:"plan-strip-info",children:[f.jsx(n7,{size:14,className:"plan-strip-icon"}),f.jsx("span",{className:"plan-strip-title",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),f.jsx("button",{className:"plan-strip-open",onClick:n,children:"Open plan"})]}),h?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{ref:y,className:"plan-strip-revise-input",placeholder:"What should change? (optional)",rows:2,value:d,onChange:w=>g(w.target.value),onKeyDown:w=>{w.key==="Escape"?(w.preventDefault(),g(""),m(!1)):w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),C())}}),f.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[f.jsx("button",{className:"btn-ghost",onClick:()=>{g(""),m(!1)},children:"Back"}),f.jsx("span",{className:"plan-strip-spacer"}),f.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:C,children:["Revise",f.jsx(Yx,{size:13})]})]})]}):f.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[f.jsx("button",{className:"btn-ghost",onClick:i,children:"Reject"}),f.jsx("button",{className:"btn-ghost",onClick:()=>m(!0),children:"Revise…"}),f.jsx("span",{className:"plan-strip-spacer"}),f.jsxs("div",{className:"plan-strip-approve",ref:u,children:[f.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),f.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>l(w=>!w),children:f.jsx(Ti,{size:13})}),c&&f.jsx("div",{className:"plan-strip-menu",children:f.jsx("button",{onClick:()=>{l(!1),r("bypass")},children:"Accept and bypass all"})})]})]})]})}const ug=[{id:"crucible",name:"Crux",jp:"朱 · shu",dark:!1,primary:"#db4d2b",tokens:{"--base":"#ffffff","--canvas":"#faf5f0","--panel":"#f2ebe2","--surface":"#fbf7f2","--surface-bright":"#fffdfb","--highlight":"#fdeee7","--text":"#231f1c","--subtext":"#776f66","--muted":"#a89f95","--primary":"#db4d2b","--primary-subtle":"#fbe7df","--secondary":"#c98a2e","--border":"#e4dbd1","--border-variant":"#ece4da","--dots-muted":"#e8ded2","--dots-strong":"#c7bcab"}},{id:"ai",name:"Indigo",jp:"藍 · ai",dark:!1,primary:"#2f4d80",tokens:{"--base":"#ffffff","--canvas":"#f4f6f9","--panel":"#e9edf3","--surface":"#f7f9fc","--surface-bright":"#ffffff","--highlight":"#e9f0f9","--text":"#1b2230","--subtext":"#66707f","--muted":"#9aa3b1","--primary":"#2f4d80","--primary-subtle":"#e6ecf6","--secondary":"#3f8fa6","--border":"#d9e0e8","--border-variant":"#e6ebf1","--dots-muted":"#dde3ec","--dots-strong":"#b6bfcd"}},{id:"kurenai",name:"Safflower",jp:"紅 · kurenai",dark:!1,primary:"#b03052",tokens:{"--base":"#ffffff","--canvas":"#faf5f6","--panel":"#f2e9ec","--surface":"#fbf6f7","--surface-bright":"#fffcfd","--highlight":"#fbe9ef","--text":"#241b1f","--subtext":"#7a6a70","--muted":"#ab9ba1","--primary":"#b03052","--primary-subtle":"#f8e5ec","--secondary":"#c98a2e","--border":"#e6dbe0","--border-variant":"#ede4e8","--dots-muted":"#ecdee4","--dots-strong":"#cab3bd"}},{id:"uguisu",name:"Nightingale",jp:"鶯 · uguisu",dark:!1,primary:"#6f7d3f",tokens:{"--base":"#ffffff","--canvas":"#f7f8f1","--panel":"#ecefe1","--surface":"#faf9f2","--surface-bright":"#fffefb","--highlight":"#f0f3e2","--text":"#22231b","--subtext":"#6f7264","--muted":"#a3a690","--primary":"#6f7d3f","--primary-subtle":"#edf0dd","--secondary":"#c98a2e","--border":"#e0e2d1","--border-variant":"#e9ebdc","--dots-muted":"#e5e7d4","--dots-strong":"#bfc2a4"}},{id:"botan",name:"Peony",jp:"牡丹 · botan",dark:!1,primary:"#bd3a84",tokens:{"--base":"#ffffff","--canvas":"#faf5f8","--panel":"#f2e9ef","--surface":"#fbf6f9","--surface-bright":"#fffcfe","--highlight":"#fbe8f2","--text":"#241c22","--subtext":"#7a6c74","--muted":"#ab9ca5","--primary":"#bd3a84","--primary-subtle":"#f8e5f0","--secondary":"#8f6fd6","--border":"#e7dbe3","--border-variant":"#eee4ea","--dots-muted":"#eddee7","--dots-strong":"#ccb3c2"}},{id:"sumi",name:"Ink",jp:"墨 · sumi",dark:!0,primary:"#e0813e",tokens:{"--base":"#15130f","--canvas":"#1a1713","--panel":"#211d18","--surface":"#231f19","--surface-bright":"#2b261f","--highlight":"#2f281f","--text":"#ede7dd","--subtext":"#a79d8e","--muted":"#756d5f","--primary":"#e0813e","--primary-subtle":"#3a2c1c","--secondary":"#c9a24e","--border":"#332e26","--border-variant":"#3d372d","--dots-muted":"#2c2820","--dots-strong":"#4a4437"}}],Yw="crux:theme",O_="crucible";function uF(e){return ug.find(t=>t.id===e)??ug[0]}function Xw(e){const t=uF(e),n=document.documentElement;for(const[r,i]of Object.entries(t.tokens))i!=null&&n.style.setProperty(r,i);n.setAttribute("data-theme",t.id),n.setAttribute("data-theme-mode",t.dark?"dark":"light"),n.style.colorScheme=t.dark?"dark":"light"}function Kw(){try{return localStorage.getItem(Yw)||O_}catch{return O_}}function hF(e){try{localStorage.setItem(Yw,e)}catch{}Xw(e)}function dF(){Xw(Kw())}function Zw({onSaved:e}){const[t,n]=O.useState(""),[r,i]=O.useState(!1),[a,c]=O.useState(null);async function l(u){if(u.preventDefault(),!(r||!t.trim())){i(!0),c(null);try{e(await QT(t.trim())),n("")}catch(h){c(h instanceof Error?h.message:String(h))}finally{i(!1)}}}return f.jsxs("form",{className:"onb-token-form",onSubmit:l,children:[f.jsx("input",{type:"password",value:t,onChange:u=>n(u.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),f.jsx("button",{type:"submit",className:"btn",disabled:r||!t.trim(),children:r?"Checking…":"Save"}),f.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),a&&f.jsx("div",{className:"error",children:a})]})}function fF(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"Crux";case"local_job":return"This machine";default:return e||"—"}}function pF({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-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.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-.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-.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-.573.534-.375-.677-1.405-2.416-1.94-2.751-.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-.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-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.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-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z",fill:"#FFD21E"})]})}function mF({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 gF({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-.5-.623h-.804l-.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-.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-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.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-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.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-.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-.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-.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 vF({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-.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-.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-.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-.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 yF({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 o2({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-.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-.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 Qw({kind:e,size:t=16}){switch(e){case"modal_job":return f.jsx(mF,{size:t});case"hf_job":return f.jsx(pF,{size:t});case"k8s_job":return f.jsx(gF,{size:t});case"ssh_job":return f.jsx(w1,{size:t});case"slurm_job":return f.jsx(EA,{size:t});case"ray_job":return f.jsx(vF,{size:t});case"openresearch_job":return f.jsx(yF,{size:t});case"local_job":return f.jsx(uN,{size:t});default:return f.jsx(w1,{size:t})}}function Jw({backend:e}){const t=ad(e),n=m7(e);return t?f.jsxs("span",{className:"backend-badge",children:[f.jsx(Qw,{kind:t}),f.jsx("span",{className:"backend-name",children:fF(t)}),n&&f.jsx("span",{className:"backend-detail mono",children:n})]}):f.jsx("span",{className:"backend-badge muted",children:"—"})}function e8({value:e,max:t,label:n,caption:r,fillColor:i}){const a=t>0?Math.min(100,Math.round(e/t*100)):0;return f.jsxs("div",{className:"progress",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track",children:f.jsx("div",{className:"progress-fill",style:{width:`${a}%`,background:i}})}),(n!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption",children:[f.jsx("span",{children:n??`${a}%`}),r]})]})}const B_={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1},keep:{className:"st-done",live:!1},kill:{className:"st-failed",live:!1},iterate:{className:"st-editing",live:!1}};function bF(e){return B_[e]??B_.idle}function _F(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fs({status:e,label:t}){const n=bF(e);return f.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[f.jsx("span",{className:"dot"}),t??_F(e)]})}function Jm(e){return e.agentReady?{cls:"ok",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"warn",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"warn",label:"Update required"}:{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function xF({h:e}){return e.authMethod?f.jsx(f.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):f.jsx(f.Fragment,{children:"—"})}function SF(e){const t=Math.max(0,Math.floor(e/1e3));if(t===0)return"now";const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?`${n}d ${r}h`:r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}function wF({u:e,now:t}){const n=e.windows??[];return n.length>0?f.jsxs("div",{className:"harness-usage",children:[n.map(r=>{const i=Math.max(0,Math.min(100,r.remainingPercent)),a=i<=10;return f.jsxs("div",{className:"usage-window",children:[f.jsx("span",{className:"usage-win-label",children:r.label}),f.jsx("span",{className:"usage-bar",children:f.jsx("span",{className:`usage-bar-fill${a?" low":""}`,style:{width:`${i}%`}})}),f.jsxs("span",{className:"usage-pct",children:[Math.round(i),"% left"]}),r.resetsAtMs!=null&&f.jsxs("span",{className:"usage-reset",title:new Date(r.resetsAtMs).toLocaleString(),children:["resets in ",SF(r.resetsAtMs-t)]})]},r.label)}),e.observedAtMs!=null&&f.jsxs("div",{className:"usage-asof",children:["as of ",gs(e.observedAtMs)]})]}):f.jsxs("span",{className:"harness-usage-note",children:[e.note??"—",e.manageUrl&&f.jsxs(f.Fragment,{children:[" ",f.jsx("a",{href:e.manageUrl,target:"_blank",rel:"noreferrer",children:"Manage ↗"})]})]})}const z_=6e4;function CF(){const[e,t]=O.useState(null),[n,r]=O.useState("claude-code"),[i,a]=O.useState(!1),[c,l]=O.useState(()=>Date.now()+z_),[u,h]=O.useState(()=>Date.now()),m=(g,y=!1)=>{a(!0),l(Date.now()+z_),cl(g,y).then(t).catch(()=>{}).finally(()=>a(!1))};O.useEffect(()=>m(!1),[]),O.useEffect(()=>{const g=setTimeout(()=>m(!0),Math.max(0,c-Date.now()));return()=>clearTimeout(g)},[c]),O.useEffect(()=>{const g=setInterval(()=>h(Date.now()),1e3);return()=>clearInterval(g)},[]),O.useEffect(()=>Zg(()=>m(!0)),[]);const d=e==null?void 0:e.find(g=>g.id===n);return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:"Harnesses"}),f.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),f.jsx("div",{className:"harness-tabs",children:(e??[]).map(g=>f.jsxs("button",{className:g.id===n?"active":"",onClick:()=>r(g.id),children:[g.name,f.jsx("span",{className:`harness-dot ${Jm(g).cls}`})]},g.id))}),e?d?f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("span",{className:`badge ${Jm(d).cls}`,children:Jm(d).label}),f.jsx("div",{className:"spacer",style:{flex:1}}),f.jsxs("button",{className:"btn sm",onClick:()=>m(!0,!0),disabled:i,children:[f.jsx(Mi,{size:12,className:i?"spin":""})," Refresh"]})]}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Binary"}),f.jsx("span",{className:"v",children:d.binPath??"not found on PATH"}),f.jsx("span",{className:"k",children:"Version"}),f.jsx("span",{className:"v",children:d.version??"—"}),f.jsx("span",{className:"k",children:"Auth"}),f.jsx("span",{className:"v",children:f.jsx(xF,{h:d})}),d.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:d.id==="opencode"?"Providers":"Account"}),f.jsx("span",{className:"v",children:d.account})]}),d.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Org"}),f.jsx("span",{className:"v",children:d.org})]}),d.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Plan"}),f.jsx("span",{className:"v",children:d.plan})]}),d.usage&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Usage"}),f.jsx("span",{className:"v",children:f.jsx(wF,{u:d.usage,now:u})})]}),f.jsx("span",{className:"k",children:"Agent models"}),f.jsx("span",{className:"v",children:d.models.length>0?`${d.models.length} available — ${d.models.slice(0,4).map(g=>j0(g)).join(", ")}${d.models.length>4?", …":""}`:"none"})]}),!d.agentReady&&d.agentNote&&f.jsx("p",{className:"settings-note",children:d.agentNote})]}):null:f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Detecting harnesses…"]})]})}function Ml(e){return e.ready?{cls:"ok",label:"Ready"}:e.kind==="scenario"?e.state==="expired"?{cls:"err",label:"Login expired"}:e.state==="error"?{cls:"err",label:"Error"}:e.reachable===!1?{cls:"err",label:"Unreachable"}:{cls:"",label:"Not connected"}:e.kind==="comfyui"?e.mcpFound&&!e.mcpRunnable?{cls:"err",label:"Server broken"}:e.mcpFound?{cls:"warn",label:"ComfyUI not running"}:{cls:"",label:"Not installed"}:e.kind==="unirig"?e.portOpen?{cls:"err",label:"Wrong service on port"}:{cls:"warn",label:"Container not running"}:e.kind==="kimodo"?e.repoFound?{cls:"warn",label:"No checkpoint"}:{cls:"",label:"Not installed"}:e.serverFound&&!e.serverRunnable?{cls:"err",label:"Server broken"}:e.serverFound?{cls:"warn",label:"Blender not running"}:{cls:"",label:"Not installed"}}function kF(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState("scenario"),[c,l]=O.useState(!1),u=(m=!1)=>(l(!0),DT(m).then(d=>{t(d),r(null)}).catch(d=>r(d instanceof Error?d.message:String(d))).finally(()=>l(!1)));O.useEffect(()=>{u()},[]);const h=e==null?void 0:e.find(m=>m.id===i);return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:"Generative AI"}),f.jsx("p",{className:"settings-sub",children:"Asset-generation backends the agent can drive. Scenario runs in the cloud on your own account; Blender and ComfyUI run on this machine, each through its own MCP server."}),n?f.jsx("div",{className:"error",children:n}):e?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"harness-tabs",children:e.map(m=>f.jsxs("button",{className:m.id===i?"active":"",onClick:()=>a(m.id),children:[m.name,f.jsx("span",{className:`harness-dot ${Ml(m).cls}`})]},m.id))}),(h==null?void 0:h.kind)==="scenario"&&f.jsx(MF,{s:h,onChanged:u}),(h==null?void 0:h.kind)==="blender"&&f.jsx(NF,{s:h,refreshing:c,onRefresh:()=>void u(!0)}),(h==null?void 0:h.kind)==="unirig"&&f.jsx(EF,{s:h,refreshing:c,onRefresh:()=>u(!0)}),(h==null?void 0:h.kind)==="kimodo"&&f.jsx(AF,{s:h,refreshing:c,onRefresh:()=>u(!0)}),(h==null?void 0:h.kind)==="comfyui"&&f.jsx(TF,{s:h,refreshing:c,onRefresh:()=>void u(!0)})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Checking providers…"]})]})}function EF({s:e,refreshing:t,onRefresh:n}){const r=Ml(e);return f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("span",{className:`badge ${r.cls}`,children:r.label}),f.jsx("div",{className:"spacer",style:{flex:1}}),f.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[f.jsx(Mi,{size:12,className:t?"spin":""})," Refresh"]})]}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Service"}),f.jsx("span",{className:"v",children:e.serviceReachable?"answering":e.portOpen?"port open, but not the UniRig API":"not running"}),f.jsx("span",{className:"k",children:"Address"}),f.jsx("span",{className:"v",children:f.jsx("code",{children:e.address})}),f.jsx("span",{className:"k",children:"Rig endpoint"}),f.jsx("span",{className:"v",children:f.jsxs("code",{children:["POST ",e.rigUrl]})}),e.docsUrl&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"API docs"}),f.jsx("span",{className:"v",children:f.jsx("a",{href:e.docsUrl,target:"_blank",rel:"noopener noreferrer",children:e.docsUrl})})]})]}),e.error&&f.jsx("div",{className:"settings-note",children:e.error}),f.jsx("p",{className:"settings-sub",children:"Runs as a container rather than an MCP server — crux posts a mesh to it directly."})]})}function AF({s:e,refreshing:t,onRefresh:n}){const r=Ml(e);return f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("span",{className:`badge ${r.cls}`,children:r.label}),f.jsx("div",{className:"spacer",style:{flex:1}}),f.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[f.jsx(Mi,{size:12,className:t?"spin":""})," Refresh"]})]}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Checkout"}),f.jsx("span",{className:"v",children:e.repoFound?f.jsx("code",{children:e.repoPath}):"not found"}),f.jsx("span",{className:"k",children:"Python env"}),f.jsx("span",{className:"v",children:e.venvFound?f.jsx("code",{children:e.pythonPath}):"none — run `uv sync` in the checkout"}),f.jsx("span",{className:"k",children:"Checkpoints"}),f.jsx("span",{className:"v",children:e.checkpoints.length===0?"none downloaded":e.checkpoints.map(i=>f.jsx("div",{children:f.jsx("code",{children:i.repo})},i.repo))})]}),e.error&&f.jsx("div",{className:"settings-note",children:e.error}),f.jsx("p",{className:"settings-sub",children:"Nothing to start — Kimodo runs as a Python job against the checkout, so this card reports disk state rather than a process."})]})}function NF({s:e,refreshing:t,onRefresh:n}){const r=Ml(e);return f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("span",{className:`badge ${r.cls}`,children:r.label}),f.jsx("div",{className:"spacer",style:{flex:1}}),f.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[f.jsx(Mi,{size:12,className:t?"spin":""})," Refresh"]})]}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"MCP server"}),f.jsx("span",{className:"v",children:e.serverFound?e.serverRunnable?e.serverRunning?`running on ${e.serverUrl}`:"installed — restart crux to start it":"installed, but will not run":"not installed"}),e.serverPath&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Path"}),f.jsx("span",{className:"v",children:f.jsx("code",{children:e.serverPath})})]}),f.jsx("span",{className:"k",children:"Blender"}),f.jsx("span",{className:"v",children:e.blenderReachable?[e.blenderVersion,e.blendFile??"unsaved file",e.objectCount!==void 0?`${e.objectCount} objects`:null].filter(Boolean).join(" · "):`not reachable on ${e.addonAddress}`}),e.toolCount!==void 0&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Tools"}),f.jsxs("span",{className:"v",children:[e.toolCount," offered to the agent"]})]})]}),!e.serverFound&&f.jsxs("p",{className:"settings-note",children:["Install the Blender MCP server with ",f.jsx("code",{children:"pipx install blender-mcp"}),", then restart crux so it can start one."]}),e.serverFound&&!e.serverRunnable&&e.serverError&&f.jsx("p",{className:"settings-note",children:e.serverError}),e.serverRunnable&&!e.blenderReachable&&f.jsxs("p",{className:"settings-note",children:[e.blenderError??`Nothing answered on ${e.addonAddress}.`," ","Blender-backed tools will fail until Blender is open; documentation tools keep working."]}),e.serverRunnable&&!e.serverRunning&&f.jsxs("p",{className:"settings-note",children:["The server is usable but crux has no child running — it starts one at launch, so restart"," ",f.jsx("code",{children:"crux up"})," to pick it up."]})]})}function TF({s:e,refreshing:t,onRefresh:n}){var m;const r=Ml(e),[i,a]=O.useState(!1),[c,l]=O.useState(null);async function u(){if(!i){a(!0),l(null);try{await jT(),n()}catch(d){l(d instanceof Error?d.message:String(d))}finally{a(!1)}}}const h=d=>d===void 0?null:`${(d/1024**3).toFixed(1)} GB`;return f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("span",{className:`badge ${r.cls}`,children:r.label}),f.jsx("div",{className:"spacer",style:{flex:1}}),e.comfyReachable&&f.jsxs("a",{className:"btn sm",href:e.dashboardUrl,target:"_blank",rel:"noreferrer",title:"Open ComfyUI's own web UI",children:["Open ComfyUI ",f.jsx(cu,{size:12})]}),f.jsxs("button",{className:"btn sm",onClick:n,disabled:t,children:[f.jsx(Mi,{size:12,className:t?"spin":""})," Refresh"]})]}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"MCP server"}),f.jsx("span",{className:"v",children:e.mcpFound?e.mcpRunnable?e.serverRunning?`running on ${e.serverUrl}`:"installed — restart crux to start it":"installed, but will not run":"not installed"}),f.jsx("span",{className:"k",children:"ComfyUI"}),f.jsx("span",{className:"v",children:e.comfyReachable?[e.comfyVersion&&`v${e.comfyVersion}`,e.comfyManaged?"started by crux":"already running",e.nodeClasses!==void 0&&`${e.nodeClasses} nodes`,e.queueDepth!==void 0&&(e.queueDepth===0?"queue idle":`${e.queueDepth} queued`)].filter(Boolean).join(" · "):`not running at ${e.dashboardUrl}`}),e.device&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Device"}),f.jsxs("span",{className:"v",children:[e.device,e.vramTotal!==void 0&&` — ${h(e.vramFree)} free of ${h(e.vramTotal)}`]})]}),e.toolCount!==void 0&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Tools"}),f.jsxs("span",{className:"v",children:[e.toolCount," offered to the agent"]})]}),f.jsx("span",{className:"k",children:"Install"}),f.jsx("span",{className:"v",children:f.jsx("code",{children:e.installPath})})]}),!e.mcpFound&&f.jsxs("p",{className:"settings-note",children:["Install the MCP server with ",f.jsx("code",{children:"npm install -g comfyui-mcp"}),", then restart crux so it can start one. There is no official local server yet — Comfy's own is in private test, and their hosted Cloud one doesn't drive a self-hosted install."]}),e.mcpFound&&!e.mcpRunnable&&e.mcpError&&f.jsx("p",{className:"settings-note",children:e.mcpError}),e.mcpRunnable&&!e.comfyReachable&&f.jsxs("p",{className:"settings-note",children:["Nothing is listening at ",f.jsx("code",{children:e.dashboardUrl}),". Start it below, or run it yourself from ",f.jsx("code",{children:e.installPath})," — the agent's ComfyUI tools fail until it's up."]}),(m=e.brokenPacks)==null?void 0:m.map(d=>f.jsxs("p",{className:"settings-note",children:[f.jsx("strong",{children:d.pack})," serves ",d.templates," workflow",d.templates===1?"":"s"," referencing node classes that aren't registered, so those workflows cannot run. Missing: ",f.jsx("code",{children:d.missingNodes.slice(0,4).join(", ")}),d.missingNodes.length>4&&` and ${d.missingNodes.length-4} more`,". Either the pack failed to import — a compiled dependency built against a different torch does this, and ComfyUI's own log says which — or the templates need other packs you haven't installed."]},d.pack)),c&&f.jsx("div",{className:"error",children:c}),e.mcpRunnable&&!e.comfyReachable&&f.jsx("div",{className:"actions",children:f.jsx("button",{className:"btn primary",onClick:()=>void u(),disabled:i,children:i?"Starting… (imports torch, ~30s+)":"Start ComfyUI"})})]})}function MF({s:e,onChanged:t}){const[n,r]=O.useState(!1),[i,a]=O.useState(null),[c,l]=O.useState(null),u=()=>t().then(()=>{r(!1)});O.useEffect(()=>EM(y=>{r(!1),l(null),y.type==="error"?a(y.error):a(null),t()}),[t]);async function h(){if(!n){r(!0),a(null),l(null);try{const y=await TT();y.browserOpened||l(y.authorizeUrl),await t()}catch(y){r(!1),a(y instanceof Error?y.message:String(y))}}}async function m(){if(!n){r(!0),a(null),l(null);try{await MT(),await t()}catch(y){a(y instanceof Error?y.message:String(y))}finally{r(!1)}}}const d=n||e.connecting,g=Ml(e);return f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("span",{className:`badge ${g.cls}`,children:e.state==="connected"?"Connected":g.label}),f.jsx("div",{className:"spacer",style:{flex:1}}),f.jsxs("button",{className:"btn sm",onClick:()=>void u(),children:[f.jsx(Mi,{size:12})," Refresh"]})]}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Login"}),f.jsx("span",{className:"v",children:e.state==="connected"?"Signed in and working":e.state==="expired"?"Stored, but no longer accepted":e.state==="error"?"Stored, but the check failed":"Not signed in"}),e.toolCount!==void 0&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Tools"}),f.jsxs("span",{className:"v",children:[e.toolCount," available in this workspace"]})]}),f.jsx("span",{className:"k",children:"Token"}),f.jsxs("span",{className:"v",children:[f.jsx("code",{children:e.authPath})," (private to your user)"]})]}),e.state==="disconnected"&&e.reachable===!1&&f.jsxs("p",{className:"settings-note",children:["Scenario didn't answer with the OAuth details a login needs, so signing in can't succeed right now — the service may be down. ",e.error]}),e.state==="expired"&&f.jsx("p",{className:"settings-note",children:"The stored login no longer works — signing in again replaces it. This happens when the same account is re-authorised somewhere else."}),e.state==="error"&&e.error&&f.jsx("p",{className:"settings-note",children:e.error}),d&&f.jsxs("p",{className:"settings-note",children:["Waiting for you to finish signing in",c?"":" in the browser tab that just opened","…",c&&f.jsxs(f.Fragment,{children:[" ","This server has no browser of its own, so open this yourself:"," ",f.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["the Scenario login page ",f.jsx(cu,{size:11})]})]})]}),i&&f.jsx("div",{className:"error",children:i}),f.jsxs("div",{className:"actions",children:[f.jsx("button",{className:"btn primary",onClick:()=>void h(),disabled:d,children:d?"Waiting for the browser…":e.state==="connected"?"Sign in again":e.state==="expired"?"Reconnect":"Connect"}),e.state!=="disconnected"&&f.jsx("button",{className:"btn",onClick:()=>void m(),disabled:d,children:"Disconnect"})]})]})}function jF({s:e}){if(!e.configured)return f.jsx("span",{className:"badge",children:"Not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?f.jsx("span",{className:"badge ok",children:"Connected"}):f.jsx("span",{className:"badge err",children:"No job-create permission"}):f.jsx("span",{className:"badge err",children:"Cluster unreachable"}):f.jsx("span",{className:"badge err",children:"kubectl not found"})}function DF(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[c,l]=O.useState(""),[u,h]=O.useState(!1),[m,d]=O.useState(null),g=w=>{t(w),a(w.context??""),l(w.namespace)};O.useEffect(()=>{kT().then(g).catch(w=>r(w instanceof Error?w.message:String(w)))},[]);const y=e!==null&&i===(e.context??"")&&c.trim()===e.namespace;async function C(w){if(w.preventDefault(),!u){h(!0),d(null);try{g(await ET({context:i,namespace:c.trim()}))}catch(b){d(b instanceof Error?b.message:String(b))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",f.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",f.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?f.jsx("div",{className:"error",children:n}):e?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Cluster"}),f.jsx("span",{className:"v",children:f.jsx(jF,{s:e})})]}),e.preflight.error&&f.jsx("p",{className:"settings-note",children:e.preflight.error}),f.jsxs("form",{className:"form settings-form",onSubmit:C,children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:["Context",f.jsxs("select",{value:i,onChange:w=>a(w.target.value),children:[f.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(w=>f.jsx("option",{value:w,children:w},w))]})]}),f.jsxs("label",{children:["Namespace",f.jsx("input",{className:"mono",type:"text",value:c,onChange:w=>l(w.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),m&&f.jsx("div",{className:"error",children:m}),f.jsx("div",{className:"actions",children:f.jsx("button",{type:"submit",className:"btn primary",disabled:u||y,children:u?"Saving…":"Save"})})]}),f.jsxs("div",{className:"settings-card",children:[f.jsx("div",{className:"settings-card-head",children:f.jsx("h3",{children:"Run manifest"})}),f.jsxs("p",{className:"settings-sub",children:["Each run applies the manifest committed on its experiment branch — default"," ",f.jsx("code",{children:".orx/k8s.yaml"}),", or ",f.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",f.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",f.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",f.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",f.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Checking kubectl…"]})]})}const RF={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function LF({s:e}){return e.ready?f.jsx("span",{className:"badge ok",children:"Connected"}):!e.tokenConfigured&&!e.modalImportable?f.jsx("span",{className:"badge",children:"Not set up"}):e.modalImportable?e.tokenConfigured?f.jsx("span",{className:"badge",children:"Unknown"}):f.jsx("span",{className:"badge err",children:"No token"}):f.jsx("span",{className:"badge err",children:e.envProvisioned?"Env broken":"Env not built"})}function OF(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(!1),[c,l]=O.useState(null);O.useEffect(()=>{AT().then(t).catch(h=>r(h instanceof Error?h.message:String(h)))},[]);async function u(){if(!i){a(!0),l(null);try{t(await NT())}catch(h){l(h instanceof Error?h.message:String(h))}finally{a(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Serverless GPUs on your own Modal account with"," ",f.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?f.jsx("div",{className:"error",children:n}):e?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Status"}),f.jsx("span",{className:"v",children:f.jsx(LF,{s:e})}),f.jsx("span",{className:"k",children:"Environment"}),f.jsx("span",{className:"v",children:e.modalImportable?"Ready":e.envProvisioned?"Provisioned (modal import failing)":"Not built yet"}),f.jsx("span",{className:"k",children:"Token"}),f.jsx("span",{className:"v",children:e.tokenSource?RF[e.tokenSource]:"Not configured"})]}),!e.tokenConfigured&&f.jsxs("p",{className:"settings-note",children:["No Modal token found. Run ",f.jsx("code",{children:"modal token new"}),", or add"," ",f.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",f.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&f.jsx("p",{className:"settings-note",children:e.error}),c&&f.jsx("div",{className:"error",children:c}),!e.modalImportable&&f.jsx("div",{className:"actions",children:f.jsx("button",{className:"btn primary",onClick:()=>void u(),disabled:i,children:i?"Setting up… (~30–60s)":"Set up environment"})})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Checking Modal…"]})]})}function BF({test:e}){if(e===void 0)return f.jsx("span",{className:"muted",children:"never tested"});if(e==="testing")return f.jsx("span",{className:"spinner"});const t=e.reachable?e.gitFound?f.jsx("span",{className:"badge ok",children:"Ready"}):f.jsx("span",{className:"badge err",children:"No git"}):f.jsx("span",{className:"badge err",title:e.error??void 0,children:"Unreachable"});return f.jsxs(f.Fragment,{children:[t,f.jsx("span",{className:"ssh-tested-at",children:gs(e.testedAt)})]})}function zF(){const[e,t]=O.useState(null),[n,r]=O.useState({});O.useEffect(()=>{IT().then(t).catch(()=>t([]))},[]);async function i(a){r(c=>({...c,[a]:"testing"}));try{const c=await HT(a);r(l=>({...l,[a]:c}))}catch(c){r(l=>({...l,[a]:{reachable:!1,gitFound:!1,error:c instanceof Error?c.message:String(c),testedAt:Date.now()}}))}}return f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Run experiments directly on your own boxes with"," ",f.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",f.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",f.jsx("code",{children:"git"})," and ",f.jsx("code",{children:"bash"}),"."]}),e===null?f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Reading ~/.ssh/config…"]}):e.length===0?f.jsx("p",{className:"settings-empty",children:"No hosts found in ~/.ssh/config."}):f.jsxs("table",{className:"flavor-table ssh-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Host"}),f.jsx("th",{children:"Address"}),f.jsx("th",{children:"Identity"}),f.jsx("th",{children:"Status"}),f.jsx("th",{})]})}),f.jsx("tbody",{children:e.map(a=>f.jsxs("tr",{children:[f.jsx("td",{className:"mono",children:a.host}),f.jsxs("td",{className:"mono muted",children:[[a.user,a.hostname??"—"].filter(Boolean).join("@"),a.port?`:${a.port}`:""]}),f.jsx("td",{className:"mono muted",children:a.identityFile??"—"}),f.jsx("td",{children:f.jsx(BF,{test:n[a.host]??a.lastTest})}),f.jsx("td",{children:f.jsx("button",{className:"btn sm",onClick:()=>void i(a.host),disabled:n[a.host]==="testing",children:"Test"})})]},a.host))})]})]})}function IF({test:e}){return e===null?null:e==="testing"?f.jsx("span",{className:"spinner"}):e.reachable?e.slurmFound?e.gitFound?f.jsx("span",{className:"badge ok",children:"Ready"}):f.jsx("span",{className:"badge err",children:"No git"}):f.jsx("span",{className:"badge err",children:"No Slurm CLI"}):f.jsx("span",{className:"badge err",title:e.error??void 0,children:"Unreachable"})}function HF(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[c,l]=O.useState(""),[u,h]=O.useState(""),[m,d]=O.useState(""),[g,y]=O.useState(!1),[C,w]=O.useState(null),[b,_]=O.useState(null),x=b!==null&&b!=="testing"?b:null,S=j=>{t(j),a(j.host??""),l(j.partition??""),h(j.account??""),d(j.timeLimit??"")};O.useEffect(()=>{FT().then(S).catch(j=>r(j instanceof Error?j.message:String(j)))},[]);const k=e!==null&&i===(e.host??"")&&c.trim()===(e.partition??"")&&u.trim()===(e.account??"")&&m.trim()===(e.timeLimit??"");async function N(j){if(j.preventDefault(),!g){y(!0),w(null);try{S(await PT({host:i,partition:c.trim(),account:u.trim(),timeLimit:m.trim()}))}catch(T){w(T instanceof Error?T.message:String(T))}finally{y(!1)}}}async function A(j){_("testing");try{_(await $T(j))}catch(T){_({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",f.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",f.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?f.jsx("div",{className:"error",children:n}):e?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:"settings-note",children:x.error}),x&&x.partitions.length>0&&f.jsxs("p",{className:"settings-note",children:["Partitions: ",f.jsx("code",{children:x.partitions.join(", ")})]}),f.jsxs("form",{className:"form settings-form",onSubmit:N,children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:["Login node",f.jsxs("select",{value:i,onChange:j=>{a(j.target.value),_(null)},children:[f.jsx("option",{value:"",children:"not set (pass --host per launch)"}),i&&!e.hosts.some(j=>j.host===i)&&f.jsxs("option",{value:i,children:[i," (not in ~/.ssh/config)"]}),e.hosts.map(j=>f.jsx("option",{value:j.host,children:j.host},j.host))]})]}),f.jsxs("label",{children:["Partition",f.jsx("input",{className:"mono",type:"text",list:"slurm-partitions",value:c,onChange:j=>l(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(j=>f.jsx("option",{value:j},j))})]})]}),f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:["Account",f.jsx("input",{className:"mono",type:"text",value:u,onChange:j=>h(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),f.jsxs("label",{children:["Time limit",f.jsx("input",{className:"mono",type:"text",value:m,onChange:j=>d(j.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),C&&f.jsx("div",{className:"error",children:C}),f.jsxs("div",{className:"actions",children:[f.jsx("button",{type:"submit",className:"btn primary",disabled:g||k,children:g?"Saving…":"Save"}),f.jsx("button",{type:"button",className:"btn",onClick:()=>void A(i),disabled:!i||b==="testing",title:i?void 0:"Pick a login node first",children:"Test connection"}),f.jsx(IF,{test:b})]})]})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading slurm settings…"]})]})}function FF(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[c,l]=O.useState(!1),[u,h]=O.useState(null),[m,d]=O.useState(null),g=m!==null&&m!=="testing"?m:null,y=_=>{t(_),a(_.address??"")};O.useEffect(()=>{UT().then(y).catch(_=>r(_ instanceof Error?_.message:String(_)))},[]);const C=e!==null&&i===(e.address??"");async function w(_){if(_.preventDefault(),!c){l(!0),h(null);try{y(await qT({address:i}))}catch(x){h(x instanceof Error?x.message:String(x))}finally{l(!1)}}}async function b(){d("testing");try{d(await GT(i.trim()||void 0))}catch(_){d({reachable:!1,address:i.trim()||"(unknown)",rayVersion:null,error:_ instanceof Error?_.message:String(_)})}}return f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Run on a Ray cluster with ",f.jsx("code",{children:"--backend ray [--flavor gpu:1]"}),". orx submits via the Ray Jobs API (Dashboard URL). Address resolution: this setting, then ",f.jsx("code",{children:"ASTROAI_RAY_JOBS_ADDRESS"})," /"," ",f.jsx("code",{children:"RAY_DASHBOARD_URL"}),", then ",f.jsx("code",{children:"http://127.0.0.1:8265"}),". Optional flavor maps to entrypoint CPUs/GPUs/memory (e.g."," ",f.jsx("code",{children:"cpu:2"}),", ",f.jsx("code",{children:"gpu:1,mem:8GiB"}),")."]}),n?f.jsx("div",{className:"error",children:n}):e?f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-note",children:["Effective: ",f.jsx("code",{children:e.resolvedAddress})," (",e.source,")"]}),(g==null?void 0:g.error)&&f.jsx("p",{className:"settings-note",children:g.error}),(g==null?void 0:g.reachable)&&g.rayVersion&&f.jsxs("p",{className:"settings-note",children:["Ray version: ",f.jsx("code",{children:g.rayVersion})]}),f.jsxs("form",{className:"form settings-form",onSubmit:w,children:[f.jsxs("label",{children:["Jobs / Dashboard URL",f.jsx("input",{className:"mono",type:"text",value:i,onChange:_=>{a(_.target.value),d(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),u&&f.jsx("div",{className:"error",children:u}),f.jsxs("div",{className:"actions",children:[f.jsx("button",{type:"submit",className:"btn primary",disabled:c||C,children:c?"Saving…":"Save"}),f.jsx("button",{type:"button",className:"btn",onClick:()=>void b(),disabled:m==="testing",children:"Test connection"}),f.jsx(PF,{test:m})]})]})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading Ray settings…"]})]})}function PF({test:e}){return e===null?null:e==="testing"?f.jsx("span",{className:"badge",children:"Testing…"}):e.reachable?f.jsx("span",{className:"badge ok",children:"Reachable"}):f.jsx("span",{className:"badge warn",children:"Unreachable"})}function $F(){const[e,t]=O.useState(null),[n,r]=O.useState(null);return O.useEffect(()=>{WT().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",f.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?f.jsx("div",{className:"error",children:n}):e?f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Hostname"}),f.jsx("span",{className:"v mono",children:e.hostname}),f.jsx("span",{className:"k",children:"System"}),f.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),f.jsx("span",{className:"k",children:"CPU"}),f.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),f.jsx("span",{className:"k",children:"RAM"}),f.jsx("span",{className:"v",children:e.memBytes!==null?$a(e.memBytes):"—"}),f.jsx("span",{className:"k",children:"GPUs"}),f.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(i=>`${i.name}${i.memMib!==null?` — ${$a(i.memMib*1024*1024)}`:""}`).join(", ")})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Detecting hardware…"]})]})}function UF(){const[e,t]=O.useState(null),[n,r]=O.useState(null);return O.useEffect(()=>{YT().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",f.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",f.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",f.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?f.jsx("div",{className:"error",children:n}):e?e.loggedIn?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Status"}),f.jsx("span",{className:"v",children:f.jsx("span",{className:"badge ok",children:"Signed in"})}),f.jsx("span",{className:"k",children:"Orgs"}),f.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:"SSH key"}),f.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?f.jsx("span",{className:"badge ok",children:"On this computer"}):e.sshKeyStatus==="no_local_match"?f.jsx("span",{className:"badge warn",children:"Not on this computer"}):e.sshKeyStatus==="none_registered"?f.jsx("span",{className:"badge err",children:"None registered"}):f.jsx("span",{className:"badge",children:"Unknown"})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?f.jsxs("p",{className:"settings-note",children:["Add one with ",f.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):f.jsxs("p",{className:"settings-note",children:["No key on this computer yet — create one with"," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),", then add it with"," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?f.jsxs("p",{className:"settings-note",children:["Register this computer with ",f.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),", or load a registered key with ",f.jsx("code",{children:"ssh-add"}),"."]}):f.jsxs("p",{className:"settings-note",children:["No key on this computer to register — load a registered key with"," ",f.jsx("code",{children:"ssh-add"}),", or create one with"," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&f.jsx("p",{className:"settings-note",children:e.error})]}):f.jsxs("p",{className:"settings-note",children:["Not signed in. Run ",f.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Checking credentials…"]})]})}const I_={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",ray:"Ray",openresearch:"OpenResearch"},qF={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},GF=["hf","modal","slurm","ray","openresearch"],H_=["hf","modal","openresearch"],F_={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"]};function VF({t:e,isDefault:t}){return e.id==="local"?f.jsx("span",{className:"badge ok",children:"Ready"}):e.unverified?f.jsx("span",{className:"badge",children:"Unknown"}):!e.configured&&t?f.jsx("span",{className:"badge warn",children:"Not configured"}):e.configured?f.jsx("span",{className:"badge ok",children:"Configured"}):f.jsx("span",{className:"badge",children:"Not set up"})}function WF({target:e,flavor:t,onSaved:n}){var d;const[r,i]=O.useState(t??""),[a,c]=O.useState(!1),[l,u]=O.useState(null);O.useEffect(()=>i(t??""),[t]);async function h(g){if(g.preventDefault(),!a){c(!0),u(null);try{n(await h7({backend:e,flavor:r.trim()||null}))}catch(y){u(y instanceof Error?y.message:String(y))}finally{c(!1)}}}const m=r.trim()===(t??"");return f.jsxs("form",{className:"form settings-form compute-flavor-form",onSubmit:h,children:[f.jsxs("label",{children:["Default flavor",f.jsx("input",{className:"mono",type:"text",list:`flavors-${e}`,value:r,onChange:g=>i(g.target.value),placeholder:H_.includes(e)?`e.g. ${((d=F_[e])==null?void 0:d[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:`flavors-${e}`,children:(F_[e]??[]).map(g=>f.jsx("option",{value:g},g))})]}),l&&f.jsx("div",{className:"error",children:l}),f.jsxs("div",{className:"actions",children:[f.jsx("button",{type:"submit",className:"btn sm",disabled:a||m,children:a?"Saving…":"Save flavor"}),H_.includes(e)&&!t&&f.jsxs("span",{className:"muted compute-flavor-hint",children:["This backend requires a flavor — without a default one, each launch must pass"," ",f.jsx("code",{children:"--flavor"}),"."]})]})]})}function YF({target:e,isDefault:t,defaultFlavor:n,open:r,onToggle:i,onSettings:a,onError:c}){const[l,u]=O.useState(!1),[h,m]=O.useState(!1);r&&!l&&u(!0);async function d(g){if(!h){m(!0);try{a(await h7({backend:g}))}catch(y){c(y instanceof Error?y.message:String(y))}finally{m(!1)}}}return f.jsxs("div",{className:`compute-row${r?" open":""}`,children:[f.jsxs("div",{className:"compute-row-head",onClick:i,children:[f.jsx("span",{className:"compute-row-logo",children:f.jsx(Qw,{kind:qF[e.id],size:18})}),f.jsx("span",{className:"compute-row-name",children:I_[e.id]}),f.jsx("span",{className:"compute-row-summary",children:e.summary}),f.jsx(VF,{t:e,isDefault:t}),t?f.jsx("span",{className:"badge compute-default-pill",children:"Default"}):f.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:g=>{g.stopPropagation(),d(e.id)},disabled:h,children:"Make default"}),f.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${I_[e.id]}`,onClick:g=>{g.stopPropagation(),i()},children:f.jsx(Ti,{size:16,className:"compute-chevron"})})]}),l&&f.jsxs("div",{className:"compute-row-body",hidden:!r,children:[t&&f.jsxs("p",{className:"settings-note compute-default-note",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",f.jsx("code",{children:"orx exp run"})," with no ",f.jsx("code",{children:"--backend"})," flag."," ",f.jsx("button",{type:"button",className:"btn sm",onClick:()=>void d(null),disabled:h,children:"Clear default"})]}),t&&!e.configured&&f.jsx("p",{className:"settings-note",children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&GF.includes(e.id)&&f.jsx(WF,{target:e.id,flavor:n,onSaved:a}),e.id==="local"&&f.jsx($F,{}),e.id==="hf"&&f.jsx(JF,{}),e.id==="modal"&&f.jsx(OF,{}),e.id==="k8s"&&f.jsx(DF,{}),e.id==="ssh"&&f.jsx(zF,{}),e.id==="slurm"&&f.jsx(HF,{}),e.id==="ray"&&f.jsx(FF,{}),e.id==="openresearch"&&f.jsx(UF,{})]})]})}function XF(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(null),[c,l]=O.useState(null),u=O.useRef(0);O.useEffect(()=>{const d=++u.current;VT().then(g=>{d===u.current&&(t(g),r(null))}).catch(g=>{if(d!==u.current)return;const y=g instanceof Error?g.message:String(g);t(C=>(C===null?r(y):l(y),C))})},[i]);const h=d=>{u.current++,t(d),l(null)},m=e?e.targets:null;return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:"Compute"}),f.jsxs("p",{className:"settings-sub",children:["Where ",f.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",f.jsx("code",{children:"--backend "})," always wins)."]}),n?f.jsx("div",{className:"error",children:n}):m?f.jsxs(f.Fragment,{children:[c&&f.jsx("div",{className:"error",children:c}),f.jsx("div",{className:"compute-list",children:m.map(d=>f.jsx(YF,{target:d,isDefault:(e==null?void 0:e.defaultBackend)===d.id,defaultFlavor:(e==null?void 0:e.defaultFlavor)??null,open:i===d.id,onToggle:()=>a(g=>g===d.id?null:d.id),onSettings:h,onError:l},d.id))}),f.jsxs("p",{className:"compute-footnote",children:[f.jsx(lN,{size:14,"aria-hidden":"true"}),f.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Checking compute targets…"]})]})}const KF={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function ZF({settings:e}){return e.configured?e.valid?f.jsx("span",{className:"badge ok",children:"Connected"}):f.jsx("span",{className:"badge err",children:"Invalid token"}):f.jsx("span",{className:"badge",children:"Not configured"})}function QF({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?f.jsx("span",{className:"badge ok",children:"Jobs: write OK"}):e.jobsWrite===!1?f.jsx("span",{className:"badge err",children:"No job.write permission"}):f.jsx("span",{className:"badge",children:"Jobs permission unknown"})}function JF(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[c,l]=O.useState(!1),[u,h]=O.useState(null),m=O.useRef(!1);O.useEffect(()=>{wT().then(g=>{m.current||t(g)}).catch(g=>{m.current||r(g instanceof Error?g.message:String(g))})},[]);async function d(g){if(g.preventDefault(),!(!i.trim()||c)){l(!0),h(null);try{const y=await CT(i.trim());m.current=!0,t(y),r(null),a("")}catch(y){h(y instanceof Error?y.message:String(y))}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-sub",children:["Run experiments on your Hugging Face account with"," ",f.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?f.jsx("div",{className:"error",children:n}):e?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Status"}),f.jsx("span",{className:"v",children:f.jsx(ZF,{settings:e})}),f.jsx("span",{className:"k",children:"Account"}),f.jsx("span",{className:"v",children:e.username??"—"}),f.jsx("span",{className:"k",children:"Token"}),f.jsx("span",{className:"v",children:e.maskedToken??"—"}),f.jsx("span",{className:"k",children:"Source"}),f.jsx("span",{className:"v",children:e.source?KF[e.source]:"Not configured"}),f.jsx("span",{className:"k",children:"Jobs"}),f.jsxs("span",{className:"v",children:[f.jsx(QF,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&f.jsx("p",{className:"settings-note",children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&f.jsxs("p",{className:"settings-note",children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",f.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",f.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading status…"]}),f.jsxs("form",{className:"form settings-form",onSubmit:d,children:[f.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",f.jsx("input",{type:"password",value:i,onChange:g=>a(g.target.value),placeholder:"hf_…",autoComplete:"off"})]}),u&&f.jsx("div",{className:"error",children:u}),f.jsx("div",{className:"actions",children:f.jsx("button",{type:"submit",className:"btn primary",disabled:!i.trim()||c,children:c?"Validating…":"Save"})})]})]})}const t8=/^hf_[A-Za-z0-9]{10,}$/;function n8(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{className:"settings-note",children:["This value looks like a Hugging Face token — compute runs only read it from"," ",f.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const P_=["HF_TOKEN","WANDB_API_KEY"];function eP({name:e,entry:t,onVars:n,onError:r}){const[i,a]=O.useState(""),[c,l]=O.useState(!1),u=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function h(){if(!(!i.trim()||c)){l(!0);try{n(await u7(e,i.trim())),a("")}catch(d){u(d)}finally{l(!1)}}}async function m(){if(!c){l(!0);try{n(await LT(e))}catch(d){u(d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"mono",children:e}),f.jsx("td",{className:"mono muted",children:t?f.jsxs(f.Fragment,{children:[t.maskedValue,t.inProcessEnv&&f.jsx("span",{className:"badge",children:"Overridden by env"})]}):f.jsx("input",{className:"mono",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),h()),d.key==="Escape"&&!c&&a("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:c})}),f.jsx("td",{children:t?f.jsx("button",{className:"icon-btn",title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void m(),disabled:c,children:f.jsx(Wg,{size:13})}):i.trim()&&f.jsx("button",{className:"btn sm",onClick:()=>void h(),disabled:c,children:c?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&t8.test(i.trim())&&f.jsx(n8,{})]})}function tP({onVars:e,onError:t,onDone:n}){const[r,i]=O.useState(""),[a,c]=O.useState(""),[l,u]=O.useState(!1);async function h(){if(!(!r.trim()||!a.trim()||l)){u(!0);try{e(await u7(r.trim(),a.trim())),n()}catch(d){t(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{u(!1)}}}const m=d=>{d.key==="Enter"&&(d.preventDefault(),h()),d.key==="Escape"&&!l&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx("input",{autoFocus:!0,className:"mono",type:"text",value:r,onChange:d=>i(d.target.value),onKeyDown:m,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:l})}),f.jsx("td",{children:f.jsx("input",{className:"mono",type:"password",value:a,onChange:d=>c(d.target.value),onKeyDown:m,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:l})}),f.jsxs("td",{children:[f.jsx("button",{className:"btn sm",onClick:()=>void h(),disabled:l||!r.trim()||!a.trim(),children:l?"Saving…":"Save"}),f.jsx("button",{className:"icon-btn",title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:l,children:f.jsx(ll,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&t8.test(a.trim())&&f.jsx(n8,{})]})}function nP(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(!1),[c,l]=O.useState(null);O.useEffect(()=>{RT().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const u=d=>{t(d),l(null)},h=e===null?[]:e.map(d=>d.key).filter(d=>!P_.includes(d)),m=[...P_,...h];return f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("h3",{children:"Environment variables"}),f.jsx("div",{className:"spacer",style:{flex:1}}),f.jsxs("button",{className:"btn sm",onClick:()=>a(!0),disabled:i||e===null,children:[f.jsx(Vg,{size:12})," Add variable"]})]}),f.jsxs("p",{className:"settings-sub",children:["Stored in ",f.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",f.jsx("code",{children:"HF_TOKEN"})," and ",f.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?f.jsx("div",{className:"error",children:n}):e===null?f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading…"]}):f.jsx("table",{className:"env-table",children:f.jsxs("tbody",{children:[m.map(d=>f.jsx(eP,{name:d,entry:e.find(g=>g.key===d),onVars:u,onError:l},d)),i&&f.jsx(tP,{onVars:u,onError:l,onDone:()=>a(!1)})]})}),c&&f.jsx("div",{className:"error",children:c})]})}function rP(){const[e,t]=O.useState(null),[n,r]=O.useState(""),[i,a]=O.useState(""),[c,l]=O.useState(!1),[u,h]=O.useState(null);O.useEffect(()=>{f7().then(g=>{t(g),r(g.userName??""),a(g.userEmail??"")}).catch(()=>{})},[]);const m=e!==null&&n.trim()===(e.userName??"")&&i.trim()===(e.userEmail??"");async function d(g){if(g.preventDefault(),!(c||m)){l(!0),h(null);try{const y=await ZT({userName:n.trim(),userEmail:i.trim()});t(y),r(y.userName??""),a(y.userEmail??"")}catch(y){h(y instanceof Error?y.message:String(y))}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:"Git"}),f.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"settings-card",children:[f.jsx("h3",{children:"Identity"}),f.jsxs("form",{className:"form",onSubmit:d,children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:["user.name",f.jsx("input",{type:"text",value:n,onChange:g=>r(g.target.value),autoComplete:"off"})]}),f.jsxs("label",{children:["user.email",f.jsx("input",{type:"text",value:i,onChange:g=>a(g.target.value),autoComplete:"off"})]})]}),u&&f.jsx("div",{className:"error",children:u}),f.jsx("div",{className:"actions",children:f.jsx("button",{type:"submit",className:"btn primary",disabled:c||m||!n.trim()&&!i.trim(),children:c?"Saving…":"Save"})})]})]}),f.jsxs("div",{className:"settings-card",children:[f.jsx("h3",{children:"GitHub access"}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"git"}),f.jsx("span",{className:"v",children:e.gitVersion??"not found"}),f.jsx("span",{className:"k",children:"Token"}),f.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",f.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),f.jsx(Zw,{onSaved:t})]}),e.githubTokenSource==="stored"&&f.jsx("div",{className:"actions",children:f.jsx("button",{className:"btn",onClick:()=>{JT().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading…"]})]})}const iP={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function sP(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(""),[c,l]=O.useState(!1),[u,h]=O.useState(null),[m,d]=O.useState({kind:"idle"}),[g,y]=O.useState(null),C=()=>OT().then(k=>{t(k),a(N=>N||k.current)}).catch(k=>r(k instanceof Error?k.message:String(k)));O.useEffect(()=>{C()},[]),O.useEffect(()=>wM(k=>{k.type==="progress"?d(N=>{const A=N.kind==="moving"?N.total:0;return{kind:"moving",phase:k.phase,copied:k.copiedBytes,total:k.totalBytes||A}}):k.type==="done"?(d({kind:"done",oldPathLeft:k.oldPathLeft}),h(null),a(""),C()):k.type==="error"&&d({kind:"error",message:k.error})}),[]);const w=(e==null?void 0:e.source)==="env",b=i.trim(),_=e!==null&&b===e.current;async function x(){if(!(c||!b)){l(!0),y(null),h(null);try{h(await BT(b))}catch(k){y(k instanceof Error?k.message:String(k))}finally{l(!1)}}}async function S(k){if(k.preventDefault(),!(m.kind==="moving"||!b||_)&&(y(null),!!window.confirm(`Move all orx data to: -${b} - -The store is copied to the new location and activated there. Active runs or chats will block the move.`))){d({kind:"moving",phase:"preparing",copied:0,total:(u==null?void 0:u.treeBytes)??0});try{await zT(b)}catch(N){d({kind:"idle"}),y(N instanceof Error?N.message:String(N))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:"Storage"}),f.jsxs("p",{className:"settings-sub",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",f.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?f.jsx("div",{className:"settings-card",children:f.jsx("div",{className:"error",children:n})}):e?f.jsxs("div",{className:"settings-card",children:[f.jsxs("div",{className:"settings-card-head",children:[f.jsx("h3",{children:"Data directory"}),f.jsx("div",{className:"spacer",style:{flex:1}}),f.jsx("span",{className:"badge",children:e.isDefault?"Default":"Custom"})]}),f.jsxs("div",{className:"kv",children:[f.jsx("span",{className:"k",children:"Current"}),f.jsx("span",{className:"v mono",children:e.current}),f.jsx("span",{className:"k",children:"Source"}),f.jsx("span",{className:"v",children:iP[e.source]}),!e.isDefault&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:"Default"}),f.jsx("span",{className:"v mono",children:e.defaultPath})]})]}),w?f.jsxs("p",{className:"settings-note",children:["The data directory is pinned by the ",f.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):f.jsxs("form",{className:"form settings-form",onSubmit:S,children:[f.jsxs("label",{children:["New location",f.jsx("input",{className:"mono",type:"text",value:i,onChange:k=>{a(k.target.value),h(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:m.kind==="moving"})]}),u&&!u.error&&u.ok&&f.jsxs("p",{className:"settings-note",children:["Ready to move ",$a(u.treeBytes??0),u.freeBytes!=null&&` — ${$a(u.freeBytes)} free at target`,u.sameFilesystem?" (same disk, instant)":"","."]}),u&&u.ok===!1&&u.error&&f.jsx("div",{className:"error",children:u.error}),g&&f.jsx("div",{className:"error",children:g}),m.kind==="moving"&&f.jsx(e8,{value:m.copied,max:m.total,label:`${m.phase.charAt(0).toUpperCase()}${m.phase.slice(1)}…`,caption:m.total>0?f.jsxs("span",{className:"mono",children:[$a(m.copied)," / ",$a(m.total)]}):void 0}),m.kind==="done"&&f.jsxs("p",{className:"settings-note",children:["Moved. orx is now using the new location.",m.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ","The old copy was left at ",f.jsx("code",{children:m.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),m.kind==="error"&&f.jsxs("div",{className:"error",children:["Move failed: ",m.message]}),f.jsxs("div",{className:"actions",children:[f.jsx("button",{type:"button",className:"btn",onClick:x,disabled:c||!b||_||m.kind==="moving",children:c?"Checking…":"Check"}),f.jsx("button",{type:"submit",className:"btn primary",disabled:!b||_||m.kind==="moving",children:m.kind==="moving"?"Moving…":"Move data here"})]})]})]}):f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading…"]})]})}const hg=e=>e==="running"||e==="starting";function aP(e){return hg(e.status)?R0(Date.now()-e.createdAt):e.endedAt?R0(e.endedAt-e.createdAt):"—"}function oP({watcher:e}){return e==="alive"?f.jsx(fs,{status:"running",label:"Watching"}):e==="lost"?f.jsx(fs,{status:"failed",label:"Lost"}):f.jsx(f.Fragment,{children:"—"})}function $_({instances:e,emptyLabel:t,showWatcher:n}){return e.length===0?f.jsx("p",{className:"instances-empty",children:t}):f.jsx("div",{className:"instances-table-wrap",children:f.jsxs("table",{className:"runs-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Backend"}),f.jsx("th",{children:"Project"}),f.jsx("th",{children:"Status"}),n&&f.jsx("th",{children:"Watcher"}),f.jsx("th",{children:"Started"}),f.jsx("th",{children:"Runtime"})]})}),f.jsx("tbody",{children:e.map(r=>{var a;const i=typeof((a=r.backend)==null?void 0:a.url)=="string"?r.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell",children:[f.jsx(Jw,{backend:r.backend}),i&&f.jsx("a",{className:"icon-btn",href:i,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:c=>c.stopPropagation(),children:f.jsx(cu,{size:12})})]})}),f.jsx("td",{children:r.projectName??k1(r.projectId)}),f.jsx("td",{children:f.jsx(fs,{status:r.status})}),n&&f.jsx("td",{children:f.jsx(oP,{watcher:r.watcher})}),f.jsx("td",{children:gs(r.createdAt)}),f.jsx("td",{children:aP(r)})]},r.id)})})]})})}function lP(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState(!1),[c,l]=O.useState(!1),[u,h]=O.useState(null),[,m]=O.useState(0);O.useEffect(()=>{const b=setInterval(()=>m(_=>_+1),3e4);return()=>clearInterval(b)},[]);const d=()=>{a(!0),lT().then(b=>{t(b),r(null)}).catch(b=>{r(b instanceof Error?b.message:String(b)),t(_=>_??[])}).finally(()=>a(!1))};O.useEffect(()=>d(),[]);const g=()=>{l(!0),h(null),cT().then(b=>{h(b.length===0?"All watchers are alive — nothing to reattach.":`Reattached ${b.length} watcher${b.length===1?"":"s"} — statuses will settle shortly.`),r(null),d()}).catch(b=>r(b instanceof Error?b.message:String(b))).finally(()=>l(!1))},y=(b,_)=>_.createdAt-b.createdAt,C=e==null?void 0:e.filter(b=>hg(b.status)).sort(y),w=e==null?void 0:e.filter(b=>!hg(b.status)).sort(y);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"settings-head-row",children:[f.jsx("h1",{children:"Instances"}),f.jsxs("button",{className:"btn sm",onClick:d,disabled:i,children:[f.jsx(Mi,{size:12,className:i?"spin":""})," Refresh"]}),f.jsxs("button",{className:"btn sm",onClick:g,disabled:c,title:"Respawn watchers for live runs whose supervisor died, so stuck statuses settle",children:[f.jsx(NN,{size:12,className:c?"spin":""})," Reattach watchers"]})]}),f.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),u&&f.jsx("p",{className:"settings-sub",children:u}),n&&f.jsx("div",{className:"error",children:n}),!C||!w?f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading…"]}):f.jsxs(f.Fragment,{children:[f.jsxs("h2",{className:"instances-section-title",children:["Running",C.length>0&&f.jsx("span",{className:"count-badge",children:C.length})]}),f.jsx($_,{instances:C,emptyLabel:"Nothing running right now.",showWatcher:!0}),f.jsx("h2",{className:"instances-section-title",children:"Past"}),f.jsx($_,{instances:w,emptyLabel:"No past instances yet."})]})]})}function cP({persona:e,isActive:t,hasProject:n,open:r,saving:i,onToggle:a,onActivate:c}){const[l,u]=O.useState(null),[h,m]=O.useState(!1);return f.jsxs("div",{className:`compute-row persona-card persona-${e.id}${r?" open":""}`,children:[f.jsxs("div",{className:"compute-row-head",onClick:a,children:[f.jsx("span",{className:`persona-swatch persona-${e.id}`}),f.jsx("span",{className:"compute-row-name",children:e.label}),f.jsx("span",{className:"compute-row-summary",children:e.description}),t?f.jsx("span",{className:`badge persona-active-pill persona-${e.id}`,children:"Active"}):f.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:d=>{d.stopPropagation(),c()},disabled:i||!n,children:"Use for this project"}),f.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${e.label}`,onClick:d=>{d.stopPropagation(),a()},children:f.jsx(Ti,{size:16,className:"compute-chevron"})})]}),r&&f.jsxs("div",{className:"compute-row-body",children:[f.jsx("h3",{className:"persona-section-title",children:"Skills"}),f.jsx("p",{className:"settings-note",children:"Installed fresh into every chat session's worktree — the agent auto-loads them."}),f.jsx("div",{className:"persona-skill-list",children:e.skills.map(d=>{const g=l===d.name;return f.jsxs("div",{className:"persona-skill",children:[f.jsxs("button",{type:"button",className:"persona-skill-head","aria-expanded":g,onClick:()=>u(g?null:d.name),children:[f.jsx(Ti,{size:14,className:"compute-chevron",style:g?{transform:"rotate(180deg)"}:void 0}),f.jsx("span",{className:"persona-skill-name",children:d.name}),f.jsx("span",{className:"persona-skill-desc",children:d.description})]}),g&&f.jsx("div",{className:"persona-doc",children:f.jsx(Xa,{text:d.content})})]},d.name)})}),f.jsx("h3",{className:"persona-section-title",children:"System prompt"}),f.jsxs("p",{className:"settings-note",children:["Injected into every chat turn; ",f.jsx("code",{children:"{token}"})," placeholders are filled with project facts at render time."," ",f.jsxs("button",{type:"button",className:"btn sm",onClick:()=>m(!h),children:[h?"Hide":"Show"," system prompt"]})]}),h&&f.jsx("div",{className:"persona-doc",children:f.jsx(Xa,{text:e.systemPrompt})})]})]})}function uP({project:e,onProjectUpdated:t}){const[n,r]=O.useState(null),[i,a]=O.useState(null),[c,l]=O.useState(null),[u,h]=O.useState(null),[m,d]=O.useState(!1);O.useEffect(()=>{s7().then(_=>{r(_),a(null)}).catch(_=>a(_ instanceof Error?_.message:String(_)))},[]);const g=(e==null?void 0:e.persona)??"research";async function y(_){if(!(!e||m)){d(!0),l(null);try{t(await C1(e.id,{persona:_}))}catch(x){l(x instanceof Error?x.message:String(x))}finally{d(!1)}}}const C=(e==null?void 0:e.autoPrompts)??{};async function w(_,x){if(!(!e||m)){d(!0),l(null);try{t(await C1(e.id,{autoPrompts:{...C,[_]:x}}))}catch(S){l(S instanceof Error?S.message:String(S))}finally{d(!1)}}}const b=[{key:"playSession",label:"Play session ended",hint:"prompt the agent to ask how it felt and record your verdict"},{key:"playBuildFailed",label:"Play build failed",hint:"prompt the agent to read the log and fix the branch"},{key:"runCompleted",label:"Job / sim run completed",hint:"prompt the agent to analyze the result and continue the loop"}];return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:"Persona"}),f.jsxs("p",{className:"settings-sub",children:["Who the agent is for"," ",e?f.jsx("strong",{children:e.name}):"this project",": each persona sets the system prompt and the skills injected into every chat session."]}),!e&&f.jsx("p",{className:"settings-note",children:"Open a project to switch its persona."}),i&&f.jsx("div",{className:"error",children:i}),c&&f.jsx("div",{className:"error",children:c}),n&&f.jsx("div",{className:"compute-list",children:n.map(_=>f.jsx(cP,{persona:_,isActive:g===_.id,hasProject:e!==null,open:u===_.id,saving:m,onToggle:()=>h(u===_.id?null:_.id),onActivate:()=>void y(_.id)},_.id))}),e&&f.jsxs(f.Fragment,{children:[f.jsx("h3",{className:"persona-section-title",children:"Automatic agent prompts"}),f.jsxs("p",{className:"settings-note",children:["When enabled, the dashboard sends the agent an ",f.jsx("code",{children:"[orx]"})," message as these events finish (only while it's idle). All off by default — the agent only acts when you talk to it."]}),f.jsx("div",{className:"persona-prompt-toggles",children:b.map(_=>f.jsxs("label",{className:"persona-prompt-toggle",children:[f.jsx("input",{type:"checkbox",checked:C[_.key]===!0,disabled:m,onChange:x=>void w(_.key,x.target.checked)}),f.jsxs("span",{children:[f.jsx("span",{className:"persona-prompt-label",children:_.label}),f.jsxs("span",{className:"persona-prompt-hint",children:[" — ",_.hint]})]})]},_.key))})]})]})}function hP(){const[e,t]=O.useState(Kw());function n(r){t(r),hF(r)}return f.jsxs("div",{className:"settings-section",children:[f.jsx("h1",{children:"Appearance"}),f.jsxs("p",{className:"settings-sub",children:["Themes from the tradition of Sanzo Wada’s ",f.jsx("em",{children:"A Dictionary of Color Combinations"}),". Pick one to retint the whole workspace — it applies instantly and is remembered on this device."]}),f.jsx("div",{className:"theme-grid",children:ug.map(r=>f.jsxs("button",{className:`theme-card ${e===r.id?"active":""}`,onClick:()=>n(r.id),title:r.name,children:[f.jsxs("span",{className:"theme-swatches",style:{background:r.tokens["--canvas"]},children:[f.jsx("i",{style:{background:r.primary}}),f.jsx("i",{style:{background:r.tokens["--panel"]}}),f.jsx("i",{style:{background:r.tokens["--surface-bright"]}}),f.jsx("i",{style:{background:r.tokens["--text"]}})]}),f.jsxs("span",{className:"theme-meta",children:[f.jsx("span",{className:"theme-name",children:r.name}),f.jsx("span",{className:"theme-jp",children:r.jp})]}),e===r.id&&f.jsx("span",{className:"theme-check",children:"✓"})]},r.id))})]})}const U_=[{id:"appearance",label:"Appearance",icon:f.jsx(wN,{size:15})},{id:"persona",label:"Persona",icon:f.jsx(UA,{size:15})},{id:"harnesses",label:"Harnesses",icon:f.jsx(SA,{size:15})},{id:"generative-ai",label:"Generative AI",icon:f.jsx(FN,{size:15})},{id:"compute",label:"Compute",icon:f.jsx(PA,{size:15})},{id:"instances",label:"Instances",icon:f.jsx(w1,{size:15})},{id:"environment",label:"Environment",icon:f.jsx($N,{size:15})},{id:"git",label:"Git",icon:f.jsx(Sl,{size:15})},{id:"storage",label:"Storage",icon:f.jsx(aN,{size:15})}];function dP({tab:e,project:t=null,onProjectUpdated:n=()=>{}}){return f.jsxs("div",{className:"settings-view",children:[e==="appearance"&&f.jsx(hP,{}),e==="persona"&&f.jsx(uP,{project:t,onProjectUpdated:n}),e==="harnesses"&&f.jsx(CF,{}),e==="generative-ai"&&f.jsx(kF,{}),e==="compute"&&f.jsx(XF,{}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:"Environment"}),f.jsx("p",{className:"settings-sub",children:"Variables available to runs and the research agent (API keys, tokens)."}),f.jsx(nP,{})]}),e==="instances"&&f.jsx(lP,{}),e==="git"&&f.jsx(rP,{}),e==="storage"&&f.jsx(sP,{})]})}function fP({skills:e,activeIndex:t,onPick:n,onHover:r}){return f.jsx("div",{className:"skill-menu",children:e.map((i,a)=>f.jsxs("button",{type:"button",className:`skill-item ${a===t?"active":""}`,onMouseDown:c=>{c.preventDefault(),n(i)},onMouseEnter:()=>r(a),children:[f.jsxs("span",{className:"skill-name",children:["/",i.name," ",f.jsx("span",{className:"skill-hint",children:i.argHint})]}),f.jsx("span",{className:"skill-desc",children:i.description})]},i.name))})}function l2(e){return e?e.split(/`([^`]+)`/).map((t,n)=>n%2===1?f.jsx("code",{className:"mono",children:t},n):t):null}const Hc={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function q_(e){var r,i;const t=e.find(a=>a.agentReady);if(!t)return null;const n=((r=t.models[0])==null?void 0:r.id)??null;return{harness:t.id,model:n,permissionMode:((i=t.options)==null?void 0:i.defaultPermissionMode)??null,reasoningLevel:Xg(t,n).defaultId}}function bu(){const[e,t]=O.useState(!1),n=O.useRef(null);return O.useEffect(()=>{if(!e)return;const r=a=>{var c;(c=n.current)!=null&&c.contains(a.target)||t(!1)},i=a=>{a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1))};return document.addEventListener("mousedown",r),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",i,!0)}},[e]),{open:e,setOpen:t,ref:n}}function pP({value:e,onSelect:t,onHarnesses:n,lockHarness:r=!1}){var w;const[i,a]=O.useState([]),{open:c,setOpen:l,ref:u}=bu(),[h,m]=O.useState("");O.useEffect(()=>{let b=!0;const _=(S=!1)=>cl(S).then(k=>{b&&(a(k),n==null||n(k))}).catch(()=>{});_();const x=Zg(()=>void _(!0));return()=>{b=!1,x()}},[]);const d=O.useMemo(()=>{const b=h.trim().toLowerCase();return(r&&e?i.filter(x=>x.id===e.harness):i).map(x=>{let S=x.models;if(b)S=S.filter(k=>k.id.toLowerCase().includes(b));else if(x.id==="opencode"){const k=[],N=new Set;for(const A of x.models){const j=A.id.split("/")[0]??A.id;N.has(j)||(N.add(j),k.push(A))}for(const A of x.models){if(k.length>=6)break;k.includes(A)||k.push(A)}S=k}return{harness:x,models:S,hidden:b?0:x.models.length-S.length}})},[i,h,r,e]),g=(b,_)=>{var S;const x=(e==null?void 0:e.harness)===b.id;t({harness:b.id,model:_,permissionMode:x?e.permissionMode:((S=b.options)==null?void 0:S.defaultPermissionMode)??null,reasoningLevel:p7(b,_,x?e.reasoningLevel:null)}),l(!1),m("")},y=(e==null?void 0:e.model)!=null?(w=i.find(b=>b.id===e.harness))==null?void 0:w.models.find(b=>b.id===e.model):void 0,C=e?e.model?y?j0(y):Kg(e.model):"Default model":"Model";return f.jsxs("div",{className:"model-picker","data-onboarding":"model-picker",ref:u,children:[f.jsxs("button",{type:"button",className:"composer-pill",title:`Harness + model for this chat — ${C}`,onClick:()=>l(b=>!b),children:[f.jsx("span",{className:"pill-label",children:C}),f.jsx(Ti,{size:12})]}),c&&f.jsxs("div",{className:"model-menu align-right",children:[f.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:h,onChange:b=>m(b.target.value)}),f.jsxs("div",{className:"model-menu-list",children:[d.map(({harness:b,models:_,hidden:x})=>f.jsxs("div",{children:[f.jsxs("div",{className:"model-group",children:[f.jsx("span",{children:b.name}),!b.agentReady&&f.jsxs("span",{className:"model-group-status",children:[f.jsx(I3,{size:10})," Unavailable"]})]}),b.agentReady?f.jsxs(f.Fragment,{children:[b.models.length===0&&f.jsxs("button",{className:"model-item",onClick:()=>g(b,null),children:[f.jsxs("span",{children:["Default model",f.jsx("span",{className:"model-id",children:"CLI configuration"})]}),(e==null?void 0:e.harness)===b.id&&(e==null?void 0:e.model)===null&&f.jsx(Qr,{size:13})]}),_.map(S=>f.jsxs("button",{className:"model-item",title:S.id,onClick:()=>g(b,S.id),children:[f.jsxs("span",{children:[j0(S),f.jsx("span",{className:"model-id",children:S.description??S.id})]}),(e==null?void 0:e.harness)===b.id&&(e==null?void 0:e.model)===S.id&&f.jsx(Qr,{size:13})]},S.id)),x>0&&f.jsxs("div",{className:"model-more",children:[x," more — search to find"]}),h.trim().length>0&&!b.models.some(S=>S.id===h.trim())&&f.jsx("button",{className:"model-item",onClick:()=>g(b,h.trim()),children:f.jsxs("span",{children:["Use “",h.trim(),"”",f.jsx("span",{className:"model-id",children:"pass as the model id"})]})})]}):f.jsx("div",{className:"model-more model-unavailable",children:b.agentNote?l2(b.agentNote):"Not available"})]},b.id)),i.length===0&&f.jsx("div",{className:"model-more",children:"Detecting harnesses…"})]}),r&&e&&i.length>1&&f.jsxs("div",{className:"model-locked-note",children:[f.jsx(I3,{size:11}),"Sessions keep their harness — new chat to switch"]})]})]})}function e1({choices:e,value:t,defaultId:n,header:r,align:i="left",variant:a="pill",title:c,numbered:l=!1,menuDirection:u="up",onSelect:h}){var k,N;const{open:m,setOpen:d,ref:g}=bu();if(e.length===0)return null;const y=t??n??((k=e[0])==null?void 0:k.id)??null,C=e.find(A=>A.id===y),w=e.find(A=>A.id===n),b=w&&w.id===D0?w:void 0,_=b?e.filter(A=>A.id!==b.id):e,x=(C==null?void 0:C.label)??((N=e[0])==null?void 0:N.label)??"",S=A=>{h(A),d(!1)};return f.jsxs("div",{className:"option-picker",ref:g,children:[f.jsxs("button",{type:"button",className:a==="pill"?"composer-pill":"composer-bare",title:c,onClick:()=>d(A=>!A),children:[f.jsx("span",{className:"pill-label",children:x}),f.jsx(Ti,{size:12})]}),m&&f.jsxs("div",{className:`option-menu ${i==="right"?"align-right":""} ${u==="down"?"drop-down":""}`,children:[r&&f.jsx("div",{className:"model-group",children:r}),b&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{className:"model-item",onClick:()=>S(b.id),children:[f.jsxs("span",{children:[b.label,f.jsx("span",{className:"option-default",children:b.label==="Default"?" · CLI configuration":" · Default"})]}),y===b.id&&f.jsx(Qr,{size:13})]}),f.jsx("div",{className:"option-sep"})]}),_.map((A,j)=>f.jsxs("button",{className:"model-item",onClick:()=>S(A.id),children:[f.jsxs("span",{children:[A.label,!b&&A.id===n&&f.jsx("span",{className:"option-default",children:" · Default"})]}),y===A.id?f.jsx(Qr,{size:13}):l&&f.jsx("span",{className:"option-num",children:j+1})]},A.id))]})]})}function mP(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const dg=6.5,G_=2*Math.PI*dg;function gP({usage:e}){const{open:t,setOpen:n,ref:r}=bu();if(!e)return null;const{usedTokens:i,contextWindow:a}=e,c=a&&a>0?Math.min(100,Math.round(i/a*100)):null,l=c===null?"var(--accent)":mP(c);return f.jsxs("div",{className:"option-picker",ref:r,children:[f.jsx("button",{type:"button",className:"composer-bare context-ring",title:"Context window used",onClick:()=>n(u=>!u),children:c===null?Bh(i):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:dg,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:dg,fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${G_*Math.max(c,2)/100} ${G_}`,transform:"rotate(-90 8 8)"})]})}),t&&f.jsxs("div",{className:"option-menu align-right context-meter-menu",children:[f.jsxs("div",{className:"context-meter-head",children:[f.jsx("span",{children:"Context window"}),f.jsx("span",{className:"context-meter-value",children:c===null?`${Bh(i)} tokens`:`${Bh(i)} / ${Bh(a)} (${c}%)`})]}),c!==null&&f.jsx(e8,{value:i,max:a,fillColor:l})]})]})}const r8="orx:agent-selection";function i8(e){switch(e){case"game-designer":return"Game designer persona";case"idea-foundry":return"Idea foundry persona";case"analyst":return"Analyst persona";case"producer":return"Producer persona";case"blender":return"Blender artist persona";case"comfyui":return"ComfyUI artist persona";default:return"Research agent persona"}}function vP(){try{const e=localStorage.getItem(r8);return e?JSON.parse(e):null}catch{return null}}const c2="local-";function yP(e,t){const n=e.findIndex(i=>i.id===t.id);if(n>=0){const i=e.slice();return i[n]=t,i}return[...t.role==="user"?e.filter(i=>!i.id.startsWith(c2)):e,t]}function bP(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set};case"seed":return t.onlyIfAbsent&&t.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:yP(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((a,c)=>r.push({id:`img${c}`,type:"image",text:a}));const i={id:`${c2}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,i]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":{const n=new Set(t.sessions),r=new Set(t.known);for(const i of e.busySessions)r.has(i)||n.add(i);return{...e,busySessions:n}}case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);return r.delete(t.sessionId),{messagesBySession:n,busySessions:r}}}}function _P({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?f.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):f.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Td(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function xP(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function V_(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function u2(e){var c,l;const t=e.tool??"tool",n=((c=e.state)==null?void 0:c.input)??{},r=typeof n.command=="string"?n.command:null,i=typeof n.filePath=="string"?n.filePath:null,a=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return i?`Read ${V_(i)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return i?`Edited ${V_(i)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebSearch":{if(typeof n.query=="string"&&n.query)return`Searched the web: “${n.query}”`;const u=typeof n.url=="string"?n.url:null;return typeof n.pattern=="string"&&n.pattern&&u?`Searched “${n.pattern}” in ${u}`:u?`Opened ${u}`:n.type==="other"?"Browsed the web":a??"Searched the web"}case"WebFetch":return typeof n.url=="string"?`Fetched ${n.url}`:a??"Fetched a page";case"Task":return a??"Ran a subagent";case"subagent":return SP(n);case"error":return"Error";case"interrupted":return"Interrupted";default:{const u=a??i??r??((l=e.state)==null?void 0:l.title)??"";return u?`${t}: ${u}`:t}}}function SP(e){const t=r=>r.length>60?`${r.slice(0,60)}…`:r,n=typeof e.prompt=="string"&&e.prompt?` — “${t(e.prompt)}”`:"";switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return`Spawned agent${n}`;case"sendInput":return`Sent input to agent${n}`;case"resumeAgent":return"Resumed agent";case"wait":return"Waiting on agent";case"closeAgent":return"Closed agent"}switch(typeof e.kind=="string"?e.kind:""){case"started":return"Sub-agent started";case"interacted":return"Sub-agent activity";case"interrupted":return"Sub-agent interrupted"}return"Sub-agent"}function W_({part:e,onOpenFile:t}){var l,u;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.command)=="string"?n.input.command:null,a=typeof((u=n==null?void 0:n.input)==null?void 0:u.filePath)=="string"?n.input.filePath:null,c=!!(r||i||a);return f.jsxs("details",{className:"tool-row",open:!1,children:[f.jsxs("summary",{children:[f.jsx("span",{className:Td(n==null?void 0:n.status)}),f.jsx("span",{className:"tool-line",children:u2(e)}),a&&t&&f.jsx("button",{className:"tool-open file-link",title:`Open ${a}`,onClick:h=>{h.preventDefault(),h.stopPropagation(),t(a)},children:"open"})]}),c&&f.jsxs("div",{className:"tool-detail",children:[i&&f.jsx("div",{className:"tool-cmd-full",children:i}),r&&f.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function wP({parts:e,onOpenFile:t}){const n=e.some(u=>{var h;return((h=u.state)==null?void 0:h.status)==="running"}),r=e.some(u=>{var h;return((h=u.state)==null?void 0:h.status)==="error"}),[i,a]=O.useState(!1);if(e.length===1)return f.jsx("div",{className:`tool-group ${r?"has-error":""}`,children:f.jsx(W_,{part:e[0],onOpenFile:t})});const c=i||n,l=`Used ${e.length} tools`;return f.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[f.jsxs("button",{className:"tool-group-summary",onClick:()=>a(u=>!u),children:[f.jsx("span",{className:Td(n?"running":r?"error":"completed")}),f.jsx("span",{className:"tool-line",children:l}),f.jsx(xl,{size:12,className:`tool-chevron ${c?"open":""}`})]}),c&&f.jsx("div",{className:"tool-group-rows",children:e.map(u=>f.jsx(W_,{part:u,onOpenFile:t},u.id))})]})}function CP({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r,fileSrc:i}){var d,g,y;const a=e.prompt,[c,l]=O.useState([]),u=!t,h=C=>t==null?void 0:t({promptId:e.id,...C});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const w=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",b=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return f.jsxs("details",{className:"prompt-collapsed",children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),f.jsx("span",{className:`prompt-outcome ${b}`,children:w})]}),f.jsxs("div",{className:"prompt-collapsed-body",children:[f.jsx(Xa,{text:a.plan??"",onOpenFile:n,fileSrc:i}),a.note&&f.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const C=(a.answers??[]).join(", ")||a.note||"";return f.jsxs("details",{className:"prompt-collapsed",children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),f.jsx("span",{className:`prompt-outcome ${C?"chosen":""}`,children:C||"Resolved"})]}),f.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&f.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(w=>{var b;return f.jsx("li",{className:(b=a.answers)!=null&&b.includes(w.label)?"sel":"",children:w.label},w.label)})}),a.note&&a.note!==C&&f.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const C=!!r;return f.jsxs("div",{className:`prompt-card plan ${u?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),f.jsx("div",{className:`prompt-plan ${C?"clamped":""}`,children:f.jsx(Xa,{text:a.plan??"",onOpenFile:n,fileSrc:i})}),C&&f.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!u&&!C&&f.jsxs("div",{className:"prompt-actions",children:[f.jsx("button",{className:"btn-primary",onClick:()=>h({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),f.jsx("button",{className:"btn-ghost",onClick:()=>h({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),f.jsx("button",{className:"btn-ghost",onClick:()=>h({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const C=typeof((d=a.toolInput)==null?void 0:d.command)=="string"&&a.toolInput.command||typeof((g=a.toolInput)==null?void 0:g.filePath)=="string"&&a.toolInput.filePath||"",w=typeof((y=a.toolInput)==null?void 0:y.reason)=="string"&&a.toolInput.reason||"";return f.jsxs("div",{className:`prompt-card permission ${u?"readonly":""}`,children:[f.jsxs("div",{className:"prompt-head",children:["Permission needed: ",f.jsx("code",{children:a.tool})]}),C&&f.jsx("div",{className:"prompt-sub",children:C}),w&&f.jsx("div",{className:"prompt-sub",children:w}),!u&&f.jsxs("div",{className:"prompt-actions",children:[f.jsx("button",{className:"btn-primary",onClick:()=>h({approve:!0}),children:"Allow"}),f.jsx("button",{className:"btn-ghost",onClick:()=>h({approve:!1}),children:"Deny"})]})]})}const m=C=>l(w=>a.multiSelect?w.includes(C)?w.filter(b=>b!==C):[...w,C]:[C]);return f.jsxs("div",{className:`prompt-card question ${u?"readonly":""}`,children:[a.header&&f.jsx("div",{className:"prompt-head",children:a.header}),a.question&&f.jsx("div",{className:"prompt-q",children:a.question}),f.jsx("div",{className:"prompt-options",children:(a.options??[]).map(C=>{const w=c.includes(C.label);return f.jsxs("button",{className:`prompt-option ${w?"sel":""}`,disabled:u,onClick:()=>u?void 0:a.multiSelect?m(C.label):h({answers:[C.label]}),children:[f.jsx("span",{className:"prompt-option-label",children:C.label}),C.description&&f.jsx("span",{className:"prompt-option-desc",children:C.description})]},C.label)})}),a.multiSelect&&!u&&f.jsx("div",{className:"prompt-actions",children:f.jsx("button",{className:"btn-primary",disabled:c.length===0,onClick:()=>h({answers:c}),children:"Submit"})})]})}function s8(e){return e.type==="prompt"?!!e.prompt&&!(e.prompt.resolved&&e.prompt.kind==="permission"):e.type==="text"||e.type==="reasoning"?!!e.text:!0}function kP(e){return e.role==="user"?!0:e.parts.some(s8)}const EP=O.memo(function({message:t,onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,skills:c,fileSrc:l}){if(t.role==="user"){const u=t.parts.filter(g=>g.type==="text").map(g=>g.text??"").join(` -`),h=u.match(/^\/(\S+)([\s\S]*)$/),m=h?c==null?void 0:c.find(g=>g.name===h[1]):void 0,d=t.parts.filter(g=>g.type==="image"&&g.text).map(g=>g.text.startsWith("data:")?g.text:lM(g.text));return f.jsxs("div",{className:"msg-user",children:[m?f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"skill-chip",children:["/",m.name]}),h[2]]}):u,d.length>0&&f.jsx("div",{className:"msg-images",children:d.map((g,y)=>f.jsx("a",{href:g,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:g,alt:"attachment"})},y))})]})}return f.jsx("div",{className:"msg-assistant",children:a8(t.parts,{onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,fileSrc:l})})});function a8(e,t){var m;const{onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,fileSrc:c}=t,l=[];let u=[];const h=()=>{u.length!==0&&(l.push(f.jsx(wP,{parts:u,onOpenFile:n},`tg-${u[0].id}`)),u=[])};for(const d of e)if(s8(d)){if(d.type==="tool"&&(d.tool==="subagent"||(((m=d.children)==null?void 0:m.length)??0)>0)){h(),l.push(f.jsx(NP,{part:d,onOpenSubagent:a},d.id));continue}if(d.type==="tool"){u.push(d);continue}h(),d.type==="text"?l.push(f.jsx(Xa,{text:d.text,onOpenFile:n,fileSrc:c},d.id)):d.type==="reasoning"?l.push(f.jsxs("details",{className:"reasoning",children:[f.jsx("summary",{children:"thinking…"}),d.text]},d.id)):d.type==="prompt"&&d.prompt&&l.push(f.jsx(CP,{part:d,onRespond:r,onOpenFile:n,onOpenPlan:i,fileSrc:c},d.id))}return h(),l}function o8(e,t){for(const n of e){if(n.id===t)return n;const r=n.children&&o8(n.children,t);if(r)return r}return null}function AP({spawn:e,onOpenFile:t,onOpenSubagent:n}){var c,l;const r=e.children??[],i=((c=e.state)==null?void 0:c.status)==="running",a=a8(r,{onOpenFile:t,onOpenSubagent:n});return f.jsxs("div",{className:"msg-assistant",children:[f.jsxs("div",{className:"subagent-tab-header",children:[f.jsx("span",{className:Td((l=e.state)==null?void 0:l.status)}),f.jsx("span",{className:"tool-line",children:u2(e)}),i&&f.jsx("span",{className:"subagent-live",children:"live"})]}),a.length===0?f.jsx("div",{className:"subagent-empty",children:i?"Working…":"No activity"}):a]})}function NP({part:e,onOpenSubagent:t}){var r,i;const n=((r=e.state)==null?void 0:r.status)==="error";return f.jsxs("button",{className:`subagent-row ${n?"has-error":""}`,title:"Open sub-agent transcript",onClick:()=>t==null?void 0:t(e.id),disabled:!t,children:[f.jsx(i7,{size:12,className:"subagent-icon"}),f.jsx("span",{className:Td((i=e.state)==null?void 0:i.status)}),f.jsx("span",{className:"tool-line",children:u2(e)}),f.jsx(xl,{size:12,className:"subagent-row-chevron"})]})}const TP=O.memo(function({messages:t,onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,skills:c,fileSrc:l}){return f.jsx(f.Fragment,{children:t.filter(kP).map(u=>f.jsx(EP,{message:u,onOpenFile:n,onRespond:r,onOpenPlan:i,onOpenSubagent:a,skills:c,fileSrc:l},u.id))})}),Y_=(e,t)=>e==="all"?!0:e==="archived"?t:!t,l8=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function MP({value:e,onChange:t}){const{open:n,setOpen:r,ref:i}=bu();return f.jsxs("div",{className:"rail-filter",ref:i,children:[f.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(a=>!a),children:f.jsx(IN,{size:13})}),n&&f.jsx("div",{className:"option-menu drop-down align-right",children:l8.map(a=>f.jsxs("button",{className:"model-item",onClick:()=>{t(a.id),r(!1)},children:[f.jsx("span",{children:a.label}),e===a.id&&f.jsx(Qr,{size:13})]},a.id))})]})}function jP({proposal:e,personas:t,harnesses:n,onResolved:r}){var j;const[i,a]=O.useState(e.persona??""),[c,l]=O.useState(e.harness??""),[u,h]=O.useState(e.model??""),[m,d]=O.useState(!1),[g,y]=O.useState(null),[C,w]=O.useState(!1),b=Wa(i||"research"),_=b.Icon,x=n.filter(T=>T.agentReady),S=((j=x.find(T=>T.id===c))==null?void 0:j.models)??[],k=S.some(T=>T.id===u)?u:"",N=u&&!S.some(T=>T.id===u)?u:null;async function A(T){d(!0),y(null);try{await T(),r()}catch(D){y(D instanceof Error?D.message:"failed"),d(!1)}}return f.jsxs("div",{className:`proposal-card ${b.cls}`,style:{"--accent":b.color},children:[f.jsxs("div",{className:"proposal-eyebrow",children:[f.jsx(_,{size:14,style:{color:b.color}}),"Suggested next · ",f.jsx("b",{children:b.label})]}),f.jsx("div",{className:"proposal-task",title:e.task,children:e.task}),e.why&&f.jsx("div",{className:"proposal-why",children:e.why}),C&&f.jsxs("div",{className:"proposal-fields",children:[f.jsxs("label",{children:["Agent",f.jsx("select",{value:i,onChange:T=>a(T.target.value),disabled:m,children:t.map(T=>f.jsx("option",{value:T.id,children:T.label},T.id))})]}),f.jsxs("label",{children:["Provider",f.jsx("select",{value:c,onChange:T=>{l(T.target.value),h("")},disabled:m,children:x.map(T=>f.jsx("option",{value:T.id,children:T.name},T.id))})]}),f.jsxs("label",{children:["Model",f.jsxs("select",{value:k,onChange:T=>h(T.target.value),disabled:m,children:[f.jsx("option",{value:"",children:"(harness default)"}),S.map(T=>f.jsx("option",{value:T.id,children:Kg(T.id)},T.id))]})]})]}),N&&f.jsxs("div",{className:"proposal-why",children:[Wa(i||"research").label," was suggested on"," ",f.jsx("code",{children:N}),", which this provider doesn't offer — it will run on the provider default unless you pick a model."]}),g&&f.jsx("div",{className:"proposal-err",children:g}),f.jsxs("div",{className:"proposal-actions",children:[f.jsx("button",{className:"proposal-approve",disabled:m||!c,onClick:()=>A(()=>nT(e.id,{persona:i||void 0,harness:c||void 0,model:k})),children:"Approve →"}),f.jsx("button",{className:"proposal-secondary",disabled:m,onClick:()=>w(T=>!T),children:C?"Done":"Change agent"}),f.jsx("button",{className:"proposal-secondary",disabled:m,onClick:()=>A(()=>rT(e.id)),children:"Dismiss"})]})]})}const DP=14,RP=500,LP=1200;function c8({title:e,animate:t}){return t?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((n,r)=>n===" "?f.jsx("span",{"aria-hidden":!0,children:n},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char",style:{animationDelay:`${Math.min(r*DP,RP)}ms`},children:n},r))}):f.jsx(f.Fragment,{children:e})}function OP({session:e,active:t,busy:n,waiting:r,persona:i,depth:a=0,revealTitle:c,onOpen:l,onRename:u,onSetArchived:h,onDelete:m}){var D;const{open:d,setOpen:g,ref:y}=bu(),C=((D=e.title)==null?void 0:D.trim())||"Untitled",w=e.persona??i??"research",b=e.model??e.effectiveModel,_=`${Hc[e.harness]??e.harness}${b?` · ${b}`:""}`,[x,S]=O.useState(!1),[k,N]=O.useState(""),A=O.useRef(null);function j(){var B;N(((B=e.title)==null?void 0:B.trim())||""),S(!0)}function T(){var F;const B=k.trim();S(!1),B&&B!==(((F=e.title)==null?void 0:F.trim())||"")&&u(B)}return O.useEffect(()=>{var B,F;x&&((B=A.current)==null||B.focus(),(F=A.current)==null||F.select())},[x]),f.jsxs("div",{ref:y,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${d?"menu-open":""} ${x?"editing":""} ${a>0?"nested":""}`,style:a>0?{paddingLeft:10+a*16}:void 0,title:`${Hc[e.harness]}${b?` · ${b}`:""}`,onClick:()=>{x||(d?g(!1):l())},onKeyDown:B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),d?g(!1):l())},children:[f.jsx("span",{className:"session-dot",children:n&&f.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),f.jsx("span",{className:`persona-bar sm persona-${w}`,title:i8(w)}),x?f.jsx("input",{ref:A,className:"session-title-input","aria-label":"Session title",value:k,onChange:B=>N(B.target.value),onClick:B=>B.stopPropagation(),onBlur:T,onKeyDown:B=>{B.stopPropagation(),B.key==="Enter"?(B.preventDefault(),T()):B.key==="Escape"&&(B.preventDefault(),S(!1))}}):f.jsxs("span",{className:"session-titlewrap",children:[f.jsx("span",{className:"session-title",children:f.jsx(c8,{title:C,animate:c!==void 0},c??"static")}),f.jsxs("span",{className:"session-sub",title:`${Wa(w).label} · ${_}`,children:[f.jsx(v7,{persona:w,compact:!0,size:12}),_]})]}),f.jsx("span",{className:"session-time",children:xP(e.updatedAt)}),f.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:B=>{B.stopPropagation(),g(F=>!F)},children:f.jsx(Xx,{size:14})}),d&&f.jsxs("div",{className:"option-menu drop-down session-menu",children:[f.jsx("button",{className:"model-item",onClick:B=>{B.stopPropagation(),g(!1),j()},children:f.jsx("span",{children:"Rename"})}),f.jsx("button",{className:"model-item",onClick:B=>{B.stopPropagation(),g(!1),h(!e.archived)},children:f.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),f.jsx("button",{className:"model-item danger",onClick:B=>{B.stopPropagation(),g(!1),m()},children:f.jsx("span",{children:"Delete"})})]})]})}function BP({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:i,mainView:a,onSelectMainView:c,panelOpen:l,onTogglePanel:u,onOpenFile:h,onOpenPlan:m,onOpenSubagent:d,onOpenWorktree:g,onStartTour:y,persona:C,baselineBranch:w,onActiveSessionChange:b,children:_}){var $i,cr,Gn;const[x,S]=O.useState([]),[k,N]=O.useState(null),[A,j]=O.useState([]),[T,D]=O.useState([]),B=()=>H3(e).then(j).catch(()=>{});O.useEffect(()=>{s7().then(D).catch(()=>{})},[]),O.useEffect(()=>{j([]);let le=!0;const Ee=()=>H3(e).then(Ie=>{le&&j(Ie)}).catch(()=>{});Ee();const Oe=setInterval(Ee,4e3);return()=>{le=!1,clearInterval(Oe)}},[e]);const[F,G]=O.useState([]);O.useEffect(()=>{G([]),eT(e).then(le=>G(le.branches)).catch(()=>G([]))},[e]);const[U,$]=O.useState("active"),[K,W]=O.useState(""),[Z,ee]=O.useState([]),[z,L]=O.useReducer(bP,{messagesBySession:{},busySessions:new Set}),[I,Y]=O.useState([]);O.useEffect(()=>{cl().then(Y).catch(()=>{})},[]);const[q,se]=O.useState(vP),[de,fe]=O.useState({}),[te,V]=O.useState(new Map),re=O.useRef(new Map),oe=O.useRef(new Set),_e=O.useRef(new Set),ye=O.useRef(0),ke=O.useRef([]),Me=O.useRef(null),Ue=O.useRef(null),Fe=O.useRef(!0),Le=O.useRef(null),[At,Dt]=O.useState([]),[Rt,Ft]=O.useState(0),[an,wt]=O.useState(!1),[Je,pt]=O.useState(null),be=O.useRef(null),[Ae,He]=O.useState(0);O.useLayoutEffect(()=>{He(Je&&be.current?be.current.offsetWidth+8:0),Ke()},[Je]);function Ke(){var le;be.current&&(be.current.style.transform=`translateY(${-(((le=Le.current)==null?void 0:le.scrollTop)??0)}px)`)}const rt=O.useRef(!1);O.useEffect(()=>{rM().then(Dt).catch(()=>{})},[]);const Pt=!Je&&K.startsWith("/")&&!/\s/.test(K)?K.slice(1):null,ot=Pt!==null&&!an?At.filter(le=>le.name.startsWith(Pt.toLowerCase())):[],Pe=ot.length>0,et=Math.min(Rt,Math.max(0,ot.length-1));O.useEffect(()=>Ft(0),[Pt]);function _t(le){var Ee;pt(le),W(""),(Ee=Le.current)==null||Ee.focus()}function ct(){var le;pt(null),(le=Le.current)==null||le.focus()}function on(le){for(const Ee of le){if(!/^image\/(png|jpeg|gif|webp)$/.test(Ee.type))continue;const Oe=new FileReader;Oe.onload=()=>{const Ie=Oe.result;ee(Ze=>[...Ze,{dataUrl:Ie,mediaType:Ee.type}])},Oe.readAsDataURL(Ee)}}function $n(le){const Ee=Array.from(le.clipboardData.items).filter(Oe=>Oe.kind==="file"&&Oe.type.startsWith("image/")).map(Oe=>Oe.getAsFile()).filter(Oe=>Oe!==null);Ee.length>0&&(le.preventDefault(),on(Ee))}const hn=x.find(le=>le.id===k),bn=hn?{harness:hn.harness,model:de.model??hn.model,permissionMode:de.permissionMode??hn.permissionMode,reasoningLevel:de.reasoningLevel??hn.reasoningLevel}:q??q_(I),xt=bn?I.find(le=>le.id===bn.harness):void 0,_n=xt==null?void 0:xt.options,zt=bn&&{...bn,reasoningLevel:p7(xt,bn.model,bn.reasoningLevel)},Pr=Xg(xt,zt==null?void 0:zt.model),zn=le=>{if(!zt)return;const Ee={...zt,...le};se(Ee),localStorage.setItem(r8,JSON.stringify(Ee)),hn&&fe(Oe=>({...Oe,...le}))},fi=le=>zn({permissionMode:le}),ws=le=>zn({reasoningLevel:le});ke.current=x;const xr=O.useCallback(async()=>{const le=ke.current.map(Ee=>Ee.id);try{const Ee=(await m0(e)).filter(Ie=>!_e.current.has(Ie.id)),Oe=new Set(Ee.map(Ie=>Ie.id));for(const Ie of le)Oe.has(Ie)||Hi(Ie);return S(Ie=>{const Ze=new Map(Ie.map(ut=>[ut.id,ut.contextUsage]));return Ee.map(ut=>({...ut,contextUsage:ut.contextUsage??Ze.get(ut.id)}))}),re.current=new Map(Ee.map(Ie=>[Ie.id,Ie.title])),L({type:"seedBusy",sessions:Ee.filter(Ie=>Ie.busy).map(Ie=>Ie.id),known:Ee.map(Ie=>Ie.id)}),Ee}catch{return null}},[e]);O.useEffect(()=>{S([]),ke.current=[],N(null),W(""),pt(null),ee([]),L({type:"reset"}),oe.current=new Set,V(new Map),re.current=new Map,xr().then(le=>{le&&N(Ee=>{var Oe;return Ee??((Oe=le.find(Ie=>!Ie.archived))==null?void 0:Oe.id)??null})})},[e,xr]),O.useEffect(()=>{!k||oe.current.has(k)||(oe.current.add(k),g0(k).then(le=>L({type:"seed",sessionId:k,messages:le})).catch(()=>{L({type:"seed",sessionId:k,messages:[],onlyIfAbsent:!0}),oe.current.delete(k)}))},[k]),O.useEffect(()=>$c(le=>{switch(le.type){case"session":{if(le.session.projectId!==e||_e.current.has(le.session.id))return;const Ee=re.current.has(le.session.id),Oe=re.current.get(le.session.id)!==le.session.title;re.current.set(le.session.id,le.session.title),Ee&&Oe&&le.session.titleSource==="generated"&&(V(Ie=>{const Ze=new Map(Ie);return Ze.set(le.session.id,(Ie.get(le.session.id)??0)+1),Ze}),window.setTimeout(()=>{V(Ie=>{if(!Ie.has(le.session.id))return Ie;const Ze=new Map(Ie);return Ze.delete(le.session.id),Ze})},LP)),S(Ie=>{const Ze=Ie.findIndex(Bt=>Bt.id===le.session.id);if(Ze<0)return[le.session,...Ie];const ut=Ie.slice();return ut[Ze]={...le.session,contextUsage:le.session.contextUsage??Ie[Ze].contextUsage},ut});break}case"sessionDeleted":Hi(le.sessionId);break;case"message":ye.current++,L({type:"upsertMessage",sessionId:le.sessionId,message:le.message});break;case"busy":L({type:"busy",sessionId:le.sessionId,busy:le.busy});break;case"usage":S(Ee=>Ee.map(Oe=>Oe.id===le.sessionId?{...Oe,contextUsage:le.usage}:Oe));break}}),[e]),O.useEffect(()=>$c(le=>{if(le.type!=="reconnected"||(xr(),!k||!oe.current.has(k)))return;const Ee=Oe=>{const Ie=ye.current;g0(k).then(Ze=>{L({type:"seed",sessionId:k,messages:Ze}),Oe&&ye.current!==Ie&&Ee(!1)}).catch(()=>{})};Ee(!0)}),[k,xr]);const An=k?z.messagesBySession[k]??[]:[],or=k?z.busySessions.has(k):!1,Ii=!!k&&!(k in z.messagesBySession),me=O.useMemo(()=>{const le=new Set;for(const Ee of z.busySessions)(z.messagesBySession[Ee]??[]).some(Oe=>Oe.parts.some(Ie=>Ie.type==="prompt"&&Ie.prompt&&!Ie.prompt.resolved&&Ie.prompt.nativeId))&&le.add(Ee);return le},[z.busySessions,z.messagesBySession]),ze=k?me.has(k):!1,qe=hn,lt=qe?te.get(qe.id):void 0,mt=O.useMemo(()=>{var le;for(let Ee=An.length-1;Ee>=0;Ee--)for(const Oe of An[Ee].parts)if(Oe.type==="prompt"&&((le=Oe.prompt)==null?void 0:le.kind)==="plan"&&!Oe.prompt.resolved)return{promptId:Oe.id,plan:Oe.prompt.plan??"",synthesized:!!Oe.prompt.synthesized};return null},[An]),xn=O.useMemo(()=>{const le=qe==null?void 0:qe.harness;if(!k||le!=="claude-code"&&le!=="codex")return null;for(let Ee=An.length-1;Ee>=0;Ee--)for(const Oe of An[Ee].parts)if(!(Oe.type!=="prompt"||!Oe.prompt||Oe.prompt.resolved)&&Oe.prompt.kind==="question")return Oe.prompt.nativeId&&!z.busySessions.has(k)?null:Oe.id;return null},[An,qe==null?void 0:qe.harness,k,z.busySessions]),[Qt,Jt]=O.useState(null),In=Qt&&Qt.sessionId===k?Qt:null;O.useEffect(()=>{if(!Qt)return;const le=z.busySessions.has(Qt.sessionId),Ee=Qt.sessionId===k&&mt&&mt.promptId!==Qt.promptId;(!le||Ee)&&Jt(null)},[Qt,mt,z.busySessions,k]);const lr=O.useMemo(()=>m&&k?(le,Ee)=>m(le,k,Ee):void 0,[m,k]),Cs=O.useMemo(()=>d&&k?le=>d(k,le):void 0,[d,k]),lo=O.useMemo(()=>h&&(le=>h(le,k??void 0)),[h,k]);O.useEffect(()=>fe({}),[k]),O.useEffect(()=>{b==null||b(k)},[k,b]);const ma=a==="chat"&&(An.length>0||or);O.useLayoutEffect(()=>{Fe.current=!0;const le=Me.current;le&&(le.scrollTop=le.scrollHeight)},[k,ma]),O.useLayoutEffect(()=>{const le=Me.current;le&&Fe.current&&(le.scrollTop=le.scrollHeight)},[An,or]),O.useEffect(()=>{const le=Me.current,Ee=Ue.current;if(!le||!Ee)return;const Oe=new ResizeObserver(()=>{Fe.current&&(le.scrollTop=le.scrollHeight)});return Oe.observe(Ee),Oe.observe(le),()=>Oe.disconnect()},[ma]);async function ga(){const le=K.trim(),Ee=Je?`/${Je.name}${le?` ${le}`:""}`:le,Oe=Z;if(!Ee&&Oe.length===0)return;if(Ee&&xn&&Oe.length===0){W(""),pt(null),sn({promptId:xn,answers:[],note:Ee}).then(ut=>{ut||W(Bt=>Bt||Ee)});return}if(or||!(xt!=null&&xt.agentReady))return;const Ie=zt;if(!Ie&&!k)return;W(""),pt(null),ee([]);let Ze=k;try{if(!Ze){const Yt=await iM(e,Ie.harness,{model:Ie.model,permissionMode:Ie.permissionMode,reasoningLevel:Ie.reasoningLevel,persona:co});oe.current.add(Yt.id),S(Kn=>[Yt,...Kn]),N(Yt.id),Ze=Yt.id}L({type:"optimisticUser",sessionId:Ze,text:Ee,imageUrls:Oe.map(Yt=>Yt.dataUrl)}),L({type:"busy",sessionId:Ze,busy:!0}),Fe.current=!0,U==="archived"&&$("active");const ut=Ie?{model:Ie.model,permissionMode:Ie.permissionMode,reasoningLevel:Ie.reasoningLevel}:{};fe({});const Bt=Oe.map(Yt=>({mediaType:Yt.mediaType,dataBase64:Yt.dataUrl.slice(Yt.dataUrl.indexOf(",")+1)}));await cM(Ze,Ee,ut,Bt.length?Bt:void 0)}catch(ut){if(W(Yt=>Yt||Ee),ee(Yt=>Yt.length?Yt:Oe),!Ze)return;const Bt=ut instanceof Error?ut.message:String(ut);if(!/session is busy/i.test(Bt)&&await m0(e).then(Kn=>{var As;return!!((As=Kn.find(bi=>bi.id===Ze))!=null&&As.busy)}).catch(()=>!1)){W(Kn=>Kn===Ee?"":Kn),ee(Kn=>Kn===Oe?[]:Kn);return}L({type:"busy",sessionId:Ze,busy:!1}),L({type:"upsertMessage",sessionId:Ze,message:{id:`${c2}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:`Message not sent: ${Bt}`}}],createdAt:Date.now()}})}}function pi(){k&&uM(k)}O.useEffect(()=>{if(!or||a!=="chat")return;function le(Ee){var Oe;Ee.key!=="Escape"||Ee.defaultPrevented||(Ee.preventDefault(),pi(),(Oe=Le.current)==null||Oe.focus())}return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[or,k,a]);function Hi(le){_e.current.add(le),S(Ee=>Ee.filter(Oe=>Oe.id!==le)),N(Ee=>Ee===le?null:Ee),oe.current.delete(le),re.current.delete(le),L({type:"forget",sessionId:le})}function mi(le,Ee){const Oe=le.archived;S(Ie=>Ie.map(Ze=>Ze.id===le.id?{...Ze,archived:Ee}:Ze)),Y_(U,Ee)||N(Ie=>Ie===le.id?null:Ie),aM(le.id,Ee).catch(()=>{S(Ie=>Ie.map(Ze=>Ze.id===le.id?{...Ze,archived:Oe}:Ze))})}function gi(le,Ee){const Oe=le.title;S(Ie=>Ie.map(Ze=>Ze.id===le.id?{...Ze,title:Ee}:Ze)),oM(le.id,Ee).catch(()=>{S(Ie=>Ie.map(Ze=>Ze.id===le.id?{...Ze,title:Oe}:Ze))})}async function vi(le){var Oe;const Ee=((Oe=le.title)==null?void 0:Oe.trim())||"Untitled";if(window.confirm(`Delete "${Ee}"? - -Its transcript is permanently removed.`)){try{await sM(le.id)}catch(Ie){window.alert(`Failed to delete "${Ee}": ${Ie instanceof Error?Ie.message:String(Ie)}`);return}Hi(le.id)}}const yi=O.useCallback(le=>no(e,le),[e]),sn=O.useCallback(le=>{if(!k)return Promise.resolve(!1);const Ee=k;return L({type:"busy",sessionId:Ee,busy:!0}),hM(Ee,le).then(()=>!0).catch(()=>!1).finally(()=>{g0(Ee).then(Oe=>L({type:"seed",sessionId:Ee,messages:Oe})).catch(()=>{}),m0(e).then(Oe=>{var Ie;return L({type:"busy",sessionId:Ee,busy:!!((Ie=Oe.find(Ze=>Ze.id===Ee))!=null&&Ie.busy)})}).catch(()=>{})})},[k,e]),Fi=x.filter(le=>Y_(U,le.archived)),[ks,ei]=O.useState(!1),Sr=U_.some(le=>le.id===a),[co,uo]=O.useState(g7),Es=f.jsxs("aside",{className:"session-rail floating-panel",children:[n,f.jsxs("nav",{className:"rail-nav",children:[f.jsxs("button",{className:"rail-nav-item","data-onboarding":"new-session",onClick:()=>{N(null),c("chat")},children:[f.jsx(Vg,{size:15}),"New session"]}),f.jsxs("button",{className:`rail-nav-item ${a==="files"?"active":""}`,"data-onboarding":"nav-files",onClick:()=>c("files"),children:[f.jsx(Gg,{size:15}),"Files"]}),f.jsxs("button",{className:`rail-nav-item settings-toggle ${Sr?"active":""}`,"aria-expanded":ks||Sr,onClick:()=>ei(le=>!le),children:[f.jsx(BN,{size:15}),"Settings",f.jsx(xl,{size:14,className:"settings-chev",style:{transform:ks||Sr?"rotate(90deg)":"none"}})]}),(ks||Sr)&&U_.map(le=>f.jsxs("button",{className:`rail-nav-item rail-nav-sub ${a===le.id?"active":""}`,"data-onboarding":le.id==="compute"?"nav-compute":void 0,onClick:()=>c(le.id),children:[le.icon,le.label]},le.id))]}),f.jsxs("div",{className:"rail-body",children:[f.jsxs("div",{className:"rail-section-head",children:[f.jsx("div",{className:"rail-section-label",children:(($i=l8.find(le=>le.id===U))==null?void 0:$i.railLabel)??"Recents"}),f.jsx(MP,{value:U,onChange:$})]}),(()=>{const le=new Map;for(const ut of Fi){const Bt=ut.parentSessionId??"";(le.get(Bt)??le.set(Bt,[]).get(Bt)).push(ut)}const Ee=new Set(Fi.map(ut=>ut.id)),Oe=Fi.filter(ut=>!ut.parentSessionId||!Ee.has(ut.parentSessionId)),Ie=(ut,Bt)=>f.jsx(OP,{session:ut,depth:Bt,active:ut.id===k&&a==="chat",busy:z.busySessions.has(ut.id),waiting:me.has(ut.id),persona:C,revealTitle:te.get(ut.id),onOpen:()=>{N(ut.id),c("chat")},onRename:Yt=>gi(ut,Yt),onSetArchived:Yt=>mi(ut,Yt),onDelete:()=>void vi(ut)},ut.id),Ze=(ut,Bt)=>[Ie(ut,Bt),...(le.get(ut.id)??[]).flatMap(Yt=>Ze(Yt,Bt+1))];return Oe.flatMap(ut=>Ze(ut,0))})(),Fi.length===0&&f.jsx("div",{className:"rail-empty",children:U==="archived"?"No archived sessions":x.length>0?"No active sessions":"No sessions yet"})]})]}),ho=`chat-header${r?"":" rail-hidden"}`,Pi=!r&&f.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:i,children:f.jsx(e7,{size:15})});return a!=="chat"?f.jsxs(f.Fragment,{children:[r&&Es,f.jsxs("section",{className:"chat-pane",children:[!r&&f.jsx("div",{className:ho,children:Pi}),f.jsx("div",{className:"settings-view-scroll",children:_})]})]}):f.jsxs(f.Fragment,{children:[r&&Es,f.jsxs("section",{className:"chat-pane",children:[f.jsxs("div",{className:ho,children:[Pi,(()=>{const le=qe?qe.persona??"research":co;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`persona-bar persona-${le}`,title:i8(le),style:{background:Wa(le).color}}),f.jsx(fM,{value:le,onChange:uo,locked:!!qe}),f.jsx(e1,{choices:F.map(Ee=>({id:Ee,label:Ee})),value:w??null,header:"Baseline branch",align:"left",variant:"bare",menuDirection:"down",title:"Branch new baselines fork from",onSelect:Ee=>{Ee!==w&&C1(e,{baselineBranch:Ee}).catch(Oe=>console.error("baseline branch:",Oe))}})]})})(),f.jsx("div",{className:"title",title:qe?((cr=qe.title)==null?void 0:cr.trim())||"Untitled":"New session",children:qe?f.jsx(c8,{title:((Gn=qe.title)==null?void 0:Gn.trim())||"Untitled",animate:lt!==void 0},lt??"static"):"New session"}),y&&f.jsx("button",{className:"icon-btn","data-tip":"Replay tour","aria-label":"Replay tour",onClick:y,children:f.jsx(RA,{size:15})}),g&&k&&f.jsx("button",{className:"icon-btn","data-tip":"View session worktree","aria-label":"View session worktree",onClick:()=>g(k),children:f.jsx(qg,{size:15})}),f.jsx("button",{className:`icon-btn ${l?"active":""}`,title:"Gallery","aria-label":"Gallery",onClick:u,children:f.jsx(Jx,{size:15})})]}),Ii?f.jsxs("div",{className:"chat-loading","aria-live":"polite","aria-busy":"true",children:[f.jsx("span",{className:"spinner"}),f.jsx("span",{children:"Loading conversation…"})]}):ma?f.jsx("div",{className:"chat-thread",ref:Me,onScroll:le=>{const Ee=le.currentTarget;Fe.current=Ee.scrollHeight-Ee.scrollTop-Ee.clientHeight<60},children:f.jsxs("div",{className:"chat-thread-inner",ref:Ue,children:[f.jsx(TP,{messages:An,onOpenFile:lo,onRespond:sn,onOpenPlan:lr,onOpenSubagent:Cs,skills:At,fileSrc:yi}),A.filter(le=>le.status==="pending"&&le.parentSessionId===k).map(le=>f.jsx(jP,{proposal:le,personas:T,harnesses:I,onResolved:B},le.id)),or&&(ze?f.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):f.jsxs("div",{className:"working",children:[f.jsx("span",{className:"spinner"})," Working…"]}))]})}):f.jsxs("div",{className:"chat-empty",children:[f.jsx("h2",{children:f.jsx(Rc,{})}),f.jsx("p",{children:"Pitch a game idea — even one vague line. The Producer captures it into a thesis, gets it scored, and leads you to a playable, handing off to the other agents as it goes."}),f.jsx(_P,{harnesses:I,selection:q??q_(I)}),t&&f.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var Ee;const le=At.find(Oe=>Oe.name==="reproduce-paper");le?(pt(le),W(`${t} on `)):W(`/reproduce-paper ${t} on `),(Ee=Le.current)==null||Ee.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),f.jsxs("div",{className:"composer",children:[mt&&!(In&&mt.promptId===In.promptId)&&f.jsx(cF,{synthesized:mt.synthesized,agentLabel:qe?Hc[qe.harness]:"The agent",onView:()=>lr==null?void 0:lr(mt.plan,mt.promptId),onApprove:le=>sn({promptId:mt.promptId,approve:!0,resumeMode:le}),onReject:()=>sn({promptId:mt.promptId,approve:!1}),onRevise:le=>{k&&Jt({sessionId:k,promptId:mt.promptId}),sn({promptId:mt.promptId,approve:!1,note:le})}}),f.jsxs("div",{className:"composer-box","data-onboarding":"composer",children:[xt&&!xt.agentReady&&f.jsxs("div",{className:"composer-harness-warning",children:[f.jsxs("strong",{children:[xt.name," is unavailable."]})," ",xt.agentNote?l2(xt.agentNote):"Re-check its setup."]}),Pe&&f.jsx(fP,{skills:ot,activeIndex:et,onPick:_t,onHover:Ft}),Z.length>0&&f.jsx("div",{className:"composer-attachments",children:Z.map((le,Ee)=>f.jsxs("div",{className:"attachment-thumb",children:[f.jsx("img",{src:le.dataUrl,alt:"pasted"}),f.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>ee(Oe=>Oe.filter((Ie,Ze)=>Ze!==Ee)),children:f.jsx(ll,{size:11})})]},Ee))}),f.jsxs("div",{className:"composer-input",children:[Je&&f.jsxs("span",{ref:be,className:"skill-chip composer-chip",children:["/",Je.name]}),f.jsx("textarea",{ref:Le,value:K,style:Je?{textIndent:Ae}:void 0,onScroll:Ke,placeholder:xn?"Type a custom answer…":Je?["reproduce-paper","paper-to-marimo"].includes(Je.name)&&t?`[paper — optional, defaults to ${t}] on [compute]`:Je.argHint:zt?xt!=null&&xt.agentReady?`Message ${Hc[zt.harness]}… ( / for skills)`:`${Hc[zt.harness]} is unavailable — open the model picker`:"Ask the research agent… ( / for skills)",rows:2,onPaste:$n,onDragOver:le=>{le.dataTransfer.types.includes("Files")&&le.preventDefault()},onDrop:le=>{le.dataTransfer.files.length!==0&&(le.preventDefault(),on(Array.from(le.dataTransfer.files)))},onChange:le=>{const Ee=le.target.value;if(!Je&&!xn&&!rt.current){const Oe=Ee.match(/^\/(\S+)\s([\s\S]*)$/),Ie=Oe&&At.find(Ze=>Ze.name===Oe[1].toLowerCase());if(Ie){pt(Ie),W(Oe[2]),wt(!1);return}}W(Ee),wt(!1)},onCompositionStart:()=>{rt.current=!0},onCompositionEnd:()=>{rt.current=!1},onKeyDown:le=>{if(Pe){if(le.key==="ArrowDown"||le.key==="ArrowUp"){le.preventDefault();const Ee=le.key==="ArrowDown"?1:-1;Ft((et+Ee+ot.length)%ot.length);return}if(le.key==="Enter"||le.key==="Tab"){le.preventDefault(),_t(ot[et]);return}if(le.key==="Escape"){le.preventDefault(),wt(!0);return}}if(Je&&le.key==="Backspace"&&le.currentTarget.selectionStart===0&&le.currentTarget.selectionEnd===0){le.preventDefault(),ct();return}le.key==="Enter"&&!le.shiftKey&&!le.nativeEvent.isComposing&&(le.preventDefault(),ga())}})]}),f.jsxs("div",{className:"composer-actions",children:[f.jsx(e1,{choices:xt!=null&&xt.agentReady?(_n==null?void 0:_n.permissionModes)??[]:[],value:(zt==null?void 0:zt.permissionMode)??null,defaultId:(_n==null?void 0:_n.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:fi}),f.jsx(pP,{value:zt,onSelect:zn,onHarnesses:Y,lockHarness:!!hn}),f.jsx(e1,{choices:xt!=null&&xt.agentReady?Pr.choices:[],value:(zt==null?void 0:zt.reasoningLevel)??null,defaultId:Pr.defaultId,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat — Default sends no override, so the harness CLI's own configured effort applies",onSelect:ws}),f.jsx("div",{style:{flex:1}}),f.jsxs("div",{className:"composer-budgets",children:[f.jsx(yM,{harness:I.find(le=>le.id===(zt==null?void 0:zt.harness))}),f.jsx(gP,{usage:hn==null?void 0:hn.contextUsage})]}),or&&!xn?f.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:pi,children:f.jsx(ll,{size:16})}):f.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void ga(),disabled:!(xt!=null&&xt.agentReady)||!Je&&!K.trim()&&Z.length===0,children:f.jsx(Yx,{size:16})})]})]})]})]})]})}function zP({sessionId:e,spawnPartId:t,onOpenFile:n,onOpenSubagent:r}){const[i,a]=O.useState(null);if(O.useEffect(()=>{let l=!0;g0(e).then(h=>l&&a(h)).catch(()=>l&&a([]));const u=$c(h=>{h.type!=="message"||h.sessionId!==e||a(m=>{const d=m?m.slice():[],g=d.findIndex(y=>y.id===h.message.id);return g===-1?d.push(h.message):d[g]=h.message,d})});return()=>{l=!1,u()}},[e]),i===null)return f.jsx("div",{className:"tab-body",children:f.jsx("div",{className:"pane-content subagent-tab-content",children:f.jsx("div",{className:"subagent-empty",children:"Loading…"})})});let c=null;for(const l of i)if(c=o8(l.parts,t),c)break;return f.jsx("div",{className:"tab-body",children:f.jsx("div",{className:"pane-content subagent-tab-content",children:c?f.jsx(AP,{spawn:c,onOpenFile:n,onOpenSubagent:r}):f.jsx("div",{className:"subagent-empty",children:"This sub-agent is no longer available."})})})}function X_(){return{dirs:new Map,files:[]}}function u8(e){const t=X_();for(const n of e){const r=n.split("/");let i=t;for(let a=0;aa(n),title:n,children:[u?f.jsx(Ti,{size:13,className:"code-tree-chev"}):f.jsx(xl,{size:13,className:"code-tree-chev"}),u?f.jsx(Gg,{size:13}):f.jsx(nN,{size:13}),f.jsx("span",{className:"code-tree-name",children:e})]}),u&&f.jsx(h2,{node:t,parentPath:n,depth:r+1,toggled:i,onToggle:a,onOpenFile:c})]})}function h2({node:e,parentPath:t,depth:n,toggled:r,onToggle:i,onOpenFile:a}){const c=[...e.dirs.keys()].sort((u,h)=>u.localeCompare(h)),l=[...e.files].sort((u,h)=>u.localeCompare(h));return f.jsxs(f.Fragment,{children:[c.map(u=>{const h=t?`${t}/${u}`:u;return f.jsx(IP,{name:u,node:e.dirs.get(u),path:h,depth:n,toggled:r,onToggle:i,onOpenFile:a},`d:${h}`)}),l.map(u=>{const h=t?`${t}/${u}`:u;return f.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+n*14},onClick:()=>a(h),title:h,children:[f.jsx(XA,{size:13}),f.jsx("span",{className:"code-tree-name",children:u})]},`f:${h}`)})]})}function HP({projectId:e,project:t,experiments:n,sel:r,toggled:i,onSelChange:a,onToggledChange:c,onOpenFile:l}){const[u,h]=O.useState(null),[m,d]=O.useState(null),[g,y]=O.useState(!0),C=O.useRef(0),w=O.useCallback(()=>{const k=++C.current;y(!0),c7(e,r?{ref:r}:{}).then(N=>{k===C.current&&(h(N),d(null))}).catch(N=>{k===C.current&&d(N.message)}).finally(()=>{k===C.current&&y(!1)})},[e,r]);O.useEffect(()=>(h(null),d(null),w(),()=>{C.current++}),[w]);const b=O.useMemo(()=>u?u8(u.entries):null,[u]),_=O.useCallback(k=>{const N=new Set(i);N.has(k)?N.delete(k):N.add(k),c(N)},[i,c]),x=O.useMemo(()=>{const k=new Set,N=[];for(const A of n)k.has(A.branchName)||(k.add(A.branchName),N.push({branch:A.branchName,label:A.slug}));return N},[n]),S=r||(u==null?void 0:u.branch)||null;return f.jsxs("div",{className:"code-tab",children:[f.jsxs("div",{className:"code-tab-header",children:[f.jsx("span",{className:"ctl-label",children:"Source"}),f.jsxs("select",{className:"input sm code-tab-select",value:r,onChange:k=>a(k.target.value),title:"Source to browse",children:[f.jsx("option",{value:"",children:"project clone"}),r&&!x.some(k=>k.branch===r)&&f.jsx("option",{value:r,children:r}),x.map(k=>f.jsx("option",{value:k.branch,children:k.label},k.branch))]}),S&&f.jsx("a",{className:"icon-btn",href:Yg(t.githubOwner,t.githubRepo,S),target:"_blank",rel:"noopener noreferrer",title:`Open ${S} on GitHub`,children:f.jsx(o2,{size:13})}),f.jsx("span",{style:{flex:1}}),f.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:w,children:g?f.jsx("span",{className:"spinner"}):f.jsx(uu,{size:13})})]}),(u==null?void 0:u.truncated)&&f.jsx("div",{className:"code-tab-note",children:"listing truncated"}),m&&b&&f.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",m]}),f.jsx("div",{className:"code-tab-body",children:b?b.dirs.size===0&&b.files.length===0?f.jsx("div",{className:"code-tab-note",children:"No files."}):f.jsx("div",{className:"code-tree",children:f.jsx(h2,{node:b,parentPath:"",depth:0,toggled:i,onToggle:_,onOpenFile:k=>l(k,void 0,r||void 0)})}):f.jsx("div",{className:"code-tab-note",children:m?`Failed to load: ${m}`:"Loading…"})})]})}function K_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function qt(e){for(var t=1;t=0||(m[u]=c[u]);return m})(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jt(e,t){return d8(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,c,l,u,h=[],m=!0,d=!1;try{if(l=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;m=!1}else for(;!(m=(a=l.call(i)).done)&&(h.push(a.value),h.length!==r);m=!0);}catch(g){d=!0,c=g}finally{try{if(!m&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(d)throw c}}return h}})(e,t)||Md(e,t)||p8()}function h8(e){return d8(e)||f8(e)||Md(e)||p8()}function Lr(e){return(function(t){if(Array.isArray(t))return pg(t)})(e)||f8(e)||Md(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 d8(e){if(Array.isArray(e))return e}function f8(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Md(e,t){if(e){if(typeof e=="string")return pg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pg(e,t):void 0}}function pg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}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 a,c=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return c=u.done,u},e:function(u){l=!0,a=u},f:function(){try{c||n.return==null||n.return()}finally{if(l)throw a}}}}var Kh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _u(e,t){return e(t={exports:{}},t.exports),t.exports}var Dr=_u((function(e){/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i-1?_.slice(0,S):k;switch(k){case"diff":w--;break e;case"deleted":case"new":var N=_.slice(S+1);N.indexOf("file mode")===0&&(c[k==="new"?"newMode":"oldMode"]=N.slice(10));break;case"similarity":c.similarity=parseInt(_.split(" ")[2],10);break;case"index":var A=_.slice(S+1).split(" "),j=A[0].split("..");c.oldRevision=j[0],c.newRevision=j[1],A[1]&&(c.oldMode=c.newMode=A[1]);break;case"copy":case"rename":var T=_.slice(S+1);T.indexOf("from")===0?c.oldPath=T.slice(5):c.newPath=T.slice(3),x=k;break;case"---":var D=_.slice(S+1),B=y[++w].slice(4);D==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(D=D.slice(2),x="delete"):(x="modify",D=D.slice(2),B=B.slice(2)),D&&(c.oldPath=D),B&&(c.newPath=B),g=5;break e}}c.type=x||"modify"}else if(b.indexOf("Binary")===0)c.isBinary=!0,c.type=b.indexOf("/dev/null and")>=0?"add":b.indexOf("and /dev/null")>=0?"delete":"modify",g=2,c=null;else if(g===5)if(b.indexOf("@@")===0){var F=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(b);l={content:b,oldStart:F[1]-0,newStart:F[4]-0,oldLines:F[3]-0||1,newLines:F[6]-0||1,changes:[]},c.hunks.push(l),u=l.oldStart,h=l.newStart}else{var G=b.slice(0,1),U={content:b.slice(1)};switch(G){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=h,h++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=u,u++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=u,U.newLineNumber=h,u++,h++;break;case"\\":var $=l.changes[l.changes.length-1];$.isDelete||(c.newEndingNewLine=!1),$.isInsert||(c.oldEndingNewLine=!1)}U.type&&l.changes.push(U)}w++}return d}};e.exports=i})()}));function pa(e){return e.type==="insert"}function Or(e){return e.type==="delete"}function ps(e){return e.type==="normal"}function UP(e,t){var n=t.nearbySequences==="zip"?(function(r){var i=r.reduce((function(a,c,l){var u=jt(a,3),h=u[0],m=u[1],d=u[2];return m?pa(c)&&d>=0?(h.splice(d+1,0,c),[h,c,d+2]):(h.push(c),[h,c,Or(c)&&Or(m)?d:l]):(h.push(c),[h,c,Or(c)?l:-1])}),[[],null,-1]);return jt(i,1)[0]})(e.changes):e.changes;return qt(qt({},e),{},{isPlain:!1,changes:n})}function g8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var i=r.indexOf(` -`),a=r.indexOf(` -`,i+1),c=r.slice(0,i),l=r.slice(i+1,a),u=c.split(" ").slice(1,-3).join(" "),h=l.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(u," b/").concat(h),"index 1111111..2222222 100644","--- a/".concat(u),"+++ b/".concat(h),r.slice(a+1)].join(` -`)})(e.trimStart());return $P.parse(n).map((function(r){return(function(i,a){var c=i.hunks.map((function(l){return UP(l,a)}));return qt(qt({},i),{},{hunks:c})})(r,t)}))}function qP(e){return e[0]}function GP(e){return e[e.length-1]}function mg(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Xc(e){return e==="old"?function(t){return pa(t)?-1:ps(t)?t.oldLineNumber:t.lineNumber}:function(t){return Or(t)?-1:ps(t)?t.newLineNumber:t.lineNumber}}function v8(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r=a&&i-1},JP=function(e,t){var n=this.__data__,r=jd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Qo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var h=a.get(e),m=a.get(t);if(h&&m)return h==t&&m==e;var d=-1,g=!0,y=2&n?new B$:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},un={};un["[object Float32Array]"]=un["[object Float64Array]"]=un["[object Int8Array]"]=un["[object Int16Array]"]=un["[object Int32Array]"]=un["[object Uint8Array]"]=un["[object Uint8ClampedArray]"]=un["[object Uint16Array]"]=un["[object Uint32Array]"]=!0,un["[object Arguments]"]=un["[object Array]"]=un["[object ArrayBuffer]"]=un["[object Boolean]"]=un["[object DataView]"]=un["[object Date]"]=un["[object Error]"]=un["[object Function]"]=un["[object Map]"]=un["[object Number]"]=un["[object Object]"]=un["[object RegExp]"]=un["[object Set]"]=un["[object String]"]=un["[object WeakMap]"]=!1;var Q$=function(e){return pl(e)&&p2(e.length)&&!!un[jl(e)]},J$=function(e){return function(t){return e(t)}},i6=_u((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&_8.process,a=(function(){try{var c=r&&r.require&&r.require("util").types;return c||i&&i.binding&&i.binding("util")}catch{}})();e.exports=a})),s6=i6&&i6.isTypedArray,m2=s6?J$(s6):Q$,eU=Object.prototype.hasOwnProperty,tU=function(e,t){var n=zr(e),r=!n&&Od(e),i=!n&&!r&&U0(e),a=!n&&!r&&!i&&m2(e),c=n||r||i||a,l=c?W$(e.length,String):[],u=l.length;for(var h in e)!eU.call(e,h)||c&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||E8(h,u))||l.push(h);return l},nU=Object.prototype,A8=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||nU)},rU=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),iU=Object.prototype.hasOwnProperty,N8=function(e){if(!A8(e))return rU(e);var t=[];for(var n in Object(e))iU.call(e,n)&&n!="constructor"&&t.push(n);return t},Bd=function(e){return e!=null&&p2(e.length)&&!S8(e)},g2=function(e){return Bd(e)?tU(e):N8(e)},a6=function(e){return $$(e,g2,V$)},sU=Object.prototype.hasOwnProperty,aU=function(e,t,n,r,i,a){var c=1&n,l=a6(e),u=l.length;if(u!=a6(t).length&&!c)return!1;for(var h=u;h--;){var m=l[h];if(!(c?m in t:sU.call(t,m)))return!1}var d=a.get(e),g=a.get(t);if(d&&g)return d==t&&g==e;var y=!0;a.set(e,t),a.set(t,e);for(var C=c;++h1)return!1;if(e.length===1){var t=jt(e,1)[0];return t.type==="text"&&!t.value}return!0}function YU(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=ua(e,VU),c=i?function(l,u){return i(l,h6,u)}:h6;return f.jsx("td",qt(qt({},a),{},{"data-change-key":t,children:r?WU(r)?" ":r.map(c):n||" "}))}var B8=O.memo(YU);function z8(e,t){return function(){var n=t==="old"?Pd(e):$d(e);return n===-1?void 0:n}}function I8(e,t){return function(n){return e&&n?f.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function q0(e,t){return t?function(n){e(),t(n)}:e}function d6(e,t,n,r){return O.useMemo((function(){var i=O8(e,(function(a){return function(c){return a&&a(t,c)}}));return i.onMouseEnter=q0(n,i.onMouseEnter),i.onMouseLeave=q0(r,i.onMouseLeave),i}),[e,n,r,t])}function f6(e,t,n,r,i,a,c,l,u){var h={change:t,side:r,inHoverState:l,renderDefault:z8(t,r),wrapInAnchor:I8(i,a)};return f.jsx("td",qt(qt({className:e},c),{},{"data-change-key":n,children:u(h)}))}function XU(e){var t,n,r,i=e.change,a=e.selected,c=e.tokens,l=e.className,u=e.generateLineClassName,h=e.gutterClassName,m=e.codeClassName,d=e.gutterEvents,g=e.codeEvents,y=e.hideGutter,C=e.gutterAnchor,w=e.generateAnchorID,b=e.renderToken,_=e.renderGutter,x=i.type,S=i.content,k=sa(i),N=(t=jt(O.useState(!1),2),n=t[0],r=t[1],[n,O.useCallback((function(){return r(!0)}),[]),O.useCallback((function(){return r(!1)}),[])]),A=jt(N,3),j=A[0],T=A[1],D=A[2],B=O.useMemo((function(){return{change:i}}),[i]),F=d6(d,B,T,D),G=d6(g,B,T,D),U=w(i),$=u({changes:[i],defaultGenerate:function(){return l}}),K=Dr("diff-gutter","diff-gutter-".concat(x),h,{"diff-gutter-selected":a}),W=Dr("diff-code","diff-code-".concat(x),m,{"diff-code-selected":a});return f.jsxs("tr",{id:U,className:Dr("diff-line",$),children:[!y&&f6(K,i,k,"old",C,U,F,j,_),!y&&f6(K,i,k,"new",C,U,F,j,_),f.jsx(B8,qt({className:W,changeKey:k,text:S,tokens:c,renderToken:b},G))]})}var KU=O.memo(XU);function ZU(e){var t=e.hideGutter,n=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var QU=["hideGutter","selectedChanges","tokens","lineClassName"],JU=["hunk","widgets","className"];function eq(e){var t=e.hunk,n=e.widgets,r=e.className,i=ua(e,JU),a=(function(c,l){return c.reduce((function(u,h){var m=sa(h);u.push(["change",m,h]);var d=l[m];return d&&u.push(["widget",m,d]),u}),[])})(t.changes,n);return f.jsx("tbody",{className:Dr("diff-hunk",r),children:a.map((function(c){return(function(l,u){var h=jt(l,3),m=h[0],d=h[1],g=h[2],y=u.hideGutter,C=u.selectedChanges,w=u.tokens,b=u.lineClassName,_=ua(u,QU);if(m==="change"){var x=Or(g)?"old":"new",S=Or(g)?Pd(g):$d(g),k=w?w[x][S-1]:null;return f.jsx(KU,qt({className:b,change:g,hideGutter:y,selected:C.includes(d),tokens:k},_),"change".concat(d))}return m==="widget"?f.jsx(ZU,{hideGutter:y,element:g},"widget".concat(d)):null})(c,i)}))})}var H8=0;function Qh(e,t,n,r){var i=O.useCallback((function(){return t(e)}),[e,t]),a=O.useCallback((function(){return t("")}),[t]);return O.useMemo((function(){var c=O8(r,(function(l){return function(u){return l&&l({side:e,change:n},u)}}));return c.onMouseEnter=q0(i,c.onMouseEnter),c.onMouseLeave=q0(a,c.onMouseLeave),c}),[n,r,i,e,a])}function r1(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,c=e.codeClassName,l=e.gutterEvents,u=e.codeEvents,h=e.anchorID,m=e.gutterAnchor,d=e.gutterAnchorTarget,g=e.hideGutter,y=e.hover,C=e.renderToken,w=e.renderGutter;if(!t){var b=Dr("diff-gutter","diff-gutter-omit",a),_=Dr("diff-code","diff-code-omit",c);return[!g&&f.jsx("td",{className:b},"gutter"),f.jsx("td",{className:_},"code")]}var x=t.type,S=t.content,k=sa(t),N=n===H8?"old":"new",A=qt({id:h||void 0,className:Dr("diff-gutter","diff-gutter-".concat(x),fg({"diff-gutter-selected":r},"diff-line-hover-"+N,y),a),children:w({change:t,side:N,inHoverState:y,renderDefault:z8(t,N),wrapInAnchor:I8(m,d)})},l),j=Dr("diff-code","diff-code-".concat(x),fg({"diff-code-selected":r},"diff-line-hover-"+N,y),c);return[!g&&f.jsx("td",qt(qt({},A),{},{"data-change-key":k}),"gutter"),f.jsx(B8,qt({className:j,changeKey:k,text:S,tokens:i,renderToken:C},u),"code")]}function tq(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,c=e.oldTokens,l=e.newTokens,u=e.monotonous,h=e.gutterClassName,m=e.codeClassName,d=e.gutterEvents,g=e.codeEvents,y=e.hideGutter,C=e.generateAnchorID,w=e.generateLineClassName,b=e.gutterAnchor,_=e.renderToken,x=e.renderGutter,S=jt(O.useState(""),2),k=S[0],N=S[1],A=Qh("old",N,n,d),j=Qh("new",N,r,d),T=Qh("old",N,n,g),D=Qh("new",N,r,g),B=n&&C(n),F=r&&C(r),G=w({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:u,hideGutter:y,gutterClassName:h,codeClassName:m,gutterEvents:d,codeEvents:g,renderToken:_,renderGutter:x},$=qt(qt({},U),{},{change:n,side:H8,selected:i,tokens:c,gutterEvents:A,codeEvents:T,anchorID:B,gutterAnchor:b,gutterAnchorTarget:B,hover:k==="old"}),K=qt(qt({},U),{},{change:r,side:1,selected:a,tokens:l,gutterEvents:j,codeEvents:D,anchorID:n===r?null:F,gutterAnchor:b,gutterAnchorTarget:n===r?B:F,hover:k==="new"});if(u)return f.jsx("tr",{className:Dr("diff-line",G),children:r1(n?$:K)});var W=(function(Z,ee){return Z&&!ee?"diff-line-old-only":!Z&&ee?"diff-line-new-only":Z===ee?"diff-line-normal":"diff-line-compare"})(n,r);return f.jsxs("tr",{className:Dr("diff-line",W,G),children:[r1($),r1(K)]})}var nq=O.memo(tq);function rq(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),f.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var iq=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],sq=["hunk","widgets","className"];function Jh(e,t){return(e?sa(e):"00")+(t?sa(t):"00")}function aq(e){var t=e.hunk,n=e.widgets,r=e.className,i=ua(e,sq),a=(function(c,l){for(var u=function(_){if(!_)return null;var x=sa(_);return l[x]||null},h=[],m=0;m=(a==null?void 0:a.value.length))return[e];var l=function(d,g){var y=a.value.slice(d,g);return[].concat(Lr(i),[qt(qt({},a),{},{value:y})])};if(t>0){var u=l(0,t);c.push(nl(u))}var h=l(Math.max(t,0),n);if(c.push(r?(function(d,g){return[g].concat(Lr(nl(d)))})(h,r):nl(h)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=ua(e,Eq);n.push(i);var a,c=d2(r);try{for(c.s();!(a=c.n()).done;)U8(a.value,t,n)}catch(l){c.e(l)}finally{c.f()}n.pop()}else t.push(nl([].concat(Lr(n.slice(1)),[e])));return t}function Aq(e){return e.reduce((function(t,n){var r=t[t.length-1],i=(function(u){var h=x2(u);return h.value.includes(` -`)?h.value.split(` -`).map((function(m){return wq(u,qt(qt({},h),{},{value:m}))})):[u]})(n),a=h8(i),c=a[0],l=a.slice(1);return[].concat(Lr(t.slice(0,-1)),[[].concat(Lr(r),[c])],Lr(l.map((function(u){return[u]}))))}),[[]])}function v6(e){return Aq(U8(e))}var Nq=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?zd(e,t,void 0,n):!!r},Tq=function(e,t){return zd(e,t)},Mq=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function jq(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,i=Mq(e.children);return i&&(r=t,(n=i).type===r.type&&(n.type==="text"||n.children&&r.children&&Nq(n,r,(function(a,c,l){return l==="chlidren"||Tq(a,c)}))))?e.children[e.children.length-1]=(function(a,c){return"value"in a&&"value"in c?qt(qt({},a),{},{value:"".concat(a.value).concat(c.value)}):a})(i,t):e.children.push(t),e.children[e.children.length-1]}function y6(e){var t,n={type:"root",children:[]},r=d2(e);try{var i=function(){var a=t.value;a.reduce((function(c,l,u){return jq(c,u===a.length-1?qt({},l):qt(qt({},l),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}return n}var Dq=Object.prototype.hasOwnProperty,Rq=P8((function(e,t,n){Dq.call(e,n)?e[n].push(t):b2(e,n,[t])})),Lq=Object.prototype.hasOwnProperty,Oq=function(e){if(e==null)return!0;if(Bd(e)&&(zr(e)||typeof e=="string"||typeof e.splice=="function"||U0(e)||m2(e)||Od(e)))return!e.length;var t=_g(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(A8(e))return!N8(e).length;for(var n in e)if(Lq.call(e,n))return!1;return!0},Bq=function(e,t){var n=t.start,r=t.length,i=n+r,a=e.reduce((function(c,l){var u=jt(c,2),h=u[0],m=u[1],d=m+x2(l).value.length;if(m>i||dr.length?n:r,u=n.length>r.length?r:n,h=l.indexOf(u);if(h!=-1)return c=[new t.Diff(1,l.substring(0,h)),new t.Diff(0,u),new t.Diff(1,l.substring(h+u.length))],n.length>r.length&&(c[0][0]=c[2][0]=-1),c;if(u.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var m=this.diff_halfMatch_(n,r);if(m){var d=m[0],g=m[1],y=m[2],C=m[3],w=m[4],b=this.diff_main(d,y,i,a),_=this.diff_main(g,C,i,a);return b.concat([new t.Diff(0,w)],_)}return i&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,a):this.diff_bisect_(n,r,a)},t.prototype.diff_lineMode_=function(n,r,i){var a=this.diff_linesToChars_(n,r);n=a.chars1,r=a.chars2;var c=a.lineArray,l=this.diff_main(n,r,!1,i);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new t.Diff(0,""));for(var u=0,h=0,m=0,d="",g="";u=1&&m>=1){l.splice(u-h-m,h+m),u=u-h-m;for(var y=this.diff_main(d,g,!1,i),C=y.length-1;C>=0;C--)l.splice(u,0,y[C]);u+=y.length}m=0,h=0,d="",g=""}u++}return l.pop(),l},t.prototype.diff_bisect_=function(n,r,i){for(var a=n.length,c=r.length,l=Math.ceil((a+c)/2),u=l,h=2*l,m=new Array(h),d=new Array(h),g=0;gi);S++){for(var k=-S+w;k<=S-b;k+=2){for(var N=u+k,A=(F=k==-S||k!=S&&m[N-1]a)b+=2;else if(A>c)w+=2;else if(C&&(D=u+y-k)>=0&&D=(T=a-d[D]))return this.diff_bisectSplit_(n,r,F,A,i)}for(var j=-S+_;j<=S-x;j+=2){for(var T,D=u+j,B=(T=j==-S||j!=S&&d[D-1]a)x+=2;else if(B>c)_+=2;else if(!C&&(N=u+y-j)>=0&&N=(T=a-T))return this.diff_bisectSplit_(n,r,F,A,i)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,i,a,c){var l=n.substring(0,i),u=r.substring(0,a),h=n.substring(i),m=r.substring(a),d=this.diff_main(l,u,!1,c),g=this.diff_main(h,m,!1,c);return d.concat(g)},t.prototype.diff_linesToChars_=function(n,r){var i=[],a={};function c(h){for(var m="",d=0,g=-1,y=i.length;ga?n=n.substring(i-a):ir.length?n:r,a=n.length>r.length?r:n;if(i.length<4||2*a.length=w.length?[x,S,k,N,T]:null}var u,h,m,d,g,y=l(i,a,Math.ceil(i.length/4)),C=l(i,a,Math.ceil(i.length/2));return y||C?(u=C?y&&y[4].length>C[4].length?y:C:y,n.length>r.length?(h=u[0],m=u[1],d=u[2],g=u[3]):(d=u[0],g=u[1],h=u[2],m=u[3]),[h,m,d,g,u[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,i=[],a=0,c=null,l=0,u=0,h=0,m=0,d=0;l0?i[a-1]:-1,u=0,h=0,m=0,d=0,c=null,r=!0)),l++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),l=1;l=w?(C>=g.length/2||C>=y.length/2)&&(n.splice(l,0,new t.Diff(0,y.substring(0,C))),n[l-1][1]=g.substring(0,g.length-C),n[l+1][1]=y.substring(C),l++):(w>=g.length/2||w>=y.length/2)&&(n.splice(l,0,new t.Diff(0,g.substring(0,w))),n[l-1][0]=1,n[l-1][1]=y.substring(0,y.length-w),n[l+1][0]=-1,n[l+1][1]=g.substring(w),l++),l++}l++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(w,b){if(!w||!b)return 6;var _=w.charAt(w.length-1),x=b.charAt(0),S=_.match(t.nonAlphaNumericRegex_),k=x.match(t.nonAlphaNumericRegex_),N=S&&_.match(t.whitespaceRegex_),A=k&&x.match(t.whitespaceRegex_),j=N&&_.match(t.linebreakRegex_),T=A&&x.match(t.linebreakRegex_),D=j&&w.match(t.blanklineEndRegex_),B=T&&b.match(t.blanklineStartRegex_);return D||B?5:j||T?4:S&&!N&&A?3:N||A?2:S||k?1:0}for(var i=1;i=y&&(y=C,m=a,d=c,g=l)}n[i-1][1]!=m&&(m?n[i-1][1]=m:(n.splice(i-1,1),i--),n[i][1]=d,g?n[i+1][1]=g:(n.splice(i+1,1),i--))}i++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(n){for(var r=!1,i=[],a=0,c=null,l=0,u=!1,h=!1,m=!1,d=!1;l0?i[a-1]:-1,m=d=!1),r=!0)),l++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,i=0,a=0,c=0,l="",u="";i1?(a!==0&&c!==0&&((r=this.diff_commonPrefix(u,l))!==0&&(i-a-c>0&&n[i-a-c-1][0]==0?n[i-a-c-1][1]+=u.substring(0,r):(n.splice(0,0,new t.Diff(0,u.substring(0,r))),i++),u=u.substring(r),l=l.substring(r)),(r=this.diff_commonSuffix(u,l))!==0&&(n[i][1]=u.substring(u.length-r)+n[i][1],u=u.substring(0,u.length-r),l=l.substring(0,l.length-r))),i-=a+c,n.splice(i,a+c),l.length&&(n.splice(i,0,new t.Diff(-1,l)),i++),u.length&&(n.splice(i,0,new t.Diff(1,u)),i++),i++):i!==0&&n[i-1][0]==0?(n[i-1][1]+=n[i][1],n.splice(i,1)):i++,c=0,a=0,l="",u=""}n[n.length-1][1]===""&&n.pop();var h=!1;for(i=1;ir));i++)l=a,u=c;return n.length!=i&&n[i][0]===-1?u:u+(r-l)},t.prototype.diff_prettyHtml=function(n){for(var r=[],i=/&/g,a=//g,l=/\n/g,u=0;u");switch(h){case 1:r[u]=''+m+"";break;case-1:r[u]=''+m+"";break;case 0:r[u]=""+m+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],i=0;ithis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(r),c=this;function l(A,j){var T=A/r.length,D=Math.abs(i-j);return c.Match_Distance?T+D/c.Match_Distance:D?1:T}var u=this.Match_Threshold,h=n.indexOf(r,i);h!=-1&&(u=Math.min(l(0,h),u),(h=n.lastIndexOf(r,i+r.length))!=-1&&(u=Math.min(l(0,h),u)));var m,d,g=1<=b;S--){var k=a[n.charAt(S-1)];if(x[S]=w===0?(x[S+1]<<1|1)&k:(x[S+1]<<1|1)&k|(y[S+1]|y[S])<<1|1|y[S+1],x[S]&g){var N=l(w,S-1);if(N<=u){if(u=N,!((h=S-1)>i))break;b=Math.max(1,2*i-h)}}}if(l(w+1,i)>u)break;y=x}return h},t.prototype.match_alphabet_=function(n){for(var r={},i=0;i2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(n&&typeof n=="object"&&r===void 0&&i===void 0)c=n,a=this.diff_text1(c);else if(typeof n=="string"&&r&&typeof r=="object"&&i===void 0)a=n,c=r;else{if(typeof n!="string"||typeof r!="string"||!i||typeof i!="object")throw new Error("Unknown call format to patch_make.");a=n,c=i}if(c.length===0)return[];for(var l=[],u=new t.patch_obj,h=0,m=0,d=0,g=a,y=a,C=0;C=2*this.Patch_Margin&&h&&(this.patch_addContext_(u,g),l.push(u),u=new t.patch_obj,h=0,g=y,m=d)}w!==1&&(m+=b.length),w!==-1&&(d+=b.length)}return h&&(this.patch_addContext_(u,g),l.push(u)),l},t.prototype.patch_deepCopy=function(n){for(var r=[],i=0;ithis.Match_MaxBits?(u=this.match_main(r,d.substring(0,this.Match_MaxBits),m))!=-1&&((g=this.match_main(r,d.substring(d.length-this.Match_MaxBits),m+d.length-this.Match_MaxBits))==-1||u>=g)&&(u=-1):u=this.match_main(r,d,m),u==-1)c[l]=!1,a-=n[l].length2-n[l].length1;else if(c[l]=!0,a=u-m,d==(h=g==-1?r.substring(u,u+d.length):r.substring(u,g+this.Match_MaxBits)))r=r.substring(0,u)+this.diff_text2(n[l].diffs)+r.substring(u+d.length);else{var y=this.diff_main(d,h,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(y)/d.length>this.Patch_DeleteThreshold)c[l]=!1;else{this.diff_cleanupSemanticLossless(y);for(var C,w=0,b=0;bl[0][1].length){var u=r-l[0][1].length;l[0][1]=i.substring(l[0][1].length)+l[0][1],c.start1-=u,c.start2-=u,c.length1+=u,c.length2+=u}return(l=(c=n[n.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new t.Diff(0,i)),c.length1+=r,c.length2+=r):r>l[l.length-1][1].length&&(u=r-l[l.length-1][1].length,l[l.length-1][1]+=i.substring(0,u),c.length1+=u,c.length2+=u),i},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,i=0;i2*r?(h.length1+=g.length,c+=g.length,m=!1,h.diffs.push(new t.Diff(d,g)),a.diffs.shift()):(g=g.substring(0,r-h.length1-this.Patch_Margin),h.length1+=g.length,c+=g.length,d===0?(h.length2+=g.length,l+=g.length):m=!1,h.diffs.push(new t.Diff(d,g)),g==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(g.length))}u=(u=this.diff_text2(h.diffs)).substring(u.length-this.Patch_Margin);var y=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);y!==""&&(h.length1+=y.length,h.length2+=y.length,h.diffs.length!==0&&h.diffs[h.diffs.length-1][0]===0?h.diffs[h.diffs.length-1][1]+=y:h.diffs.push(new t.Diff(0,y))),m||n.splice(++i,0,h)}}},t.prototype.patch_toText=function(n){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?$q:Uq,r=_2(e.map((function(l){return l.changes})),q8).map(n).reduce((function(l,u){var h=jt(l,2),m=h[0],d=h[1],g=jt(u,2),y=g[0],C=g[1];return[m.concat(y),d.concat(C)]}),[[],[]]),i=jt(r,2),a=i[0],c=i[1];return zq(_6(a),_6(c))}var Gq=["enhancers"],C6=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=jt(Sq(e,ua(n,Gq)),2),c=a[0],l=a[1],u=[v6(c),v6(l)],h=(t=[u[0],u[1]],i.reduce((function(w,b){return b(w)}),t)),m=jt(h,2),d=m[0],g=m[1],y=[d.map(y6),g.map(y6)],C=y[1];return{old:y[0].map((function(w){var b;return(b=w.children)!==null&&b!==void 0?b:[]})),new:C.map((function(w){var b;return(b=w.children)!==null&&b!==void 0?b:[]}))}};const Vq=2e3,Wq={highlight(e,t){return tt.highlight(e,t).children}};function Yq(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function V8(e){let t=0,n=0;for(const r of e.hunks)for(const i of r.changes)i.type==="insert"?t++:i.type==="delete"&&n++;return{additions:t,deletions:n}}function Xq(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function Kq(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 Zq(e){const t=[qq(e.hunks,{type:"line"})],n=Bw(Xq(e));return n&&tt.registered(n)?C6(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:Wq}):C6(e.hunks,{enhancers:t,highlight:!1})}const Qq=({change:e,side:t})=>t==="old"?null:Yq(e);function k6(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function W8({bytesRead:e,byteLimit:t}){return f.jsxs("div",{className:"truncated-notice",children:[f.jsx("h4",{children:"Diff too large to display"}),f.jsxs("p",{children:["This diff is larger than ",k6(t)," (",k6(e)," read). View it locally with git."]})]})}function Jq({file:e,defaultExpanded:t}){const[n,r]=O.useState(t),{additions:i,deletions:a}=O.useMemo(()=>V8(e),[e]),c=n&&i+a<=Vq,l=O.useMemo(()=>{if(c)try{return Zq(e)}catch{return}},[e,c]);return f.jsxs("section",{className:"diff-file-card",children:[f.jsxs("button",{className:"diff-file-header",onClick:()=>r(u=>!u),children:[f.jsx("span",{className:"chev",children:n?f.jsx(Ti,{size:14}):f.jsx(xl,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:Kq(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add",children:["+",i]}),f.jsxs("span",{className:"diff-stat-del",children:["−",a]})]})]}),n&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty",children:"No textual diff for this file."}):f.jsx(dq,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:Qq,tokens:l,viewType:"unified"}))]})}function S2({diff:e,className:t}){const n=O.useMemo(()=>{if(!e.trim())return[];try{return g8(e,{nearbySequences:"zip"})}catch{return[]}},[e]);return n.length===0?f.jsx("div",{className:"diff-empty",children:"No changes."}):f.jsx("div",{className:t?`openresearch-diff ${t}`:"openresearch-diff",children:n.map((r,i)=>f.jsx(Jq,{file:r,defaultExpanded:i===0},`${r.oldPath}→${r.newPath}#${i}`))})}const eG=5e3;function tG({sessionId:e,projectId:t,view:n,toggled:r,onViewChange:i,onToggledChange:a,onOpenFile:c}){var N;const[l,u]=O.useState(null),[h,m]=O.useState(null),[d,g]=O.useState(null),[y,C]=O.useState(!0),w=O.useRef(0),b=O.useCallback(()=>{const A=++w.current;C(!0),Promise.all([ST(e),c7(t,{sessionId:e})]).then(([j,T])=>{A===w.current&&(u(j),m(T),g(null))}).catch(j=>{A===w.current&&g(j.message)}).finally(()=>{A===w.current&&C(!1)})},[e,t]);O.useEffect(()=>(u(null),m(null),g(null),b(),()=>{w.current++}),[b]),O.useEffect(()=>{let A=!1,j=!1,T=!1,D=null;const B=()=>{D||(D=setInterval(b,eG))},F=()=>{D&&(clearInterval(D),D=null)},G=$c(U=>{U.type!=="busy"||U.sessionId!==e||(j=!0,U.busy&&!A?(A=!0,B()):!U.busy&&A&&(A=!1,F(),b()))});return m0(t).then(U=>{var $;T||j||A||($=U.find(K=>K.id===e))!=null&&$.busy&&(A=!0,B())}).catch(()=>{}),()=>{T=!0,G(),F()}},[e,t,b]);const _=O.useMemo(()=>h?u8(h.entries):null,[h]),x=O.useCallback(A=>{const j=new Set(r);j.has(A)?j.delete(A):j.add(A),a(j)},[r,a]),S=(l==null?void 0:l.branch)??(l!=null&&l.baselineBranch?`detached @ ${l.baselineBranch}`:"detached"),k=((N=l==null?void 0:l.files)==null?void 0:N.length)??0;return f.jsxs("div",{className:"code-tab wt-tab",children:[f.jsxs("div",{className:"code-tab-header",children:[f.jsxs("div",{className:"seg",children:[f.jsx("button",{className:n==="changes"?"active":"",onClick:()=>i("changes"),children:"Changes"}),f.jsx("button",{className:n==="files"?"active":"",onClick:()=>i("files"),children:"Files"})]}),(l==null?void 0:l.exists)&&f.jsxs("span",{className:"wt-branch-chip",title:S,children:[f.jsx(Sl,{size:12}),f.jsx("span",{className:"wt-branch-name",children:S})]}),(l==null?void 0:l.exists)&&n==="changes"&&f.jsxs("span",{className:"code-tab-note wt-count",children:[k," ",k===1?"file":"files"]}),f.jsx("span",{style:{flex:1}}),f.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:b,children:y?f.jsx("span",{className:"spinner"}):f.jsx(uu,{size:13})})]}),d&&(l||h)&&f.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",d]}),l?l.exists?n==="changes"?f.jsx("div",{className:"code-tab-body wt-changes",children:k===0||!l.diff?f.jsx("div",{className:"changes-note",children:"No changes yet."}):f.jsxs(f.Fragment,{children:[l.diff.truncated&&f.jsx(W8,{bytesRead:l.diff.bytesRead,byteLimit:l.diff.byteLimit}),f.jsx(S2,{diff:l.diff.diff})]})}):f.jsxs("div",{className:"code-tab-body",children:[(h==null?void 0:h.root)==="clone"&&f.jsx("div",{className:"code-tab-note",children:"Worktree unavailable — showing the project clone."}),(h==null?void 0:h.truncated)&&f.jsx("div",{className:"code-tab-note",children:"listing truncated"}),_?_.dirs.size===0&&_.files.length===0?f.jsx("div",{className:"code-tab-note",children:"No files."}):f.jsx("div",{className:"code-tree",children:f.jsx(h2,{node:_,parentPath:"",depth:0,toggled:r,onToggle:x,onOpenFile:A=>c(A,e)})}):f.jsx("div",{className:"code-tab-note",children:"Loading…"})]}):f.jsx("div",{className:"code-tab-body",children:f.jsxs("div",{className:"wt-empty",children:[f.jsx(qg,{size:22}),f.jsx("p",{children:"The agent hasn't started working yet — its worktree is created on the first message."})]})}):f.jsx("div",{className:"code-tab-body",children:f.jsx("div",{className:"code-tab-note",children:d?`Failed to load: ${d}`:"Loading…"})})]})}const nG="modulepreload",rG=function(e){return"/"+e},E6={},qd=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=c(n.map(h=>{if(h=rG(h),h in E6)return;E6[h]=!0;const m=h.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${d}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":nG,m||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),m)return new Promise((y,C)=>{g.addEventListener("load",y),g.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(c){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=c,window.dispatchEvent(l),!l.defaultPrevented)throw c}return i.then(c=>{for(const l of c||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};function Y8({text:e,path:t}){const n=O.useMemo(()=>$w(e,Bw(t)),[e,t]),r=e?e.split(` -`).length-(e.endsWith(` -`)?1:0):0;return f.jsxs("div",{className:"file-view-codewrap",children:[r>0&&f.jsx("pre",{className:"file-view-gutter","aria-hidden":"true",children:Array.from({length:r},(i,a)=>a+1).join(` -`)}),f.jsx("pre",{className:"file-view-code",children:f.jsx("code",{children:n})})]})}const iG="project";function sG(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function aG(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` ----`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const oG=512*1024,X8="orx:files-tree-width",K8=180,Z8=560,lG=280;function cG(){try{const e=Number(localStorage.getItem(X8));if(Number.isFinite(e)&&e>=K8&&e<=Z8)return e}catch{}return lG}function Sg(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Sg(n.children??[],t);if(r)return r}}return null}function Q8(e){const t=[];for(const n of e)n.isDir&&(n.reportTitle!==void 0&&t.push(n),t.push(...Q8(n.children??[])));return t}function J8({projectId:e,folder:t,markdown:n}){const r=i=>{if(sG(i))return i;const a=i.replace(/^\.?\//,"");return no(e,t?`${t}/${a}`:a)};return f.jsx("div",{className:"md report-md",children:f.jsx(rS,{remarkPlugins:[Lw,[Ow,Gw]],rehypePlugins:[cw],components:{a:({href:i,children:a,...c})=>{const l=!i||i.startsWith("#");return f.jsx("a",{...c,href:l?i:r(i),...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const c=r(i);return f.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[f.jsx("img",{src:c,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"report-img-caption",children:a})]})},...Ww},children:Vw(aG(n))})})}const uG=O.lazy(()=>qd(()=>import("./ModelViewer-D3HqfNbT.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ModelViewer}))),hG=O.lazy(()=>qd(()=>import("./SplatViewer-Bz_PebWi.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SplatViewer})));function dG(e){return e.isDir?"report":tF.test(e.name)?"markdown":a2(e.name)??"text"}function fG(e,t,n){const[r,i]=O.useState(null),[a,c]=O.useState(!1),[l,u]=O.useState(null),h=n==="report"||n==="markdown"||n==="text"&&t.size<=oG;return O.useEffect(()=>{if(i(null),c(!1),u(null),!h)return;let m=!1;return(n==="report"?d7(e,t.path).then(g=>g.markdown):fetch(no(e,t.path)).then(g=>{if(!g.ok)throw new Error(`Failed to load file (${g.status})`);return g.text()})).then(g=>{m||(g.includes("\0")?c(!0):i(g))}).catch(g=>{m||u(g instanceof Error?g.message:String(g))}),()=>{m=!0}},[e,t.path,t.modifiedAt,n,h]),{text:r,binary:a,error:l,wantsText:h}}function pG({projectId:e,entry:t,onDelete:n}){const r=dG(t),{text:i,binary:a,error:c,wantsText:l}=fG(e,t,r),[u,h]=O.useState(!1),m=r==="report"||r==="markdown",d=t.isDir?t.path:t.path.split("/").slice(0,-1).join("/"),g=no(e,t.isDir?`${t.path}/report.md`:t.path);let y;return r==="image"?y=f.jsx("a",{className:"fpreview-image",href:g,target:"_blank",rel:"noopener noreferrer",children:f.jsx("img",{src:g,alt:t.name})}):r==="video"?y=f.jsx("video",{className:"fpreview-video",src:g,controls:!0,loop:!0,playsInline:!0}):r==="audio"?y=f.jsx("audio",{className:"fpreview-audio",src:g,controls:!0}):r==="model"?y=f.jsx(O.Suspense,{fallback:f.jsx("div",{className:"file-view-note",children:"Loading 3D viewer…"}),children:f.jsx(uG,{src:g,name:t.name})}):r==="splat"?y=f.jsx(O.Suspense,{fallback:f.jsx("div",{className:"file-view-note",children:"Loading splat viewer…"}),children:f.jsx(hG,{src:g,name:t.name})}):r==="pdf"?y=f.jsx("iframe",{className:"fpreview-pdf",title:t.name,src:g}):!l||a?y=f.jsxs("div",{className:"file-view-note",children:[a?"Binary file — no inline preview.":"File too large to preview inline."," ",f.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:"Open raw"})]}):c?y=f.jsxs("div",{className:"file-view-note",children:["Failed to load: ",c]}):i===null?y=f.jsxs("div",{className:"settings-loading",children:[f.jsx("span",{className:"spinner"})," Loading…"]}):m&&!u?y=f.jsx(J8,{projectId:e,folder:d,markdown:i}):y=f.jsx(Y8,{text:i,path:t.isDir?"report.md":t.path}),f.jsxs("div",{className:"fpreview file-view",children:[f.jsxs("div",{className:"fpreview-head",children:[f.jsx(Zx,{size:13,style:{flexShrink:0}}),f.jsx("code",{className:"fpreview-path",title:t.path,children:t.isDir?`${t.path}/report.md`:t.path}),f.jsxs("span",{className:"fpreview-date",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),!t.isDir&&r==="text"&&f.jsx("span",{className:"fpreview-size",children:$a(t.size)}),m&&f.jsx("button",{className:`icon-btn ${u?"active":""}`,"data-tip":u?"Rendered view":"View source","aria-label":u?"Rendered view":"View source",onClick:()=>h(C=>!C),children:f.jsx(Wx,{size:13})}),f.jsx("a",{className:"icon-btn",href:g,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","aria-label":"Open raw in new tab",children:f.jsx(cu,{size:13})}),f.jsx("button",{className:"icon-btn","data-tip":t.isDir?"Delete report folder":"Delete file","aria-label":t.isDir?"Delete report folder":"Delete file",onClick:()=>{window.confirm(`Delete "${t.path}" from the files dir?`)&&n(t.path)},children:f.jsx(Wg,{size:13})})]}),f.jsx("div",{className:`fpreview-body ${m&&!u?"doc":""}`,children:y})]})}function e9({projectId:e,entries:t,depth:n,collapsed:r,selected:i,onToggle:a,onSelect:c}){return f.jsx(f.Fragment,{children:t.map(l=>{var h,m;const u={paddingLeft:8+n*14};if(l.isDir){const d=l.reportTitle!==void 0,g=!r.has(l.path),y=d?l.reportTitle:`${l.name}/`,C=d?[l.name,(h=l.experiment)==null?void 0:h.latestRunStatus].filter(Boolean).join(" — "):void 0;return f.jsxs("div",{children:[f.jsxs("div",{className:`ft-row ${i===l.path?"selected":""}`,style:u,title:C,onClick:()=>d?c(l.path):a(l.path),children:[f.jsx("button",{className:`ft-chevron ${g?"open":""}`,"aria-label":g?`Collapse ${l.name}`:`Expand ${l.name}`,onClick:w=>{w.stopPropagation(),a(l.path)},children:f.jsx(xl,{size:12})}),f.jsx("span",{className:d?"ft-title":"ft-dirname",children:y})]}),g&&(((m=l.children)==null?void 0:m.length)??0)>0&&f.jsx(e9,{projectId:e,entries:l.children??[],depth:n+1,collapsed:r,selected:i,onToggle:a,onSelect:c})]},l.path)}return f.jsxs("div",{className:`ft-row file ${i===l.path?"selected":""}`,style:u,title:l.path,onClick:()=>c(l.path),children:[f.jsx("span",{className:"ft-chevron spacer"}),Uw.test(l.name)&&f.jsx("img",{className:"ft-thumb",src:no(e,l.path),alt:"",loading:"lazy"}),f.jsx("span",{className:"ft-name",children:l.name})]},l.path)})})}function mG(e){const t=[],n=[],r=[];for(const i of e)i.isDir&&i.name===iG?t.push(i):i.isDir&&i.experiment?n.push(i):r.push(i);return{project:t,experiments:n,other:r}}function A6({dir:e,onOpenStorage:t}){const[n,r]=O.useState(!1);return f.jsxs("div",{className:"ftree-footer",title:e,children:[f.jsx("code",{children:e}),f.jsx("button",{className:"icon-btn tip-up","data-tip":n?"Copied!":"Copy path","aria-label":"Copy files directory path",onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?f.jsx(Qr,{size:12}):f.jsx(Ug,{size:12})}),f.jsx("button",{className:"icon-btn tip-up","data-tip":"Storage settings","aria-label":"Storage settings",onClick:t,children:f.jsx(LN,{size:12})})]})}function gG({project:e,files:t,onChanged:n,onOpenStorage:r}){const[i,a]=O.useState(null),[c,l]=O.useState(new Set),[u,h]=O.useState(!1),[m,d]=O.useState(cG),g=O.useRef(null),y=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const A=((B=g.current)==null?void 0:B.getBoundingClientRect().left)??0,j=document.body.style.userSelect;document.body.style.userSelect="none";const T=F=>{const G=Math.round(F.clientX-A),U=Math.min(Math.max(G,K8),Z8);d(U);try{localStorage.setItem(X8,String(U))}catch{}},D=()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",T),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};O.useEffect(()=>{if(!t||u||(h(!0),i))return;const N=Q8(t.entries);if(N.length===0)return;const A=N.reduce((j,T)=>T.modifiedAt>j.modifiedAt?T:j);a(A.path)},[t,u,i]),O.useEffect(()=>{i&&t&&!Sg(t.entries,i)&&a(null)},[i,t]);const C=N=>l(A=>{const j=new Set(A);return j.has(N)?j.delete(N):j.add(N),j}),w=N=>{(i===N||i!=null&&i.startsWith(N+"/"))&&a(null),XT(e.id,N).catch(()=>{}).finally(n)};if(!t)return f.jsx("div",{className:"files-tab",children:f.jsxs("div",{className:"settings-loading",style:{padding:20},children:[f.jsx("span",{className:"spinner"})," Loading files…"]})});const{project:b,experiments:_,other:x}=mG(t.entries),S=N=>f.jsx(e9,{projectId:e.id,entries:N,depth:0,collapsed:c,selected:i,onToggle:C,onSelect:a}),k=i?Sg(t.entries,i):null;return t.entries.length===0?f.jsx("div",{className:"files-tab",children:f.jsxs("div",{className:"files-empty-state",children:[f.jsx(Gg,{size:28,strokeWidth:1.5}),f.jsx("h3",{children:"No files yet"}),f.jsx("p",{children:"This is where the agent saves the project's files — experiment reports, figures, and other artifacts. Ask it for a write-up of its findings and the report will land here. You can also drop your own files into the folder:"}),f.jsx(A6,{dir:t.dir,onOpenStorage:r})]})}):f.jsxs("div",{className:"files-tab",children:[f.jsxs("div",{className:"ftree-pane",ref:g,style:{width:m},children:[f.jsx("div",{className:"ftree-resizer",onPointerDown:y}),f.jsxs("div",{className:"ftree-scroll",children:[S(b),S(_),x.length>0&&(_.length>0||b.length>0)&&f.jsx("div",{className:"ft-divider",children:"Other files"}),S(x),t.truncated&&f.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]}),f.jsx(A6,{dir:t.dir,onOpenStorage:r})]}),k?f.jsx(pG,{projectId:e.id,entry:k,onDelete:w},k.path):f.jsxs("div",{className:"fpreview fpreview-none",children:[f.jsx(bN,{size:22,strokeWidth:1.5}),f.jsx("span",{children:"Click a file to view it"})]})]})}function Yo({active:e,label:t,icon:n,onSelect:r,onClose:i}){return f.jsxs("button",{className:`tab closable ${e?"active":""}`,onClick:r,title:t,children:[n,f.jsx("span",{className:"tab-label",children:t}),f.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:a=>{a.stopPropagation(),i()},children:f.jsx(ll,{size:12})})]})}function vG({owner:e,repo:t,branch:n}){return f.jsxs("a",{className:"files-pill",href:Yg(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[f.jsx("code",{children:n}),f.jsx(o2,{size:12})]})}var i1={exports:{}},N6;function yG(){return N6||(N6=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),h=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),d=u-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(d/a.css.cell.height))}}}})(),n})()))})(i1)),i1.exports}var bG=yG(),s1={exports:{}},T6;function _G(){return T6||(T6=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(c,l,u){var h=this&&this.__decorate||function(x,S,k,N){var A,j=arguments.length,T=j<3?S:N===null?N=Object.getOwnPropertyDescriptor(S,k):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,S,k,N);else for(var D=x.length-1;D>=0;D--)(A=x[D])&&(T=(j<3?A(T):j>3?A(S,k,T):A(S,k))||T);return j>3&&T&&Object.defineProperty(S,k,T),T},m=this&&this.__param||function(x,S){return function(k,N){S(k,N,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=u(9042),g=u(9924),y=u(844),C=u(4725),w=u(2585),b=u(3656);let _=l.AccessibilityManager=class extends y.Disposable{constructor(x,S,k,N){super(),this._terminal=x,this._coreBrowserService=k,this._renderService=N,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 A=0;Athis._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,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 g.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((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` -`)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.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,y.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let S=0;S0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.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,S){this._liveRegionDebouncer.refresh(x,S,this._terminal.rows)}_renderRows(x,S){const k=this._terminal.buffer,N=k.lines.length.toString();for(let A=x;A<=S;A++){const j=k.lines.get(k.ydisp+A),T=[],D=(j==null?void 0:j.translateToString(!0,void 0,void 0,T))||"",B=(k.ydisp+A+1).toString(),F=this._rowElements[A];F&&(D.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=D,this._rowColumns.set(F,T)),F.setAttribute("aria-posinset",B),F.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,S){const k=x.target,N=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==N)return;let A,j;if(S===0?(A=k,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(A=this._rowElements.shift(),j=k,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),j.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===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 S={node:x.anchorNode,offset:x.anchorOffset},k={node:x.focusNode,offset:x.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const N=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:N,offset:((D=N.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(k.node))return;const A=({node:B,offset:F})=>{const G=B instanceof Text?B.parentNode:B;let U=parseInt(G==null?void 0:G.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(G);if(!$)return console.warn("columns is null. Race condition?"),null;let K=F<$.length?$[F]:$.slice(-1)[0]+1;return K>=this._terminal.cols&&(++U,K=0),{row:U,column:K}},j=A(S),T=A(k);if(j&&T){if(j.row>T.row||j.row===T.row&&j.column>=T.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(T.row-j.row)*this._terminal.cols-j.column+T.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;Sx;)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 u(g){return g.replace(/\r?\n/g,"\r")}function h(g,y){return y?"\x1B[200~"+g+"\x1B[201~":g}function m(g,y,C,w){g=h(g=u(g),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(g,!0),y.value=""}function d(g,y,C){const w=C.getBoundingClientRect(),b=g.clientX-w.left-10,_=g.clientY-w.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${b}px`,y.style.top=`${_}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=h,l.copyHandler=function(g,y){g.clipboardData&&g.clipboardData.setData("text/plain",y.selectionText),g.preventDefault()},l.handlePasteEvent=function(g,y,C,w){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),y,C,w)},l.paste=m,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(g,y,C,w,b){d(g,y,C),b&&w.rightClickSelect(g),y.value=w.selectionText,y.select()}},7239:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const h=u(1505);l.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,d,g){this._css.set(m,d,g)}getCss(m,d){return this._css.get(m,d)}setColor(m,d,g){this._color.set(m,d,g)}getColor(m,d){return this._color.get(m,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,h,m,d){u.addEventListener(h,m,d);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(h,m,d))}}}},3551:function(c,l,u){var h=this&&this.__decorate||function(_,x,S,k){var N,A=arguments.length,j=A<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,x,S,k);else for(var T=_.length-1;T>=0;T--)(N=_[T])&&(j=(A<3?N(j):A>3?N(x,S,j):N(x,S))||j);return A>3&&j&&Object.defineProperty(x,S,j),j},m=this&&this.__param||function(_,x){return function(S,k){x(S,k,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const d=u(3656),g=u(8460),y=u(844),C=u(2585),w=u(4725);let b=l.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(_,x,S,k,N){super(),this._element=_,this._mouseService=x,this._renderService=S,this._bufferService=k,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)((()=>{var A;this._lastMouseEvent=void 0,(A=this._activeProviderReplies)==null||A.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const x=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const S=_.composedPath();for(let k=0;k{A==null||A.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let S=!1;for(const[A,j]of this._linkProviderService.linkProviders.entries())x?(N=this._activeProviderReplies)!=null&&N.get(A)&&(S=this._checkLinkProviderResult(A,_,S)):j.provideLinks(_.y,(T=>{var B,F;if(this._isMouseOut)return;const D=T==null?void 0:T.map((G=>({link:G})));(B=this._activeProviderReplies)==null||B.set(A,D),S=this._checkLinkProviderResult(A,_,S),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,x){const S=new Set;for(let k=0;k_?this._bufferService.cols:j.link.range.end.x;for(let B=T;B<=D;B++){if(S.has(B)){N.splice(A--,1);break}S.add(B)}}}}_checkLinkProviderResult(_,x,S){var A;if(!this._activeProviderReplies)return S;const k=this._activeProviderReplies.get(_);let N=!1;for(let j=0;j<_;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(N=!0);if(!N&&k){const j=k.find((T=>this._linkAtPosition(T.link,x)));j&&(S=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let j=0;jthis._linkAtPosition(D.link,x)));if(T){S=!0,this._handleNewLink(T);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const x=this._positionFromMouseEvent(_,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,x){this._currentLink&&this._lastMouseEvent&&(!_||!x||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(_.link,x)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var S,k;return(k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.pointerCursor},set:S=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>{var S,k;return(k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.underline},set:S=>{var k,N,A;(k=this._currentLink)!=null&&k.state&&((A=(N=this._currentLink)==null?void 0:N.state)==null?void 0:A.decorations.underline)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const k=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(k,N),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(_,x,S){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(S,x.text)}_fireUnderlineEvent(_,x){const S=_.range,k=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-k-1,S.end.x,S.end.y-k-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(_,x,S){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(S,x.text)}_linkAtPosition(_,x){const S=_.range.start.y*this._bufferService.cols+_.range.start.x,k=_.range.end.y*this._bufferService.cols+_.range.end.x,N=x.y*this._bufferService.cols+x.x;return S<=N&&N<=k}_positionFromMouseEvent(_,x,S){const k=S.getCoords(_,x,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,x,S,k,N){return{x1:_,y1:x,x2:S,y2:k,cols:this._bufferService.cols,fg:N}}};l.Linkifier=b=h([m(1,w.IMouseService),m(2,w.IRenderService),m(3,C.IBufferService),m(4,w.ILinkProviderService)],b)},9042:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(c,l,u){var h=this&&this.__decorate||function(w,b,_,x){var S,k=arguments.length,N=k<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,b,_,x);else for(var A=w.length-1;A>=0;A--)(S=w[A])&&(N=(k<3?S(N):k>3?S(b,_,N):S(b,_))||N);return k>3&&N&&Object.defineProperty(b,_,N),N},m=this&&this.__param||function(w,b){return function(_,x){b(_,x,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=u(511),g=u(2585);let y=l.OscLinkProvider=class{constructor(w,b,_){this._bufferService=w,this._optionsService=b,this._oscLinkService=_}provideLinks(w,b){var D;const _=this._bufferService.buffer.lines.get(w-1);if(!_)return void b(void 0);const x=[],S=this._optionsService.rawOptions.linkHandler,k=new d.CellData,N=_.getTrimmedLength();let A=-1,j=-1,T=!1;for(let B=0;BS?S.activate($,K,G):C(0,K),hover:($,K)=>{var W;return(W=S==null?void 0:S.hover)==null?void 0:W.call(S,$,K,G)},leave:($,K)=>{var W;return(W=S==null?void 0:S.leave)==null?void 0:W.call(S,$,K,G)}})}T=!1,k.hasExtendedAttrs()&&k.extended.urlId?(j=B,A=k.extended.urlId):(j=-1,A=-1)}}b(x)}};function C(w,b){if(confirm(`Do you want to navigate to ${b}? - -WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=y=h([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],y)},6193:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,m){this._rowCount=m,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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 u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const h=u(3614),m=u(3656),d=u(3551),g=u(9042),y=u(3730),C=u(1680),w=u(3107),b=u(5744),_=u(2950),x=u(1296),S=u(428),k=u(4269),N=u(5114),A=u(8934),j=u(3230),T=u(9312),D=u(4725),B=u(6731),F=u(8055),G=u(8969),U=u(8460),$=u(844),K=u(6114),W=u(8437),Z=u(2584),ee=u(7399),z=u(5941),L=u(9074),I=u(2585),Y=u(5435),q=u(4567),se=u(779);class de extends G.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(te={}){super(te),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.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(L.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(se.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((V,re)=>this.refresh(V,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((V=>this._reportWindowsOptions(V)))),this.register(this._inputHandler.onColor((V=>this._handleColorEvent(V)))),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((V=>this._afterResize(V.cols,V.rows)))),this.register((0,$.toDisposable)((()=>{var V,re;this._customKeyEventHandler=void 0,(re=(V=this.element)==null?void 0:V.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(te){if(this._themeService)for(const V of te){let re,oe="";switch(V.index){case 256:re="foreground",oe="10";break;case 257:re="background",oe="11";break;case 258:re="cursor",oe="12";break;default:re="ansi",oe="4;"+V.index}switch(V.type){case 0:const _e=F.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[V.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${Z.C0.ESC}]${oe};${(0,z.toRgbString)(_e)}${Z.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((ye=>ye.ansi[V.index]=F.channels.toColor(...V.color)));else{const ye=re;this._themeService.modifyColors((ke=>ke[ye]=F.channels.toColor(...V.color)))}break;case 2:this._themeService.restoreColor(V.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(te){te?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(te){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var te;return(te=this.textarea)==null?void 0:te.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.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 te=this.buffer.ybase+this.buffer.y,V=this.buffer.lines.get(te);if(!V)return;const re=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,_e=V.getWidth(re),ye=this._renderService.dimensions.css.cell.width*_e,ke=this.buffer.y*this._renderService.dimensions.css.cell.height,Me=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Me+"px",this.textarea.style.top=ke+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(V=>{this.hasSelection()&&(0,h.copyHandler)(V,this._selectionService)})));const te=V=>(0,h.handlePasteEvent)(V,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",te)),this.register((0,m.addDisposableDomListener)(this.element,"paste",te)),K.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(V=>{V.button===2&&(0,h.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(V=>{(0,h.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(V=>{V.button===1&&(0,h.moveTextAreaUnderMouseCursor)(V,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(te=>this._keyUp(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(te=>this._keyDown(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(te=>this._keyPress(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(te=>this._compositionHelper.compositionupdate(te)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(te=>this._inputEvent(te)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(te){var re;if(!te)throw new Error("Terminal requires a parent element.");if(te.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((re=this.element)==null?void 0:re.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=te.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"),te.appendChild(this.element);const V=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),V.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,m.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),V.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),K.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(N.CoreBrowserService,this.textarea,te.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(V);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&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(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const te=this,V=this.element;function re(ye){const ke=te._mouseService.getMouseReportCoords(ye,te.screenElement);if(!ke)return!1;let Me,Ue;switch(ye.overrideType||ye.type){case"mousemove":Ue=32,ye.buttons===void 0?(Me=3,ye.button!==void 0&&(Me=ye.button<3?ye.button:3)):Me=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Ue=0,Me=ye.button<3?ye.button:3;break;case"mousedown":Ue=1,Me=ye.button<3?ye.button:3;break;case"wheel":if(te._customWheelEventHandler&&te._customWheelEventHandler(ye)===!1||te.viewport.getLinesScrolled(ye)===0)return!1;Ue=ye.deltaY<0?0:1,Me=4;break;default:return!1}return!(Ue===void 0||Me===void 0||Me>4)&&te.coreMouseService.triggerMouseEvent({col:ke.col,row:ke.row,x:ke.x,y:ke.y,button:Me,action:Ue,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:ye=>(re(ye),ye.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(ye)),wheel:ye=>(re(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&re(ye)},mousemove:ye=>{ye.buttons||re(ye)}};this.register(this.coreMouseService.onProtocolChange((ye=>{ye?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ye)),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&ye?oe.mousemove||(V.addEventListener("mousemove",_e.mousemove),oe.mousemove=_e.mousemove):(V.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&ye?oe.wheel||(V.addEventListener("wheel",_e.wheel,{passive:!1}),oe.wheel=_e.wheel):(V.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&ye?oe.mouseup||(oe.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&ye?oe.mousedrag||(oe.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(V,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return re(ye),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(ye)}))),this.register((0,m.addDisposableDomListener)(V,"wheel",(ye=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const ke=this.viewport.getLinesScrolled(ye);if(ke===0)return;const Me=Z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Ue="";for(let Fe=0;Fe{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(V,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(te,V){var re;(re=this._renderService)==null||re.refreshRows(te,V)}updateCursorStyle(te){var V;(V=this._selectionService)!=null&&V.shouldColumnSelect(te)?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(te,V,re=0){var oe;re===1?(super.scrollLines(te,V,re),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(te)}paste(te){(0,h.paste)(te,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(te){this._customKeyEventHandler=te}attachCustomWheelEventHandler(te){this._customWheelEventHandler=te}registerLinkProvider(te){return this._linkProviderService.registerLinkProvider(te)}registerCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const V=this._characterJoinerService.register(te);return this.refresh(0,this.rows-1),V}deregisterCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(te)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(te){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+te)}registerDecoration(te){return this._decorationService.registerDecoration(te)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(te,V,re){this._selectionService.setSelection(te,V,re)}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 te;(te=this._selectionService)==null||te.clearSelection()}selectAll(){var te;(te=this._selectionService)==null||te.selectAll()}selectLines(te,V){var re;(re=this._selectionService)==null||re.selectLines(te,V)}_keyDown(te){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;const V=this.browser.isMac&&this.options.macOptionIsMeta&&te.altKey;if(!V&&!this._compositionHelper.keydown(te))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;V||te.key!=="Dead"&&te.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,ee.evaluateKeyboardEvent)(te,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(te),re.type===3||re.type===2){const oe=this.rows-1;return this.scrollLines(re.type===2?-oe:oe),this.cancel(te,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,te)||(re.cancel&&this.cancel(te,!0),!re.key||!!(te.key&&!te.ctrlKey&&!te.altKey&&!te.metaKey&&te.key.length===1&&te.key.charCodeAt(0)>=65&&te.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==Z.C0.ETX&&re.key!==Z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||te.altKey||te.ctrlKey?this.cancel(te,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(te,V){const re=te.isMac&&!this.options.macOptionIsMeta&&V.altKey&&!V.ctrlKey&&!V.metaKey||te.isWindows&&V.altKey&&V.ctrlKey&&!V.metaKey||te.isWindows&&V.getModifierState("AltGraph");return V.type==="keypress"?re:re&&(!V.keyCode||V.keyCode>47)}_keyUp(te){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1||((function(V){return V.keyCode===16||V.keyCode===17||V.keyCode===18})(te)||this.focus(),this.updateCursorStyle(te),this._keyPressHandled=!1)}_keyPress(te){let V;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;if(this.cancel(te),te.charCode)V=te.charCode;else if(te.which===null||te.which===void 0)V=te.keyCode;else{if(te.which===0||te.charCode===0)return!1;V=te.which}return!(!V||(te.altKey||te.ctrlKey||te.metaKey)&&!this._isThirdLevelShift(this.browser,te)||(V=String.fromCharCode(V),this._onKey.fire({key:V,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(V,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(te){if(te.data&&te.inputType==="insertText"&&(!te.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const V=te.data;return this.coreService.triggerDataEvent(V,!0),this.cancel(te),!0}return!1}resize(te,V){te!==this.cols||V!==this.rows?super.resize(te,V):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(te,V){var re,oe;(re=this._charSizeService)==null||re.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var te;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 V=1;V{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,m){this._rowCount=m,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=d-this._lastRefreshMs,y=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(c,l,u){var h=this&&this.__decorate||function(_,x,S,k){var N,A=arguments.length,j=A<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,x,S,k);else for(var T=_.length-1;T>=0;T--)(N=_[T])&&(j=(A<3?N(j):A>3?N(x,S,j):N(x,S))||j);return A>3&&j&&Object.defineProperty(x,S,j),j},m=this&&this.__param||function(_,x){return function(S,k){x(S,k,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=u(3656),g=u(4725),y=u(8460),C=u(844),w=u(2585);let b=l.Viewport=class extends C.Disposable{constructor(_,x,S,k,N,A,j,T){super(),this._viewportElement=_,this._scrollArea=x,this._bufferService=S,this._optionsService=k,this._charSizeService=N,this._renderService=A,this._coreBrowserService=j,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 y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.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(T.colors),this.register(T.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.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(_){if(_)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 _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){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 _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<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(_,x){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&S0&&(S=G),k=""}}return{bufferElements:N,cursorElement:S}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let x=this._applyScrollModifier(_.deltaY,_);return _.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):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(_,x){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&x.altKey||S==="ctrl"&&x.ctrlKey||S==="shift"&&x.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const x=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(_,x))}};l.Viewport=b=h([m(2,w.IBufferService),m(3,w.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],b)},3107:function(c,l,u){var h=this&&this.__decorate||function(w,b,_,x){var S,k=arguments.length,N=k<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,b,_,x);else for(var A=w.length-1;A>=0;A--)(S=w[A])&&(N=(k<3?S(N):k>3?S(b,_,N):S(b,_))||N);return k>3&&N&&Object.defineProperty(b,_,N),N},m=this&&this.__param||function(w,b){return function(_,x){b(_,x,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=u(4725),g=u(844),y=u(2585);let C=l.BufferDecorationRenderer=class extends g.Disposable{constructor(w,b,_,x,S){super(),this._screenElement=w,this._bufferService=b,this._coreBrowserService=_,this._decorationService=x,this._renderService=S,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((k=>this._removeDecoration(k)))),this.register((0,g.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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var x;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((x=w==null?void 0:w.options)==null?void 0:x.layer)==="top"),b.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(w.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 _=w.options.x??0;return _&&_>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(w,b),b}_refreshStyle(w){const b=w.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let _=this._decorationElements.get(w);_||(_=this._createElement(w),w.element=_,this._decorationElements.set(w,_),this._container.appendChild(_),w.onDispose((()=>{this._decorationElements.delete(w),_.remove()}))),_.style.top=b*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(_)}}_refreshXPosition(w,b=w.element){if(!b)return;const _=w.options.x??0;(w.options.anchor||"left")==="right"?b.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var b;(b=this._decorationElements.get(w))==null||b.remove(),this._decorationElements.delete(w),w.dispose()}};l.BufferDecorationRenderer=C=h([m(1,y.IBufferService),m(2,d.ICoreBrowserService),m(3,y.IDecorationService),m(4,d.IRenderService)],C)},5871:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,m){return h>=u.startBufferLine-this._linePadding[m||"full"]&&h<=u.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(c,l,u){var h=this&&this.__decorate||function(S,k,N,A){var j,T=arguments.length,D=T<3?k:A===null?A=Object.getOwnPropertyDescriptor(k,N):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,k,N,A);else for(var B=S.length-1;B>=0;B--)(j=S[B])&&(D=(T<3?j(D):T>3?j(k,N,D):j(k,N))||D);return T>3&&D&&Object.defineProperty(k,N,D),D},m=this&&this.__param||function(S,k){return function(N,A){k(N,A,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=u(5871),g=u(4725),y=u(844),C=u(2585),w={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let x=l.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,N,A,j,T,D){var F;super(),this._viewportElement=S,this._screenElement=k,this._bufferService=N,this._decorationService=A,this._renderService=j,this._optionsService=T,this._coreBrowserService=D,this._colorZoneStore=new d.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(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)((()=>{var G;(G=this._canvas)==null||G.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 S=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=S,b.center=k,b.right=S,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=b.left,_.right=b.left+b.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);w.left=k,w.center=k,w.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(_[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-w[S.position||"full"]/2),b[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=x=h([m(2,C.IBufferService),m(3,C.IDecorationService),m(4,g.IRenderService),m(5,C.IOptionsService),m(6,g.ICoreBrowserService)],x)},2950:function(c,l,u){var h=this&&this.__decorate||function(w,b,_,x){var S,k=arguments.length,N=k<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,b,_,x);else for(var A=w.length-1;A>=0;A--)(S=w[A])&&(N=(k<3?S(N):k>3?S(b,_,N):S(b,_))||N);return k>3&&N&&Object.defineProperty(b,_,N),N},m=this&&this.__param||function(w,b){return function(_,x){b(_,x,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=u(4725),g=u(2585),y=u(2584);let C=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,b,_,x,S,k){this._textarea=w,this._compositionView=b,this._bufferService=_,this._optionsService=x,this._coreService=S,this._renderService=k,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(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),_.length>0&&this._coreService.triggerDataEvent(_,!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 w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,_=b.replace(w,"");this._dataAlreadySent=_,b.length>w.length?this._coreService.triggerDataEvent(_,!0):b.lengththis.updateCompositionElements(!0)),0)}}};l.CompositionHelper=C=h([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,d.IRenderService)],C)},9806:(c,l)=>{function u(h,m,d){const g=d.getBoundingClientRect(),y=h.getComputedStyle(d),C=parseInt(y.getPropertyValue("padding-left")),w=parseInt(y.getPropertyValue("padding-top"));return[m.clientX-g.left-C,m.clientY-g.top-w]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(h,m,d,g,y,C,w,b,_){if(!C)return;const x=u(h,m,d);return x?(x[0]=Math.ceil((x[0]+(_?w/2:0))/w),x[1]=Math.ceil(x[1]/b),x[0]=Math.min(Math.max(x[0],1),g+(_?1:0)),x[1]=Math.min(Math.max(x[1],1),y),x):void 0}},9504:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const h=u(2584);function m(b,_,x,S){const k=b-d(b,x),N=_-d(_,x),A=Math.abs(k-N)-(function(j,T,D){let B=0;const F=j-d(j,D),G=T-d(T,D);for(let U=0;U=0&&b<_.rows;)x++,S=_.buffer.lines.get(--b),k=S==null?void 0:S.isWrapped;return x}function g(b,_){return b>_?"A":"B"}function y(b,_,x,S,k,N){let A=b,j=_,T="";for(;A!==x||j!==S;)A+=k?1:-1,k&&A>N.cols-1?(T+=N.buffer.translateBufferLineToString(j,!1,b,A),A=0,b=0,j++):!k&&A<0&&(T+=N.buffer.translateBufferLineToString(j,!1,0,b+1),A=N.cols-1,b=A,j--);return T+N.buffer.translateBufferLineToString(j,!1,b,A)}function C(b,_){const x=_?"O":"[";return h.C0.ESC+x+b}function w(b,_){b=Math.floor(b);let x="";for(let S=0;S0?F-d(F,G):D;const K=F,W=(function(Z,ee,z,L,I,Y){let q;return q=m(z,L,I,Y).length>0?L-d(L,I):ee,Z=z&&qb?"D":"C",w(Math.abs(k-b),C(A,S));A=N>_?"D":"C";const j=Math.abs(N-_);return w((function(T,D){return D.cols-T})(N>_?b:k,x)+(j-1)*x.cols+1+((N>_?k:b)-1),C(A,S))}},1296:function(c,l,u){var h=this&&this.__decorate||function(U,$,K,W){var Z,ee=arguments.length,z=ee<3?$:W===null?W=Object.getOwnPropertyDescriptor($,K):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,$,K,W);else for(var L=U.length-1;L>=0;L--)(Z=U[L])&&(z=(ee<3?Z(z):ee>3?Z($,K,z):Z($,K))||z);return ee>3&&z&&Object.defineProperty($,K,z),z},m=this&&this.__param||function(U,$){return function(K,W){$(K,W,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=u(3787),g=u(2550),y=u(2223),C=u(6171),w=u(6052),b=u(4725),_=u(8055),x=u(8460),S=u(844),k=u(2585),N="xterm-dom-renderer-owner-",A="xterm-rows",j="xterm-fg-",T="xterm-bg-",D="xterm-focus",B="xterm-selection";let F=1,G=l.DomRenderer=class extends S.Disposable{constructor(U,$,K,W,Z,ee,z,L,I,Y,q,se,de){super(),this._terminal=U,this._document=$,this._element=K,this._screenElement=W,this._viewportElement=Z,this._helperContainer=ee,this._linkifier2=z,this._charSizeService=I,this._optionsService=Y,this._bufferService=q,this._coreBrowserService=se,this._themeService=de,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(A),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(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((fe=>this._injectCss(fe)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(N+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((fe=>this._handleLinkHover(fe)))),this.register(this._linkifier2.onHideLinkUnderline((fe=>this._handleLinkLeave(fe)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(N+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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 $=`${this._terminalSelector} .${A} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${A} .xterm-dim { color: ${_.color.multiplyOpacity(U.foreground,.5).css};}`,$+=`${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 K=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,Z=`blink_block_${this._terminalClass}`;$+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${W} { 50% { box-shadow: none; }}`,$+=`@keyframes ${Z} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,$+=`${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,z]of U.ansi.entries())$+=`${this._terminalSelector} .${j}${ee} { color: ${z.css}; }${this._terminalSelector} .${j}${ee}.xterm-dim { color: ${_.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${T}${ee} { background-color: ${z.css}; }`;$+=`${this._terminalSelector} .${j}${y.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(U.background).css}; }${this._terminalSelector} .${j}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${T}${y.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=$}_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,$){for(let K=this._rowElements.length;K<=$;K++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,$){this._refreshRowElements(U,$),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(U,$,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,$,K),this.renderRows(0,this._bufferService.rows-1),!U||!$)return;this._selectionRenderModel.update(this._terminal,U,$,K);const W=this._selectionRenderModel.viewportStartRow,Z=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||z<0)return;const L=this._document.createDocumentFragment();if(K){const I=U[0]>$[0];L.appendChild(this._createSelectionElement(ee,I?$[0]:U[0],I?U[0]:$[0],z-ee+1))}else{const I=W===ee?U[0]:0,Y=ee===Z?$[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(ee,I,Y));const q=z-ee-1;if(L.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,q)),ee!==z){const se=Z===z?$[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(z,0,se))}}this._selectionContainer.appendChild(L)}_createSelectionElement(U,$,K,W=1){const Z=this._document.createElement("div"),ee=$*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(K-$);return ee+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-ee),Z.style.height=W*this.dimensions.css.cell.height+"px",Z.style.top=U*this.dimensions.css.cell.height+"px",Z.style.left=`${ee}px`,Z.style.width=`${z}px`,Z}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,$){const K=this._bufferService.buffer,W=K.ybase+K.y,Z=Math.min(K.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=U;I<=$;I++){const Y=I+K.ydisp,q=this._rowElements[I],se=K.lines.get(Y);if(!q||!se)break;q.replaceChildren(...this._rowFactory.createRow(se,Y,Y===W,z,L,Z,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N}${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,$,K,W,Z,ee){K<0&&(U=0),W<0&&($=0);const z=this._bufferService.rows-1;K=Math.max(Math.min(K,z),0),W=Math.max(Math.min(W,z),0),Z=Math.min(Z,this._bufferService.cols);const L=this._bufferService.buffer,I=L.ybase+L.y,Y=Math.min(L.x,Z-1),q=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let fe=K;fe<=W;++fe){const te=fe+L.ydisp,V=this._rowElements[fe],re=L.lines.get(te);if(!V||!re)break;V.replaceChildren(...this._rowFactory.createRow(re,te,te===I,se,de,Y,q,this.dimensions.css.cell.width,this._widthCache,ee?fe===K?U:0:-1,ee?(fe===W?$:Z)-1:-1))}}};l.DomRenderer=G=h([m(7,k.IInstantiationService),m(8,b.ICharSizeService),m(9,k.IOptionsService),m(10,k.IBufferService),m(11,b.ICoreBrowserService),m(12,b.IThemeService)],G)},3787:function(c,l,u){var h=this&&this.__decorate||function(A,j,T,D){var B,F=arguments.length,G=F<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(A,j,T,D);else for(var U=A.length-1;U>=0;U--)(B=A[U])&&(G=(F<3?B(G):F>3?B(j,T,G):B(j,T))||G);return F>3&&G&&Object.defineProperty(j,T,G),G},m=this&&this.__param||function(A,j){return function(T,D){j(T,D,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=u(2223),g=u(643),y=u(511),C=u(2585),w=u(8055),b=u(4725),_=u(4269),x=u(6171),S=u(3734);let k=l.DomRendererRowFactory=class{constructor(A,j,T,D,B,F,G){this._document=A,this._characterJoinerService=j,this._optionsService=T,this._coreBrowserService=D,this._coreService=B,this._decorationService=F,this._themeService=G,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,j,T){this._selectionStart=A,this._selectionEnd=j,this._columnSelectMode=T}createRow(A,j,T,D,B,F,G,U,$,K,W){const Z=[],ee=this._characterJoinerService.getJoinedCharacters(j),z=this._themeService.colors;let L,I=A.getNoBgTrimmedLength();T&&I0&&ke===ee[0][0]){Ue=!0;const ot=ee.shift();Le=new _.JoinedCellData(this._workCell,A.translateToString(!0,ot[0],ot[1]),ot[1]-ot[0]),Fe=ot[1]-1,Me=Le.getWidth()}const At=this._isCellInSelection(ke,j),Dt=T&&ke===F,Rt=ye&&ke>=K&&ke<=W;let Ft=!1;this._decorationService.forEachDecorationAtCell(ke,j,void 0,(ot=>{Ft=!0}));let an=Le.getChars()||g.WHITESPACE_CELL_CHAR;if(an===" "&&(Le.isUnderline()||Le.isOverline())&&(an=" "),oe=Me*U-$.get(an,Le.isBold(),Le.isItalic()),L){if(Y&&(At&&re||!At&&!re&&Le.bg===se)&&(At&&re&&z.selectionForeground||Le.fg===de)&&Le.extended.ext===fe&&Rt===te&&oe===V&&!Dt&&!Ue&&!Ft){Le.isInvisible()?q+=g.WHITESPACE_CELL_CHAR:q+=an,Y++;continue}Y&&(L.textContent=q),L=this._document.createElement("span"),Y=0,q=""}else L=this._document.createElement("span");if(se=Le.bg,de=Le.fg,fe=Le.extended.ext,te=Rt,V=oe,re=At,Ue&&F>=ke&&F<=Fe&&(F=ke),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&_e.push("xterm-cursor-blink"),_e.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){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(Le.isBold()&&_e.push("xterm-bold"),Le.isItalic()&&_e.push("xterm-italic"),Le.isDim()&&_e.push("xterm-dim"),q=Le.isInvisible()?g.WHITESPACE_CELL_CHAR:Le.getChars()||g.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(_e.push(`xterm-underline-${Le.extended.underlineStyle}`),q===" "&&(q=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let ot=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&ot<8&&(ot+=8),L.style.textDecorationColor=z.ansi[ot].css}Le.isOverline()&&(_e.push("xterm-overline"),q===" "&&(q=" ")),Le.isStrikethrough()&&_e.push("xterm-strikethrough"),Rt&&(L.style.textDecoration="underline");let wt=Le.getFgColor(),Je=Le.getFgColorMode(),pt=Le.getBgColor(),be=Le.getBgColorMode();const Ae=!!Le.isInverse();if(Ae){const ot=wt;wt=pt,pt=ot;const Pe=Je;Je=be,be=Pe}let He,Ke,rt,Pt=!1;switch(this._decorationService.forEachDecorationAtCell(ke,j,void 0,(ot=>{ot.options.layer!=="top"&&Pt||(ot.backgroundColorRGB&&(be=50331648,pt=ot.backgroundColorRGB.rgba>>8&16777215,He=ot.backgroundColorRGB),ot.foregroundColorRGB&&(Je=50331648,wt=ot.foregroundColorRGB.rgba>>8&16777215,Ke=ot.foregroundColorRGB),Pt=ot.options.layer==="top")})),!Pt&&At&&(He=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,pt=He.rgba>>8&16777215,be=50331648,Pt=!0,z.selectionForeground&&(Je=50331648,wt=z.selectionForeground.rgba>>8&16777215,Ke=z.selectionForeground)),Pt&&_e.push("xterm-decoration-top"),be){case 16777216:case 33554432:rt=z.ansi[pt],_e.push(`xterm-bg-${pt}`);break;case 50331648:rt=w.channels.toColor(pt>>16,pt>>8&255,255&pt),this._addStyle(L,`background-color:#${N((pt>>>0).toString(16),"0",6)}`);break;default:Ae?(rt=z.foreground,_e.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):rt=z.background}switch(He||Le.isDim()&&(He=w.color.multiplyOpacity(rt,.5)),Je){case 16777216:case 33554432:Le.isBold()&&wt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(wt+=8),this._applyMinimumContrast(L,rt,z.ansi[wt],Le,He,void 0)||_e.push(`xterm-fg-${wt}`);break;case 50331648:const ot=w.channels.toColor(wt>>16&255,wt>>8&255,255&wt);this._applyMinimumContrast(L,rt,ot,Le,He,Ke)||this._addStyle(L,`color:#${N(wt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,rt,z.foreground,Le,He,Ke)||Ae&&_e.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}_e.length&&(L.className=_e.join(" "),_e.length=0),Dt||Ue||Ft?L.textContent=q:Y++,oe!==this.defaultSpacing&&(L.style.letterSpacing=`${oe}px`),Z.push(L),ke=Fe}return L&&Y&&(L.textContent=q),Z}_applyMinimumContrast(A,j,T,D,B,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const G=this._getContrastCache(D);let U;if(B||F||(U=G.getColor(j.rgba,T.rgba)),U===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);U=w.color.ensureContrastRatio(B||j,F||T,$),G.setColor((B||j).rgba,(F||T).rgba,U??null)}return!!U&&(this._addStyle(A,`color:${U.css}`),!0)}_getContrastCache(A){return A.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(A,j){A.setAttribute("style",`${A.getAttribute("style")||""}${j};`)}_isCellInSelection(A,j){const T=this._selectionStart,D=this._selectionEnd;return!(!T||!D)&&(this._columnSelectMode?T[0]<=D[0]?A>=T[0]&&j>=T[1]&&A=T[1]&&A>=D[0]&&j<=D[1]:j>T[1]&&j=T[0]&&A=T[0])}};function N(A,j,T){for(;A.length{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 m=u.createElement("span");m.classList.add("xterm-char-measure-element");const d=u.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const y=u.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[m,d,g,y],this._container.appendChild(m),this._container.appendChild(d),this._container.appendChild(g),this._container.appendChild(y),h.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(u,h,m,d){u===this._font&&h===this._fontSize&&m===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=h,this._weight=m,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,h,m){let d=0;if(!h&&!m&&u.length===1&&(d=u.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const C=this._measure(u,0);return C>0&&(this._flat[d]=C),C}let g=u;h&&(g+="B"),m&&(g+="I");let y=this._holey.get(g);if(y===void 0){let C=0;h&&(C|=1),m&&(C|=2),y=this._measure(u,C),y>0&&this._holey.set(g,y)}return y}_measure(u,h){const m=this._measureElements[h];return m.textContent=u.repeat(32),m.offsetWidth/32}}},2223:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(c,l)=>{function u(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=h,l.allowRescaling=function(m,d,g,y){return d===1&&g>Math.ceil(1.5*y)&&m!==void 0&&m>255&&!h(m)&&!u(m)&&!(function(C){return 57344<=C&&C<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return u(m)||(function(d){return 9472<=d&&d<=9631})(m)},l.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}}}},l.computeNextVariantOffset=function(m,d,g=0){return(m-(2*Math.round(d)-g))%(2*Math.round(d))}},6052:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{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(m,d,g,y=!1){if(this.selectionStart=d,this.selectionEnd=g,!d||!g||d[0]===g[0]&&d[1]===g[1])return void this.clear();const C=m.buffers.active.ydisp,w=d[1]-C,b=g[1]-C,_=Math.max(w,0),x=Math.min(b,m.rows-1);_>=m.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=w,this.viewportEndRow=b,this.viewportCappedStartRow=_,this.viewportCappedEndRow=x,this.startCol=d[0],this.endCol=g[0])}isCellSelected(m,d,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&g>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&d=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(c,l,u){var h=this&&this.__decorate||function(x,S,k,N){var A,j=arguments.length,T=j<3?S:N===null?N=Object.getOwnPropertyDescriptor(S,k):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,S,k,N);else for(var D=x.length-1;D>=0;D--)(A=x[D])&&(T=(j<3?A(T):j>3?A(S,k,T):A(S,k))||T);return j>3&&T&&Object.defineProperty(S,k,T),T},m=this&&this.__param||function(x,S){return function(k,N){S(k,N,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=u(2585),g=u(8460),y=u(844);let C=l.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,S,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new b(x,S,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())}};l.CharSizeService=C=h([m(2,d.IOptionsService)],C);class w extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,k){S!==void 0&&S>0&&k!==void 0&&k>0&&(this._result.width=S,this._result.height=k)}}class b extends w{constructor(S,k,N){super(),this._document=S,this._parentElement=k,this._optionsService=N,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 _ extends w{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(c,l,u){var h=this&&this.__decorate||function(_,x,S,k){var N,A=arguments.length,j=A<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,x,S,k);else for(var T=_.length-1;T>=0;T--)(N=_[T])&&(j=(A<3?N(j):A>3?N(x,S,j):N(x,S))||j);return A>3&&j&&Object.defineProperty(x,S,j),j},m=this&&this.__param||function(_,x){return function(S,k){x(S,k,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=u(3734),g=u(643),y=u(511),C=u(2585);class w extends d.AttributeData{constructor(x,S,k){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=S,this._width=k}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()]}}l.JoinedCellData=w;let b=l.CharacterJoinerService=class t9{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(x){const S={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(S),S.id}deregister(x){for(let S=0;S1){const G=this._getJoinedRanges(N,T,j,S,A);for(let U=0;U1){const F=this._getJoinedRanges(N,T,j,S,A);for(let G=0;G{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const h=u(844),m=u(8460),d=u(3656);class g extends h.Disposable{constructor(w,b,_){super(),this._textarea=w,this._window=b,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,m.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(w){this._window!==w&&(this._window=w,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}}l.CoreBrowserService=g;class y extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.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:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const h=u(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const y=this.linkProviders.indexOf(g);y!==-1&&this.linkProviders.splice(y,1)}}}}l.LinkProviderService=m},8934:function(c,l,u){var h=this&&this.__decorate||function(C,w,b,_){var x,S=arguments.length,k=S<3?w:_===null?_=Object.getOwnPropertyDescriptor(w,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(C,w,b,_);else for(var N=C.length-1;N>=0;N--)(x=C[N])&&(k=(S<3?x(k):S>3?x(w,b,k):x(w,b))||k);return S>3&&k&&Object.defineProperty(w,b,k),k},m=this&&this.__param||function(C,w){return function(b,_){w(b,_,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=u(4725),g=u(9806);let y=l.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,b,_,x){return(0,g.getCoords)(window,C,w,b,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(C,w){const b=(0,g.getCoordsRelativeToElement)(window,C,w);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])}}};l.MouseService=y=h([m(0,d.IRenderService),m(1,d.ICharSizeService)],y)},3230:function(c,l,u){var h=this&&this.__decorate||function(x,S,k,N){var A,j=arguments.length,T=j<3?S:N===null?N=Object.getOwnPropertyDescriptor(S,k):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,S,k,N);else for(var D=x.length-1;D>=0;D--)(A=x[D])&&(T=(j<3?A(T):j>3?A(S,k,T):A(S,k))||T);return j>3&&T&&Object.defineProperty(S,k,T),T},m=this&&this.__param||function(x,S){return function(k,N){S(k,N,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=u(6193),g=u(4725),y=u(8460),C=u(844),w=u(7226),b=u(2585);let _=l.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,S,k,N,A,j,T,D){super(),this._rowCount=x,this._charSizeService=N,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.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 y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((B,F)=>this._renderRows(B,F)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(A.onDecorationRegistered((()=>this._fullRefresh()))),this.register(A.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,S),this.register(T.onWindowChange((B=>this._registerIntersectionObserver(B,S))))}_registerIntersectionObserver(x,S){if("IntersectionObserver"in x){const k=new x.IntersectionObserver((N=>this._handleIntersectionChange(N[N.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,C.toDisposable)((()=>k.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,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,S,this._rowCount))}_renderRows(x,S){this._renderer.value&&(x=Math.min(x,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(x,S),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:S}),this._onRender.fire({start:x,end:S}),this._isNextRenderRedrawOnly=!0)}resize(x,S){this._rowCount=S,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((S=>this.refreshRows(S.start,S.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,S;this._renderer.value&&((S=(x=this._renderer.value).clearTextureAtlas)==null||S.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(x,S)})):this._renderer.value.handleResize(x,S),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,S,k){var N;this._selectionState.start=x,this._selectionState.end=S,this._selectionState.columnSelectMode=k,(N=this._renderer.value)==null||N.handleSelectionChanged(x,S,k)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};l.RenderService=_=h([m(2,b.IOptionsService),m(3,g.ICharSizeService),m(4,b.IDecorationService),m(5,b.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],_)},9312:function(c,l,u){var h=this&&this.__decorate||function(T,D,B,F){var G,U=arguments.length,$=U<3?D:F===null?F=Object.getOwnPropertyDescriptor(D,B):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(T,D,B,F);else for(var K=T.length-1;K>=0;K--)(G=T[K])&&($=(U<3?G($):U>3?G(D,B,$):G(D,B))||$);return U>3&&$&&Object.defineProperty(D,B,$),$},m=this&&this.__param||function(T,D){return function(B,F){D(B,F,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=u(9806),g=u(9504),y=u(456),C=u(4725),w=u(8460),b=u(844),_=u(6114),x=u(4841),S=u(511),k=u(2585),N=" ",A=new RegExp(N,"g");let j=l.SelectionService=class extends b.Disposable{constructor(T,D,B,F,G,U,$,K,W){super(),this._element=T,this._screenElement=D,this._linkifier=B,this._bufferService=F,this._coreService=G,this._mouseService=U,this._optionsService=$,this._renderService=K,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Z=>this._handleMouseMove(Z),this._mouseUpListener=Z=>this._handleMouseUp(Z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Z=>this._handleTrim(Z))),this.register(this._bufferService.buffers.onBufferActivate((Z=>this._handleBufferActivate(Z)))),this.enable(),this._model=new y.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 T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!T||!D||T[0]===D[0]&&T[1]===D[1])}get selectionText(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!T||!D)return"";const B=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(T[0]===D[0])return"";const G=T[0]G.replace(A," "))).join(_.isWindows?`\r -`:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&T&&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(T){const D=this._getMouseBufferCoords(T),B=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(B&&F&&D)&&this._areCoordsInSelection(D,B,F)}isCellInSelection(T,D){const B=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!B||!F)&&this._areCoordsInSelection([T,D],B,F)}_areCoordsInSelection(T,D,B){return T[1]>D[1]&&T[1]=D[0]&&T[0]=D[0]}_selectWordAtCursor(T,D){var G,U;const B=(U=(G=this._linkifier.currentLink)==null?void 0:G.link)==null?void 0:U.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(T);return!!F&&(this._selectWordAt(F,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,D){this._model.clearSelection(),T=Math.max(T,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const D=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(T){let D=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=B?0:(D>B&&(D-=B),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(T){return _.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),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(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!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(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const D=this._getMouseBufferCoords(T);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(T){return T.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.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(T),!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 B=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(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const D=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const F=(0,g.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,B=!(!T||!D||T[0]===D[0]&&T[1]===D[1]);B?T&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,D,B)):this._oldHasSelection&&this._fireOnSelectionChange(T,D,B)}_fireOnSelectionChange(T,D,B){this._oldSelectionStart=T,this._oldSelectionEnd=D,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(T,D){let B=D;for(let F=0;D>=F;F++){const G=T.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:G>1&&D!==F&&(B+=G-1)}return B}setSelection(T,D,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,D],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,D,B=!0,F=!0){if(T[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,U=G.lines.get(T[1]);if(!U)return;const $=G.translateBufferLineToString(T[1],!1);let K=this._convertViewportColToCharacterIndex(U,T[0]),W=K;const Z=T[0]-K;let ee=0,z=0,L=0,I=0;if($.charAt(K)===" "){for(;K>0&&$.charAt(K-1)===" ";)K--;for(;W<$.length&&$.charAt(W+1)===" ";)W++}else{let se=T[0],de=T[0];U.getWidth(se)===0&&(ee++,se--),U.getWidth(de)===2&&(z++,de++);const fe=U.getString(de).length;for(fe>1&&(I+=fe-1,W+=fe-1);se>0&&K>0&&!this._isCharWordSeparator(U.loadCell(se-1,this._workCell));){U.loadCell(se-1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,se--):te>1&&(L+=te-1,K-=te-1),K--,se--}for(;de1&&(I+=te-1,W+=te-1),W++,de++}}W++;let Y=K+Z-ee+L,q=Math.min(this._bufferService.cols,W-K+ee+z-L-I);if(D||$.slice(K,W).trim()!==""){if(B&&Y===0&&U.getCodePoint(0)!==32){const se=G.lines.get(T[1]-1);if(se&&U.isWrapped&&se.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(de){const fe=this._bufferService.cols-de.start;Y-=fe,q+=fe}}}if(F&&Y+q===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const se=G.lines.get(T[1]+1);if(se!=null&&se.isWrapped&&se.getCodePoint(0)!==32){const de=this._getWordAt([0,T[1]+1],!1,!1,!0);de&&(q+=de.length)}}return{start:Y,length:q}}}_selectWordAt(T,D){const B=this._getWordAt(T,D);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[B.start,T[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(T){const D=this._getWordAt(T,!0);if(D){let B=T[1];for(;D.start<0;)D.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,B]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const D=this._bufferService.buffer.getWrappedRangeForLine(T),B={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)(B,this._bufferService.cols)}};l.SelectionService=j=h([m(3,k.IBufferService),m(4,k.ICoreService),m(5,C.IMouseService),m(6,k.IOptionsService),m(7,C.IRenderService),m(8,C.ICoreBrowserService)],j)},4725:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const h=u(8343);l.ICharSizeService=(0,h.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),l.IMouseService=(0,h.createDecorator)("MouseService"),l.IRenderService=(0,h.createDecorator)("RenderService"),l.ISelectionService=(0,h.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,h.createDecorator)("ThemeService"),l.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(c,l,u){var h=this&&this.__decorate||function(j,T,D,B){var F,G=arguments.length,U=G<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,D):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(j,T,D,B);else for(var $=j.length-1;$>=0;$--)(F=j[$])&&(U=(G<3?F(U):G>3?F(T,D,U):F(T,D))||U);return G>3&&U&&Object.defineProperty(T,D,U),U},m=this&&this.__param||function(j,T){return function(D,B){T(D,B,j)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),g=u(8055),y=u(8460),C=u(844),w=u(2585),b=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),x=g.css.toColor("#ffffff"),S=g.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let D=0;D<216;D++){const B=T[D/36%6|0],F=T[D/6%6|0],G=T[D%6];j.push({css:g.channels.toCss(B,F,G),rgba:g.channels.toRgba(B,F,G)})}for(let D=0;D<24;D++){const B=8+10*D;j.push({css:g.channels.toCss(B,B,B),rgba:g.channels.toRgba(B,B,B)})}return j})());let N=l.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:_,cursor:x,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:g.color.blend(_,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:g.color.blend(_,k),ansi:l.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(j={}){const T=this._colors;if(T.foreground=A(j.foreground,b),T.background=A(j.background,_),T.cursor=A(j.cursor,x),T.cursorAccent=A(j.cursorAccent,S),T.selectionBackgroundTransparent=A(j.selectionBackground,k),T.selectionBackgroundOpaque=g.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=A(j.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=g.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=j.selectionForeground?A(j.selectionForeground,g.NULL_COLOR):void 0,T.selectionForeground===g.NULL_COLOR&&(T.selectionForeground=void 0),g.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=g.color.opacity(T.selectionBackgroundTransparent,.3)),g.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=g.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=A(j.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=A(j.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=A(j.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=A(j.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=A(j.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=A(j.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=A(j.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=A(j.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=A(j.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=A(j.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=A(j.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=A(j.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=A(j.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=A(j.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=A(j.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=A(j.brightWhite,l.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const D=Math.min(T.ansi.length-16,j.extendedAnsi.length);for(let B=0;B{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const h=u(8460),m=u(844);class d extends m.Disposable{constructor(y){super(),this._maxLength=y,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(y){if(this._maxLength===y)return;const C=new Array(y);for(let w=0;wthis._length)for(let C=this._length;C=y;b--)this._array[this._getCyclicIndex(b+w.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;bthis._maxLength){const b=this._length+w.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=w.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,C,w){if(!(C<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let _=C-1;_>=0;_--)this.set(y+_+w,this.get(y+_));const b=y+C+w-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(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(h,m=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const g in h)d[g]=m<=1?h[g]:h[g]&&u(h[g],m-1);return d}},8055:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,h=0,m=0,d=0;var g,y,C,w,b;function _(S){const k=S.toString(16);return k.length<2?"0"+k:k}function x(S,k){return S>>0},S.toColor=function(k,N,A,j){return{css:S.toCss(k,N,A,j),rgba:S.toRgba(k,N,A,j)}}})(g||(l.channels=g={})),(function(S){function k(N,A){return d=Math.round(255*A),[u,h,m]=b.toChannels(N.rgba),{css:g.toCss(u,h,m,d),rgba:g.toRgba(u,h,m,d)}}S.blend=function(N,A){if(d=(255&A.rgba)/255,d===1)return{css:A.css,rgba:A.rgba};const j=A.rgba>>24&255,T=A.rgba>>16&255,D=A.rgba>>8&255,B=N.rgba>>24&255,F=N.rgba>>16&255,G=N.rgba>>8&255;return u=B+Math.round((j-B)*d),h=F+Math.round((T-F)*d),m=G+Math.round((D-G)*d),{css:g.toCss(u,h,m),rgba:g.toRgba(u,h,m)}},S.isOpaque=function(N){return(255&N.rgba)==255},S.ensureContrastRatio=function(N,A,j){const T=b.ensureContrastRatio(N.rgba,A.rgba,j);if(T)return g.toColor(T>>24&255,T>>16&255,T>>8&255)},S.opaque=function(N){const A=(255|N.rgba)>>>0;return[u,h,m]=b.toChannels(A),{css:g.toCss(u,h,m),rgba:A}},S.opacity=k,S.multiplyOpacity=function(N,A){return d=255&N.rgba,k(N,d*A/255)},S.toColorRGB=function(N){return[N.rgba>>24&255,N.rgba>>16&255,N.rgba>>8&255]}})(y||(l.color=y={})),(function(S){let k,N;try{const A=document.createElement("canvas");A.width=1,A.height=1;const j=A.getContext("2d",{willReadFrequently:!0});j&&(k=j,k.globalCompositeOperation="copy",N=k.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return u=parseInt(A.slice(1,2).repeat(2),16),h=parseInt(A.slice(2,3).repeat(2),16),m=parseInt(A.slice(3,4).repeat(2),16),g.toColor(u,h,m);case 5:return u=parseInt(A.slice(1,2).repeat(2),16),h=parseInt(A.slice(2,3).repeat(2),16),m=parseInt(A.slice(3,4).repeat(2),16),d=parseInt(A.slice(4,5).repeat(2),16),g.toColor(u,h,m,d);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const j=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return u=parseInt(j[1]),h=parseInt(j[2]),m=parseInt(j[3]),d=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),g.toColor(u,h,m,d);if(!k||!N)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=N,k.fillStyle=A,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[u,h,m,d]=k.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,h,m,d),css:A}}})(C||(l.css=C={})),(function(S){function k(N,A,j){const T=N/255,D=A/255,B=j/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}S.relativeLuminance=function(N){return k(N>>16&255,N>>8&255,255&N)},S.relativeLuminance2=k})(w||(l.rgb=w={})),(function(S){function k(A,j,T){const D=A>>24&255,B=A>>16&255,F=A>>8&255;let G=j>>24&255,U=j>>16&255,$=j>>8&255,K=x(w.relativeLuminance2(G,U,$),w.relativeLuminance2(D,B,F));for(;K0||U>0||$>0);)G-=Math.max(0,Math.ceil(.1*G)),U-=Math.max(0,Math.ceil(.1*U)),$-=Math.max(0,Math.ceil(.1*$)),K=x(w.relativeLuminance2(G,U,$),w.relativeLuminance2(D,B,F));return(G<<24|U<<16|$<<8|255)>>>0}function N(A,j,T){const D=A>>24&255,B=A>>16&255,F=A>>8&255;let G=j>>24&255,U=j>>16&255,$=j>>8&255,K=x(w.relativeLuminance2(G,U,$),w.relativeLuminance2(D,B,F));for(;K>>0}S.blend=function(A,j){if(d=(255&j)/255,d===1)return j;const T=j>>24&255,D=j>>16&255,B=j>>8&255,F=A>>24&255,G=A>>16&255,U=A>>8&255;return u=F+Math.round((T-F)*d),h=G+Math.round((D-G)*d),m=U+Math.round((B-U)*d),g.toRgba(u,h,m)},S.ensureContrastRatio=function(A,j,T){const D=w.relativeLuminance(A>>8),B=w.relativeLuminance(j>>8);if(x(D,B)>8));if($x(D,w.relativeLuminance(K>>8))?U:K}return U}const F=N(A,j,T),G=x(D,w.relativeLuminance(F>>8));if(Gx(D,w.relativeLuminance(U>>8))?F:U}return F}},S.reduceLuminance=k,S.increaseLuminance=N,S.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(b||(l.rgba=b={})),l.toPaddedHex=_,l.contrastRatio=x},8969:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const h=u(844),m=u(2585),d=u(4348),g=u(7866),y=u(744),C=u(7302),w=u(6975),b=u(8460),_=u(1753),x=u(1480),S=u(7994),k=u(9282),N=u(5435),A=u(5981),j=u(2660);let T=!1;class D extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((F=>{var G;(G=this._onScrollApi)==null||G.fire(F.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(F){for(const G in F)this.optionsService.options[G]=F[G]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new h.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 d.InstantiationService,this.optionsService=this.register(new C.OptionsService(F)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(y.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new N.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((G=>{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((G=>{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 A.WriteBuffer(((G,U)=>this._inputHandler.parse(G,U)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,G){this._writeBuffer.write(F,G)}writeSync(F,G){this._logService.logLevel<=m.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(F,G)}input(F,G=!0){this.coreService.triggerDataEvent(F,G)}resize(F,G){isNaN(F)||isNaN(G)||(F=Math.max(F,y.MINIMUM_COLS),G=Math.max(G,y.MINIMUM_ROWS),this._bufferService.resize(F,G))}scroll(F,G=!1){this._bufferService.scroll(F,G)}scrollLines(F,G,U){this._bufferService.scrollLines(F,G,U)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const G=F-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(F,G){return this._inputHandler.registerEscHandler(F,G)}registerDcsHandler(F,G){return this._inputHandler.registerDcsHandler(F,G)}registerCsiHandler(F,G){return this._inputHandler.registerCsiHandler(F,G)}registerOscHandler(F,G){return this._inputHandler.registerOscHandler(F,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?F=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const G of F)G.dispose()}))}}}l.CoreTerminal=D},8460:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;hh.fire(m)))},l.runAndSubscribe=function(u,h){return h(void 0),u((m=>h(m)))}},5435:function(c,l,u){var h=this&&this.__decorate||function(ee,z,L,I){var Y,q=arguments.length,se=q<3?z:I===null?I=Object.getOwnPropertyDescriptor(z,L):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(ee,z,L,I);else for(var de=ee.length-1;de>=0;de--)(Y=ee[de])&&(se=(q<3?Y(se):q>3?Y(z,L,se):Y(z,L))||se);return q>3&&se&&Object.defineProperty(z,L,se),se},m=this&&this.__param||function(ee,z){return function(L,I){z(L,I,ee)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=u(2584),g=u(7116),y=u(2015),C=u(844),w=u(482),b=u(8437),_=u(8460),x=u(643),S=u(511),k=u(3734),N=u(2585),A=u(1480),j=u(6242),T=u(6351),D=u(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function G(ee,z){if(ee>24)return z.setWinLines||!1;switch(ee){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var U;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let $=0;class K extends C.Disposable{getAttrData(){return this._curAttrData}constructor(z,L,I,Y,q,se,de,fe,te=new y.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=L,this._coreService=I,this._logService=Y,this._optionsService=q,this._oscLinkService=se,this._coreMouseService=de,this._unicodeService=fe,this._parser=te,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new S.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 _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.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 W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((V=>this._activeBuffer=V.activeBuffer))),this._parser.setCsiHandlerFallback(((V,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(V),params:re.toArray()})})),this._parser.setEscHandlerFallback((V=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(V)})})),this._parser.setExecuteHandlerFallback((V=>{this._logService.debug("Unknown EXECUTE code: ",{code:V})})),this._parser.setOscHandlerFallback(((V,re,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:V,action:re,data:oe})})),this._parser.setDcsHandlerFallback(((V,re,oe)=>{re==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(V),action:re,payload:oe})})),this._parser.setPrintHandler(((V,re,oe)=>this.print(V,re,oe))),this._parser.registerCsiHandler({final:"@"},(V=>this.insertChars(V))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(V=>this.scrollLeft(V))),this._parser.registerCsiHandler({final:"A"},(V=>this.cursorUp(V))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(V=>this.scrollRight(V))),this._parser.registerCsiHandler({final:"B"},(V=>this.cursorDown(V))),this._parser.registerCsiHandler({final:"C"},(V=>this.cursorForward(V))),this._parser.registerCsiHandler({final:"D"},(V=>this.cursorBackward(V))),this._parser.registerCsiHandler({final:"E"},(V=>this.cursorNextLine(V))),this._parser.registerCsiHandler({final:"F"},(V=>this.cursorPrecedingLine(V))),this._parser.registerCsiHandler({final:"G"},(V=>this.cursorCharAbsolute(V))),this._parser.registerCsiHandler({final:"H"},(V=>this.cursorPosition(V))),this._parser.registerCsiHandler({final:"I"},(V=>this.cursorForwardTab(V))),this._parser.registerCsiHandler({final:"J"},(V=>this.eraseInDisplay(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(V=>this.eraseInDisplay(V,!0))),this._parser.registerCsiHandler({final:"K"},(V=>this.eraseInLine(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(V=>this.eraseInLine(V,!0))),this._parser.registerCsiHandler({final:"L"},(V=>this.insertLines(V))),this._parser.registerCsiHandler({final:"M"},(V=>this.deleteLines(V))),this._parser.registerCsiHandler({final:"P"},(V=>this.deleteChars(V))),this._parser.registerCsiHandler({final:"S"},(V=>this.scrollUp(V))),this._parser.registerCsiHandler({final:"T"},(V=>this.scrollDown(V))),this._parser.registerCsiHandler({final:"X"},(V=>this.eraseChars(V))),this._parser.registerCsiHandler({final:"Z"},(V=>this.cursorBackwardTab(V))),this._parser.registerCsiHandler({final:"`"},(V=>this.charPosAbsolute(V))),this._parser.registerCsiHandler({final:"a"},(V=>this.hPositionRelative(V))),this._parser.registerCsiHandler({final:"b"},(V=>this.repeatPrecedingCharacter(V))),this._parser.registerCsiHandler({final:"c"},(V=>this.sendDeviceAttributesPrimary(V))),this._parser.registerCsiHandler({prefix:">",final:"c"},(V=>this.sendDeviceAttributesSecondary(V))),this._parser.registerCsiHandler({final:"d"},(V=>this.linePosAbsolute(V))),this._parser.registerCsiHandler({final:"e"},(V=>this.vPositionRelative(V))),this._parser.registerCsiHandler({final:"f"},(V=>this.hVPosition(V))),this._parser.registerCsiHandler({final:"g"},(V=>this.tabClear(V))),this._parser.registerCsiHandler({final:"h"},(V=>this.setMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(V=>this.setModePrivate(V))),this._parser.registerCsiHandler({final:"l"},(V=>this.resetMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(V=>this.resetModePrivate(V))),this._parser.registerCsiHandler({final:"m"},(V=>this.charAttributes(V))),this._parser.registerCsiHandler({final:"n"},(V=>this.deviceStatus(V))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(V=>this.deviceStatusPrivate(V))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(V=>this.softReset(V))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(V=>this.setCursorStyle(V))),this._parser.registerCsiHandler({final:"r"},(V=>this.setScrollRegion(V))),this._parser.registerCsiHandler({final:"s"},(V=>this.saveCursor(V))),this._parser.registerCsiHandler({final:"t"},(V=>this.windowOptions(V))),this._parser.registerCsiHandler({final:"u"},(V=>this.restoreCursor(V))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(V=>this.insertColumns(V))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(V=>this.deleteColumns(V))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(V=>this.selectProtected(V))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(V=>this.requestMode(V,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(V=>this.requestMode(V,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new j.OscHandler((V=>(this.setTitle(V),this.setIconName(V),!0)))),this._parser.registerOscHandler(1,new j.OscHandler((V=>this.setIconName(V)))),this._parser.registerOscHandler(2,new j.OscHandler((V=>this.setTitle(V)))),this._parser.registerOscHandler(4,new j.OscHandler((V=>this.setOrReportIndexedColor(V)))),this._parser.registerOscHandler(8,new j.OscHandler((V=>this.setHyperlink(V)))),this._parser.registerOscHandler(10,new j.OscHandler((V=>this.setOrReportFgColor(V)))),this._parser.registerOscHandler(11,new j.OscHandler((V=>this.setOrReportBgColor(V)))),this._parser.registerOscHandler(12,new j.OscHandler((V=>this.setOrReportCursorColor(V)))),this._parser.registerOscHandler(104,new j.OscHandler((V=>this.restoreIndexedColor(V)))),this._parser.registerOscHandler(110,new j.OscHandler((V=>this.restoreFgColor(V)))),this._parser.registerOscHandler(111,new j.OscHandler((V=>this.restoreBgColor(V)))),this._parser.registerOscHandler(112,new j.OscHandler((V=>this.restoreCursorColor(V)))),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 V in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:V},(()=>this.selectCharset("("+V))),this._parser.registerEscHandler({intermediates:")",final:V},(()=>this.selectCharset(")"+V))),this._parser.registerEscHandler({intermediates:"*",final:V},(()=>this.selectCharset("*"+V))),this._parser.registerEscHandler({intermediates:"+",final:V},(()=>this.selectCharset("+"+V))),this._parser.registerEscHandler({intermediates:"-",final:V},(()=>this.selectCharset("-"+V))),this._parser.registerEscHandler({intermediates:".",final:V},(()=>this.selectCharset("."+V))),this._parser.registerEscHandler({intermediates:"/",final:V},(()=>this.selectCharset("/"+V)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((V=>(this._logService.error("Parsing error: ",V),V))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((V,re)=>this.requestStatusString(V,re))))}_preserveStack(z,L,I,Y){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=I,this._parseStack.position=Y}_logSlowResolvingAsync(z){this._logService.logLevel<=N.LogLevelEnum.WARN&&Promise.race([z,new Promise(((L,I)=>setTimeout((()=>I("#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(z,L){let I,Y=this._activeBuffer.x,q=this._activeBuffer.y,se=0;const de=this._parseStack.paused;if(de){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(I),I;Y=this._parseStack.cursorStartX,q=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>F&&(se=this._parseStack.position+F)}if(this._logService.logLevel<=N.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(V=>String.fromCharCode(V))).join("")}"`),typeof z=="string"?z.split("").map((V=>V.charCodeAt(0))):z),this._parseBuffer.lengthF)for(let V=se;V0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let _e=this._parser.precedingJoinState;for(let ye=L;yefe){if(te){const Fe=oe;let Le=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ue>0&&oe instanceof b.BufferLine&&oe.copyCellsFrom(Fe,Le,0,Ue,!1);Le=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(V&&(oe.insertCells(this._activeBuffer.x,q-Ue,this._activeBuffer.getNullCell(re)),oe.getWidth(fe-1)===2&&oe.setCellFromCodepoint(fe-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,re)),oe.setCellFromCodepoint(this._activeBuffer.x++,Y,q,re),q>0)for(;--q;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=_e,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,L){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,L):this._parser.registerCsiHandler(z,(I=>!G(I.params[0],this._optionsService.rawOptions.windowOptions)||L(I)))}registerDcsHandler(z,L){return this._parser.registerDcsHandler(z,new T.DcsHandler(L))}registerEscHandler(z,L){return this._parser.registerEscHandler(z,L)}registerOscHandler(z,L){return this._parser.registerOscHandler(z,new j.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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.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 z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=z,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+L)}cursorUp(z){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const L=z.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=z.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=z.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const L=z.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,L,I,Y=!1,q=!1){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);se.replaceCells(L,I,this._activeBuffer.getNullCell(this._eraseAttrData()),q),Y&&(se.isWrapped=!1)}_resetBufferLine(z,L=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),I.isWrapped=!1)}eraseInDisplay(z,L=!1){let I;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);I=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,L);this._dirtyRowTracker.markDirty(0);break;case 3:const Y=this._activeBuffer.lines.length-this._bufferService.rows;Y>0&&(this._activeBuffer.lines.trimStart(Y),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Y,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Y,0),this._onScroll.fire(0))}return!0}eraseInLine(z,L=!1){switch(this._restrictCursor(this._bufferService.cols),z.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(z){this._restrictCursor();let L=z.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 te=fe;for(let V=1;V0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let L=0;LMe?1:2,_e=z.params[0];return ye=_e,ke=L?_e===2?4:_e===4?oe(se.modes.insertMode):_e===12?3:_e===20?oe(re.convertEol):0:_e===1?oe(I.applicationCursorKeys):_e===3?re.windowOptions.setWinLines?fe===80?2:fe===132?1:0:0:_e===6?oe(I.origin):_e===7?oe(I.wraparound):_e===8?3:_e===9?oe(Y==="X10"):_e===12?oe(re.cursorBlink):_e===25?oe(!se.isCursorHidden):_e===45?oe(I.reverseWraparound):_e===66?oe(I.applicationKeypad):_e===67?4:_e===1e3?oe(Y==="VT200"):_e===1002?oe(Y==="DRAG"):_e===1003?oe(Y==="ANY"):_e===1004?oe(I.sendFocus):_e===1005?4:_e===1006?oe(q==="SGR"):_e===1015?4:_e===1016?oe(q==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?oe(te===V):_e===2004?oe(I.bracketedPasteMode):0,se.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${ye};${ke}$y`),!0;var ye,ke}_updateAttrColor(z,L,I,Y,q){return L===2?(z|=50331648,z&=-16777216,z|=k.AttributeData.fromColorRGB([I,Y,q])):L===5&&(z&=-50331904,z|=33554432|255&I),z}_extractColor(z,L,I){const Y=[0,0,-1,0,0,0];let q=0,se=0;do{if(Y[se+q]=z.params[L+se],z.hasSubParams(L+se)){const de=z.getSubParams(L+se);let fe=0;do Y[1]===5&&(q=1),Y[se+fe+1+q]=de[fe];while(++fe=2||Y[1]===2&&se+q>=5)break;Y[1]&&(q=1)}while(++se+L5)&&(z=1),L.extended.underlineStyle=z,L.fg|=268435456,z===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(z){z.fg=b.DEFAULT_ATTR_DATA.fg,z.bg=b.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=z.length;let I;const Y=this._curAttrData;for(let q=0;q=30&&I<=37?(Y.fg&=-50331904,Y.fg|=16777216|I-30):I>=40&&I<=47?(Y.bg&=-50331904,Y.bg|=16777216|I-40):I>=90&&I<=97?(Y.fg&=-50331904,Y.fg|=16777224|I-90):I>=100&&I<=107?(Y.bg&=-50331904,Y.bg|=16777224|I-100):I===0?this._processSGR0(Y):I===1?Y.fg|=134217728:I===3?Y.bg|=67108864:I===4?(Y.fg|=268435456,this._processUnderline(z.hasSubParams(q)?z.getSubParams(q)[0]:1,Y)):I===5?Y.fg|=536870912:I===7?Y.fg|=67108864:I===8?Y.fg|=1073741824:I===9?Y.fg|=2147483648:I===2?Y.bg|=134217728:I===21?this._processUnderline(2,Y):I===22?(Y.fg&=-134217729,Y.bg&=-134217729):I===23?Y.bg&=-67108865:I===24?(Y.fg&=-268435457,this._processUnderline(0,Y)):I===25?Y.fg&=-536870913:I===27?Y.fg&=-67108865:I===28?Y.fg&=-1073741825:I===29?Y.fg&=2147483647:I===39?(Y.fg&=-67108864,Y.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):I===49?(Y.bg&=-67108864,Y.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?q+=this._extractColor(z,q,Y):I===53?Y.bg|=1073741824:I===55?Y.bg&=-1073741825:I===59?(Y.extended=Y.extended.clone(),Y.extended.underlineColor=-1,Y.updateExtended()):I===100?(Y.fg&=-67108864,Y.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,Y.bg&=-67108864,Y.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${I}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const L=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${I}R`)}return!0}softReset(z){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(z){const L=z.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 I=L%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(z){const L=z.params[0]||1;let I;return(z.length<2||(I=z.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(z){if(!G(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:L!==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(`${d.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(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const L=[],I=z.split(";");for(;I.length>1;){const Y=I.shift(),q=I.shift();if(/^\d+$/.exec(Y)){const se=parseInt(Y);if(Z(se))if(q==="?")L.push({type:0,index:se});else{const de=(0,D.parseColor)(q);de&&L.push({type:1,index:se,color:de})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(z){const L=z.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(z,L){this._getCurrentLinkId()&&this._finishHyperlink();const I=z.split(":");let Y;const q=I.findIndex((se=>se.startsWith("id=")));return q!==-1&&(Y=I[q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Y,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(z,L){const I=z.split(";");for(let Y=0;Y=this._specialColors.length);++Y,++L)if(I[Y]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const q=(0,D.parseColor)(I[Y]);q&&this._onColor.fire([{type:1,index:this._specialColors[L],color:q}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const L=[],I=z.split(";");for(let Y=0;Y=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 z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new S.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${q}${d.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[Y.cursorStyle]-(Y.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,L){this._dirtyRowTracker.markRangeDirty(z,L)}}l.InputHandler=K;let W=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){eethis.end&&(this.end=ee)}markRangeDirty(ee,z){ee>z&&($=ee,ee=z,z=$),eethis.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(ee){return 0<=ee&&ee<256}W=h([m(0,N.IBufferService)],W)},844:(c,l)=>{function u(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},l.toDisposable=function(h){return{dispose:h}},l.disposeArray=u,l.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(m,d,g){this._data[m]||(this._data[m]={}),this._data[m][d]=g}get(m,d){return this._data[m]?this._data[m][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(h,m,d,g,y){this._data.get(h,m)||this._data.set(h,m,new u),this._data.get(h,m).set(d,g,y)}get(h,m,d,g){var y;return(y=this._data.get(h,m))==null?void 0:y.get(d,g)}clear(){this._data.clear()}}},6114:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,h=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=u.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),l.isIpad=h==="iPad",l.isIphone=h==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),l.isLinux=h.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(u=this._search(m),u===-1)||this._getKey(this._array[u])!==m)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u=this._array.length)&&this._getKey(this._array[u])===h))do m(this._array[u]);while(++u=m;){let g=m+d>>1;const y=this._getKey(this._array[g]);if(y>h)d=g-1;else{if(!(y0&&this._getKey(this._array[g-1])===h;)g--;return g}m=g+1}}return m}}},7226:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const h=u(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),this._start()}flush(){for(;this._i_)return b-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-C))}ms`),void this._start();b=_}this.clear()}}class d extends m{_requestCallback(y){return setTimeout((()=>y(this._createDeadline(16))))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const C=Date.now()+y;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const h=u(643);l.updateWindowsModeWrappedState=function(m){const d=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=d==null?void 0:d.get(m.cols-1),y=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);y&&g&&(y.isWrapped=g[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&g[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}l.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,g=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=g}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=h},9092:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const h=u(6349),m=u(7226),d=u(3734),g=u(8437),y=u(4634),C=u(511),w=u(643),b=u(4863),_=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(x,S,k){this._hasScrollback=x,this._optionsService=S,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.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 d.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 d.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,S){return new g.BufferLine(this._bufferService.cols,this.getNullCell(x),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&xl.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:S}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=g.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,S){const k=this.getNullCell(g.DEFAULT_ATTR_DATA);let N=0;const A=this._getCorrectBufferLength(S);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(x,k)));else for(let T=this._rows;T>S;T--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(A0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=A}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,S-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(x,S),this._cols>x))for(let j=0;j.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 S=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,S){this._cols!==x&&(x>this._cols?this._reflowLarger(x,S):this._reflowSmaller(x,S))}_reflowLarger(x,S){const k=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(k.length>0){const N=(0,y.reflowLargerCreateNewLayout)(this.lines,k);(0,y.reflowLargerApplyNewLayout)(this.lines,N.layout),this._reflowLargerAdjustViewport(x,S,N.countRemoved)}}_reflowLargerAdjustViewport(x,S,k){const N=this.getNullCell(g.DEFAULT_ATTR_DATA);let A=k;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;j--){let T=this.lines.get(j);if(!T||!T.isWrapped&&T.getTrimmedLength()<=x)continue;const D=[T];for(;T.isWrapped&&j>0;)T=this.lines.get(--j),D.unshift(T);const B=this.ybase+this.y;if(B>=j&&B0&&(N.push({start:j+D.length+A,newLines:K}),A+=K.length),D.push(...K);let W=G.length-1,Z=G[W];Z===0&&(W--,Z=G[W]);let ee=D.length-U-1,z=F;for(;ee>=0;){const I=Math.min(z,Z);if(D[W]===void 0)break;if(D[W].copyCellsFrom(D[ee],z-I,Z-I,I,!0),Z-=I,Z===0&&(W--,Z=G[W]),z-=I,z===0){ee--;const Y=Math.max(ee,0);z=(0,y.getWrappedLineTrimmedLength)(D,Y,this._cols)}}for(let I=0;I0;)this.ybase===0?this.y0){const j=[],T=[];for(let W=0;W=0;W--)if(G&&G.start>B+U){for(let Z=G.newLines.length-1;Z>=0;Z--)this.lines.set(W--,G.newLines[Z]);W++,j.push({index:B+1,amount:G.newLines.length}),U+=G.newLines.length,G=N[++F]}else this.lines.set(W,T[B--]);let $=0;for(let W=j.length-1;W>=0;W--)j[W].index+=$,this.lines.onInsertEmitter.fire(j[W]),$+=j[W].amount;const K=Math.max(0,D+A-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(x,S,k=0,N){const A=this.lines.get(x);return A?A.translateToString(S,k,N):""}getWrappedRangeForLine(x){let S=x,k=x;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;k+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 S=0;S{S.line-=k,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((k=>{S.line>=k.index&&(S.line+=k.amount)}))),S.register(this.lines.onDelete((k=>{S.line>=k.index&&S.linek.index&&(S.line-=k.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const h=u(3734),m=u(511),d=u(643),g=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let y=0;class C{constructor(b,_,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const S=_||m.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let k=0;k>22,2097152&_?this._combined[b].charCodeAt(this._combined[b].length-1):x]}set(b,_){this._data[3*b+1]=_[d.CHAR_DATA_ATTR_INDEX],_[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=_[1],this._data[3*b+0]=2097152|b|_[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=_[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[d.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 _=this._data[3*b+0];return 2097152&_?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&_}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const _=this._data[3*b+0];return 2097152&_?this._combined[b]:2097151&_?(0,g.stringFromCodePoint)(2097151&_):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,_){return y=3*b,_.content=this._data[y+0],_.fg=this._data[y+1],_.bg=this._data[y+2],2097152&_.content&&(_.combinedData=this._combined[b]),268435456&_.bg&&(_.extended=this._extendedAttrs[b]),_}setCell(b,_){2097152&_.content&&(this._combined[b]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[b]=_.extended),this._data[3*b+0]=_.content,this._data[3*b+1]=_.fg,this._data[3*b+2]=_.bg}setCellFromCodepoint(b,_,x,S){268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=_|x<<22,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}addCodepointToCell(b,_,x){let S=this._data[3*b+0];2097152&S?this._combined[b]+=(0,g.stringFromCodePoint)(_):2097151&S?(this._combined[b]=(0,g.stringFromCodePoint)(2097151&S)+(0,g.stringFromCodePoint)(_),S&=-2097152,S|=2097152):S=_|4194304,x&&(S&=-12582913,S|=x<<22),this._data[3*b+0]=S}insertCells(b,_,x){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),_=0;--k)this.setCell(b+_+k,this.loadCell(b+k,S));for(let k=0;k<_;++k)this.setCell(b+k,x)}else for(let S=b;Sthis.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const S=new Uint32Array(x);S.set(this._data),this._data=S}for(let S=this.length;S=b&&delete this._combined[A]}const k=Object.keys(this._extendedAttrs);for(let N=0;N=b&&delete this._extendedAttrs[A]}}return this.length=b,4*x*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,_,x,S,k){const N=b._data;if(k)for(let j=S-1;j>=0;j--){for(let T=0;T<3;T++)this._data[3*(x+j)+T]=N[3*(_+j)+T];268435456&N[3*(_+j)+2]&&(this._extendedAttrs[x+j]=b._extendedAttrs[_+j])}else for(let j=0;j=_&&(this._combined[T-_+x]=b._combined[T])}}translateToString(b,_,x,S){_=_??0,x=x??this.length,b&&(x=Math.min(x,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;_>22||1}return S&&S.push(_),k}}l.BufferLine=C},4841:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(c,l)=>{function u(h,m,d){if(m===h.length-1)return h[m].getTrimmedLength();const g=!h[m].hasContent(d-1)&&h[m].getWidth(d-1)===1,y=h[m+1].getWidth(0)===2;return g&&y?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(h,m,d,g,y){const C=[];for(let w=0;w=w&&g0&&(T>S||x[T].getTrimmedLength()===0);T--)j++;j>0&&(C.push(w+x.length-j),C.push(j)),w+=x.length-1}return C},l.reflowLargerCreateNewLayout=function(h,m){const d=[];let g=0,y=m[g],C=0;for(let w=0;wu(h,x,m))).reduce(((_,x)=>_+x));let C=0,w=0,b=0;for(;b_&&(C-=_,w++);const x=h[w].getWidth(C-1)===2;x&&C--;const S=x?d-1:d;g.push(S),b+=S}return g},l.getWrappedLineTrimmedLength=u},5295:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const h=u(8460),m=u(844),d=u(9092);class g extends m.Disposable{constructor(C,w){super(),this._optionsService=C,this._bufferService=w,this._onBufferActivate=this.register(new h.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}l.BufferSet=g},511:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const h=u(482),m=u(643),d=u(3734);class g extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new g;return w.setFromCharData(C),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[m.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[m.CHAR_DATA_CHAR_INDEX].length===2){const b=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const _=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(b-55296)+_-56320+65536|C[m.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[m.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=g},643:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const h=u(8460),m=u(844);class d{get id(){return this._id}constructor(y){this.line=y,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(y){return this._disposables.push(y),y}}l.Marker=d,d._nextId=1},7116:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(c,l)=>{var u,h,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` -`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(u||(l.C0=u={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(h||(l.C1=h={})),(function(d){d.ST=`${u.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const h=u(2584),m={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:["'",'"']};l.evaluateKeyboardEvent=function(d,g,y,C){const w={type:0,cancel:!1,key:void 0},b=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?w.key=g?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?w.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?w.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(w.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:w.key=d.ctrlKey?"\b":h.C0.DEL,d.altKey&&(w.key=h.C0.ESC+w.key);break;case 9:if(d.shiftKey){w.key=h.C0.ESC+"[Z";break}w.key=h.C0.HT,w.cancel=!0;break;case 13:w.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,w.cancel=!0;break;case 27:w.key=h.C0.ESC,d.altKey&&(w.key=h.C0.ESC+h.C0.ESC),w.cancel=!0;break;case 37:if(d.metaKey)break;b?(w.key=h.C0.ESC+"[1;"+(b+1)+"D",w.key===h.C0.ESC+"[1;3D"&&(w.key=h.C0.ESC+(y?"b":"[1;5D"))):w.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;b?(w.key=h.C0.ESC+"[1;"+(b+1)+"C",w.key===h.C0.ESC+"[1;3C"&&(w.key=h.C0.ESC+(y?"f":"[1;5C"))):w.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;b?(w.key=h.C0.ESC+"[1;"+(b+1)+"A",y||w.key!==h.C0.ESC+"[1;3A"||(w.key=h.C0.ESC+"[1;5A")):w.key=g?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;b?(w.key=h.C0.ESC+"[1;"+(b+1)+"B",y||w.key!==h.C0.ESC+"[1;3B"||(w.key=h.C0.ESC+"[1;5B")):w.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(w.key=h.C0.ESC+"[2~");break;case 46:w.key=b?h.C0.ESC+"[3;"+(b+1)+"~":h.C0.ESC+"[3~";break;case 36:w.key=b?h.C0.ESC+"[1;"+(b+1)+"H":g?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:w.key=b?h.C0.ESC+"[1;"+(b+1)+"F":g?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?w.type=2:d.ctrlKey?w.key=h.C0.ESC+"[5;"+(b+1)+"~":w.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?w.type=3:d.ctrlKey?w.key=h.C0.ESC+"[6;"+(b+1)+"~":w.key=h.C0.ESC+"[6~";break;case 112:w.key=b?h.C0.ESC+"[1;"+(b+1)+"P":h.C0.ESC+"OP";break;case 113:w.key=b?h.C0.ESC+"[1;"+(b+1)+"Q":h.C0.ESC+"OQ";break;case 114:w.key=b?h.C0.ESC+"[1;"+(b+1)+"R":h.C0.ESC+"OR";break;case 115:w.key=b?h.C0.ESC+"[1;"+(b+1)+"S":h.C0.ESC+"OS";break;case 116:w.key=b?h.C0.ESC+"[15;"+(b+1)+"~":h.C0.ESC+"[15~";break;case 117:w.key=b?h.C0.ESC+"[17;"+(b+1)+"~":h.C0.ESC+"[17~";break;case 118:w.key=b?h.C0.ESC+"[18;"+(b+1)+"~":h.C0.ESC+"[18~";break;case 119:w.key=b?h.C0.ESC+"[19;"+(b+1)+"~":h.C0.ESC+"[19~";break;case 120:w.key=b?h.C0.ESC+"[20;"+(b+1)+"~":h.C0.ESC+"[20~";break;case 121:w.key=b?h.C0.ESC+"[21;"+(b+1)+"~":h.C0.ESC+"[21~";break;case 122:w.key=b?h.C0.ESC+"[23;"+(b+1)+"~":h.C0.ESC+"[23~";break;case 123:w.key=b?h.C0.ESC+"[24;"+(b+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(y&&!C||!d.altKey||d.metaKey)!y||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?w.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(w.key=h.C0.US),d.key==="@"&&(w.key=h.C0.NUL)):d.keyCode===65&&(w.type=1);else{const _=m[d.keyCode],x=_==null?void 0:_[d.shiftKey?1:0];if(x)w.key=h.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const S=d.ctrlKey?d.keyCode-64:d.keyCode+32;let k=String.fromCharCode(S);d.shiftKey&&(k=k.toUpperCase()),w.key=h.C0.ESC+k}else if(d.keyCode===32)w.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let S=d.code.slice(3,4);d.shiftKey||(S=S.toLowerCase()),w.key=h.C0.ESC+S,w.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?w.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?w.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?w.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?w.key=h.C0.DEL:d.keyCode===219?w.key=h.C0.ESC:d.keyCode===220?w.key=h.C0.FS:d.keyCode===221&&(w.key=h.C0.GS)}return w}},482:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,h=0,m=u.length){let d="";for(let g=h;g65535?(y-=65536,d+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):d+=String.fromCharCode(y)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const m=u.length;if(!m)return 0;let d=0,g=0;if(this._interim){const y=u.charCodeAt(g++);56320<=y&&y<=57343?h[d++]=1024*(this._interim-55296)+y-56320+65536:(h[d++]=this._interim,h[d++]=y),this._interim=0}for(let y=g;y=m)return this._interim=C,d;const w=u.charCodeAt(y);56320<=w&&w<=57343?h[d++]=1024*(C-55296)+w-56320+65536:(h[d++]=C,h[d++]=w)}else C!==65279&&(h[d++]=C)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const m=u.length;if(!m)return 0;let d,g,y,C,w=0,b=0,_=0;if(this.interim[0]){let k=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let A,j=0;for(;(A=63&this.interim[++j])&&j<4;)N<<=6,N|=A;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=T-j;for(;_=m)return 0;if(A=u[_++],(192&A)!=128){_--,k=!0;break}this.interim[j++]=A,N<<=6,N|=63&A}k||(T===2?N<128?_--:h[w++]=N:T===3?N<2048||N>=55296&&N<=57343||N===65279||(h[w++]=N):N<65536||N>1114111||(h[w++]=N)),this.interim.fill(0)}const x=m-4;let S=_;for(;S=m)return this.interim[0]=d,w;if(g=u[S++],(192&g)!=128){S--;continue}if(b=(31&d)<<6|63&g,b<128){S--;continue}h[w++]=b}else if((240&d)==224){if(S>=m)return this.interim[0]=d,w;if(g=u[S++],(192&g)!=128){S--;continue}if(S>=m)return this.interim[0]=d,this.interim[1]=g,w;if(y=u[S++],(192&y)!=128){S--;continue}if(b=(15&d)<<12|(63&g)<<6|63&y,b<2048||b>=55296&&b<=57343||b===65279)continue;h[w++]=b}else if((248&d)==240){if(S>=m)return this.interim[0]=d,w;if(g=u[S++],(192&g)!=128){S--;continue}if(S>=m)return this.interim[0]=d,this.interim[1]=g,w;if(y=u[S++],(192&y)!=128){S--;continue}if(S>=m)return this.interim[0]=d,this.interim[1]=g,this.interim[2]=y,w;if(C=u[S++],(192&C)!=128){S--;continue}if(b=(7&d)<<18|(63&g)<<12|(63&y)<<6|63&C,b<65536||b>1114111)continue;h[w++]=b}}return w}}},225:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const h=u(1480),m=[[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]],d=[[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 g;l.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let y=0;yw[x][1])return!1;for(;x>=_;)if(b=_+x>>1,C>w[b][1])_=b+1;else{if(!(C=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,C){let w=this.wcwidth(y),b=w===0&&C!==0;if(b){const _=h.UnicodeService.extractWidth(C);_===0?b=!1:_>w&&(w=_)}return h.UnicodeService.createPropertyValue(0,w,b)}}},5981:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const h=u(8460),m=u(844);class d extends m.Disposable{constructor(y){super(),this._action=y,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(y,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,C){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+=y.length,this._writeBuffer.push(y),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(C)}_innerWrite(y=0,C=!0){const w=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],_=this._action(b,C);if(_){const S=k=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(w,k);return void _.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(S)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-w>=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()}}l.WriteBuffer=d},5941:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\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})$/,h=/^[\da-f]+$/;function m(d,g){const y=d.toString(16),C=y.length<2?"0"+y:y;switch(g){case 4:return y[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}l.parseColor=function(d){if(!d)return;let g=d.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const y=u.exec(g);if(y){const C=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/C*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/C*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/C*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),h.exec(g)&&[3,6,9,12].includes(g.length))){const y=g.length/3,C=[0,0,0];for(let w=0;w<3;++w){const b=parseInt(g.slice(y*w,y*w+y),16);C[w]=y===1?b<<4:y===2?b:y===3?b>>4:b>>8}return C}},l.toRgbString=function(d,g=16){const[y,C,w]=d;return`rgb:${m(y,g)}/${m(C,g)}/${m(w,g)}`}},5770:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const h=u(482),m=u(8742),d=u(5770),g=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const b=this._handlers[C];return b.push(w),{dispose:()=>{const _=b.indexOf(w);_!==-1&&b.splice(_,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||g,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,b){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(C,w,b);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(C,w,b))}unhook(C,w=!0){if(this._active.length){let b=!1,_=this._active.length-1,x=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,b=w,x=this._stack.fallThrough,this._stack.paused=!1),!x&&b===!1){for(;_>=0&&(b=this._active[_].unhook(C),b!==!0);_--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,b;_--}for(;_>=0;_--)if(b=this._active[_].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",C);this._active=g,this._ident=0}};const y=new m.Params;y.addParam(0),l.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=y,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():y,this._data="",this._hitLimit=!1}put(C,w,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(C,w,b),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((b=>(this._params=y,this._data="",this._hitLimit=!1,b)));return this._params=y,this._data="",this._hitLimit=!1,w}}},2015:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const h=u(844),m=u(8742),d=u(6242),g=u(6351);class y{constructor(_){this.table=new Uint8Array(_)}setDefault(_,x){this.table.fill(_<<4|x)}add(_,x,S,k){this.table[x<<8|_]=S<<4|k}addMany(_,x,S,k){for(let N=0;N<_.length;N++)this.table[x<<8|_[N]]=S<<4|k}}l.TransitionTable=y;const C=160;l.VT500_TRANSITION_TABLE=(function(){const b=new y(4095),_=Array.apply(null,Array(256)).map(((j,T)=>T)),x=(j,T)=>_.slice(j,T),S=x(32,127),k=x(0,24);k.push(25),k.push.apply(k,x(28,32));const N=x(0,14);let A;for(A in b.setDefault(1,0),b.addMany(S,0,2,0),N)b.addMany([24,26,153,154],A,3,0),b.addMany(x(128,144),A,3,0),b.addMany(x(144,152),A,3,0),b.add(156,A,0,0),b.add(27,A,11,1),b.add(157,A,4,8),b.addMany([152,158,159],A,0,7),b.add(155,A,11,3),b.add(144,A,11,9);return b.addMany(k,0,3,0),b.addMany(k,1,3,1),b.add(127,1,0,1),b.addMany(k,8,0,8),b.addMany(k,3,3,3),b.add(127,3,0,3),b.addMany(k,4,3,4),b.add(127,4,0,4),b.addMany(k,6,3,6),b.addMany(k,5,3,5),b.add(127,5,0,5),b.addMany(k,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(S,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(x(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(S,7,0,7),b.addMany(k,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(x(64,127),3,7,0),b.addMany(x(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(x(48,60),4,8,4),b.addMany(x(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(x(32,64),6,0,6),b.add(127,6,0,6),b.addMany(x(64,127),6,0,0),b.addMany(x(32,48),3,9,5),b.addMany(x(32,48),5,9,5),b.addMany(x(48,64),5,0,6),b.addMany(x(64,127),5,7,0),b.addMany(x(32,48),4,9,5),b.addMany(x(32,48),1,9,2),b.addMany(x(32,48),2,9,2),b.addMany(x(48,127),2,10,0),b.addMany(x(48,80),1,10,0),b.addMany(x(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(x(96,127),1,10,0),b.add(80,1,11,9),b.addMany(k,9,0,9),b.add(127,9,0,9),b.addMany(x(28,32),9,0,9),b.addMany(x(32,48),9,9,12),b.addMany(x(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(k,11,0,11),b.addMany(x(32,128),11,0,11),b.addMany(x(28,32),11,0,11),b.addMany(k,10,0,10),b.add(127,10,0,10),b.addMany(x(28,32),10,0,10),b.addMany(x(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(x(32,48),10,9,12),b.addMany(k,12,0,12),b.add(127,12,0,12),b.addMany(x(28,32),12,0,12),b.addMany(x(32,48),12,9,12),b.addMany(x(48,64),12,0,11),b.addMany(x(64,127),12,12,13),b.addMany(x(64,127),10,12,13),b.addMany(x(64,127),9,12,13),b.addMany(k,13,13,13),b.addMany(S,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(C,0,2,0),b.add(C,8,5,8),b.add(C,6,0,6),b.add(C,11,0,11),b.add(C,13,13,13),b})();class w extends h.Disposable{constructor(_=l.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,S,k)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,S)=>{},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,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,x=[64,126]){let S=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=_.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;N<_.intermediates.length;++N){const A=_.intermediates.charCodeAt(N);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=A}}if(_.final.length!==1)throw new Error("final must be a single byte");const k=_.final.charCodeAt(0);if(x[0]>k||k>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return S<<=8,S|=k,S}identToString(_){const x=[];for(;_;)x.push(String.fromCharCode(255&_)),_>>=8;return x.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,x){const S=this._identifier(_,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const k=this._escHandlers[S];return k.push(x),{dispose:()=>{const N=k.indexOf(x);N!==-1&&k.splice(N,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,x){this._executeHandlers[_.charCodeAt(0)]=x}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,x){const S=this._identifier(_);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const k=this._csiHandlers[S];return k.push(x),{dispose:()=>{const N=k.indexOf(x);N!==-1&&k.splice(N,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,x){return this._dcsParser.registerHandler(this._identifier(_),x)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,x){return this._oscParser.registerHandler(_,x)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,x,S,k,N){this._parseStack.state=_,this._parseStack.handlers=x,this._parseStack.handlerPos=S,this._parseStack.transition=k,this._parseStack.chunkPos=N}parse(_,x,S){let k,N=0,A=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=this._parseStack.chunkPos+1;else{if(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&D>-1){for(;D>=0&&(k=T[D](this._params),k!==!0);D--)if(k instanceof Promise)return this._parseStack.handlerPos=D,k}this._parseStack.handlers=[];break;case 4:if(S===!1&&D>-1){for(;D>=0&&(k=T[D](),k!==!0);D--)if(k instanceof Promise)return this._parseStack.handlerPos=D,k}this._parseStack.handlers=[];break;case 6:if(N=_[this._parseStack.chunkPos],k=this._dcsParser.unhook(N!==24&&N!==26,S),k)return k;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(N=_[this._parseStack.chunkPos],k=this._oscParser.end(N!==24&&N!==26,S),k)return k;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=j;T>4){case 2:for(let U=T+1;;++U){if(U>=x||(N=_[U])<32||N>126&&N=x||(N=_[U])<32||N>126&&N=x||(N=_[U])<32||N>126&&N=x||(N=_[U])<32||N>126&&N=0&&(k=D[B](this._params),k!==!0);B--)if(k instanceof Promise)return this._preserveStack(3,D,B,A,T),k;B<0&&this._csiHandlerFb(this._collect<<8|N,this._params),this.precedingJoinState=0;break;case 8:do switch(N){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(N-48)}while(++T47&&N<60);T--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const F=this._escHandlers[this._collect<<8|N];let G=F?F.length-1:-1;for(;G>=0&&(k=F[G](),k!==!0);G--)if(k instanceof Promise)return this._preserveStack(4,F,G,A,T),k;G<0&&this._escHandlerFb(this._collect<<8|N),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|N,this._params);break;case 13:for(let U=T+1;;++U)if(U>=x||(N=_[U])===24||N===26||N===27||N>127&&N=x||(N=_[U])<32||N>127&&N{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const h=u(5770),m=u(482),d=[];l.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,y){this._handlers[g]===void 0&&(this._handlers[g]=[]);const C=this._handlers[g];return C.push(y),{dispose:()=>{const w=C.indexOf(y);w!==-1&&C.splice(w,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,y,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(g,y,C);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,y,C))}start(){this.reset(),this._state=1}put(g,y,C){if(this._state!==3){if(this._state===1)for(;y0&&this._put(g,y,C)}}end(g,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,b=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=y,b=this._stack.fallThrough,this._stack.paused=!1),!b&&C===!1){for(;w>=0&&(C=this._active[w].end(g),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",g);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,y,C){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,y,C),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let y=!1;if(this._hitLimit)y=!1;else if(g&&(y=this._handler(this._data),y instanceof Promise))return y.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,y}}},8742:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class h{static fromArray(d){const g=new h;if(!d.length)return g;for(let y=Array.isArray(d[0])?1:0;y256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let g=0;g>8,C=255&this._subParamsIdx[g];C-y>0&&d.push(Array.prototype.slice.call(this._subParams,y,C))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const g=this._subParamsIdx[d]>>8,y=255&this._subParamsIdx[d];return y-g>0?this._subParams.subarray(g,y):null}getSubParamsAll(){const d={};for(let g=0;g>8,C=255&this._subParamsIdx[g];C-y>0&&(d[g]=this._subParams.slice(y,C))}return d}addDigit(d){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,C=y[g-1];y[g-1]=~C?Math.min(10*C+d,u):d}}l.Params=h},5741:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let m=0;m{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const h=u(3785),m=u(511);l.BufferApiView=class{constructor(d,g){this._buffer=d,this.type=g}init(d){return this._buffer=d,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(d){const g=this._buffer.lines.get(d);if(g)return new h.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const h=u(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,d){if(!(m<0||m>=this._line.length))return d?(this._line.loadCell(m,d),d):this._line.loadCell(m,new h.CellData)}translateToString(m,d,g){return this._line.translateToString(m,d,g)}}},8285:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const h=u(8771),m=u(8460),d=u(844);class g extends d.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}l.BufferNamespaceApi=g},7975:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(m=>h(m.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((m,d)=>h(m,d.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(c,l,u){var h=this&&this.__decorate||function(b,_,x,S){var k,N=arguments.length,A=N<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,_,x,S);else for(var j=b.length-1;j>=0;j--)(k=b[j])&&(A=(N<3?k(A):N>3?k(_,x,A):k(_,x))||A);return N>3&&A&&Object.defineProperty(_,x,A),A},m=this&&this.__param||function(b,_){return function(x,S){_(x,S,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=u(8460),g=u(844),y=u(5295),C=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let w=l.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new y.BufferSet(b,this))}resize(b,_){this.cols=b,this.rows=_,this.buffers.resize(b,_),this._onResize.fire({cols:b,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,_=!1){const x=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===b.fg&&S.getBg(0)===b.bg||(S=x.getBlankLine(b,_),this._cachedBlankLine=S),S.isWrapped=_;const k=x.ybase+x.scrollTop,N=x.ybase+x.scrollBottom;if(x.scrollTop===0){const A=x.lines.isFull;N===x.lines.length-1?A?x.lines.recycle().copyFrom(S):x.lines.push(S.clone()):x.lines.splice(N+1,0,S.clone()),A?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const A=N-k+1;x.lines.shiftElements(k+1,A-1,-1),x.lines.set(N,S.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(b,_,x){const S=this.buffer;if(b<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else b+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const k=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+b,S.ybase),0),k!==S.ydisp&&(_||this._onScroll.fire(S.ydisp))}};l.BufferService=w=h([m(0,C.IOptionsService)],w)},7994:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(c,l,u){var h=this&&this.__decorate||function(S,k,N,A){var j,T=arguments.length,D=T<3?k:A===null?A=Object.getOwnPropertyDescriptor(k,N):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,k,N,A);else for(var B=S.length-1;B>=0;B--)(j=S[B])&&(D=(T<3?j(D):T>3?j(k,N,D):j(k,N))||D);return T>3&&D&&Object.defineProperty(k,N,D),D},m=this&&this.__param||function(S,k){return function(N,A){k(N,A,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=u(2585),g=u(8460),y=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function w(S,k){let N=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(N|=64,N|=S.action):(N|=3&S.button,4&S.button&&(N|=64),8&S.button&&(N|=128),S.action===32?N|=32:S.action!==0||k||(N|=3)),N}const b=String.fromCharCode,_={DEFAULT:S=>{const k=[w(S,!1)+32,S.col+32,S.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${b(k[0])}${b(k[1])}${b(k[2])}`},SGR:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${w(S,!0)};${S.col};${S.row}${k}`},SGR_PIXELS:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${w(S,!0)};${S.x};${S.y}${k}`}};let x=l.CoreMouseService=class extends y.Disposable{constructor(S,k){super(),this._bufferService=S,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(C))this.addProtocol(N,C[N]);for(const N of Object.keys(_))this.addEncoding(N,_[N]);this.reset()}addProtocol(S,k){this._protocols[S]=k}addEncoding(S,k){this._encodings[S]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const k=this._encodings[this._activeEncoding](S);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,k,N){if(N){if(S.x!==k.x||S.y!==k.y)return!1}else if(S.col!==k.col||S.row!==k.row)return!1;return S.button===k.button&&S.action===k.action&&S.ctrl===k.ctrl&&S.alt===k.alt&&S.shift===k.shift}};l.CoreMouseService=x=h([m(0,d.IBufferService),m(1,d.ICoreService)],x)},6975:function(c,l,u){var h=this&&this.__decorate||function(x,S,k,N){var A,j=arguments.length,T=j<3?S:N===null?N=Object.getOwnPropertyDescriptor(S,k):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,S,k,N);else for(var D=x.length-1;D>=0;D--)(A=x[D])&&(T=(j<3?A(T):j>3?A(S,k,T):A(S,k))||T);return j>3&&T&&Object.defineProperty(S,k,T),T},m=this&&this.__param||function(x,S){return function(k,N){S(k,N,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=u(1439),g=u(8460),y=u(844),C=u(2585),w=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=l.CoreService=class extends y.Disposable{constructor(x,S,k){super(),this._bufferService=x,this._logService=S,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(b)}reset(){this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(b)}triggerDataEvent(x,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((N=>N.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(x))}};l.CoreService=_=h([m(0,C.IBufferService),m(1,C.ILogService),m(2,C.IOptionsService)],_)},9074:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const h=u(8055),m=u(8460),d=u(844),g=u(6106);let y=0,C=0;class w extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const S=new b(x);if(S){const k=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),k.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,S,k){let N=0,A=0;for(const j of this._decorations.getKeyIterator(S))N=j.options.x??0,A=N+(j.options.width??1),x>=N&&x{y=A.options.x??0,C=y+(A.options.width??1),x>=y&&x{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const h=u(2585),m=u(8343);class d{constructor(...y){this._entries=new Map;for(const[C,w]of y)this.set(C,w)}set(y,C){const w=this._entries.get(y);return this._entries.set(y,C),w}forEach(y){for(const[C,w]of this._entries.entries())y(C,w)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(g,y){this._services.set(g,y)}getService(g){return this._services.get(g)}createInstance(g,...y){const C=(0,m.getServiceDependencies)(g).sort(((_,x)=>_.index-x.index)),w=[];for(const _ of C){const x=this._services.get(_.id);if(!x)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${_.id}.`);w.push(x)}const b=C.length>0?C[0].index:y.length;if(y.length!==b)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${b+1} conflicts with ${y.length} static arguments`);return new g(...y,...w)}}},7866:function(c,l,u){var h=this&&this.__decorate||function(b,_,x,S){var k,N=arguments.length,A=N<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,_,x,S);else for(var j=b.length-1;j>=0;j--)(k=b[j])&&(A=(N<3?k(A):N>3?k(_,x,A):k(_,x))||A);return N>3&&A&&Object.defineProperty(_,x,A),A},m=this&&this.__param||function(b,_){return function(x,S){_(x,S,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=u(844),g=u(2585),y={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let C,w=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let _=0;_JSON.stringify(A))).join(", ")})`);const N=S.apply(this,k);return C.trace(`GlyphRenderer#${S.name} return`,N),N}}},7302:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const h=u(8460),m=u(844),d=u(6114);l.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:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends m.Disposable{constructor(w){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...l.DEFAULT_OPTIONS};for(const _ in w)if(_ in b)try{const x=w[_];b[_]=this._sanitizeAndValidateOption(_,x)}catch(x){console.error(x)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,b){return this.onOptionChange((_=>{_===w&&b(this.rawOptions[w])}))}onMultipleOptionChange(w,b){return this.onOptionChange((_=>{w.indexOf(_)!==-1&&b()}))}_setupOptions(){const w=_=>{if(!(_ in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},b=(_,x)=>{if(!(_ in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);x=this._sanitizeAndValidateOption(_,x),this.rawOptions[_]!==x&&(this.rawOptions[_]=x,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const x={get:w.bind(this,_),set:b.bind(this,_)};Object.defineProperty(this.options,_,x)}}_sanitizeAndValidateOption(w,b){switch(w){case"cursorStyle":if(b||(b=l.DEFAULT_OPTIONS[w]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${w}`);break;case"wordSeparator":b||(b=l.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=g.includes(b)?b:l.DEFAULT_OPTIONS[w];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${w} 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(`${w} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${w} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}l.OptionsService=y},2660:function(c,l,u){var h=this&&this.__decorate||function(y,C,w,b){var _,x=arguments.length,S=x<3?C:b===null?b=Object.getOwnPropertyDescriptor(C,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,C,w,b);else for(var k=y.length-1;k>=0;k--)(_=y[k])&&(S=(x<3?_(S):x>3?_(C,w,S):_(C,w))||S);return x>3&&S&&Object.defineProperty(C,w,S),S},m=this&&this.__param||function(y,C){return function(w,b){C(w,b,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=u(2585);let g=l.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const C=this._bufferService.buffer;if(y.id===void 0){const k=C.addMarker(C.ybase+C.y),N={data:y,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(N,k))),this._dataByLinkId.set(N.id,N),N.id}const w=y,b=this._getEntryIdKey(w),_=this._entriesWithId.get(b);if(_)return this.addLineToLink(_.id,C.ybase+C.y),_.id;const x=C.addMarker(C.ybase+C.y),S={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(S,x))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(y,C){const w=this._dataByLinkId.get(y);if(w&&w.lines.every((b=>b.line!==C))){const b=this._bufferService.buffer.addMarker(C);w.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(w,b)))}}getLinkData(y){var C;return(C=this._dataByLinkId.get(y))==null?void 0:C.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,C){const w=y.lines.indexOf(C);w!==-1&&(y.lines.splice(w,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};l.OscLinkService=g=h([m(0,d.IBufferService)],g)},8343:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",h="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[h]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const d=function(g,y,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,b,_){b[u]===b?b[h].push({id:w,index:_}):(b[h]=[{id:w,index:_}],b[u]=b)})(d,g,C)};return d.toString=()=>m,l.serviceRegistry.set(m,d),d}},2585:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const h=u(8343);var m;l.IBufferService=(0,h.createDecorator)("BufferService"),l.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),l.ICoreService=(0,h.createDecorator)("CoreService"),l.ICharsetService=(0,h.createDecorator)("CharsetService"),l.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,h.createDecorator)("LogService"),l.IOptionsService=(0,h.createDecorator)("OptionsService"),l.IOscLinkService=(0,h.createDecorator)("OscLinkService"),l.IUnicodeService=(0,h.createDecorator)("UnicodeService"),l.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const h=u(8460),m=u(225);class d{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,C,w=!1){return(16777215&y)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const y=new m.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let C=0,w=0;const b=y.length;for(let _=0;_=b)return C+this.wcwidth(x);const N=y.charCodeAt(_);56320<=N&&N<=57343?x=1024*(x-55296)+N-56320+65536:C+=this.wcwidth(N)}const S=this.charProperties(x,w);let k=d.extractWidth(S);d.extractShouldJoin(S)&&(k-=d.extractWidth(w)),C+=k,w=S}return C}charProperties(y,C){return this._activeProvider.charProperties(y,C)}}l.UnicodeService=d}},r={};function i(c){var l=r[c];if(l!==void 0)return l.exports;var u=r[c]={exports:{}};return n[c].call(u.exports,u,u.exports,i),u.exports}var a={};return(()=>{var c=a;Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const l=i(9042),u=i(3236),h=i(844),m=i(5741),d=i(8285),g=i(7975),y=i(7090),C=["cols","rows"];class w extends h.Disposable{constructor(_){super(),this._core=this.register(new u.Terminal(_)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const x=k=>this._core.options[k],S=(k,N)=>{this._checkReadonlyOptions(k),this._core.options[k]=N};for(const k in this._core.options){const N={get:x.bind(this,k),set:S.bind(this,k)};Object.defineProperty(this._publicOptions,k,N)}}_checkReadonlyOptions(_){if(C.includes(_))throw new Error(`Option "${_}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=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:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const x in _)this._publicOptions[x]=_[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,x=!0){this._core.input(_,x)}resize(_,x){this._verifyIntegers(_,x),this._core.resize(_,x)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,x,S){this._verifyIntegers(_,x,S),this._core.select(_,x,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,x){this._verifyIntegers(_,x),this._core.selectLines(_,x)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,x){this._core.write(_,x)}writeln(_,x){this._core.write(_),this._core.write(`\r -`,x)}paste(_){this._core.paste(_)}refresh(_,x){this._verifyIntegers(_,x),this._core.refresh(_,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return l}_verifyIntegers(..._){for(const x of _)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const x of _)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}c.Terminal=w})(),a})()))})(s1)),s1.exports}var xG=_G();function M6(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new xG.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),i=new bG.FitAddon;r.loadAddon(i),r.open(n);try{i.fit()}catch{}const a=new ResizeObserver(()=>{try{i.fit()}catch{}});a.observe(n);let c=!1,l=0,u=!1,h=!1;async function m(){if(u){h=!0;return}u=!0;try{for(;;){const g=await vT(e,l);if(c)return;if(g.dataBase64&&r.write(M6(g.dataBase64)),l=g.nextOffset,g.eof)break}}catch{}finally{u=!1,h&&!c&&(h=!1,m())}}const d=xM(e,g=>{if(c)return;const y=M6(g.dataBase64);!u&&g.offset===l?(r.write(y),l+=y.length):g.offset+y.length>l&&m()});return m(),()=>{c=!0,d(),a.disconnect(),r.dispose()}},[e]),f.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const Xo="__uncommitted__";function wG({state:e}){return!e||e.loading?f.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?f.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?f.jsx(W8,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):f.jsx(S2,{diff:e.payload.diff}):f.jsx("div",{className:"diff-empty",children:"No changes."})}function CG({experiment:e}){const[t,n]=O.useState(e.playEntry??""),[r,i]=O.useState(0);O.useEffect(()=>n(e.playEntry??""),[e.playEntry]),O.useEffect(()=>{fT(e.id).catch(d=>console.error("play-build:",d))},[e.id,r]);const[a,c]=O.useState(null),[,l]=O.useState(0);O.useEffect(()=>{let d=!1;const g=()=>gT(e.id).then(w=>{d||c(w)}).catch(()=>{});g();const y=setInterval(g,1e4),C=setInterval(()=>l(w=>w+1),3e4);return()=>{d=!0,clearInterval(y),clearInterval(C)}},[e.id,r]);const u=(d,g)=>{o7(e.id,d,g).then(()=>c(null)).catch(y=>console.error("play-session:",y))},h=pT({id:e.id,playEntry:e.playEntry}),m=()=>{const d=t.trim()||null;(e.playEntry??null)!==d&&mT(e.id,d).then(()=>i(g=>g+1)).catch(g=>console.error("play-entry:",g))};return f.jsxs("div",{className:"play-view",children:[f.jsxs("div",{className:"play-bar",children:[f.jsx("span",{className:"ctl-label",children:"Entry"}),f.jsx("input",{className:"input sm play-entry-input",placeholder:"index.html (e.g. gambit-slots.html?x=1)",value:t,onChange:d=>n(d.target.value),onBlur:m,onKeyDown:d=>{d.key==="Enter"&&d.target.blur()}}),f.jsx("span",{style:{flex:1}}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"session-clock",title:`Session started ${gs(a.createdAt)}`,children:[f.jsx("span",{className:"dot"}),R0(Date.now()-a.createdAt)]}),f.jsx(w2,{verdict:a.verdict??null,notes:a.verdictNotes,onSave:u})]}),f.jsxs("button",{className:"btn sm",title:"Rebuild from the branch head and reload",onClick:()=>i(d=>d+1),children:[f.jsx(uu,{size:12})," Rebuild"]}),f.jsx("a",{className:"icon-btn",href:h,target:"_blank",rel:"noreferrer",title:"Open in a browser tab","aria-label":"Open in a browser tab",children:f.jsx(cu,{size:14})})]}),f.jsx("iframe",{className:"play-frame",src:h,title:"Playable build"},r)]})}const kG=["keep","kill","iterate"];function w2({verdict:e,notes:t,onSave:n,label:r}){const[i,a]=O.useState(e??null),[c,l]=O.useState(t??""),[u,h]=O.useState(!1);O.useEffect(()=>a(e??null),[e]),O.useEffect(()=>l(t??""),[t]);const m=d=>{const g=i===d?null:d;a(g),n(g,c)};return f.jsxs("span",{className:"verdict-control",children:[r&&f.jsx("span",{className:"verdict-label",children:r}),kG.map(d=>f.jsx("button",{className:`verdict-chip ${d} ${i===d?"active":""}`,title:i===d?`Clear ${d}`:d,onClick:()=>m(d),children:d},d)),f.jsx("button",{className:`icon-btn ${u||c?"active":""}`,title:c?`Notes: ${c}`:"Add notes","aria-label":"Verdict notes",onClick:()=>h(d=>!d),children:f.jsx(xN,{size:13})}),u&&f.jsx("input",{className:"input sm verdict-notes",placeholder:"Why? (saved on blur)",value:c,autoFocus:!0,onChange:d=>l(d.target.value),onBlur:()=>{h(!1),n(i,c)},onKeyDown:d=>{d.key==="Enter"&&d.target.blur()}})]})}function a1(e){return typeof e=="number"?Number.isInteger(e)?String(e):e.toPrecision(3):String(e)}function EG({aggregate:e,parentAggregate:t}){return f.jsx("div",{className:"metric-chips",children:Object.entries(e).map(([n,r])=>{const i=t==null?void 0:t[n],a=typeof r=="number"&&typeof i=="number"?r-i:null;return f.jsxs("span",{className:"metric-chip",title:i!=null?`parent: ${a1(i)}`:void 0,children:[f.jsx("span",{className:"metric-key",children:n}),f.jsx("span",{className:"metric-value",children:a1(r)}),a!==null&&a!==0&&f.jsxs("span",{className:`metric-delta ${a>0?"up":"down"}`,children:[a>0?"▲":"▼",a1(Math.abs(a))]})]},n)})})}function AG({runId:e,terminal:t}){const[n,r]=O.useState(null);if(O.useEffect(()=>{dT(e).then(r).catch(()=>r([]))},[e,t]),!n||n.length===0)return null;const i=n.filter(c=>c.contentType.startsWith("image/")),a=n.filter(c=>!c.contentType.startsWith("image/"));return f.jsxs("div",{className:"artifact-gallery",children:[i.length>0&&f.jsx("div",{className:"artifact-grid",children:i.map(c=>f.jsx("a",{href:gm(e,c.path),target:"_blank",rel:"noreferrer",title:c.path,children:f.jsx("img",{src:gm(e,c.path),alt:c.path,loading:"lazy"})},c.path))}),a.length>0&&f.jsx("div",{className:"artifact-files",children:a.map(c=>f.jsx("a",{className:"artifact-file",href:gm(e,c.path),target:"_blank",rel:"noreferrer",children:c.path},c.path))})]})}function NG({experiment:e,project:t,view:n,runs:r,selectedRunId:i,onSelectRun:a,mergeParent:c=null}){var m;const l=r.filter(d=>d.experimentId===e.id).sort((d,g)=>g.createdAt-d.createdAt),u=e.parentExperimentId&&((m=r.filter(d=>d.experimentId===e.parentExperimentId&&d.kind==="sim"&&d.status==="done"&&d.metricsAggregate).sort((d,g)=>g.createdAt-d.createdAt)[0])==null?void 0:m.metricsAggregate)||null,h=n==="terminal"?f.jsx(TG,{experiment:e,expRuns:l,parentAggregate:u,selectedRunId:i,onSelectRun:a}):n==="play"?f.jsx(CG,{experiment:e}):f.jsx(MG,{experiment:e,project:t});return f.jsxs("div",{className:"exp-detail",children:[f.jsxs("div",{className:"exp-verdict-strip",children:[f.jsx(w2,{label:"Experiment verdict",verdict:e.verdict,notes:e.verdictNotes,onSave:(d,g)=>void hT(e.id,d,g).catch(()=>{})}),e.verdictNotes&&f.jsx("span",{className:"verdict-notes-preview",title:e.verdictNotes,children:e.verdictNotes}),c&&f.jsxs("span",{className:"verdict-notes-preview",title:`Branch ${c.branchName} was merged into this node at creation`,children:["merged from ",c.title||c.slug]})]}),f.jsx("div",{className:"exp-detail-body",children:h})]})}function TG({experiment:e,expRuns:t,parentAggregate:n,selectedRunId:r,onSelectRun:i}){const[a,c]=O.useState(null),[l,u]=O.useState(!1),h=O.useRef(null),m=r&&t.find(w=>w.id===r)||t[0]||null,d=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="starting",g=w=>{const b=t.findIndex(_=>_.id===w);return b===-1?t.length:t.length-b},y=O.useRef(null);O.useEffect(()=>{if(y.current===null){y.current=new Set(t.map(b=>b.id));return}const w=t.find(b=>!y.current.has(b.id));for(const b of t)y.current.add(b.id);w&&i(w.id)},[t,i]),O.useEffect(()=>{if(!l)return;const w=b=>{var _;(_=h.current)!=null&&_.contains(b.target)||u(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[l]);async function C(){if(m){c(null);try{await a7(m.id)}catch(w){c(w instanceof Error?w.message:String(w))}}}return f.jsxs("div",{className:"term-view",children:[f.jsxs("div",{className:"term-bar",children:[f.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{style:{flex:1}}),a&&f.jsx("span",{className:"error",children:a}),m&&!d&&f.jsx(w2,{verdict:m.verdict??null,notes:m.verdictNotes,onSave:(w,b)=>void uT(m.id,w,b).catch(()=>{})}),d&&f.jsxs("button",{className:"btn sm ghost",onClick:()=>void C(),children:[f.jsx(OA,{size:13}),"Stop"]}),t.length>0&&m&&f.jsxs("div",{className:"run-history",ref:h,children:[f.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>u(w=>!w),children:[f.jsxs("span",{className:"run-label",children:["Run ",g(m.id)]}),f.jsx(fs,{status:m.status}),f.jsx(Ti,{size:14,className:"run-picker-chev"})]}),l&&f.jsx("div",{className:"history-menu",children:t.map(w=>f.jsxs("button",{className:`history-item ${w.id===(m==null?void 0:m.id)?"active":""}`,onClick:()=>{i(w.id),u(!1)},children:[f.jsxs("span",{className:"run-label",children:["Run ",g(w.id)]}),f.jsx(fs,{status:w.status}),f.jsx("span",{className:"when",children:gs(w.createdAt)})]},w.id))})]})]}),(m==null?void 0:m.metricsAggregate)&&f.jsx("div",{className:"results-strip",children:f.jsx(EG,{aggregate:m.metricsAggregate,parentAggregate:n})}),m&&f.jsx(AG,{runId:m.id,terminal:!d},`art-${m.id}`),f.jsx("div",{className:"term-fill",children:m?f.jsx(SG,{runId:m.id},m.id):f.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function MG({experiment:e,project:t}){const[n,r]=O.useState(null),[i,a]=O.useState(null),[c,l]=O.useState(null),[u,h]=O.useState(null),[m,d]=O.useState({}),g=!!(c&&c.diff.trim()!==""&&c.experimentId===e.id);async function y(){a(null);try{const[w,b]=await Promise.all([bT(e.id),F3(e.projectId)]);r(w),l(b),h(_=>{var S;return _!==null?_:b.diff.trim()!==""&&b.experimentId===e.id?Xo:((S=w[0])==null?void 0:S.sha)??null})}catch(w){a(w instanceof Error?w.message:String(w))}}O.useEffect(()=>{n===null&&!i&&y()},[n,i,e.id]),O.useEffect(()=>{const w=setInterval(()=>{F3(e.projectId).then(l).catch(()=>{})},5e3);return()=>clearInterval(w)},[e.projectId]),O.useEffect(()=>{var w;u===Xo&&c&&!g&&h(((w=n==null?void 0:n[0])==null?void 0:w.sha)??null)},[u,c,g,n]),O.useEffect(()=>{if(!u||u===Xo||m[u])return;const w=u;d(b=>({...b,[w]:{loading:!0}})),_T(e.id,w).then(b=>d(_=>({..._,[w]:{loading:!1,payload:b}}))).catch(b=>d(_=>({..._,[w]:{loading:!1,error:b instanceof Error?b.message:String(b)}})))},[u,m,e.id]);const C=!g&&((n==null?void 0:n.length)??0)===0;return f.jsx("div",{className:"drawer",children:f.jsx("div",{className:"drawer-body",children:f.jsxs("div",{className:"drawer-section",children:[f.jsxs("div",{className:"changes-branch",children:[f.jsx("span",{className:"ctl-label",children:"Branch"}),f.jsx(vG,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),i?f.jsx("div",{className:"error",children:i}):n===null?f.jsx("div",{className:"changes-note",children:"Loading changes…"}):C?f.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"commit-picker",children:[f.jsx("span",{className:"ctl-label",children:"Commit"}),u===Xo&&f.jsx("span",{className:"uncommitted-dot"}),f.jsxs("select",{className:"input sm",value:u??"",onChange:w=>h(w.target.value),children:[g&&f.jsx("option",{value:Xo,children:"● Uncommitted changes"}),n.map(w=>f.jsxs("option",{value:w.sha,children:[w.sha.slice(0,7)," — ",w.subject]},w.sha))]}),f.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void y(),children:f.jsx(uu,{size:14})})]}),f.jsx("div",{style:{marginTop:10},children:u===Xo&&c?c.truncated?f.jsxs("div",{className:"truncated-notice",children:[f.jsx("h4",{children:"Diff too large to display"}),f.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):f.jsx(S2,{diff:c.diff}):u?f.jsx(wG,{state:m[u]}):f.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}const jG=O.lazy(()=>qd(()=>import("./ModelViewer-D3HqfNbT.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ModelViewer}))),DG=O.lazy(()=>qd(()=>import("./SplatViewer-Bz_PebWi.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SplatViewer})));function RG({kind:e,src:t,name:n}){const[r,i]=O.useState(!1);return r?f.jsxs("div",{className:"file-view-note",children:["No preview — this isn’t a file in the project’s files dir."," ",f.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"Open raw"})]}):e==="image"?f.jsx("a",{className:"fpreview-image",href:t,target:"_blank",rel:"noopener noreferrer",children:f.jsx("img",{src:t,alt:n,onError:()=>i(!0)})}):e==="video"?f.jsx("video",{className:"fpreview-video",src:t,controls:!0,loop:!0,playsInline:!0,onError:()=>i(!0)}):e==="audio"?f.jsx("audio",{className:"fpreview-audio",src:t,controls:!0,onError:()=>i(!0)}):e==="pdf"?f.jsx("iframe",{className:"fpreview-pdf",title:n,src:t}):e==="splat"?f.jsx(O.Suspense,{fallback:f.jsx("div",{className:"file-view-note",children:"Loading splat viewer…"}),children:f.jsx(DG,{src:t,name:n})}):f.jsx(O.Suspense,{fallback:f.jsx("div",{className:"file-view-note",children:"Loading 3D viewer…"}),children:f.jsx(jG,{src:t,name:n})})}function LG({projectId:e,path:t,source:n="repo",sessionId:r,gitRef:i,onOpenFile:a}){const[c,l]=O.useState(null),[u,h]=O.useState(!1),[m,d]=O.useState(null),[g,y]=O.useState(!0),[C,w]=O.useState(0),b=n==="files",_=a2(t),x=/\.(md|mdx|markdown)$/i.test(t),S=/(^|\/)report\.md$/i.test(t),k=S?t.replace(/\/?report\.md$/i,""):t.split("/").slice(0,-1).join("/"),[N,A]=O.useState(!1),j=(c==null?void 0:c.file)??null,T=(c==null?void 0:c.viaFiles)??!1,D=b||T;O.useEffect(()=>{if(_){l(null),d(null),y(!1);return}let F=!1;y(!0),h(!1);const G=()=>(S&&k?d7(e,k).then($=>$.markdown).catch(()=>null):KT(e,t)).then($=>({path:t,content:$??"",truncated:!1,notFound:$===null,root:"clone"}));return(b?G().then($=>({file:$,viaFiles:!1})):xT(e,t,{sessionId:r,ref:i}).then($=>$.notFound&&!i?G().then(K=>K.notFound?{file:$,viaFiles:!1}:{file:{...K,root:$.root},viaFiles:!0}):{file:$,viaFiles:!1})).then($=>{F||((b||$.viaFiles)&&$.file.content.includes("\0")&&h(!0),l($),d(null))}).catch($=>{F||d($.message)}).finally(()=>{F||y(!1)}),()=>{F=!0}},[e,t,n,r,i,C,_]);const B=F=>b?"File not found in the project's files.":i?`File not found on branch ${i}.`:r&&F.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone or the project's files.":`File not found in the ${F.root==="worktree"?"session's worktree":"project clone"} or the project's files.`;return f.jsxs("div",{className:"file-view",children:[f.jsxs("div",{className:"file-view-header",children:[f.jsx(Zx,{size:13,style:{flexShrink:0}}),f.jsx("code",{className:"file-view-path",title:t,children:t}),i&&f.jsx("code",{className:"file-view-ref",title:`Committed state of ${i}`,children:i}),x&&f.jsx("button",{className:`icon-btn ${N?"active":""}`,"data-tip":N?"Rendered view":"View source","aria-label":N?"Rendered view":"View source",onClick:()=>A(F=>!F),children:f.jsx(Wx,{size:13})}),f.jsx("button",{className:"icon-btn","data-tip":"Reload file","aria-label":"Reload file",onClick:()=>w(F=>F+1),children:g?f.jsx("span",{className:"spinner"}):f.jsx(uu,{size:13})})]}),f.jsx("div",{className:"file-view-body",children:_?f.jsx(RG,{kind:_,src:no(e,t),name:t}):m?f.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",m]}):j===null?f.jsx("div",{className:"file-view-note",children:"Loading…"}):j.notFound?f.jsx("div",{className:"file-view-note",children:B(j)}):u?f.jsx("div",{className:"file-view-note",children:"Binary file — no inline preview."}):f.jsxs(f.Fragment,{children:[!D&&!i&&r&&j.root==="clone"&&f.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),T&&f.jsxs("div",{className:"file-view-note",children:["Not in the ",j.root==="worktree"?"session's worktree":"project clone"," — showing the copy from the project's files."]}),x&&!N?f.jsx("div",{className:"file-view-md",children:D?f.jsx(J8,{projectId:e,folder:k,markdown:j.content}):f.jsx(Xa,{text:j.content,onOpenFile:a&&(F=>a(F,r,i))})}):f.jsx(Y8,{text:j.content,path:t}),!D&&j.truncated&&f.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function OG({projectName:e,onHome:t,onCollapse:n}){return f.jsxs("div",{className:"rail-brand",children:[f.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[f.jsx(S1,{size:15}),f.jsx("span",{className:"brand-project",children:e})]}),n&&f.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:f.jsx(e7,{size:15})})]})}const j6="Couldn't reach orx. Check it's still running, then re-check.";function BG({onDone:e}){const[t,n]=O.useState(0),[r,i]=O.useState(null),[a,c]=O.useState(null),[l,u]=O.useState(null),[h,m]=O.useState(!1),[d,g]=O.useState(!1),[y,C]=O.useState(!1),w=(r==null?void 0:r.some(k=>k.agentReady))??!1,b=(a==null?void 0:a.githubTokenSource)!=null,_=O.useRef(0),x=(k,N=!1)=>{const A=++_.current;m(!0),g(!1),C(!1);const j=()=>A===_.current;Promise.allSettled([cl(k,N).then(T=>j()&&i(T)),f7().then(T=>j()&&c(T)),eM().then(T=>j()&&u(T))]).then(([T,D])=>{j()&&(T.status==="rejected"&&(g(!0),i(null)),D.status==="rejected"&&(C(!0),c(null)))}).finally(()=>m(!1))};O.useEffect(()=>x(!1),[]),O.useEffect(()=>Zg(()=>{cl(!0).then(k=>{i(k),g(!1)}).catch(()=>g(!0))}),[]);const S=()=>{nM((l==null?void 0:l.enabled)??!0).catch(()=>{}),e()};return f.jsx("div",{className:"home onboarding",children:f.jsx("div",{className:"home-inner",children:t===0?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow",children:[f.jsx(Rc,{})," · Step 1 of 3"]}),f.jsx("h2",{className:"onb-title",children:"Your coding agents"}),f.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),f.jsx("div",{className:"onb-cards",children:r!==null?r.map(k=>f.jsx(IG,{h:k},k.id)):d?f.jsx("div",{className:"onb-card-meta",children:j6}):f.jsxs("div",{className:"onb-loading",children:[f.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]})}),r!==null&&!w&&f.jsx("p",{className:"onb-gate-hint",children:"Sign in to at least one agent to continue."}),f.jsxs("div",{className:"onb-actions",children:[f.jsxs("button",{className:"btn ghost",onClick:()=>x(!0,!0),disabled:h,children:[f.jsx(Mi,{size:12,className:h?"spin":""})," Re-check"]}),f.jsx("div",{style:{flex:1}}),f.jsxs("button",{className:"btn primary",onClick:()=>n(1),disabled:!w,title:w?void 0:"Sign in to at least one coding agent to continue",children:["Continue ",f.jsx(mm,{size:13})]})]})]}):t===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow",children:[f.jsx(Rc,{})," · Step 2 of 3"]}),f.jsx("h2",{className:"onb-title",children:"Connect GitHub"}),f.jsx("p",{className:"onb-sub",children:"orx clones your GitHub repos and pushes each experiment as a branch."}),f.jsx("div",{className:"onb-cards",children:y?f.jsx("div",{className:"onb-card-meta",children:j6}):f.jsx(HG,{git:a,onUpdate:k=>{_.current++,c(k),C(!1)}})}),a!==null&&!b&&f.jsx("p",{className:"onb-gate-hint",children:"Without GitHub access, orx can't create repos for you — cloning and pushing still work if you have SSH keys."}),f.jsxs("div",{className:"onb-actions",children:[f.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[f.jsx(S1,{size:12})," Back"]}),f.jsxs("button",{className:"btn ghost",onClick:()=>x(!1),disabled:h,children:[f.jsx(Mi,{size:12,className:h?"spin":""})," Re-check"]}),f.jsx("div",{style:{flex:1}}),f.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",f.jsx(mm,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow",children:[f.jsx(Rc,{})," · Step 3 of 3"]}),f.jsx("h2",{className:"onb-title",children:"Usage analytics"}),f.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),f.jsx("div",{className:"onb-cards",children:f.jsx(FG,{telemetry:l,onUpdate:u})}),f.jsx("p",{className:"onb-aside-text",style:{marginTop:12},children:"Your database, run logs, and artifacts stay on this machine — change where they live any time in Settings → Storage."}),f.jsxs("div",{className:"onb-actions",children:[f.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[f.jsx(S1,{size:12})," Back"]}),f.jsx("div",{style:{flex:1}}),f.jsxs("button",{className:"btn primary",onClick:S,children:["Create your first project ",f.jsx(mm,{size:13})]})]})]})})})}function D6({cmd:e}){const[t,n]=O.useState(!1),r=()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return f.jsxs("span",{className:"onb-cmd-chip",children:[f.jsx("code",{children:e}),f.jsx("button",{className:"onb-cmd-copy",onClick:r,"aria-label":t?"Copied":"Copy command",title:t?"Copied":"Copy",children:t?f.jsx(Qr,{size:13,strokeWidth:3}):f.jsx(Ug,{size:13})})]})}function zG(e){return e.agentReady?{cls:"st-done",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"st-starting",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"st-starting",label:"Update required"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}:{cls:"st-idle",label:"Not detected"}}function IG({h:e}){var r;const t=zG(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return f.jsxs("div",{className:"onb-card",children:[f.jsxs("div",{className:"onb-card-head",children:[f.jsx("span",{className:"onb-card-name",children:e.name}),f.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?f.jsx(Qr,{size:12,strokeWidth:3}):f.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(i=>j0(i)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):f.jsx("div",{className:"onb-card-meta",children:l2(e.agentNote)})]})}function HG({git:e,onUpdate:t}){const[n,r]=O.useState(!1);if(e===null)return f.jsxs("div",{className:"onb-loading",children:[f.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return f.jsxs("div",{className:"onb-card",children:[f.jsxs("div",{className:"onb-card-head",children:[f.jsx("span",{className:"onb-card-name",children:"git"}),f.jsxs("span",{className:"status-badge st-failed",children:[f.jsx("span",{className:"dot"})," Not found"]})]}),f.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const i=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return f.jsxs("div",{className:"onb-card",children:[f.jsxs("div",{className:"onb-card-row",children:[f.jsx("span",{className:"onb-card-name",children:"GitHub"}),f.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"Token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"Token saved in orx":e.githubTokenSource==="gh"?"Signed in via gh CLI":""}),f.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?f.jsx(Qr,{size:12,strokeWidth:3}):f.jsx("span",{className:"dot"}),e.githubTokenSource?"Connected":"Not connected"]})]}),!e.githubTokenSource&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-fix",children:[f.jsx("span",{className:"onb-fix-label",children:n?"Paste a personal access token:":e.ghInstalled?"Run this in your terminal to sign in:":"Install the GitHub CLI, then run this to sign in:"}),f.jsx("button",{className:"onb-fix-alt",onClick:()=>r(a=>!a),children:n?"Use gh instead":"Paste a token instead"})]}),n?f.jsx(Zw,{onSaved:t}):f.jsx(D6,{cmd:"gh auth login"})]}),!i&&f.jsxs("div",{className:"onb-aside",children:[f.jsx("div",{className:"onb-aside-text",children:"Optional — so the agent's commits are attributed to you:"}),f.jsx(D6,{cmd:'git config --global user.name "Your Name" && git config --global user.email "you@example.com"'})]})]})}function FG({telemetry:e,onUpdate:t}){const[n,r]=O.useState(!1);if(e===null)return f.jsxs("div",{className:"onb-loading",children:[f.jsx("span",{className:"spinner"})," Checking analytics…"]});const i=e.enabled,a=!i&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",c=l=>{n||l===i||(r(!0),tM(l).then(t).finally(()=>r(!1)))};return f.jsxs("div",{className:"onb-card",children:[f.jsxs("div",{className:"onb-card-head",children:[f.jsxs("div",{children:[f.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),f.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:i?"On — helps prioritize what to build next.":a?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),f.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[f.jsxs("button",{className:`btn ${i?"primary":"ghost"}`,onClick:()=>c(!0),disabled:n,"aria-pressed":i,children:[i?f.jsx(Qr,{size:12,strokeWidth:3}):null," On"]}),f.jsxs("button",{className:`btn ${i?"ghost":"primary"}`,onClick:()=>c(!1),disabled:n,"aria-pressed":!i,children:[i?null:f.jsx(Qr,{size:12,strokeWidth:3})," Off"]})]})]}),f.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",f.jsx("code",{children:"orx telemetry off"}),"."]}),a&&f.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function t0(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function PG(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function $G(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function UG(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function qG(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)}function GG({info:e,checking:t}){if(t&&!e)return f.jsx("span",{className:"repo-hint",children:"Checking that folder…"});if(!e)return null;switch(e.kind){case"github":return f.jsxs("span",{className:"repo-hint",children:["Found ",f.jsx("strong",{children:`${e.owner}/${e.repo}`}),e.currentBranch?` · ${e.currentBranch}`:""," — crux will use this repo."]});case"noRemote":return e.currentBranch?f.jsx("span",{className:"repo-hint",children:"A git repo with no GitHub remote. Publish it below, or add a remote first."}):f.jsx("span",{className:"repo-hint",children:"A git repo with nothing to publish yet — commit something, or check out a branch."});case"foreignRemote":return f.jsxs("span",{className:"repo-hint",children:["Its remote is ",f.jsx("code",{children:e.remoteUrl}),", which isn't GitHub. crux clones from GitHub when it runs experiments, so this repo can't be used yet."]});case"notARepo":return f.jsxs("span",{className:"repo-hint",children:["That folder isn't a git repo. Run ",f.jsx("code",{children:"git init"})," there, or use New blank repo."]});case"missing":return f.jsx("span",{className:"repo-hint",children:"No folder at that path."})}}function VG({onCreated:e,onCancel:t}){var ot;const[n,r]=O.useState("local"),[i,a]=O.useState("use"),[c,l]=O.useState(""),[u,h]=O.useState(null),[m,d]=O.useState(!1),[g,y]=O.useState(!1),C=O.useRef(0),[w,b]=O.useState(""),[_,x]=O.useState(""),[S,k]=O.useState(!1),[N,A]=O.useState(!1),[j,T]=O.useState(null),[D,B]=O.useState(null);O.useEffect(()=>{if(!N){B(null);return}return CM(B)},[N]);const[F,G]=O.useState(""),[U,$]=O.useState([]),[K,W]=O.useState(!1),[Z,ee]=O.useState(null),[z,L]=O.useState(!1),[I,Y]=O.useState(null),q=O.useRef(0),[se,de]=O.useState(null),[fe,te]=O.useState(null);O.useEffect(()=>{ZN().then(Pe=>te(Pe.login)).catch(()=>te(null))},[]);const V=fe??"you",re=t0(w),oe=(u==null?void 0:u.kind)==="noRemote"&&!!u.currentBranch,_e=`${qG(_)||"project"}`,ye=(u==null?void 0:u.kind)==="github"||oe&&g,ke=!!(_.trim()&&(n==="new"||n==="local"&&ye||n==="existing"&&re!==null||n==="paper"&&Z!==null&&(w.trim()===""||re!==null))),Me=Pe=>{r(Pe),Pe!=="paper"&&a("use"),Pe!=="local"&&y(!1)},Ue=Pe=>{if(l(Pe),y(!1),h(null),!S){const et=Pe.trim().replace(/\/+$/,"").split("/").pop()??"";x(et)}},Fe=Pe=>{var et;b(Pe),n!=="paper"&&a("use"),S||x(((et=t0(Pe))==null?void 0:et.repo)??"")};O.useEffect(()=>{if(n!=="local")return;const Pe=c.trim();if(Pe===""){h(null),d(!1);return}const et=++C.current;d(!0);const _t=setTimeout(()=>{YN(Pe).then(ct=>{et===C.current&&h(ct)}).catch(()=>{et===C.current&&h(null)}).finally(()=>{et===C.current&&d(!1)})},300);return()=>clearTimeout(_t)},[n,c]);const[Le,At]=O.useState(null),[Dt,Rt]=O.useState(!1);O.useEffect(()=>{n==="existing"&&Le===null&&tT().then(At).catch(()=>At([]))},[n,Le]);const Ft=w.trim().toLowerCase(),an=(Le??[]).filter(Pe=>Pe.fullName.toLowerCase()!==Ft&&(Ft===""||Pe.fullName.toLowerCase().includes(Ft))).slice(0,8);async function wt(Pe){const et=++q.current;$([]),W(!1),L(!0),Y(null);try{const _t=await JN(Pe);if(et!==q.current)return;ee(_t);const ct=_t.repoUrl?t0(_t.repoUrl):null;b(ct?`${ct.owner}/${ct.repo}`:""),a("fork"),S||x((ct==null?void 0:ct.repo)??(_t.title??"").trim().slice(0,60))}catch(_t){if(et!==q.current)return;Y(_t instanceof Error?_t.message:String(_t))}finally{et===q.current&&L(!1)}}function Je(){q.current++,ee(null),G(""),$([]),Y(null),b(""),S||x("")}const pt=re?`${re.owner}/${re.repo}`:"";O.useEffect(()=>{if(!pt){de(null);return}const[Pe,et]=pt.split("/");de(null);let _t=!0;const ct=setTimeout(()=>{QN(Pe,et).then(on=>{_t&&(de(on.canPush),on.canPush||a("fork"))}).catch(()=>{_t&&de(!0)})},400);return()=>{_t=!1,clearTimeout(ct)}},[pt]),O.useEffect(()=>{if(n!=="paper"||Z)return;const Pe=F.trim(),et=$G(Pe);if(!et&&Pe.length<3){$([]),W(!1);return}const _t=++q.current;et||W(!0);const ct=setTimeout(()=>{if(et){wt(et);return}KN(Pe).then(on=>{_t===q.current&&$(on)}).catch(on=>{_t===q.current&&($([]),Y(on instanceof Error?on.message:String(on)))}).finally(()=>{_t===q.current&&W(!1)})},350);return()=>clearTimeout(ct)},[n,Z,F]);async function be(Pe){if(Pe.preventDefault(),!(!ke||N)){A(!0),T(null);try{const et=await XN(n==="local"&&(u==null?void 0:u.kind)==="github"?{name:_.trim(),githubOwner:u.owner,githubRepo:u.repo}:n==="local"?{name:_.trim(),publishLocalPath:c.trim()}:n==="new"?{name:_.trim(),createRepo:!0}:n==="paper"&&!re?{name:_.trim(),createRepo:!0,paperId:Z.paperId}:{name:_.trim(),githubOwner:re.owner,githubRepo:re.repo,forkRepo:i==="fork",...n==="paper"?{paperId:Z.paperId}:{}});e(et)}catch(et){T(et instanceof Error?et.message:String(et))}finally{A(!1)}}}const Ae=n==="new"||n==="paper"&&!re,He=re?`${re.owner}/${re.repo}`:"the repo",Ke=re?se===null?f.jsxs("span",{className:"repo-hint",children:["Checking your access to ",He,"…"]}):f.jsx(f.Fragment,{children:se===!1?f.jsxs("span",{className:"repo-hint",children:["You can't push to ",He,", so orx snapshots its latest commit into a new private repo on github.com/",V,". Your experiments push there."]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"seg form-seg",children:[f.jsx("button",{type:"button",className:i==="use"?"active":"",onClick:()=>a("use"),children:"Use this repo"}),f.jsx("button",{type:"button",className:i==="fork"?"active":"",onClick:()=>a("fork"),children:"Private copy"})]}),f.jsx("span",{className:"repo-hint mono ok",children:i==="fork"?`Snapshots the latest commit of ${He} into a new private repo on github.com/${V}`:`Experiments push branches straight to ${He}`})]})}):null,rt=f.jsxs("label",{children:["Project name",f.jsx("input",{value:_,onChange:Pe=>{k(!0),x(Pe.target.value)},placeholder:"my-game"})]}),Pt=f.jsx("span",{className:`repo-hint mono ${_.trim()?"ok":""}`,children:_.trim()?`Creates github.com/${V}/${PG(_)} · private`:"A blank private repo is created on your GitHub account"});return f.jsxs("form",{className:"form",onSubmit:be,children:[f.jsxs("div",{className:"seg form-seg",children:[f.jsx("button",{type:"button",className:n==="local"?"active":"",onClick:()=>Me("local"),children:"Local repo"}),f.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>Me("existing"),children:"Existing repo"}),f.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>Me("new"),children:"New blank repo"}),f.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>Me("paper"),children:"From a paper"})]}),n==="local"&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{children:[f.jsx("span",{children:"Folder on this machine"}),f.jsx("input",{autoFocus:!0,type:"text",placeholder:"~/projects/my-game",value:c,onChange:Pe=>Ue(Pe.target.value),spellCheck:!1})]}),c.trim()!==""&&f.jsx(GG,{info:u,checking:m}),((u==null?void 0:u.kind)==="github"||oe)&&rt,oe&&f.jsxs("label",{className:"check",children:[f.jsx("input",{type:"checkbox",checked:g,onChange:Pe=>y(Pe.target.checked)}),f.jsxs("span",{children:["Create ",f.jsx("code",{children:_e})," on GitHub and push this history to it. This also sets the folder's ",f.jsx("code",{children:"origin"}),"."]})]})]}),n==="existing"&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{children:["GitHub repository",f.jsx("input",{value:w,onChange:Pe=>Fe(Pe.target.value),onFocus:()=>Rt(!0),onBlur:()=>Rt(!1),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),f.jsx("span",{className:`repo-hint mono ${re?"ok":""}`,children:re?`${re.owner} / ${re.repo}`:w.trim()?"Paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),Dt&&an.length>0&&f.jsx("div",{className:"paper-results",children:an.map(Pe=>f.jsxs("button",{type:"button",onMouseDown:et=>et.preventDefault(),onClick:()=>Fe(Pe.fullName),children:[f.jsx("span",{className:"title",children:Pe.fullName}),f.jsx("span",{className:"id",children:Pe.private?"private":"public"})]},Pe.fullName))}),Ke,re&&rt]}),n==="paper"&&(Z===null?f.jsxs(f.Fragment,{children:[f.jsxs("label",{children:["Paper",f.jsx("input",{value:F,onChange:Pe=>G(Pe.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),f.jsx("span",{className:`repo-hint ${I?"":"mono"}`,children:z?"Looking up paper…":K?"Searching alphaXiv…":I??"Searches alphaXiv by title — or paste an arXiv id / URL"})]}),!I&&!z&&!K&&f.jsx("span",{className:"repo-hint",children:"orx clones the code repo linked to the paper on alphaXiv."}),U.length>0&&f.jsx("div",{className:"paper-results",children:U.map(Pe=>f.jsxs("button",{type:"button",onClick:()=>void wt(Pe.paperId),children:[f.jsx("span",{className:"title",children:UG(Pe.title)}),f.jsx("span",{className:"id",children:Pe.paperId})]},Pe.paperId))})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"paper-pick",children:[f.jsxs("div",{className:"meta",children:[f.jsx("div",{className:"title",children:Z.title||Z.paperId}),f.jsxs("div",{className:"id",children:["arXiv ",Z.paperId]})]}),f.jsx("button",{type:"button",className:"btn ghost",onClick:Je,children:"Change"})]}),f.jsxs("label",{children:["GitHub repository",Z.repoUrl?"":" (optional)",f.jsx("input",{value:w,onChange:Pe=>Fe(Pe.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),f.jsx("span",{className:`repo-hint mono ${re?"ok":""}`,children:re?`${re.owner} / ${re.repo}`+(Z.repoUrl&&((ot=t0(Z.repoUrl))==null?void 0:ot.repo)===re.repo?` · linked on alphaXiv${Z.repoStars!=null?` · ★ ${Z.repoStars}`:""}`:""):w.trim()?"Paste a GitHub URL or owner/repo":"No code linked to this paper — a blank private repo will be created"})]}),Ke,rt,!re&&Pt]})),n==="new"&&f.jsxs(f.Fragment,{children:[rt,Pt]}),j&&f.jsx("div",{className:"error",children:j}),N&&D&&f.jsxs("div",{className:"progress",children:[f.jsx("div",{className:"progress-track",children:f.jsx("div",{className:`progress-fill${D.percent==null?" indeterminate":""}`,style:D.percent==null?void 0:{width:`${D.percent}%`}})}),f.jsx("div",{className:"progress-caption",children:f.jsxs("span",{children:[D.phase,D.percent!=null?` ${D.percent}%`:"…"]})})]}),f.jsxs("div",{className:"actions",children:[t&&f.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),f.jsx("button",{type:"submit",className:"btn primary",disabled:!ke||N,children:N?Ae?"Creating repo…":i==="fork"?"Copying repo…":"Cloning repo…":"Create project"})]})]})}function R6({projects:e,onOpen:t,onCreated:n,onDeleted:r,openNewProject:i=!1,onNewProjectOpened:a}){const[c,l]=O.useState(i),[u,h]=O.useState(null);O.useEffect(()=>{i&&(a==null||a())},[]);async function m(d){if(window.confirm(`Delete project "${d.name}"? - -Its experiments, runs and chats are removed from orx. The GitHub repo (${d.githubOwner}/${d.githubRepo}) is kept.`)){h(d.id);try{await sT(d.id),r(d.id)}catch(y){window.alert(y instanceof Error?y.message:String(y))}finally{h(null)}}}return f.jsxs("div",{className:"home",children:[f.jsxs("div",{className:"home-inner",children:[f.jsx("div",{className:"home-brand",children:f.jsx(Rc,{})}),f.jsxs("div",{className:"home-head",children:[f.jsx("h2",{children:"Projects"}),f.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[f.jsx(Vg,{size:13})," New project"]})]}),f.jsx("div",{className:"home-list",children:e.length===0?f.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((d,g)=>g.updatedAt-d.updatedAt).map(d=>f.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(d.id),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&t(d.id)},children:[f.jsx("span",{className:"name",children:d.name}),f.jsxs("span",{className:"repo mono",children:[d.githubOwner,"/",d.githubRepo," · ",d.baselineBranch]}),d.paperId&&f.jsxs("span",{className:"paper mono",children:["arXiv ",d.paperId]}),f.jsxs("span",{className:"time",children:["created ",gs(d.createdAt)]}),f.jsx("button",{className:"project-delete",title:`Delete ${d.name}`,disabled:u===d.id,onClick:g=>{g.stopPropagation(),m(d)},children:f.jsx(Wg,{size:14})})]},d.id))})]}),c&&f.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:f.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[f.jsx("h2",{children:"New project"}),f.jsx(VG,{onCancel:()=>l(!1),onCreated:d=>{l(!1),n(d)}})]})})]})}function WG(e){const t=ad(e.backend);return t?[t,m7(e.backend)].filter(Boolean).join(" · "):"—"}function YG({runs:e,experiments:t,emptyHint:n,onOpen:r,onOpenChanges:i,onCancel:a}){const c=new Map(t.map(u=>[u.id,u.slug])),l=[...e].sort((u,h)=>h.createdAt-u.createdAt);return l.length===0?f.jsx("div",{className:"empty-state",children:f.jsx("p",{children:n??"No runs yet."})}):f.jsx("div",{className:"runs-table-wrap",children:f.jsxs("table",{className:"runs-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Run"}),f.jsx("th",{children:"Experiment"}),f.jsx("th",{children:"Status"}),f.jsx("th",{children:"Backend"}),f.jsx("th",{children:"Commit"}),f.jsx("th",{children:"Started"}),f.jsx("th",{children:"Exit"}),f.jsx("th",{})]})}),f.jsx("tbody",{children:l.map(u=>{const h=u.status==="running"||u.status==="starting";return f.jsxs("tr",{className:"clickable",onClick:()=>r(u),children:[f.jsx("td",{className:"mono",children:k1(u.id)}),f.jsx("td",{className:"mono",children:c.get(u.experimentId)??k1(u.experimentId)}),f.jsx("td",{children:f.jsx(fs,{status:u.status})}),f.jsx("td",{className:"mono",children:WG(u)}),f.jsx("td",{className:"mono",children:u.commitSha?u.commitSha.slice(0,7):"—"}),f.jsx("td",{children:gs(u.createdAt)}),f.jsx("td",{className:"mono",children:u.exitCode??"—"}),f.jsx("td",{children:f.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[f.jsx("button",{className:"icon-btn",title:"Open changes",onClick:m=>{m.stopPropagation(),i(u.experimentId)},children:f.jsx(Sl,{size:14})}),h&&f.jsx("button",{className:"btn sm danger",onClick:m=>{m.stopPropagation(),a(u.id)},children:"Cancel"})]})})]},u.id)})})]})})}var n9=Gx();function XG(e){const[t,n]=O.useState(null),[,r]=O.useState({});return t==null||t.setTracked(e),O.useEffect(()=>{const i=new KG(()=>r({}));return i.setTracked(e),n(i),()=>i.dispose()},[]),(t==null?void 0:t.bounds)??null}var hi,wg,Cg,kg;class KG{constructor(t){k3(this,hi);Ra(this,"selectors",new Set);Ra(this,"elements",new Set);Ra(this,"onSizeChange",()=>La(this,hi,wg).call(this));Ra(this,"resizeObs",new ResizeObserver(this.onSizeChange));Ra(this,"mutationObs",new MutationObserver(t=>this.onMutation(t)));Ra(this,"bounds",null);this.onBoundsChange=t,window.addEventListener("resize",this.onSizeChange),document.addEventListener("scroll",this.onSizeChange,!0),this.mutationObs.observe(document.body,{childList:!0,subtree:!0})}dispose(){this.resizeObs.disconnect(),this.mutationObs.disconnect(),window.removeEventListener("resize",this.onSizeChange),document.removeEventListener("scroll",this.onSizeChange,!0)}setTracked(t){const n=new Set(t),r=[...n].filter(c=>!this.selectors.has(c)),i=[...this.selectors].filter(c=>!n.has(c));let a=!1;if(r.length>0){const c=r.map(u=>`[data-onboarding="${u}"]`).join(","),l=document.body.querySelectorAll(c);l.forEach(u=>{this.elements.add(u),this.resizeObs.observe(u)}),a||(a=l.length>0)}if(i.length>0){const c=i.map(u=>`[data-onboarding="${u}"]`).join(","),l=document.body.querySelectorAll(c);l.forEach(u=>{this.elements.delete(u),this.resizeObs.unobserve(u)}),a||(a=l.length>0)}a&&La(this,hi,Cg).call(this),this.selectors=n}onMutation(t){if(this.selectors.size===0)return;const n=Array.from(this.selectors,i=>`[data-onboarding="${i}"]`).join(",");let r=!1;for(const i of t){for(const a of i.addedNodes)a instanceof Element&&(a.matches(n)&&(this.elements.add(a),this.resizeObs.observe(a),r=!0),a.querySelectorAll(n).forEach(c=>{this.elements.add(c),this.resizeObs.observe(c),r=!0}));for(const a of i.removedNodes)a instanceof Element&&(a.matches(n)&&(this.elements.delete(a),this.resizeObs.unobserve(a),r=!0),a.querySelectorAll(n).forEach(c=>{this.elements.delete(c),this.resizeObs.unobserve(c),r=!0}))}r&&La(this,hi,wg).call(this)}}hi=new WeakSet,wg=function(){const t=La(this,hi,kg).call(this);La(this,hi,Cg).call(this),t!==La(this,hi,kg).call(this)&&this.onBoundsChange()},Cg=function(){if(this.elements.size===0){this.bounds=null;return}const t=Array.from(this.elements,c=>c.getBoundingClientRect()).filter(c=>c.width>0&&c.height>0);if(t.length===0){this.bounds=null;return}const n=Math.min(...t.map(c=>c.left)),r=Math.min(...t.map(c=>c.top)),i=Math.max(...t.map(c=>c.right)),a=Math.max(...t.map(c=>c.bottom));this.bounds={x:n,y:r,width:i-n,height:a-r}},kg=function(){return this.bounds?[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height].join(","):"null"};function r9(){const[e,t]=O.useState(0),[n,r]=O.useState(0);return{ref:O.useCallback(a=>{if(!a)return;function c(){t(a.offsetWidth),r(a.offsetHeight)}const l=new ResizeObserver(c),u=new MutationObserver(c);return l.observe(a),u.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),c(),()=>{l.disconnect(),u.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const n0=8;function i9(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:i,viewWidth:a},c]=O.useState({viewWidth:0,viewHeight:0});O.useEffect(()=>{function m(){c({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",m),m(),()=>window.removeEventListener("resize",m)},[]);let l=0,u=0,h=0;if(e){const{distance:m}=e;switch(e.anchor){case"left":l=e.x-n-m,u=e.y+e.height/2-r/2;break;case"right":l=e.x+e.width+m,u=e.y+e.height/2-r/2;break;case"below":l=e.x+e.width/2-n/2,u=e.y+e.height+m;break;case"above":l=e.x+e.width/2-n/2,u=e.y-r-m;break}const d=l,g=u;l=Math.min(Math.max(l,n0),a-n-n0),u=Math.min(Math.max(u,n0),i-r-n0),h=e.anchor==="left"||e.anchor==="right"?g-u:d-l}return{x:l,y:u,arrowAdjustment:h}}const L6="orx:tour-done",ia=8,ZG=20,G0=[{focus:null,anchor:null,title:"Welcome to Crux",description:"Crux turns a one-line game idea into a validated, playable prototype. A producer orchestrates a crew of AI agents — you approve the moves."},{focus:["composer"],anchor:"above",title:"Pitch a game idea",description:"Tell the producer what kind of game you want to make — even one vague line. It captures the idea into a thesis, gets it scored, and leads you to a playable. Type / for skills."},{focus:["model-picker"],anchor:"above",title:"Pick your model",description:"Choose a model from any harness you've connected: Claude Code, Codex, or OpenCode. New sessions start with whatever you pick here, and each session keeps its harness."},{focus:["nav-files"],anchor:"right",title:"Files and outputs",description:"Theses, evaluations, and build artifacts land here, and anything you drop in is visible to the agents too. Check Files after a build to see what came back."},{focus:["nav-compute"],anchor:"right",title:"Where builds run",description:"Prototypes build on this machine by default. If you need heavier runs, point them at Modal, SSH boxes, Kubernetes, or Slurm — set it up once and agents pick per run."},{focus:["experiments"],anchor:"left",title:"Your game gallery",description:"Every idea and prototype lands here. Capture ideas, evaluate them against the market-fit rubric, greenlight the strong ones, and open any prototype's play build, code, or logs."},{focus:["new-session"],anchor:"right",title:"Start a session",description:"Each session is an agent in its own worktree, so a whole crew can work in parallel. Pitch your first game idea whenever you're ready."}];function QG({onClose:e}){const[t,n]=O.useState(0),r=G0[t],i=XG(r.focus??[]);O.useEffect(()=>{function c(l){l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),e())}return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e]);const a=i?{left:i.x-ia,top:i.y-ia,width:i.width+ia*2,height:i.height+ia*2}:null;return n9.createPortal(f.jsxs("div",{className:"tour-overlay",children:[a?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"tour-spotlight",style:a}),f.jsx("div",{className:"tour-ring",style:a})]}):f.jsx("div",{className:"tour-dim"}),f.jsx(JG,{step:r,bounds:i,index:t,onBack:()=>n(c=>Math.max(0,c-1)),onNext:()=>t+1>=G0.length?e():n(t+1),onClose:e})]}),document.body)}function JG({step:e,bounds:t,index:n,onBack:r,onNext:i,onClose:a}){const c=r9(),l=i9(t&&e.anchor?{x:t.x-ia,y:t.y-ia,width:t.width+ia*2,height:t.height+ia*2,anchor:e.anchor,distance:ZG}:null,c),u=e.anchor!=null&&t!=null&&l.x>0,h=n+1===G0.length;return f.jsxs("div",{ref:c.ref,className:`tour-card ${u?"":"centered"}`,style:u?{left:l.x,top:l.y}:void 0,children:[u&&e.anchor&&f.jsx(eV,{anchor:e.anchor,adjustment:l.arrowAdjustment}),f.jsx("button",{className:"icon-btn tour-close",title:"Skip tour",onClick:a,children:f.jsx(ll,{size:15})}),f.jsx("h3",{children:e.title}),f.jsx("p",{children:e.description}),f.jsxs("div",{className:"tour-footer",children:[f.jsx("div",{className:"tour-footer-side",children:n>0&&f.jsx("button",{className:"btn ghost",onClick:r,children:"Back"})}),f.jsxs("span",{className:"tour-count",children:[n+1," / ",G0.length]}),f.jsx("div",{className:"tour-footer-side end",children:f.jsx("button",{className:"btn primary",onClick:i,children:h?"Done":"Next"})})]})]})}function eV({anchor:e,adjustment:t}){const n=e==="above"||e==="below"?`${t}px 0`:`0 ${t}px`;return f.jsx("div",{className:`tour-arrow ${e}`,style:{translate:n}})}function Bn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Gd(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}C0.prototype=Gd.prototype={constructor:C0,on:function(e,t){var n=this._,r=nV(e+"",n),i,a=-1,c=r.length;if(arguments.length<2){for(;++a0)for(var n=new Array(i),r=0,i,a;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),B6.hasOwnProperty(t)?{space:B6[t],local:e}:e}function iV(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Eg&&t.documentElement.namespaceURI===Eg?t.createElement(e):t.createElementNS(n,e)}}function sV(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function s9(e){var t=Vd(e);return(t.local?sV:iV)(t)}function aV(){}function C2(e){return e==null?aV:function(){return this.querySelector(e)}}function oV(e){typeof e!="function"&&(e=C2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=S&&(S=x+1);!(N=b[S])&&++S=0;)(c=r[i])&&(a&&c.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(c,a),a=c);return this}function DV(e){e||(e=RV);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;at?1:e>=t?0:NaN}function LV(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function OV(){return Array.from(this)}function BV(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?WV:typeof t=="function"?XV:YV)(e,t,n??"")):ml(this.node(),e)}function ml(e,t){return e.style.getPropertyValue(t)||u9(e).getComputedStyle(e,null).getPropertyValue(t)}function ZV(e){return function(){delete this[e]}}function QV(e,t){return function(){this[e]=t}}function JV(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function eW(e,t){return arguments.length>1?this.each((t==null?ZV:typeof t=="function"?JV:QV)(e,t)):this.node()[e]}function h9(e){return e.trim().split(/^|\s+/)}function k2(e){return e.classList||new d9(e)}function d9(e){this._node=e,this._names=h9(e.getAttribute("class")||"")}d9.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function f9(e,t){for(var n=k2(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function NW(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n()=>e;function Ag(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:c,y:l,dx:u,dy:h,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:m}})}Ag.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function IW(e){return!e.ctrlKey&&!e.button}function HW(){return this.parentNode}function FW(e,t){return t??{x:e.x,y:e.y}}function PW(){return navigator.maxTouchPoints||"ontouchstart"in this}function b9(){var e=IW,t=HW,n=FW,r=PW,i={},a=Gd("start","drag","end"),c=0,l,u,h,m,d=0;function g(k){k.on("mousedown.drag",y).filter(r).on("touchstart.drag",b).on("touchmove.drag",_,zW).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(k,N){if(!(m||!e.call(this,k,N))){var A=S(this,t.call(this,k,N),k,N,"mouse");A&&(jr(k.view).on("mousemove.drag",C,Jc).on("mouseup.drag",w,Jc),v9(k.view),o1(k),h=!1,l=k.clientX,u=k.clientY,A("start",k))}}function C(k){if(al(k),!h){var N=k.clientX-l,A=k.clientY-u;h=N*N+A*A>d}i.mouse("drag",k)}function w(k){jr(k.view).on("mousemove.drag mouseup.drag",null),y9(k.view,h),al(k),i.mouse("end",k)}function b(k,N){if(e.call(this,k,N)){var A=k.changedTouches,j=t.call(this,k,N),T=A.length,D,B;for(D=0;D>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?i0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?i0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=UW.exec(e))?new br(t[1],t[2],t[3],1):(t=qW.exec(e))?new br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=GW.exec(e))?i0(t[1],t[2],t[3],t[4]):(t=VW.exec(e))?i0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=WW.exec(e))?U6(t[1],t[2]/100,t[3]/100,1):(t=YW.exec(e))?U6(t[1],t[2]/100,t[3]/100,t[4]):z6.hasOwnProperty(e)?F6(z6[e]):e==="transparent"?new br(NaN,NaN,NaN,0):null}function F6(e){return new br(e>>16&255,e>>8&255,e&255,1)}function i0(e,t,n,r){return r<=0&&(e=t=n=NaN),new br(e,t,n,r)}function ZW(e){return e instanceof Su||(e=Ka(e)),e?(e=e.rgb(),new br(e.r,e.g,e.b,e.opacity)):new br}function Ng(e,t,n,r){return arguments.length===1?ZW(e):new br(e,t,n,r??1)}function br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}E2(br,Ng,_9(Su,{brighter(e){return e=e==null?W0:Math.pow(W0,e),new br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?eu:Math.pow(eu,e),new br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new br(Ga(this.r),Ga(this.g),Ga(this.b),Y0(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:P6,formatHex:P6,formatHex8:QW,formatRgb:$6,toString:$6}));function P6(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}`}function QW(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}${Ua((isNaN(this.opacity)?1:this.opacity)*255)}`}function $6(){const e=Y0(this.opacity);return`${e===1?"rgb(":"rgba("}${Ga(this.r)}, ${Ga(this.g)}, ${Ga(this.b)}${e===1?")":`, ${e})`}`}function Y0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ga(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ua(e){return e=Ga(e),(e<16?"0":"")+e.toString(16)}function U6(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new si(e,t,n,r)}function x9(e){if(e instanceof si)return new si(e.h,e.s,e.l,e.opacity);if(e instanceof Su||(e=Ka(e)),!e)return new si;if(e instanceof si)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),c=NaN,l=a-i,u=(a+i)/2;return l?(t===a?c=(n-r)/l+(n0&&u<1?0:c,new si(c,l,u,e.opacity)}function JW(e,t,n,r){return arguments.length===1?x9(e):new si(e,t,n,r??1)}function si(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}E2(si,JW,_9(Su,{brighter(e){return e=e==null?W0:Math.pow(W0,e),new si(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?eu:Math.pow(eu,e),new si(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new br(l1(e>=240?e-240:e+120,i,r),l1(e,i,r),l1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new si(q6(this.h),s0(this.s),s0(this.l),Y0(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=Y0(this.opacity);return`${e===1?"hsl(":"hsla("}${q6(this.h)}, ${s0(this.s)*100}%, ${s0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function q6(e){return e=(e||0)%360,e<0?e+360:e}function s0(e){return Math.max(0,Math.min(1,e||0))}function l1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const A2=e=>()=>e;function eY(e,t){return function(n){return e+n*t}}function tY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function nY(e){return(e=+e)==1?S9:function(t,n){return n-t?tY(t,n,e):A2(isNaN(t)?n:t)}}function S9(e,t){var n=t-e;return n?eY(e,n):A2(isNaN(e)?t:e)}const X0=(function e(t){var n=nY(t);function r(i,a){var c=n((i=Ng(i)).r,(a=Ng(a)).r),l=n(i.g,a.g),u=n(i.b,a.b),h=S9(i.opacity,a.opacity);return function(m){return i.r=c(m),i.g=l(m),i.b=u(m),i.opacity=h(m),i+""}}return r.gamma=e,r})(1);function rY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),l[c]?l[c]+=a:l[++c]=a),(r=r[0])===(i=i[0])?l[c]?l[c]+=i:l[++c]=i:(l[++c]=null,u.push({i:c,x:Ei(r,i)})),n=c1.lastIndex;return n180?m+=360:m-h>180&&(h+=360),g.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ei(h,m)})):m&&d.push(i(d)+"rotate("+m+r)}function l(h,m,d,g){h!==m?g.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Ei(h,m)}):m&&d.push(i(d)+"skewX("+m+r)}function u(h,m,d,g,y,C){if(h!==d||m!==g){var w=y.push(i(y)+"scale(",null,",",null,")");C.push({i:w-4,x:Ei(h,d)},{i:w-2,x:Ei(m,g)})}else(d!==1||g!==1)&&y.push(i(y)+"scale("+d+","+g+")")}return function(h,m){var d=[],g=[];return h=e(h),m=e(m),a(h.translateX,h.translateY,m.translateX,m.translateY,d,g),c(h.rotate,m.rotate,d,g),l(h.skewX,m.skewX,d,g),u(h.scaleX,h.scaleY,m.scaleX,m.scaleY,d,g),h=m=null,function(y){for(var C=-1,w=g.length,b;++C=0&&e._call.call(void 0,t),e=e._next;--gl}function W6(){Za=(Z0=nu.now())+Wd,gl=jc=0;try{yY()}finally{gl=0,_Y(),Za=0}}function bY(){var e=nu.now(),t=e-Z0;t>E9&&(Wd-=t,Z0=e)}function _Y(){for(var e,t=K0,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:K0=n);Dc=e,jg(r)}function jg(e){if(!gl){jc&&(jc=clearTimeout(jc));var t=e-Za;t>24?(e<1/0&&(jc=setTimeout(W6,e-nu.now()-Wd)),Ac&&(Ac=clearInterval(Ac))):(Ac||(Z0=nu.now(),Ac=setInterval(bY,E9)),gl=1,A9(W6))}}function Y6(e,t,n){var r=new Q0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var xY=Gd("start","end","cancel","interrupt"),SY=[],T9=0,X6=1,Dg=2,E0=3,K6=4,Rg=5,A0=6;function Yd(e,t,n,r,i,a){var c=e.__transition;if(!c)e.__transition={};else if(n in c)return;wY(e,n,{name:t,index:r,group:i,on:xY,tween:SY,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:T9})}function T2(e,t){var n=di(e,t);if(n.state>T9)throw new Error("too late; already scheduled");return n}function zi(e,t){var n=di(e,t);if(n.state>E0)throw new Error("too late; already running");return n}function di(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function wY(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=N9(a,0,n.time);function a(h){n.state=X6,n.timer.restart(c,n.delay,n.time),n.delay<=h&&c(h-n.delay)}function c(h){var m,d,g,y;if(n.state!==X6)return u();for(m in r)if(y=r[m],y.name===n.name){if(y.state===E0)return Y6(c);y.state===K6?(y.state=A0,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[m]):+mDg&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function JY(e,t,n){var r,i,a=QY(t)?T2:zi;return function(){var c=a(this,e),l=c.on;l!==r&&(i=(r=l).copy()).on(t,n),c.on=i}}function eX(e,t){var n=this._id;return arguments.length<2?di(this.node(),n).on.on(e):this.each(JY(n,e,t))}function tX(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function nX(){return this.on("end.remove",tX(this._id))}function rX(e){var t=this._name,n=this._id;typeof e!="function"&&(e=C2(e));for(var r=this._groups,i=r.length,a=new Array(i),c=0;c()=>e;function NX(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function cs(e,t,n){this.k=e,this.x=t,this.y=n}cs.prototype={constructor:cs,scale:function(e){return e===1?this:new cs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Xd=new cs(1,0,0);R9.prototype=cs.prototype;function R9(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Xd;return e.__zoom}function u1(e){e.stopImmediatePropagation()}function Nc(e){e.preventDefault(),e.stopImmediatePropagation()}function TX(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function MX(){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 Z6(){return this.__zoom||Xd}function jX(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function DX(){return navigator.maxTouchPoints||"ontouchstart"in this}function RX(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],c=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),c>a?(a+c)/2:Math.min(0,a)||Math.max(0,c))}function L9(){var e=TX,t=MX,n=RX,r=jX,i=DX,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,u=k0,h=Gd("start","zoom","end"),m,d,g,y=500,C=150,w=0,b=10;function _($){$.property("__zoom",Z6).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function($,K,W,Z){var ee=$.selection?$.selection():$;ee.property("__zoom",Z6),$!==ee?N($,K,W,Z):ee.interrupt().each(function(){A(this,arguments).event(Z).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},_.scaleBy=function($,K,W,Z){_.scaleTo($,function(){var ee=this.__zoom.k,z=typeof K=="function"?K.apply(this,arguments):K;return ee*z},W,Z)},_.scaleTo=function($,K,W,Z){_.transform($,function(){var ee=t.apply(this,arguments),z=this.__zoom,L=W==null?k(ee):typeof W=="function"?W.apply(this,arguments):W,I=z.invert(L),Y=typeof K=="function"?K.apply(this,arguments):K;return n(S(x(z,Y),L,I),ee,c)},W,Z)},_.translateBy=function($,K,W,Z){_.transform($,function(){return n(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof W=="function"?W.apply(this,arguments):W),t.apply(this,arguments),c)},null,Z)},_.translateTo=function($,K,W,Z,ee){_.transform($,function(){var z=t.apply(this,arguments),L=this.__zoom,I=Z==null?k(z):typeof Z=="function"?Z.apply(this,arguments):Z;return n(Xd.translate(I[0],I[1]).scale(L.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof W=="function"?-W.apply(this,arguments):-W),z,c)},Z,ee)};function x($,K){return K=Math.max(a[0],Math.min(a[1],K)),K===$.k?$:new cs(K,$.x,$.y)}function S($,K,W){var Z=K[0]-W[0]*$.k,ee=K[1]-W[1]*$.k;return Z===$.x&&ee===$.y?$:new cs($.k,Z,ee)}function k($){return[(+$[0][0]+ +$[1][0])/2,(+$[0][1]+ +$[1][1])/2]}function N($,K,W,Z){$.on("start.zoom",function(){A(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(Z).end()}).tween("zoom",function(){var ee=this,z=arguments,L=A(ee,z).event(Z),I=t.apply(ee,z),Y=W==null?k(I):typeof W=="function"?W.apply(ee,z):W,q=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),se=ee.__zoom,de=typeof K=="function"?K.apply(ee,z):K,fe=u(se.invert(Y).concat(q/se.k),de.invert(Y).concat(q/de.k));return function(te){if(te===1)te=de;else{var V=fe(te),re=q/V[2];te=new cs(re,Y[0]-V[0]*re,Y[1]-V[1]*re)}L.zoom(null,te)}})}function A($,K,W){return!W&&$.__zooming||new j($,K)}function j($,K){this.that=$,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply($,K),this.taps=0}j.prototype={event:function($){return $&&(this.sourceEvent=$),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function($,K){return this.mouse&&$!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&$!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&$!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function($){var K=jr(this.that).datum();h.call($,this.that,new NX($,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:h}),K)}};function T($,...K){if(!e.apply(this,arguments))return;var W=A(this,K).event($),Z=this.__zoom,ee=Math.max(a[0],Math.min(a[1],Z.k*Math.pow(2,r.apply(this,arguments)))),z=ii($);if(W.wheel)(W.mouse[0][0]!==z[0]||W.mouse[0][1]!==z[1])&&(W.mouse[1]=Z.invert(W.mouse[0]=z)),clearTimeout(W.wheel);else{if(Z.k===ee)return;W.mouse=[z,Z.invert(z)],N0(this),W.start()}Nc($),W.wheel=setTimeout(L,C),W.zoom("mouse",n(S(x(Z,ee),W.mouse[0],W.mouse[1]),W.extent,c));function L(){W.wheel=null,W.end()}}function D($,...K){if(g||!e.apply(this,arguments))return;var W=$.currentTarget,Z=A(this,K,!0).event($),ee=jr($.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",q,!0),z=ii($,W),L=$.clientX,I=$.clientY;v9($.view),u1($),Z.mouse=[z,this.__zoom.invert(z)],N0(this),Z.start();function Y(se){if(Nc(se),!Z.moved){var de=se.clientX-L,fe=se.clientY-I;Z.moved=de*de+fe*fe>w}Z.event(se).zoom("mouse",n(S(Z.that.__zoom,Z.mouse[0]=ii(se,W),Z.mouse[1]),Z.extent,c))}function q(se){ee.on("mousemove.zoom mouseup.zoom",null),y9(se.view,Z.moved),Nc(se),Z.event(se).end()}}function B($,...K){if(e.apply(this,arguments)){var W=this.__zoom,Z=ii($.changedTouches?$.changedTouches[0]:$,this),ee=W.invert(Z),z=W.k*($.shiftKey?.5:2),L=n(S(x(W,z),Z,ee),t.apply(this,K),c);Nc($),l>0?jr(this).transition().duration(l).call(N,L,Z,$):jr(this).call(_.transform,L,Z,$)}}function F($,...K){if(e.apply(this,arguments)){var W=$.touches,Z=W.length,ee=A(this,K,$.changedTouches.length===Z).event($),z,L,I,Y;for(u1($),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:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ru=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],O9=["Enter"," ","Escape"],B9={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var vl;(function(e){e.Strict="strict",e.Loose="loose"})(vl||(vl={}));var Va;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Va||(Va={}));var iu;(function(e){e.Partial="partial",e.Full="full"})(iu||(iu={}));const z9={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var na;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(na||(na={}));var J0;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(J0||(J0={}));var Xe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Xe||(Xe={}));const Q6={[Xe.Left]:Xe.Right,[Xe.Right]:Xe.Left,[Xe.Top]:Xe.Bottom,[Xe.Bottom]:Xe.Top};function I9(e){return e===null?null:e?"valid":"invalid"}const H9=e=>"id"in e&&"source"in e&&"target"in e,LX=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),j2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),wu=(e,t=[0,0])=>{const{width:n,height:r}=Ss(e),i=e.origin??t,a=n*i[0],c=r*i[1];return{x:e.position.x-a,y:e.position.y-c}},OX=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let c=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(c=a?t.nodeLookup.get(i):j2(i)?i:t.nodeLookup.get(i.id));const l=c?ed(c,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Kd(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zd(n)},Cu=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Kd(n,ed(i)),r=!0)}),r?Zd(n):{x:0,y:0,width:0,height:0}},D2=(e,t,[n,r,i]=[0,0,1],a=!1,c=!1)=>{const l=(t.x-n)/i,u=(t.y-r)/i,h=t.width/i,m=t.height/i,d=[];for(const g of e.values()){const{measured:y,selectable:C=!0,hidden:w=!1}=g;if(c&&!C||w)continue;const b=y.width??g.width??g.initialWidth??0,_=y.height??g.height??g.initialHeight??0,{x,y:S}=g.internals.positionAbsolute,k=U9(l,u,h,m,x,S,b,_),N=b*_,A=a&&k>0;(!g.internals.handleBounds||A||k>=N||g.dragging)&&d.push(g)}return d},BX=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function zX(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function IX({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},c){if(e.size===0)return!0;const l=zX(e,c),u=Cu(l),h=L2(u,t,n,(c==null?void 0:c.minZoom)??i,(c==null?void 0:c.maxZoom)??a,(c==null?void 0:c.padding)??.1);return await r.setViewport(h,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),!0}function F9({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const c=n.get(e),l=c.parentId?n.get(c.parentId):void 0,{x:u,y:h}=l?l.internals.positionAbsolute:{x:0,y:0},m=c.origin??r;let d=c.extent||i;if(c.extent==="parent"&&!c.expandParent)if(!l)a==null||a("005",ui.error005());else{const y=l.measured.width,C=l.measured.height;y&&C&&(d=[[u,h],[u+y,h+C]])}else l&&Ja(c.extent)&&(d=[[c.extent[0][0]+u,c.extent[0][1]+h],[c.extent[1][0]+u,c.extent[1][1]+h]]);const g=Ja(d)?Qa(t,d,c.measured):t;return(c.measured.width===void 0||c.measured.height===void 0)&&(a==null||a("015",ui.error015())),{position:{x:g.x-u+(c.measured.width??0)*m[0],y:g.y-h+(c.measured.height??0)*m[1]},positionAbsolute:g}}async function HX({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),c=[];for(const g of n){if(g.deletable===!1)continue;const y=a.has(g.id),C=!y&&g.parentId&&c.find(w=>w.id===g.parentId);(y||C)&&c.push(g)}const l=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),m=BX(c,u);for(const g of u)l.has(g.id)&&!m.find(C=>C.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:c};const d=await i({nodes:c,edges:m});return typeof d=="boolean"?d?{edges:m,nodes:c}:{edges:[],nodes:[]}:d}const yl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Qa=(e={x:0,y:0},t,n)=>({x:yl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:yl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function P9(e,t,n){const{width:r,height:i}=Ss(n),{x:a,y:c}=n.internals.positionAbsolute;return Qa(e,[[a,c],[a+r,c+i]],t)}const J6=(e,t,n)=>en?-yl(Math.abs(e-n),1,t)/t:0,R2=(e,t,n=15,r=40)=>{const i=J6(e.x,r,t.width-r)*n,a=J6(e.y,r,t.height-r)*n;return[i,a]},Kd=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Lg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Zd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),su=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=j2(e)?e.internals.positionAbsolute:wu(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},ed=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=j2(e)?e.internals.positionAbsolute:wu(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},$9=(e,t)=>Zd(Kd(Lg(e),Lg(t))),U9=(e,t,n,r,i,a,c,l)=>{const u=Math.max(0,Math.min(e+n,i+c)-Math.max(e,i)),h=Math.max(0,Math.min(t+r,a+l)-Math.max(t,a));return Math.ceil(u*h)},td=(e,t)=>U9(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),ex=e=>ai(e.width)&&ai(e.height)&&ai(e.x)&&ai(e.y),ai=e=>!isNaN(e)&&isFinite(e),q9=(e,t)=>(n,r)=>{},ku=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Eu=({x:e,y:t},[n,r,i],a=!1,c=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?ku(l,c):l},bl=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Ko(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function FX(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ko(e,n),i=Ko(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Ko(e.top??e.y??0,n),i=Ko(e.bottom??e.y??0,n),a=Ko(e.left??e.x??0,t),c=Ko(e.right??e.x??0,t);return{top:r,right:c,bottom:i,left:a,x:a+c,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function PX(e,t,n,r,i,a){const{x:c,y:l}=bl(e,[t,n,r]),{x:u,y:h}=bl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-u,d=a-h;return{left:Math.floor(c),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(d)}}const L2=(e,t,n,r,i,a)=>{const c=FX(a,t,n),l=(t-c.x)/e.width,u=(n-c.y)/e.height,h=Math.min(l,u),m=yl(h,r,i),d=e.x+e.width/2,g=e.y+e.height/2,y=t/2-d*m,C=n/2-g*m,w=PX(e,y,C,m,t,n),b={left:Math.min(w.left-c.left,0),top:Math.min(w.top-c.top,0),right:Math.min(w.right-c.right,0),bottom:Math.min(w.bottom-c.bottom,0)};return{x:y-b.left+b.right,y:C-b.top+b.bottom,zoom:m}},au=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ja(e){return e!=null&&e!=="parent"}function Ss(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function G9(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function V9(e,t={width:0,height:0},n,r,i){const a={...e},c=r.get(n);if(c){const l=c.origin||i;a.x+=c.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=c.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function tx(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function $X(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function UX(e){return{...B9,...e||{}}}function Pc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:c}=oi(e),l=Eu({x:a-((i==null?void 0:i.left)??0),y:c-((i==null?void 0:i.top)??0)},r),{x:u,y:h}=n?ku(l,t):l;return{xSnapped:u,ySnapped:h,...l}}const O2=e=>({width:e.offsetWidth,height:e.offsetHeight}),W9=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},qX=["INPUT","SELECT","TEXTAREA"];function Y9(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:qX.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const X9=e=>"clientX"in e,oi=(e,t)=>{var a,c;const n=X9(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(c=e.touches)==null?void 0:c[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},nx=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(c=>{const l=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:i,position:c.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...O2(c)}})};function K9({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:c,targetControlY:l}){const u=e*.125+i*.375+c*.375+n*.125,h=t*.125+a*.375+l*.375+r*.125,m=Math.abs(u-e),d=Math.abs(h-t);return[u,h,m,d]}function l0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function rx({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Xe.Left:return[t-l0(t-r,a),n];case Xe.Right:return[t+l0(r-t,a),n];case Xe.Top:return[t,n-l0(n-i,a)];case Xe.Bottom:return[t,n+l0(i-n,a)]}}function Z9({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:r,targetY:i,targetPosition:a=Xe.Top,curvature:c=.25}){const[l,u]=rx({pos:n,x1:e,y1:t,x2:r,y2:i,c}),[h,m]=rx({pos:a,x1:r,y1:i,x2:e,y2:t,c}),[d,g,y,C]=K9({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:h,targetControlY:m});return[`M${e},${t} C${l},${u} ${h},${m} ${r},${i}`,d,g,y,C]}function Q9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n0}const WX=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,YX=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),XX=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",ui.error006()),t;const r=n.getEdgeId||WX;let i;return H9(e)?i={...e}:i={...e,id:r(e)},YX(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function J9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,c,l]=Q9({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,c,l]}const ix={[Xe.Left]:{x:-1,y:0},[Xe.Right]:{x:1,y:0},[Xe.Top]:{x:0,y:-1},[Xe.Bottom]:{x:0,y:1}},KX=({source:e,sourcePosition:t=Xe.Bottom,target:n})=>t===Xe.Left||t===Xe.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function ZX({source:e,sourcePosition:t=Xe.Bottom,target:n,targetPosition:r=Xe.Top,center:i,offset:a,stepPosition:c}){const l=ix[t],u=ix[r],h={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+u.x*a,y:n.y+u.y*a},d=KX({source:h,sourcePosition:t,target:m}),g=d.x!==0?"x":"y",y=d[g];let C=[],w,b;const _={x:0,y:0},x={x:0,y:0},[,,S,k]=Q9({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*u[g]===-1){g==="x"?(w=i.x??h.x+(m.x-h.x)*c,b=i.y??(h.y+m.y)/2):(w=i.x??(h.x+m.x)/2,b=i.y??h.y+(m.y-h.y)*c);const T=[{x:w,y:h.y},{x:w,y:m.y}],D=[{x:h.x,y:b},{x:m.x,y:b}];l[g]===y?C=g==="x"?T:D:C=g==="x"?D:T}else{const T=[{x:h.x,y:m.y}],D=[{x:m.x,y:h.y}];if(g==="x"?C=l.x===y?D:T:C=l.y===y?T:D,t===r){const $=Math.abs(e[g]-n[g]);if($<=a){const K=Math.min(a-1,a-$);l[g]===y?_[g]=(h[g]>e[g]?-1:1)*K:x[g]=(m[g]>n[g]?-1:1)*K}}if(t!==r){const $=g==="x"?"y":"x",K=l[g]===u[$],W=h[$]>m[$],Z=h[$]=U?(w=(B.x+F.x)/2,b=C[0].y):(w=C[0].x,b=(B.y+F.y)/2)}const N={x:h.x+_.x,y:h.y+_.y},A={x:m.x+x.x,y:m.y+x.y};return[[e,...N.x!==C[0].x||N.y!==C[0].y?[N]:[],...C,...A.x!==C[C.length-1].x||A.y!==C[C.length-1].y?[A]:[],n],w,b,S,k]}function QX(e,t,n,r){const i=Math.min(sx(e,t)/2,sx(t,n)/2,r),{x:a,y:c}=t;if(e.x===a&&a===n.x||e.y===c&&c===n.y)return`L${a} ${c}`;if(e.y===c){const h=e.xn.id===t):e[0])||null}function Bg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function eK(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((c,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const h=Bg(u,t);a.has(h)||(c.push({id:h,color:u.color||n,...u}),a.add(h))}}),c),[]).sort((c,l)=>c.id.localeCompare(l.id))}const eC=1e3,tK=10,B2={nodeOrigin:[0,0],nodeExtent:ru,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nK={...B2,checkEquality:!0};function z2(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function rK(e,t,n){const r=z2(B2,n);for(const i of e.values())if(i.parentId)H2(i,e,t,r);else{const a=wu(i,r.nodeOrigin),c=Ja(i.extent)?i.extent:r.nodeExtent,l=Qa(a,c,Ss(i));i.internals.positionAbsolute=l}}function iK(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function I2(e){return e==="manual"}function zg(e,t,n,r={}){var m,d;const i=z2(nK,r),a={i:0},c=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!I2(i.zIndexMode)?eC:0;let u=e.length>0,h=!1;t.clear(),n.clear();for(const g of e){let y=c.get(g.id);if(i.checkEquality&&g===(y==null?void 0:y.internals.userNode))t.set(g.id,y);else{const C=wu(g,i.nodeOrigin),w=Ja(g.extent)?g.extent:i.nodeExtent,b=Qa(C,w,Ss(g));y={...i.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(d=g.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:iK(g,y),z:tC(g,l,i.zIndexMode),userNode:g}},t.set(g.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(u=!1),g.parentId&&H2(y,t,n,r,a),h||(h=g.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:h}}function sK(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function H2(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:c,nodeExtent:l,zIndexMode:u}=z2(B2,r),h=e.parentId,m=t.get(h);if(!m){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}sK(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*tK),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const d=a&&!I2(u)?eC:0,{x:g,y,z:C}=aK(e,m,c,l,d,u),{positionAbsolute:w}=e.internals,b=g!==w.x||y!==w.y;(b||C!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:g,y}:w,z:C}})}function tC(e,t,n){const r=ai(e.zIndex)?e.zIndex:0;return I2(n)?r:r+(e.selected?t:0)}function aK(e,t,n,r,i,a){const{x:c,y:l}=t.internals.positionAbsolute,u=Ss(e),h=wu(e,n),m=Ja(e.extent)?Qa(h,e.extent,u):h;let d=Qa({x:c+m.x,y:l+m.y},r,u);e.extent==="parent"&&(d=P9(d,u,t));const g=tC(e,i,a),y=t.internals.z??0;return{x:d.x,y:d.y,z:y>=g?y+1:g}}function F2(e,t,n,r=[0,0]){var c;const i=[],a=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const h=((c=a.get(l.parentId))==null?void 0:c.expandedRect)??su(u),m=$9(h,l.rect);a.set(l.parentId,{expandedRect:m,parent:u})}return a.size>0&&a.forEach(({expandedRect:l,parent:u},h)=>{var S;const m=u.internals.positionAbsolute,d=Ss(u),g=u.origin??r,y=l.x0||C>0||_||x)&&(i.push({id:h,type:"position",position:{x:u.position.x-y+_,y:u.position.y-C+x}}),(S=n.get(h))==null||S.forEach(k=>{e.some(N=>N.id===k.id)||i.push({id:k.id,type:"position",position:{x:k.position.x+y,y:k.position.y+C}})})),(d.width0){const y=F2(g,t,n,i);h.push(...y)}return{changes:h,updatedInternals:u}}async function lK({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;const c=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!c&&(c.x!==n[0]||c.y!==n[1]||c.k!==n[2])}function cx(e,t,n,r,i,a){let c=i;const l=r.get(c)||new Map;r.set(c,l.set(n,t)),c=`${i}-${e}`;const u=r.get(c)||new Map;if(r.set(c,u.set(n,t)),a){c=`${i}-${e}-${a}`;const h=r.get(c)||new Map;r.set(c,h.set(n,t))}}function nC(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:c=null,targetHandle:l=null}=r,u={edgeId:r.id,source:i,target:a,sourceHandle:c,targetHandle:l},h=`${i}-${c}--${a}-${l}`,m=`${a}-${l}--${i}-${c}`;cx("source",u,m,e,i,c),cx("target",u,h,e,a,l),t.set(r.id,r)}}function rC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:rC(n,t):!1}function ux(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function cK(e,t,n,r){const i=new Map;for(const[a,c]of e)if((c.selected||c.id===r)&&(!c.parentId||!rC(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function h1({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var c,l,u;const i=[];for(const[h,m]of t){const d=(c=n.get(h))==null?void 0:c.internals.userNode;d&&i.push({...d,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:r}:i[0],i]}function uK({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},c=ku(a,t);return{x:c.x-a.x,y:c.y-a.y}}function hK({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},c=0,l=new Map,u=!1,h={x:0,y:0},m=null,d=!1,g=null,y=!1,C=!1,w=null;function b({noDragClassName:x,handleSelector:S,domNode:k,isSelectable:N,nodeId:A,nodeClickDistance:j=0}){g=jr(k);function T({x:G,y:U}){const{nodeLookup:$,nodeExtent:K,snapGrid:W,snapToGrid:Z,nodeOrigin:ee,onNodeDrag:z,onSelectionDrag:L,onError:I,updateNodePositions:Y}=t();a={x:G,y:U};let q=!1;const se=l.size>1,de=se&&K?Lg(Cu(l)):null,fe=se&&Z?uK({dragItems:l,snapGrid:W,x:G,y:U}):null;for(const[te,V]of l){if(!$.has(te))continue;let re={x:G-V.distance.x,y:U-V.distance.y};Z&&(re=fe?{x:Math.round(re.x+fe.x),y:Math.round(re.y+fe.y)}:ku(re,W));let oe=null;if(se&&K&&!V.extent&&de){const{positionAbsolute:ke}=V.internals,Me=ke.x-de.x+K[0][0],Ue=ke.x+V.measured.width-de.x2+K[1][0],Fe=ke.y-de.y+K[0][1],Le=ke.y+V.measured.height-de.y2+K[1][1];oe=[[Me,Fe],[Ue,Le]]}const{position:_e,positionAbsolute:ye}=F9({nodeId:te,nextPosition:re,nodeLookup:$,nodeExtent:oe||K,nodeOrigin:ee,onError:I});q=q||V.position.x!==_e.x||V.position.y!==_e.y,V.position=_e,V.internals.positionAbsolute=ye}if(C=C||q,!!q&&(Y(l,!0),w&&(r||z||!A&&L))){const[te,V]=h1({nodeId:A,dragItems:l,nodeLookup:$});r==null||r(w,l,te,V),z==null||z(w,te,V),A||L==null||L(w,V)}}async function D(){if(!m)return;const{transform:G,panBy:U,autoPanSpeed:$,autoPanOnNodeDrag:K}=t();if(!K){u=!1,cancelAnimationFrame(c);return}const[W,Z]=R2(h,m,$);(W!==0||Z!==0)&&(a.x=(a.x??0)-W/G[2],a.y=(a.y??0)-Z/G[2],await U({x:W,y:Z})&&T(a)),c=requestAnimationFrame(D)}function B(G){var se;const{nodeLookup:U,multiSelectionActive:$,nodesDraggable:K,transform:W,snapGrid:Z,snapToGrid:ee,selectNodesOnDrag:z,onNodeDragStart:L,onSelectionDragStart:I,unselectNodesAndEdges:Y}=t();d=!0,(!z||!N)&&!$&&A&&((se=U.get(A))!=null&&se.selected||Y()),N&&z&&A&&(e==null||e(A));const q=Pc(G.sourceEvent,{transform:W,snapGrid:Z,snapToGrid:ee,containerBounds:m});if(a=q,l=cK(U,K,q,A),l.size>0&&(n||L||!A&&I)){const[de,fe]=h1({nodeId:A,dragItems:l,nodeLookup:U});n==null||n(G.sourceEvent,l,de,fe),L==null||L(G.sourceEvent,de,fe),A||I==null||I(G.sourceEvent,fe)}}const F=b9().clickDistance(j).on("start",G=>{const{domNode:U,nodeDragThreshold:$,transform:K,snapGrid:W,snapToGrid:Z}=t();m=(U==null?void 0:U.getBoundingClientRect())||null,y=!1,C=!1,w=G.sourceEvent,$===0&&B(G),a=Pc(G.sourceEvent,{transform:K,snapGrid:W,snapToGrid:Z,containerBounds:m}),h=oi(G.sourceEvent,m)}).on("drag",G=>{const{autoPanOnNodeDrag:U,transform:$,snapGrid:K,snapToGrid:W,nodeDragThreshold:Z,nodeLookup:ee}=t(),z=Pc(G.sourceEvent,{transform:$,snapGrid:K,snapToGrid:W,containerBounds:m});if(w=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||A&&!ee.has(A))&&(y=!0),!y){if(!u&&U&&d&&(u=!0,D()),!d){const L=oi(G.sourceEvent,m),I=L.x-h.x,Y=L.y-h.y;Math.sqrt(I*I+Y*Y)>Z&&B(G)}(a.x!==z.xSnapped||a.y!==z.ySnapped)&&l&&d&&(h=oi(G.sourceEvent,m),T(z))}}).on("end",G=>{if(!d||y){y&&l.size>0&&t().updateNodePositions(l,!1);return}if(u=!1,d=!1,cancelAnimationFrame(c),l.size>0){const{nodeLookup:U,updateNodePositions:$,onNodeDragStop:K,onSelectionDragStop:W}=t();if(C&&($(l,!1),C=!1),i||K||!A&&W){const[Z,ee]=h1({nodeId:A,dragItems:l,nodeLookup:U,dragging:!1});i==null||i(G.sourceEvent,l,Z,ee),K==null||K(G.sourceEvent,Z,ee),A||W==null||W(G.sourceEvent,ee)}}}).filter(G=>{const U=G.target;return!G.button&&(!x||!ux(U,`.${x}`,k))&&(!S||ux(U,S,k))});g.call(F)}function _(){g==null||g.on(".drag",null)}return{update:b,destroy:_}}function dK(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())td(i,su(a))>0&&r.push(a);return r}const fK=250;function pK(e,t,n,r){var l,u;let i=[],a=1/0;const c=dK(e,n,t+fK);for(const h of c){const m=[...((l=h.internals.handleBounds)==null?void 0:l.source)??[],...((u=h.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of m){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:g,y}=eo(h,d,d.position,!0),C=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));C>t||(C1){const h=r.type==="source"?"target":"source";return i.find(m=>m.type===h)??i[0]}return i[0]}function iC(e,t,n,r,i,a=!1){var h,m,d;const c=r.get(e);if(!c)return null;const l=i==="strict"?(h=c.internals.handleBounds)==null?void 0:h[t]:[...((m=c.internals.handleBounds)==null?void 0:m.source)??[],...((d=c.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return u&&a?{...u,...eo(c,u,u.position,!0)}:u}function sC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function mK(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const aC=()=>!0;function gK(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:c,domNode:l,nodeLookup:u,lib:h,autoPanOnConnect:m,flowId:d,panBy:g,cancelConnection:y,onConnectStart:C,onConnect:w,onConnectEnd:b,isValidConnection:_=aC,onReconnectEnd:x,updateConnection:S,getTransform:k,getFromHandle:N,autoPanSpeed:A,dragThreshold:j=1,handleDomNode:T}){const D=W9(e.target);let B=0,F;const{x:G,y:U}=oi(e),$=sC(a,T),K=l==null?void 0:l.getBoundingClientRect();let W=!1;if(!K||!$)return;const Z=iC(i,$,r,u,t);if(!Z)return;let ee=oi(e,K),z=!1,L=null,I=!1,Y=null;function q(){if(!m||!K)return;const[_e,ye]=R2(ee,K,A);g({x:_e,y:ye}),B=requestAnimationFrame(q)}const se={...Z,nodeId:i,type:$,position:Z.position},de=u.get(i);let te={inProgress:!0,isValid:null,from:eo(de,se,Xe.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:de,to:ee,toHandle:null,toPosition:Q6[se.position],toNode:null,pointer:ee};function V(){W=!0,S(te),C==null||C(e,{nodeId:i,handleId:r,handleType:$})}j===0&&V();function re(_e){if(!W){const{x:Le,y:At}=oi(_e),Dt=Le-G,Rt=At-U;if(!(Dt*Dt+Rt*Rt>j*j))return;V()}if(!N()||!se){oe(_e);return}const ye=k();ee=oi(_e,K),F=pK(Eu(ee,ye,!1,[1,1]),n,u,se),z||(q(),z=!0);const ke=oC(_e,{handle:F,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:c?"target":"source",isValidConnection:_,doc:D,lib:h,flowId:d,nodeLookup:u});Y=ke.handleDomNode,L=ke.connection,I=mK(!!F,ke.isValid);const Me=u.get(i),Ue=Me?eo(Me,se,Xe.Left,!0):te.from,Fe={...te,from:Ue,isValid:I,to:ke.toHandle&&I?bl({x:ke.toHandle.x,y:ke.toHandle.y},ye):ee,toHandle:ke.toHandle,toPosition:I&&ke.toHandle?ke.toHandle.position:Q6[se.position],toNode:ke.toHandle?u.get(ke.toHandle.nodeId):null,pointer:ee};S(Fe),te=Fe}function oe(_e){if(!("touches"in _e&&_e.touches.length>0)){if(W){(F||Y)&&L&&I&&(w==null||w(L));const{inProgress:ye,...ke}=te,Me={...ke,toPosition:te.toHandle?te.toPosition:null};b==null||b(_e,Me),a&&(x==null||x(_e,Me))}y(),cancelAnimationFrame(B),z=!1,I=!1,L=null,Y=null,D.removeEventListener("mousemove",re),D.removeEventListener("mouseup",oe),D.removeEventListener("touchmove",re),D.removeEventListener("touchend",oe)}}D.addEventListener("mousemove",re),D.addEventListener("mouseup",oe),D.addEventListener("touchmove",re),D.addEventListener("touchend",oe)}function oC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:c,lib:l,flowId:u,isValidConnection:h=aC,nodeLookup:m}){const d=a==="target",g=t?c.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:C}=oi(e),w=c.elementFromPoint(y,C),b=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:g,_={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const x=sC(void 0,b),S=b.getAttribute("data-nodeid"),k=b.getAttribute("data-handleid"),N=b.classList.contains("connectable"),A=b.classList.contains("connectableend");if(!S||!x)return _;const j={source:d?S:r,sourceHandle:d?k:i,target:d?r:S,targetHandle:d?i:k};_.connection=j;const D=N&&A&&(n===vl.Strict?d&&x==="source"||!d&&x==="target":S!==r||k!==i);_.isValid=D&&h(j),_.toHandle=iC(S,x,k,m,n,!0)}return _}const Ig={onPointerDown:gK,isValid:oC};function vK({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=jr(e);function a({translateExtent:l,width:u,height:h,zoomStep:m=1,pannable:d=!0,zoomable:g=!0,inversePan:y=!1}){const C=S=>{if(S.sourceEvent.type!=="wheel"||!t)return;const k=n(),N=S.sourceEvent.ctrlKey&&au()?10:1,A=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*m,j=k[2]*Math.pow(2,A*N);t.scaleTo(j)};let w=[0,0];const b=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(w=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},_=S=>{const k=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const N=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],A=[N[0]-w[0],N[1]-w[1]];w=N;const j=r()*Math.max(k[2],Math.log(k[2]))*(y?-1:1),T={x:k[0]-A[0]*j,y:k[1]-A[1]*j},D=[[0,0],[u,h]];t.setViewportConstrained({x:T.x,y:T.y,zoom:k[2]},D,l)},x=L9().on("start",b).on("zoom",d?_:null).on("zoom.wheel",g?C:null);i.call(x,{})}function c(){i.on("zoom",null)}return{update:a,destroy:c,pointer:ii}}const Qd=e=>({x:e.x,y:e.y,zoom:e.k}),d1=({x:e,y:t,zoom:n})=>Xd.translate(e,t).scale(n),rl=(e,t)=>e.target.closest(`.${t}`),lC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),yK=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,f1=(e,t=0,n=yK,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},cC=e=>{const t=e.ctrlKey&&au()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function bK({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:c,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:h}){return m=>{if(rl(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(m.ctrlKey&&c){const b=ii(m),_=cC(m),x=d*Math.pow(2,_);r.scaleTo(n,x,b,m);return}const g=m.deltaMode===1?20:1;let y=i===Va.Vertical?0:m.deltaX*g,C=i===Va.Horizontal?0:m.deltaY*g;!au()&&m.shiftKey&&i!==Va.Vertical&&(y=m.deltaY*g,C=0),r.translateBy(n,-(y/d)*a,-(C/d)*a,{internal:!0});const w=Qd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,w),e.panScrollTimeout=setTimeout(()=>{h==null||h(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,w))}}function _K({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",c=!t&&a&&!r.ctrlKey,l=rl(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),c||l)return null;r.preventDefault(),n.call(this,r,i)}}function xK({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,c,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=Qd(r.transform);e.mouseButton=((c=r.sourceEvent)==null?void 0:c.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function SK({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var c,l;e.usedRightMouseButton=!!(n&&lC(t,e.mouseButton??0)),(c=a.sourceEvent)!=null&&c.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,Qd(a.transform)))}}function wK({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return c=>{var l;if(!((l=c.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&lC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&a(c.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const u=Qd(c.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(c.sourceEvent,u)},n?150:0)}}}function CK({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:c,noWheelClassName:l,noPanClassName:u,lib:h,connectionInProgress:m}){return d=>{var b;const g=e||t,y=n&&d.ctrlKey,C=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(rl(d,`${h}-flow__node`)||rl(d,`${h}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||c||m&&!C||rl(d,l)&&C||rl(d,u)&&(!C||i&&C&&!e)||!n&&d.ctrlKey&&C)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!g&&!i&&!y&&C||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||C)&&w}}function kK({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:c,onPanZoomEnd:l,onDraggingChange:u}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),d=L9().scaleExtent([t,n]).translateExtent(r),g=jr(e).call(d);x({x:i.x,y:i.y,zoom:yl(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const y=g.on("wheel.zoom"),C=g.on("dblclick.zoom");d.wheelDelta(cC);async function w(F,G){return g?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?Fc:k0).transform(f1(g,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),F)}):!1}function b({noWheelClassName:F,noPanClassName:G,onPaneContextMenu:U,userSelectionActive:$,panOnScroll:K,panOnDrag:W,panOnScrollMode:Z,panOnScrollSpeed:ee,preventScrolling:z,zoomOnPinch:L,zoomOnScroll:I,zoomOnDoubleClick:Y,zoomActivationKeyPressed:q,lib:se,onTransformChange:de,connectionInProgress:fe,paneClickDistance:te,selectionOnDrag:V}){$&&!h.isZoomingOrPanning&&_();const re=K&&!q&&!$;d.clickDistance(V?1/0:!ai(te)||te<0?0:te);const oe=re?bK({zoomPanValues:h,noWheelClassName:F,d3Selection:g,d3Zoom:d,panOnScrollMode:Z,panOnScrollSpeed:ee,zoomOnPinch:L,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:l}):_K({noWheelClassName:F,preventScrolling:z,d3ZoomHandler:y});g.on("wheel.zoom",oe,{passive:!1});const _e=xK({zoomPanValues:h,onDraggingChange:u,onPanZoomStart:c});d.on("start",_e);const ye=SK({zoomPanValues:h,panOnDrag:W,onPaneContextMenu:!!U,onPanZoom:a,onTransformChange:de});d.on("zoom",ye);const ke=wK({zoomPanValues:h,panOnDrag:W,panOnScroll:K,onPaneContextMenu:U,onPanZoomEnd:l,onDraggingChange:u});d.on("end",ke);const Me=CK({zoomActivationKeyPressed:q,panOnDrag:W,zoomOnScroll:I,panOnScroll:K,zoomOnDoubleClick:Y,zoomOnPinch:L,userSelectionActive:$,noPanClassName:G,noWheelClassName:F,lib:se,connectionInProgress:fe});d.filter(Me),Y?g.on("dblclick.zoom",C):g.on("dblclick.zoom",null)}function _(){d.on("zoom",null)}async function x(F,G,U){const $=d1(F),K=d==null?void 0:d.constrain()($,G,U);return K&&await w(K),K}async function S(F,G){const U=d1(F);return await w(U,G),U}function k(F){if(g){const G=d1(F),U=g.property("__zoom");(U.k!==F.zoom||U.x!==F.x||U.y!==F.y)&&(d==null||d.transform(g,G,null,{sync:!0}))}}function N(){const F=g?R9(g.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}async function A(F,G){return g?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?Fc:k0).scaleTo(f1(g,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),F)}):!1}async function j(F,G){return g?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?Fc:k0).scaleBy(f1(g,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),F)}):!1}function T(F){d==null||d.scaleExtent(F)}function D(F){d==null||d.translateExtent(F)}function B(F){const G=!ai(F)||F<0?0:F;d==null||d.clickDistance(G)}return{update:b,destroy:_,setViewport:S,setViewportConstrained:x,getViewport:N,scaleTo:A,scaleBy:j,setScaleExtent:T,setTranslateExtent:D,syncViewport:k,setClickDistance:B}}var _l;(function(e){e.Line="line",e.Handle="handle"})(_l||(_l={}));function EK({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const c=e-t,l=n-r,u=[c>0?1:c<0?-1:0,l>0?1:l<0?-1:0];return c&&i&&(u[0]=u[0]*-1),l&&a&&(u[1]=u[1]*-1),u}function hx(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function ea(e,t){return Math.max(0,t-e)}function ta(e,t){return Math.max(0,e-t)}function c0(e,t,n){return Math.max(0,t-e,e-n)}function dx(e,t){return e?!t:t}function AK(e,t,n,r,i,a,c,l){let{affectsX:u,affectsY:h}=t;const{isHorizontal:m,isVertical:d}=t,g=m&&d,{xSnapped:y,ySnapped:C}=n,{minWidth:w,maxWidth:b,minHeight:_,maxHeight:x}=r,{x:S,y:k,width:N,height:A,aspectRatio:j}=e;let T=Math.floor(m?y-e.pointerX:0),D=Math.floor(d?C-e.pointerY:0);const B=N+(u?-T:T),F=A+(h?-D:D),G=-a[0]*N,U=-a[1]*A;let $=c0(B,w,b),K=c0(F,_,x);if(c){let ee=0,z=0;u&&T<0?ee=ea(S+T+G,c[0][0]):!u&&T>0&&(ee=ta(S+B+G,c[1][0])),h&&D<0?z=ea(k+D+U,c[0][1]):!h&&D>0&&(z=ta(k+F+U,c[1][1])),$=Math.max($,ee),K=Math.max(K,z)}if(l){let ee=0,z=0;u&&T>0?ee=ta(S+T,l[0][0]):!u&&T<0&&(ee=ea(S+B,l[1][0])),h&&D>0?z=ta(k+D,l[0][1]):!h&&D<0&&(z=ea(k+F,l[1][1])),$=Math.max($,ee),K=Math.max(K,z)}if(i){if(m){const ee=c0(B/j,_,x)*j;if($=Math.max($,ee),c){let z=0;!u&&!h||u&&!h&&g?z=ta(k+U+B/j,c[1][1])*j:z=ea(k+U+(u?T:-T)/j,c[0][1])*j,$=Math.max($,z)}if(l){let z=0;!u&&!h||u&&!h&&g?z=ea(k+B/j,l[1][1])*j:z=ta(k+(u?T:-T)/j,l[0][1])*j,$=Math.max($,z)}}if(d){const ee=c0(F*j,w,b)/j;if(K=Math.max(K,ee),c){let z=0;!u&&!h||h&&!u&&g?z=ta(S+F*j+G,c[1][0])/j:z=ea(S+(h?D:-D)*j+G,c[0][0])/j,K=Math.max(K,z)}if(l){let z=0;!u&&!h||h&&!u&&g?z=ea(S+F*j,l[1][0])/j:z=ta(S+(h?D:-D)*j,l[0][0])/j,K=Math.max(K,z)}}}D=D+(D<0?K:-K),T=T+(T<0?$:-$),i&&(g?B>F*j?D=(dx(u,h)?-T:T)/j:T=(dx(u,h)?-D:D)*j:m?(D=T/j,h=u):(T=D*j,u=h));const W=u?S+T:S,Z=h?k+D:k;return{width:N+(u?-T:T),height:A+(h?-D:D),x:a[0]*T*(u?-1:1)+W,y:a[1]*D*(h?-1:1)+Z}}const uC={width:0,height:0,x:0,y:0},NK={...uC,pointerX:0,pointerY:0,aspectRatio:1};function TK(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,c=e.measured.height??0,l=n[0]*a,u=n[1]*c;return[[r-l,i-u],[r+a-l,i+c-u]]}function MK({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=jr(e);let c={controlDirection:hx("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:h,boundaries:m,keepAspectRatio:d,resizeDirection:g,onResizeStart:y,onResize:C,onResizeEnd:w,shouldResize:b}){let _={...uC},x={...NK};c={boundaries:m,resizeDirection:g,keepAspectRatio:d,controlDirection:hx(h)};let S,k=null,N=[],A,j,T,D=!1;const B=b9().on("start",F=>{const{nodeLookup:G,transform:U,snapGrid:$,snapToGrid:K,nodeOrigin:W,paneDomNode:Z}=n();if(S=G.get(t),!S)return;k=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:ee,ySnapped:z}=Pc(F.sourceEvent,{transform:U,snapGrid:$,snapToGrid:K,containerBounds:k});_={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},x={..._,pointerX:ee,pointerY:z,aspectRatio:_.width/_.height},A=void 0,j=Ja(S.extent)?S.extent:void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(A=G.get(S.parentId)),A&&S.extent==="parent"&&(j=[[0,0],[A.measured.width,A.measured.height]]),N=[],T=void 0;for(const[L,I]of G)if(I.parentId===t&&(N.push({id:L,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent)){const Y=TK(I,S,I.origin??W);T?T=[[Math.min(Y[0][0],T[0][0]),Math.min(Y[0][1],T[0][1])],[Math.max(Y[1][0],T[1][0]),Math.max(Y[1][1],T[1][1])]]:T=Y}y==null||y(F,{..._})}).on("drag",F=>{const{transform:G,snapGrid:U,snapToGrid:$,nodeOrigin:K}=n(),W=Pc(F.sourceEvent,{transform:G,snapGrid:U,snapToGrid:$,containerBounds:k}),Z=[];if(!S)return;const{x:ee,y:z,width:L,height:I}=_,Y={},q=S.origin??K,{width:se,height:de,x:fe,y:te}=AK(x,c.controlDirection,W,c.boundaries,c.keepAspectRatio,q,j,T),V=se!==L,re=de!==I,oe=fe!==ee&&V,_e=te!==z&&re;if(!oe&&!_e&&!V&&!re)return;if((oe||_e||q[0]===1||q[1]===1)&&(Y.x=oe?fe:_.x,Y.y=_e?te:_.y,_.x=Y.x,_.y=Y.y,N.length>0)){const Ue=fe-ee,Fe=te-z;for(const Le of N)Le.position={x:Le.position.x-Ue+q[0]*(se-L),y:Le.position.y-Fe+q[1]*(de-I)},Z.push(Le)}if((V||re)&&(Y.width=V&&(!c.resizeDirection||c.resizeDirection==="horizontal")?se:_.width,Y.height=re&&(!c.resizeDirection||c.resizeDirection==="vertical")?de:_.height,_.width=Y.width,_.height=Y.height),A&&S.expandParent){const Ue=q[0]*(Y.width??0);Y.x&&Y.x{D&&(w==null||w(F,{..._}),i==null||i({..._}),D=!1)});a.call(B)}function u(){a.on(".drag",null)}return{update:l,destroy:u}}var p1={exports:{}},m1={},g1={exports:{}},v1={};/** - * @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 fx;function jK(){if(fx)return v1;fx=1;var e=lu();function t(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,c=e.useDebugValue;function l(d,g){var y=g(),C=r({inst:{value:y,getSnapshot:g}}),w=C[0].inst,b=C[1];return a(function(){w.value=y,w.getSnapshot=g,u(w)&&b({inst:w})},[d,y,g]),i(function(){return u(w)&&b({inst:w}),d(function(){u(w)&&b({inst:w})})},[d]),c(y),y}function u(d){var g=d.getSnapshot;d=d.value;try{var y=g();return!n(d,y)}catch{return!0}}function h(d,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:l;return v1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,v1}var px;function DK(){return px||(px=1,g1.exports=jK()),g1.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 mx;function RK(){if(mx)return m1;mx=1;var e=lu(),t=DK();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,c=e.useEffect,l=e.useMemo,u=e.useDebugValue;return m1.useSyncExternalStoreWithSelector=function(h,m,d,g,y){var C=a(null);if(C.current===null){var w={hasValue:!1,value:null};C.current=w}else w=C.current;C=l(function(){function _(A){if(!x){if(x=!0,S=A,A=g(A),y!==void 0&&w.hasValue){var j=w.value;if(y(j,A))return k=j}return k=A}if(j=k,r(S,A))return j;var T=g(A);return y!==void 0&&y(j,T)?(S=A,j):(S=A,k=T)}var x=!1,S,k,N=d===void 0?null:d;return[function(){return _(m())},N===null?void 0:function(){return _(N())}]},[m,d,g,y]);var b=i(h,C[0],C[1]);return c(function(){w.hasValue=!0,w.value=b},[b]),u(b),b},m1}var gx;function LK(){return gx||(gx=1,p1.exports=RK()),p1.exports}var OK=LK();const BK=id(OK),zK={},vx=e=>{let t;const n=new Set,r=(m,d)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const y=t;t=d??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(C=>C(t,y))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(zK?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(r,i,u);return u},IK=e=>e?vx(e):vx,{useDebugValue:HK}=iA,{useSyncExternalStoreWithSelector:FK}=BK,PK=e=>e;function hC(e,t=PK,n){const r=FK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return HK(r),r}const yx=(e,t)=>{const n=IK(e),r=(i,a=t)=>hC(n,i,a);return Object.assign(r,n),r},$K=(e,t)=>e?yx(e,t):yx;function pn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Jd=O.createContext(null),UK=Jd.Provider,dC=ui.error001("react");function Lt(e,t){const n=O.useContext(Jd);if(n===null)throw new Error(dC);return hC(n,e,t)}function gn(){const e=O.useContext(Jd);if(e===null)throw new Error(dC);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const bx={display:"none"},qK={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},fC="react-flow__node-desc",pC="react-flow__edge-desc",GK="react-flow__aria-live",VK=e=>e.ariaLiveMessage,WK=e=>e.ariaLabelConfig;function YK({rfId:e}){const t=Lt(VK);return f.jsx("div",{id:`${GK}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:qK,children:t})}function XK({rfId:e,disableKeyboardA11y:t}){const n=Lt(WK);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${fC}-${e}`,style:bx,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${pC}-${e}`,style:bx,children:n["edge.a11yDescription.default"]}),!t&&f.jsx(YK,{rfId:e})]})}const ef=O.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const c=`${e}`.split("-");return f.jsx("div",{className:Bn(["react-flow__panel",n,...c]),style:r,ref:a,...i,children:t})});ef.displayName="Panel";const _x="https://reactflow.dev?utm_source=attribution";function KK({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(ef,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${_x}`,children:f.jsx("a",{href:_x,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ZK=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},u0=e=>e.id;function QK(e,t){return pn(e.selectedNodes.map(u0),t.selectedNodes.map(u0))&&pn(e.selectedEdges.map(u0),t.selectedEdges.map(u0))}function JK({onSelectionChange:e}){const t=gn(),{selectedNodes:n,selectedEdges:r}=Lt(ZK,QK);return O.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const eZ=e=>!!e.onSelectionChangeHandlers;function tZ({onSelectionChange:e}){const t=Lt(eZ);return e||t?f.jsx(JK,{onSelectionChange:e}):null}const mC=[0,0],nZ={x:0,y:0,zoom:1},rZ=["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"],xx=[...rZ,"rfId"],iZ=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}),Sx={translateExtent:ru,nodeOrigin:mC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function sZ(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:c,reset:l,setDefaultNodesAndEdges:u}=Lt(iZ,pn),h=gn();O.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=Sx,l()}),[]);const m=O.useRef(Sx);return O.useEffect(()=>{for(const d of xx){const g=e[d],y=m.current[d];g!==y&&(typeof e[d]>"u"||(d==="nodes"?t(g):d==="edges"?n(g):d==="minZoom"?r(g):d==="maxZoom"?i(g):d==="translateExtent"?a(g):d==="nodeExtent"?c(g):d==="ariaLabelConfig"?h.setState({ariaLabelConfig:UX(g)}):d==="fitView"?h.setState({fitViewQueued:g}):d==="fitViewOptions"?h.setState({fitViewOptions:g}):h.setState({[d]:g})))}m.current=e},xx.map(d=>e[d])),null}function wx(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function aZ(e){var r;const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const i=wx(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=wx())!=null&&r.matches?"dark":"light"}const Cx=typeof document<"u"?document:null;function ou(e=null,t={target:Cx,actInsideInputWithModifier:!0}){const[n,r]=O.useState(!1),i=O.useRef(!1),a=O.useRef(new Set([])),[c,l]=O.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` -`).replace(` - -`,` -+`).split(` -`)),m=h.reduce((d,g)=>d.concat(...g),[]);return[h,m]}return[[],[]]},[e]);return O.useEffect(()=>{const u=(t==null?void 0:t.target)??Cx,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=y=>{var b,_;if(i.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!i.current||i.current&&!h)&&Y9(y))return!1;const w=Ex(y.code,l);if(a.current.add(y[w]),kx(c,a.current,!1)){const x=((_=(b=y.composedPath)==null?void 0:b.call(y))==null?void 0:_[0])||y.target,S=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(i.current||!S)&&y.preventDefault(),r(!0)}},d=y=>{const C=Ex(y.code,l);kx(c,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(y[C]),y.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function kx(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Ex(e,t){return t.includes(e)?"code":"key"}const oZ=()=>{const e=gn();return O.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,a],panZoom:c}=e.getState();return c?(await c.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:a,maxZoom:c,panZoom:l}=e.getState(),u=L2(t,r,i,a,c,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:a,domNode:c}=e.getState();if(!c)return t;const{x:l,y:u}=c.getBoundingClientRect(),h={x:t.x-l,y:t.y-u},m=n.snapGrid??i,d=n.snapToGrid??a;return Eu(h,r,d,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),c=bl(t,n);return{x:c.x+i,y:c.y+a}}}),[])};function gC(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const c=r.get(a.id);c?c.push(a):r.set(a.id,[a])}for(const a of t){const c=r.get(a.id);if(!c){n.push(a);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){n.push({...c[0].item});continue}const l={...a};for(const u of c)lZ(u,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function lZ(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function cZ(e,t){return gC(e,t)}function uZ(e,t){return gC(e,t)}function Fa(e,t){return{id:e,type:"select",selected:t}}function il(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const c=t.has(i);!(a.selected===void 0&&!c)&&a.selected!==c&&(n&&(a.selected=c),r.push(Fa(a.id,c)))}return r}function Ax({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,c]of e.entries()){const l=t.get(c.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==c&&n.push({id:c.id,item:c,type:"replace"}),u===void 0&&n.push({item:c,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function Nx(e){return{id:e.id,type:"remove"}}const hZ=q9();function dZ(e,t,n={}){return XX(e,t,{...n,onError:n.onError??hZ})}const Tx=e=>LX(e),fZ=e=>H9(e);function vC(e){return O.forwardRef(e)}const pZ=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Mx(e){const[t,n]=O.useState(BigInt(0)),[r]=O.useState(()=>mZ(()=>n(i=>i+BigInt(1))));return pZ(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function mZ(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const yC=O.createContext(null);function gZ({children:e}){const t=gn(),n=O.useCallback(l=>{const{nodes:u=[],setNodes:h,hasDefaultNodes:m,onNodesChange:d,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:C}=t.getState();let w=u;for(const _ of l)w=typeof _=="function"?_(w):_;let b=Ax({items:w,lookup:g});for(const _ of C.values())b=_(b);m&&h(w),b.length>0?d==null||d(b):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:x,setNodes:S}=t.getState();_&&S(x)})},[]),r=Mx(n),i=O.useCallback(l=>{const{edges:u=[],setEdges:h,hasDefaultEdges:m,onEdgesChange:d,edgeLookup:g}=t.getState();let y=u;for(const C of l)y=typeof C=="function"?C(y):C;m?h(y):d&&d(Ax({items:y,lookup:g}))},[]),a=Mx(i),c=O.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return f.jsx(yC.Provider,{value:c,children:e})}function vZ(){const e=O.useContext(yC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const yZ=e=>!!e.panZoom;function P2(){const e=oZ(),t=gn(),n=vZ(),r=Lt(yZ),i=O.useMemo(()=>{const a=d=>t.getState().nodeLookup.get(d),c=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},u=d=>{var _,x;const{nodeLookup:g,nodeOrigin:y}=t.getState(),C=Tx(d)?d:g.get(d.id),w=C.parentId?V9(C.position,C.measured,C.parentId,g,y):C.position,b={...C,position:w,width:((_=C.measured)==null?void 0:_.width)??C.width,height:((x=C.measured)==null?void 0:x.height)??C.height};return su(b)},h=(d,g,y={replace:!1})=>{c(C=>C.map(w=>{if(w.id===d){const b=typeof g=="function"?g(w):g;return y.replace&&Tx(b)?b:{...w,...b}}return w}))},m=(d,g,y={replace:!1})=>{l(C=>C.map(w=>{if(w.id===d){const b=typeof g=="function"?g(w):g;return y.replace&&fZ(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var g;return(g=a(d))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(g=>({...g}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:c,setEdges:l,addNodes:d=>{const g=Array.isArray(d)?d:[d];n.nodeQueue.push(y=>[...y,...g])},addEdges:d=>{const g=Array.isArray(d)?d:[d];n.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:d=[],edges:g=[],transform:y}=t.getState(),[C,w,b]=y;return{nodes:d.map(_=>({..._})),edges:g.map(_=>({..._})),viewport:{x:C,y:w,zoom:b}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:y,edges:C,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:_,triggerEdgeChanges:x,onDelete:S,onBeforeDelete:k}=t.getState(),{nodes:N,edges:A}=await HX({nodesToRemove:d,edgesToRemove:g,nodes:y,edges:C,onBeforeDelete:k}),j=A.length>0,T=N.length>0;if(j){const D=A.map(Nx);b==null||b(A),x(D)}if(T){const D=N.map(Nx);w==null||w(N),_(D)}return(T||j)&&(S==null||S({nodes:N,edges:A})),{deletedNodes:N,deletedEdges:A}},getIntersectingNodes:(d,g=!0,y)=>{const C=ex(d),w=C?d:u(d),b=y!==void 0;return w?(y||t.getState().nodes).filter(_=>{const x=t.getState().nodeLookup.get(_.id);if(x&&!C&&(_.id===d.id||!x.internals.positionAbsolute))return!1;const S=su(b?_:x),k=td(S,w);return g&&k>0||k>=S.width*S.height||k>=w.width*w.height}):[]},isNodeIntersecting:(d,g,y=!0)=>{const w=ex(d)?d:u(d);if(!w)return!1;const b=td(w,g);return y&&b>0||b>=g.width*g.height||b>=w.width*w.height},updateNode:h,updateNodeData:(d,g,y={replace:!1})=>{h(d,C=>{const w=typeof g=="function"?g(C):g;return y.replace?{...C,data:w}:{...C,data:{...C.data,...w}}},y)},updateEdge:m,updateEdgeData:(d,g,y={replace:!1})=>{m(d,C=>{const w=typeof g=="function"?g(C):g;return y.replace?{...C,data:w}:{...C,data:{...C.data,...w}}},y)},getNodesBounds:d=>{const{nodeLookup:g,nodeOrigin:y}=t.getState();return OX(d,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:d,id:g,nodeId:y})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${y}-${d}${g?`-${g}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:d,handleId:g,nodeId:y})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${y}${d?g?`-${d}-${g}`:`-${d}`:""}`))==null?void 0:C.values())??[])},fitView:async d=>{const g=t.getState().fitViewResolver??$X();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),n.nodeQueue.push(y=>[...y]),g.promise}}},[]);return O.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const jx=e=>e.selected,bZ=typeof window<"u"?window:void 0;function _Z({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=gn(),{deleteElements:r}=P2(),i=ou(e,{actInsideInputWithModifier:!1}),a=ou(t,{target:bZ});O.useEffect(()=>{if(i){const{edges:c,nodes:l}=n.getState();r({nodes:l.filter(jx),edges:c.filter(jx)}),n.setState({nodesSelectionActive:!1})}},[i]),O.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function xZ(e){const t=gn();O.useEffect(()=>{const n=()=>{var i,a,c,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=O2(e.current);(r.height===0||r.width===0)&&((l=(c=t.getState()).onError)==null||l.call(c,"004",ui.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const tf={position:"absolute",width:"100%",height:"100%",top:0,left:0},SZ=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function wZ({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Va.Free,zoomOnDoubleClick:c=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:h,minZoom:m,maxZoom:d,zoomActivationKeyCode:g,preventScrolling:y=!0,children:C,noWheelClassName:w,noPanClassName:b,onViewportChange:_,isControlledViewport:x,paneClickDistance:S,selectionOnDrag:k}){const N=gn(),A=O.useRef(null),{userSelectionActive:j,lib:T,connectionInProgress:D}=Lt(SZ,pn),B=ou(g),F=O.useRef();xZ(A);const G=O.useCallback(U=>{_==null||_({x:U[0],y:U[1],zoom:U[2]}),x||N.setState({transform:U})},[_,x]);return O.useEffect(()=>{if(A.current){F.current=kK({domNode:A.current,minZoom:m,maxZoom:d,translateExtent:h,viewport:u,onDraggingChange:W=>N.setState(Z=>Z.paneDragging===W?Z:{paneDragging:W}),onPanZoomStart:(W,Z)=>{const{onViewportChangeStart:ee,onMoveStart:z}=N.getState();z==null||z(W,Z),ee==null||ee(Z)},onPanZoom:(W,Z)=>{const{onViewportChange:ee,onMove:z}=N.getState();z==null||z(W,Z),ee==null||ee(Z)},onPanZoomEnd:(W,Z)=>{const{onViewportChangeEnd:ee,onMoveEnd:z}=N.getState();z==null||z(W,Z),ee==null||ee(Z)}});const{x:U,y:$,zoom:K}=F.current.getViewport();return N.setState({panZoom:F.current,transform:[U,$,K],domNode:A.current.closest(".react-flow")}),()=>{var W;(W=F.current)==null||W.destroy()}}},[]),O.useEffect(()=>{var U;(U=F.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:c,panOnDrag:l,zoomActivationKeyPressed:B,preventScrolling:y,noPanClassName:b,userSelectionActive:j,noWheelClassName:w,lib:T,onTransformChange:G,connectionInProgress:D,selectionOnDrag:k,paneClickDistance:S})},[e,t,n,r,i,a,c,l,B,y,b,j,w,T,G,D,k,S]),f.jsx("div",{className:"react-flow__renderer",ref:A,style:tf,children:C})}const CZ=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function kZ(){const{userSelectionActive:e,userSelectionRect:t}=Lt(CZ,pn);return e&&t?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const y1=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},EZ=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function AZ({isSelecting:e,selectionKeyPressed:t,selectionMode:n=iu.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:c,onSelectionStart:l,onSelectionEnd:u,onPaneClick:h,onPaneContextMenu:m,onPaneScroll:d,onPaneMouseEnter:g,onPaneMouseMove:y,onPaneMouseLeave:C,children:w}){const b=O.useRef(0),_=gn(),{userSelectionActive:x,elementsSelectable:S,dragging:k,panBy:N,autoPanSpeed:A}=Lt(EZ,pn),j=S&&(e||x),T=O.useRef(null),D=O.useRef(),B=O.useRef(new Set),F=O.useRef(new Set),G=O.useRef(!1),U=O.useRef(!1),$=O.useRef({x:0,y:0}),K=O.useRef(!1),W=V=>{if(U.current||G.current||_.getState().connection.inProgress){U.current=!1,G.current=!1;return}h==null||h(V),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},Z=V=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){V.preventDefault();return}m==null||m(V)},ee=d?V=>d(V):void 0,z=V=>{U.current&&(V.stopPropagation(),U.current=!1)},L=V=>{var Le,At;const{domNode:re,transform:oe}=_.getState();if(D.current=re==null?void 0:re.getBoundingClientRect(),!D.current)return;const _e=V.target===T.current;if(!_e&&!!V.target.closest(".nokey")||!e||!(c&&_e||t)||V.button!==0||!V.isPrimary)return;(At=(Le=V.target)==null?void 0:Le.setPointerCapture)==null||At.call(Le,V.pointerId),U.current=!1;const{x:Me,y:Ue}=oi(V.nativeEvent,D.current),Fe=Eu({x:Me,y:Ue},oe);_.setState({userSelectionRect:{width:0,height:0,startX:Fe.x,startY:Fe.y,x:Me,y:Ue}}),_e||(V.stopPropagation(),V.preventDefault())};function I(V,re){const{userSelectionRect:oe}=_.getState();if(!oe)return;const{transform:_e,nodeLookup:ye,edgeLookup:ke,connectionLookup:Me,triggerNodeChanges:Ue,triggerEdgeChanges:Fe,defaultEdgeOptions:Le}=_.getState(),At={x:oe.startX,y:oe.startY},{x:Dt,y:Rt}=bl(At,_e),Ft={startX:At.x,startY:At.y,x:Vpt.id)),F.current=new Set;const Je=(Le==null?void 0:Le.selectable)??!0;for(const pt of B.current){const be=Me.get(pt);if(be)for(const{edgeId:Ae}of be.values()){const He=ke.get(Ae);He&&(He.selectable??Je)&&F.current.add(Ae)}}if(!tx(an,B.current)){const pt=il(ye,B.current,!0);Ue(pt)}if(!tx(wt,F.current)){const pt=il(ke,F.current);Fe(pt)}_.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function Y(){if(!i||!D.current)return;const[V,re]=R2($.current,D.current,A);N({x:V,y:re}).then(oe=>{if(!U.current||!oe){b.current=requestAnimationFrame(Y);return}const{x:_e,y:ye}=$.current;I(_e,ye),b.current=requestAnimationFrame(Y)})}const q=()=>{cancelAnimationFrame(b.current),b.current=0,K.current=!1};O.useEffect(()=>()=>q(),[]);const se=V=>{const{userSelectionRect:re,transform:oe,resetSelectedElements:_e}=_.getState();if(!D.current||!re)return;const{x:ye,y:ke}=oi(V.nativeEvent,D.current);$.current={x:ye,y:ke};const Me=bl({x:re.startX,y:re.startY},oe);if(!U.current){const Ue=t?0:a;if(Math.hypot(ye-Me.x,ke-Me.y)<=Ue)return;_e(),l==null||l(V)}U.current=!0,K.current||(Y(),K.current=!0),I(ye,ke)},de=V=>{var re,oe;if(!j){V.target===T.current&&_.getState().connection.inProgress&&(G.current=!0);return}V.button===0&&((oe=(re=V.target)==null?void 0:re.releasePointerCapture)==null||oe.call(re,V.pointerId),!x&&V.target===T.current&&_.getState().userSelectionRect&&(W==null||W(V)),_.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(u==null||u(V),_.setState({nodesSelectionActive:B.current.size>0})),q())},fe=V=>{var re,oe;(oe=(re=V.target)==null?void 0:re.releasePointerCapture)==null||oe.call(re,V.pointerId),q()},te=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:Bn(["react-flow__pane",{draggable:te,dragging:k,selection:e}]),onClick:j?void 0:y1(W,T),onContextMenu:y1(Z,T),onWheel:y1(ee,T),onPointerEnter:j?void 0:g,onPointerMove:j?se:y,onPointerUp:de,onPointerCancel:j?fe:void 0,onPointerDownCapture:j?L:void 0,onClickCapture:j?z:void 0,onPointerLeave:C,ref:T,style:tf,children:[w,f.jsx(kZ,{})]})}function Hg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:c,nodeLookup:l,onError:u}=t.getState(),h=l.get(e);if(!h){u==null||u("012",ui.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&c)&&(a({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function bC({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:c}){const l=gn(),[u,h]=O.useState(!1),m=O.useRef();return O.useEffect(()=>{m.current=hK({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Hg({id:d,store:l,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),O.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:c}),()=>{var d;(d=m.current)==null||d.destroy()}},[n,r,t,a,e,i,c]),u}const NZ=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function _C(){const e=gn();return O.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:c,onError:l,updateNodePositions:u,nodeLookup:h,nodeOrigin:m}=e.getState(),d=new Map,g=NZ(c),y=i?a[0]:5,C=i?a[1]:5,w=n.direction.x*y*n.factor,b=n.direction.y*C*n.factor;for(const[,_]of h){if(!g(_))continue;let x={x:_.internals.positionAbsolute.x+w,y:_.internals.positionAbsolute.y+b};i&&(x=ku(x,a));const{position:S,positionAbsolute:k}=F9({nodeId:_.id,nextPosition:x,nodeLookup:h,nodeExtent:r,nodeOrigin:m,onError:l});_.position=S,_.internals.positionAbsolute=k,d.set(_.id,_)}u(d)},[])}const $2=O.createContext(null),TZ=$2.Provider;$2.Consumer;const xC=()=>O.useContext($2),MZ=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),SC=O.createContext(null);function jZ({children:e}){const t=Lt(MZ,pn);return f.jsx(SC.Provider,{value:t,children:e})}function DZ(){const e=O.useContext(SC);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const RZ={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},LZ=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:c}=r,{fromHandle:l,toHandle:u,isValid:h}=c;if(!l&&!i)return RZ;const m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===vl.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:m&&h}};function OZ({type:e="source",position:t=Xe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:c,onConnect:l,children:u,className:h,onMouseDown:m,onTouchStart:d,...g},y){var K,W;const C=c||null,w=e==="target",b=gn(),_=xC(),{connectOnClick:x,noPanClassName:S,rfId:k}=DZ(),{connectingFrom:N,connectingTo:A,clickConnecting:j,isPossibleEndHandle:T,connectionInProcess:D,clickConnectionInProcess:B,valid:F}=Lt(LZ(_,C,e),pn);_||(W=(K=b.getState()).onError)==null||W.call(K,"010",ui.error010());const G=Z=>{const{defaultEdgeOptions:ee,onConnect:z,hasDefaultEdges:L}=b.getState(),I={...ee,...Z};if(L){const{edges:Y,setEdges:q,onError:se}=b.getState();q(dZ(I,Y,{onError:se}))}z==null||z(I),l==null||l(I)},U=Z=>{if(!_)return;const ee=X9(Z.nativeEvent);if(i&&(ee&&Z.button===0||!ee)){const z=b.getState();Ig.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:w,handleId:C,nodeId:_,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:(...L)=>{var I,Y;return(Y=(I=b.getState()).onConnectEnd)==null?void 0:Y.call(I,...L)},updateConnection:z.updateConnection,onConnect:G,isValidConnection:n||((...L)=>{var I,Y;return((Y=(I=b.getState()).isValidConnection)==null?void 0:Y.call(I,...L))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}ee?m==null||m(Z):d==null||d(Z)},$=Z=>{const{onClickConnectStart:ee,onClickConnectEnd:z,connectionClickStartHandle:L,connectionMode:I,isValidConnection:Y,lib:q,rfId:se,nodeLookup:de,connection:fe}=b.getState();if(!_||!L&&!i)return;if(!L){ee==null||ee(Z.nativeEvent,{nodeId:_,handleId:C,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:_,type:e,id:C}});return}const te=W9(Z.target),V=n||Y,{connection:re,isValid:oe}=Ig.isValid(Z.nativeEvent,{handle:{nodeId:_,id:C,type:e},connectionMode:I,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:V,flowId:se,doc:te,lib:q,nodeLookup:de});oe&&re&&G(re);const _e=structuredClone(fe);delete _e.inProgress,_e.toPosition=_e.toHandle?_e.toHandle.position:null,z==null||z(Z,_e),b.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":C,"data-nodeid":_,"data-handlepos":t,"data-id":`${k}-${_}-${C}-${e}`,className:Bn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,h,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:j,connectingfrom:N,connectingto:A,valid:F,connectionindicator:r&&(!D||T)&&(D||B?a:i)}]),onMouseDown:U,onTouchStart:U,onClick:x?$:void 0,ref:y,...g,children:u})}const ha=O.memo(vC(OZ));function BZ({data:e,isConnectable:t,sourcePosition:n=Xe.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(ha,{type:"source",position:n,isConnectable:t})]})}function zZ({data:e,isConnectable:t,targetPosition:n=Xe.Top,sourcePosition:r=Xe.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(ha,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,f.jsx(ha,{type:"source",position:r,isConnectable:t})]})}function IZ(){return null}function HZ({data:e,isConnectable:t,targetPosition:n=Xe.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(ha,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const nd={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Dx={input:BZ,default:zZ,output:HZ,group:IZ};function FZ(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const PZ=e=>{const{width:t,height:n,x:r,y:i}=Cu(e.nodeLookup,{filter:a=>!!a.selected});return{width:ai(t)?t:null,height:ai(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function $Z({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=gn(),{width:i,height:a,transformString:c,userSelectionActive:l}=Lt(PZ,pn),u=_C(),h=O.useRef(null);O.useEffect(()=>{var y;n||(y=h.current)==null||y.focus({preventScroll:!0})},[n]);const m=!l&&i!==null&&a!==null;if(bC({nodeRef:h,disabled:!m}),!m)return null;const d=e?y=>{const C=r.getState().nodes.filter(w=>w.selected);e(y,C)}:void 0,g=y=>{Object.prototype.hasOwnProperty.call(nd,y.key)&&(y.preventDefault(),u({direction:nd[y.key],factor:y.shiftKey?4:1}))};return f.jsx("div",{className:Bn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c},children:f.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const Rx=typeof window<"u"?window:void 0,UZ=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function wC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:c,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:h,selectionOnDrag:m,selectionMode:d,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:C,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:_,zoomOnScroll:x,zoomOnPinch:S,panOnScroll:k,panOnScrollSpeed:N,panOnScrollMode:A,zoomOnDoubleClick:j,panOnDrag:T,autoPanOnSelection:D,defaultViewport:B,translateExtent:F,minZoom:G,maxZoom:U,preventScrolling:$,onSelectionContextMenu:K,noWheelClassName:W,noPanClassName:Z,disableKeyboardA11y:ee,onViewportChange:z,isControlledViewport:L}){const{nodesSelectionActive:I,userSelectionActive:Y}=Lt(UZ,pn),q=ou(h,{target:Rx}),se=ou(w,{target:Rx}),de=se||T,fe=se||k,te=m&&de!==!0,V=q||Y||te;return _Z({deleteKeyCode:u,multiSelectionKeyCode:C}),f.jsx(wZ,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:x,zoomOnPinch:S,panOnScroll:fe,panOnScrollSpeed:N,panOnScrollMode:A,zoomOnDoubleClick:j,panOnDrag:!q&&de,defaultViewport:B,translateExtent:F,minZoom:G,maxZoom:U,zoomActivationKeyCode:b,preventScrolling:$,noWheelClassName:W,noPanClassName:Z,onViewportChange:z,isControlledViewport:L,paneClickDistance:l,selectionOnDrag:te,children:f.jsxs(AZ,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:c,panOnDrag:de,autoPanOnSelection:D,isSelecting:!!V,selectionMode:d,selectionKeyPressed:q,paneClickDistance:l,selectionOnDrag:te,children:[e,I&&f.jsx($Z,{onSelectionContextMenu:K,noPanClassName:Z,disableKeyboardA11y:ee})]})})}wC.displayName="FlowRenderer";const qZ=O.memo(wC),GZ=e=>t=>e?D2(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function VZ(e){return Lt(O.useCallback(GZ(e),[e]),pn)}const WZ=e=>e.updateNodeInternals;function YZ(){const e=Lt(WZ),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function XZ({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=gn(),a=O.useRef(null),c=O.useRef(null),l=O.useRef(e.sourcePosition),u=O.useRef(e.targetPosition),h=O.useRef(t),m=n&&!!e.internals.handleBounds;return O.useEffect(()=>{a.current&&!e.hidden&&(!m||c.current!==a.current)&&(c.current&&(r==null||r.unobserve(c.current)),r==null||r.observe(a.current),c.current=a.current)},[m,e.hidden]),O.useEffect(()=>()=>{c.current&&(r==null||r.unobserve(c.current),c.current=null)},[]),O.useEffect(()=>{if(a.current){const d=h.current!==t,g=l.current!==e.sourcePosition,y=u.current!==e.targetPosition;(d||g||y)&&(h.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function KZ({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:c,nodesDraggable:l,elementsSelectable:u,nodesConnectable:h,nodesFocusable:m,resizeObserver:d,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:C,rfId:w,nodeTypes:b,nodeClickDistance:_,onError:x}){const{node:S,internals:k,isParent:N}=Lt(V=>{const re=V.nodeLookup.get(e),oe=V.parentLookup.has(e);return{node:re,internals:re.internals,isParent:oe}},pn);let A=S.type||"default",j=(b==null?void 0:b[A])||Dx[A];j===void 0&&(x==null||x("003",ui.error003(A)),A="default",j=(b==null?void 0:b.default)||Dx.default);const T=!!(S.draggable||l&&typeof S.draggable>"u"),D=!!(S.selectable||u&&typeof S.selectable>"u"),B=!!(S.connectable||h&&typeof S.connectable>"u"),F=!!(S.focusable||m&&typeof S.focusable>"u"),G=gn(),U=G9(S),$=XZ({node:S,nodeType:A,hasDimensions:U,resizeObserver:d}),K=bC({nodeRef:$,disabled:S.hidden||!T,noDragClassName:g,handleSelector:S.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:_}),W=_C();if(S.hidden)return null;const Z=Ss(S),ee=FZ(S),z=D||T||t||n||r||i,L=n?V=>n(V,{...k.userNode}):void 0,I=r?V=>r(V,{...k.userNode}):void 0,Y=i?V=>i(V,{...k.userNode}):void 0,q=a?V=>a(V,{...k.userNode}):void 0,se=c?V=>c(V,{...k.userNode}):void 0,de=V=>{const{selectNodesOnDrag:re,nodeDragThreshold:oe}=G.getState();D&&(!re||!T||oe>0)&&Hg({id:e,store:G,nodeRef:$}),t&&t(V,{...k.userNode})},fe=V=>{if(!(Y9(V.nativeEvent)||C)){if(O9.includes(V.key)&&D){const re=V.key==="Escape";Hg({id:e,store:G,unselect:re,nodeRef:$})}else if(T&&S.selected&&Object.prototype.hasOwnProperty.call(nd,V.key)){V.preventDefault();const{ariaLabelConfig:re}=G.getState();G.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),W({direction:nd[V.key],factor:V.shiftKey?4:1})}}},te=()=>{var Me;if(C||!((Me=$.current)!=null&&Me.matches(":focus-visible")))return;const{transform:V,width:re,height:oe,autoPanOnNodeFocus:_e,setCenter:ye}=G.getState();if(!_e)return;D2(new Map([[e,S]]),{x:0,y:0,width:re,height:oe},V,!0).length>0||ye(S.position.x+Z.width/2,S.position.y+Z.height/2,{zoom:V[2]})};return f.jsx("div",{className:Bn(["react-flow__node",`react-flow__node-${A}`,{[y]:T},S.className,{selected:S.selected,selectable:D,parent:N,draggable:T,dragging:K}]),ref:$,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:U?"visible":"hidden",...S.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:I,onMouseLeave:Y,onContextMenu:q,onClick:de,onDoubleClick:se,onKeyDown:F?fe:void 0,tabIndex:F?0:void 0,onFocus:F?te:void 0,role:S.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${fC}-${w}`,"aria-label":S.ariaLabel,...S.domAttributes,children:f.jsx(TZ,{value:e,children:f.jsx(j,{id:e,data:S.data,type:A,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:S.selected??!1,selectable:D,draggable:T,deletable:S.deletable??!0,isConnectable:B,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:K,dragHandle:S.dragHandle,zIndex:k.z,parentId:S.parentId,...Z})})})}var ZZ=O.memo(KZ);const QZ=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function CC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Lt(QZ,pn),c=VZ(e.onlyRenderVisibleElements),l=YZ();return f.jsx("div",{className:"react-flow__nodes",style:tf,children:c.map(u=>f.jsx(ZZ,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}CC.displayName="NodeRenderer";const JZ=O.memo(CC);function eQ(e){return Lt(O.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),c=n.nodeLookup.get(i.target);a&&c&&VX({sourceNode:a,targetNode:c,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),pn)}const tQ=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},nQ=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Lx={[J0.Arrow]:tQ,[J0.ArrowClosed]:nQ};function rQ(e){const t=gn();return O.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(Lx,e)?Lx[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",ui.error009(e)),null)},[e])}const iQ=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:c,orient:l="auto-start-reverse"})=>{const u=rQ(t);return u?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:f.jsx(u,{color:n,strokeWidth:c})}):null},kC=({defaultColor:e,rfId:t})=>{const n=Lt(a=>a.edges),r=Lt(a=>a.defaultEdgeOptions),i=O.useMemo(()=>eK(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:i.map(a=>f.jsx(iQ,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};kC.displayName="MarkerDefinitions";var sQ=O.memo(kC);function EC({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:c=[2,4],labelBgBorderRadius:l=2,children:u,className:h,...m}){const[d,g]=O.useState({x:1,y:0,width:0,height:0}),y=Bn(["react-flow__edge-textwrapper",h]),C=O.useRef(null);return O.useEffect(()=>{if(C.current){const w=C.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?f.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:y,visibility:d.width?"visible":"hidden",...m,children:[i&&f.jsx("rect",{width:d.width+2*c[0],x:-c[0],y:-c[1],height:d.height+2*c[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:C,style:r,children:n}),u]}):null}EC.displayName="EdgeText";const aQ=O.memo(EC);function nf({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:h=20,...m}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...m,d:e,fill:"none",className:Bn(["react-flow__edge-path",m.className])}),h?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,r&&ai(t)&&ai(n)?f.jsx(aQ,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Ox({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Xe.Left||e===Xe.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function AC({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:r,targetY:i,targetPosition:a=Xe.Top}){const[c,l]=Ox({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,h]=Ox({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,d,g,y]=K9({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:h});return[`M${e},${t} C${c},${l} ${u},${h} ${r},${i}`,m,d,g,y]}function NC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:c,targetPosition:l,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:w,markerStart:b,interactionWidth:_})=>{const[x,S,k]=AC({sourceX:n,sourceY:r,sourcePosition:c,targetX:i,targetY:a,targetPosition:l}),N=e.isInternal?void 0:t;return f.jsx(nf,{id:N,path:x,labelX:S,labelY:k,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:w,markerStart:b,interactionWidth:_})})}const oQ=NC({isInternal:!1}),TC=NC({isInternal:!0});oQ.displayName="SimpleBezierEdge";TC.displayName="SimpleBezierEdgeInternal";function MC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,sourcePosition:y=Xe.Bottom,targetPosition:C=Xe.Top,markerEnd:w,markerStart:b,pathOptions:_,interactionWidth:x})=>{const[S,k,N]=Og({sourceX:n,sourceY:r,sourcePosition:y,targetX:i,targetY:a,targetPosition:C,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset,stepPosition:_==null?void 0:_.stepPosition}),A=e.isInternal?void 0:t;return f.jsx(nf,{id:A,path:S,labelX:k,labelY:N,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:w,markerStart:b,interactionWidth:x})})}const jC=MC({isInternal:!1}),DC=MC({isInternal:!0});jC.displayName="SmoothStepEdge";DC.displayName="SmoothStepEdgeInternal";function RC(e){return O.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return f.jsx(jC,{...n,id:r,pathOptions:O.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const lQ=RC({isInternal:!1}),LC=RC({isInternal:!0});lQ.displayName="StepEdge";LC.displayName="StepEdgeInternal";function OC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:y,markerStart:C,interactionWidth:w})=>{const[b,_,x]=J9({sourceX:n,sourceY:r,targetX:i,targetY:a}),S=e.isInternal?void 0:t;return f.jsx(nf,{id:S,path:b,labelX:_,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:y,markerStart:C,interactionWidth:w})})}const cQ=OC({isInternal:!1}),BC=OC({isInternal:!0});cQ.displayName="StraightEdge";BC.displayName="StraightEdgeInternal";function zC(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:c=Xe.Bottom,targetPosition:l=Xe.Top,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:w,markerStart:b,pathOptions:_,interactionWidth:x})=>{const[S,k,N]=Z9({sourceX:n,sourceY:r,sourcePosition:c,targetX:i,targetY:a,targetPosition:l,curvature:_==null?void 0:_.curvature}),A=e.isInternal?void 0:t;return f.jsx(nf,{id:A,path:S,labelX:k,labelY:N,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:w,markerStart:b,interactionWidth:x})})}const uQ=zC({isInternal:!1}),IC=zC({isInternal:!0});uQ.displayName="BezierEdge";IC.displayName="BezierEdgeInternal";const Bx={default:IC,straight:BC,step:LC,smoothstep:DC,simplebezier:TC},zx={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},hQ=(e,t,n)=>n===Xe.Left?e-t:n===Xe.Right?e+t:e,dQ=(e,t,n)=>n===Xe.Top?e-t:n===Xe.Bottom?e+t:e,Ix="react-flow__edgeupdater";function Hx({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:c,type:l}){return f.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:c,className:Bn([Ix,`${Ix}-${l}`]),cx:hQ(t,r,e),cy:dQ(n,r,e),r,stroke:"transparent",fill:"transparent"})}function fQ({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:c,sourcePosition:l,targetPosition:u,onReconnect:h,onReconnectStart:m,onReconnectEnd:d,setReconnecting:g,setUpdateHover:y}){const C=gn(),w=(k,N)=>{if(k.button!==0)return;const{autoPanOnConnect:A,domNode:j,connectionMode:T,connectionRadius:D,lib:B,onConnectStart:F,cancelConnection:G,nodeLookup:U,rfId:$,panBy:K,updateConnection:W}=C.getState(),Z=N.type==="target",ee=(I,Y)=>{g(!1),d==null||d(I,n,N.type,Y)},z=I=>h==null?void 0:h(n,I),L=(I,Y)=>{g(!0),m==null||m(k,n,N.type),F==null||F(I,Y)};Ig.onPointerDown(k.nativeEvent,{autoPanOnConnect:A,connectionMode:T,connectionRadius:D,domNode:j,handleId:N.id,nodeId:N.nodeId,nodeLookup:U,isTarget:Z,edgeUpdaterType:N.type,lib:B,flowId:$,cancelConnection:G,panBy:K,isValidConnection:(...I)=>{var Y,q;return((q=(Y=C.getState()).isValidConnection)==null?void 0:q.call(Y,...I))??!0},onConnect:z,onConnectStart:L,onConnectEnd:(...I)=>{var Y,q;return(q=(Y=C.getState()).onConnectEnd)==null?void 0:q.call(Y,...I)},onReconnectEnd:ee,updateConnection:W,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},b=k=>w(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=k=>w(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>y(!0),S=()=>y(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(Hx,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:b,onMouseEnter:x,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&f.jsx(Hx,{position:u,centerX:a,centerY:c,radius:t,onMouseDown:_,onMouseEnter:x,onMouseOut:S,type:"target"})]})}function pQ({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:c,onMouseEnter:l,onMouseMove:u,onMouseLeave:h,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:y,rfId:C,edgeTypes:w,noPanClassName:b,onError:_,disableKeyboardA11y:x}){let S=Lt(ye=>ye.edgeLookup.get(e));const k=Lt(ye=>ye.defaultEdgeOptions);S=k?{...k,...S}:S;let N=S.type||"default",A=(w==null?void 0:w[N])||Bx[N];A===void 0&&(_==null||_("011",ui.error011(N)),N="default",A=(w==null?void 0:w.default)||Bx.default);const j=!!(S.focusable||t&&typeof S.focusable>"u"),T=typeof d<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),D=!!(S.selectable||r&&typeof S.selectable>"u"),B=O.useRef(null),[F,G]=O.useState(!1),[U,$]=O.useState(!1),K=gn(),{zIndex:W=S.zIndex,sourceX:Z,sourceY:ee,targetX:z,targetY:L,sourcePosition:I,targetPosition:Y}=Lt(O.useCallback(ye=>{const ke=ye.nodeLookup.get(S.source),Me=ye.nodeLookup.get(S.target);if(!ke||!Me)return zx;const Ue=JX({id:e,sourceNode:ke,targetNode:Me,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:ye.connectionMode,onError:_}),Fe=GX({selected:S.selected,zIndex:S.zIndex,sourceNode:ke,targetNode:Me,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode});return{...Ue||zx,zIndex:Fe}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),pn),q=O.useMemo(()=>S.markerStart?`url('#${Bg(S.markerStart,C)}')`:void 0,[S.markerStart,C]),se=O.useMemo(()=>S.markerEnd?`url('#${Bg(S.markerEnd,C)}')`:void 0,[S.markerEnd,C]);if(S.hidden||Z===null||ee===null||z===null||L===null)return null;const de=ye=>{var Fe;const{addSelectedEdges:ke,unselectNodesAndEdges:Me,multiSelectionActive:Ue}=K.getState();D&&(K.setState({nodesSelectionActive:!1}),S.selected&&Ue?(Me({nodes:[],edges:[S]}),(Fe=B.current)==null||Fe.blur()):ke([e])),i&&i(ye,S)},fe=a?ye=>{a(ye,{...S})}:void 0,te=c?ye=>{c(ye,{...S})}:void 0,V=l?ye=>{l(ye,{...S})}:void 0,re=u?ye=>{u(ye,{...S})}:void 0,oe=h?ye=>{h(ye,{...S})}:void 0,_e=ye=>{var ke;if(!x&&O9.includes(ye.key)&&D){const{unselectNodesAndEdges:Me,addSelectedEdges:Ue}=K.getState();ye.key==="Escape"?((ke=B.current)==null||ke.blur(),Me({edges:[S]})):Ue([e])}};return f.jsx("svg",{style:{zIndex:W},children:f.jsxs("g",{className:Bn(["react-flow__edge",`react-flow__edge-${N}`,S.className,b,{selected:S.selected,animated:S.animated,inactive:!D&&!i,updating:F,selectable:D}]),onClick:de,onDoubleClick:fe,onContextMenu:te,onMouseEnter:V,onMouseMove:re,onMouseLeave:oe,onKeyDown:j?_e:void 0,tabIndex:j?0:void 0,role:S.ariaRole??(j?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":j?`${pC}-${C}`:void 0,ref:B,...S.domAttributes,children:[!U&&f.jsx(A,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:D,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:Z,sourceY:ee,targetX:z,targetY:L,sourcePosition:I,targetPosition:Y,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:q,markerEnd:se,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),T&&f.jsx(fQ,{edge:S,isReconnectable:T,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:y,sourceX:Z,sourceY:ee,targetX:z,targetY:L,sourcePosition:I,targetPosition:Y,setUpdateHover:G,setReconnecting:$})]})})}var mQ=O.memo(pQ);const gQ=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function HC({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:c,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:d,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:C,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:_,elementsSelectable:x,onError:S}=Lt(gQ,pn),k=eQ(t);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(sQ,{defaultColor:e,rfId:n}),k.map(N=>f.jsx(mQ,{id:N,edgesFocusable:b,edgesReconnectable:_,elementsSelectable:x,noPanClassName:i,onReconnect:a,onContextMenu:c,onMouseEnter:l,onMouseMove:u,onMouseLeave:h,onClick:m,reconnectRadius:d,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:C,rfId:n,onError:S,edgeTypes:r,disableKeyboardA11y:w},N))]})}HC.displayName="EdgeRenderer";const vQ=O.memo(HC),yQ=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function bQ({children:e}){const t=Lt(yQ);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function _Q(e){const t=P2(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const xQ=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function SQ(e){const t=Lt(xQ),n=gn();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function wQ(e){return e.connection.inProgress?{...e.connection,to:Eu(e.connection.to,e.transform)}:{...e.connection}}function CQ(e){return wQ}function kQ(e){const t=CQ();return Lt(t,pn)}const EQ=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function AQ({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:c,isValid:l,inProgress:u}=Lt(EQ,pn);return!(a&&i&&u)?null:f.jsx("svg",{style:e,width:a,height:c,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:Bn(["react-flow__connection",I9(l)]),children:f.jsx(FC,{style:t,type:n,CustomComponent:r,isValid:l})})})}const FC=({style:e,type:t=na.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:c,fromHandle:l,fromPosition:u,to:h,toNode:m,toHandle:d,toPosition:g,pointer:y}=kQ();if(!i)return;if(n)return f.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:c,fromHandle:l,fromX:a.x,fromY:a.y,toX:h.x,toY:h.y,fromPosition:u,toPosition:g,connectionStatus:I9(r),toNode:m,toHandle:d,pointer:y});let C="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:h.x,targetY:h.y,targetPosition:g};switch(t){case na.Bezier:[C]=Z9(w);break;case na.SimpleBezier:[C]=AC(w);break;case na.Step:[C]=Og({...w,borderRadius:0});break;case na.SmoothStep:[C]=Og(w);break;default:[C]=J9(w)}return f.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:e})};FC.displayName="ConnectionLine";const NQ={};function Fx(e=NQ){O.useRef(e),gn(),O.useEffect(()=>{},[e])}function TQ(){gn(),O.useRef(!1),O.useEffect(()=>{},[])}function PC({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:c,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:y,connectionLineType:C,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:_,selectionKeyCode:x,selectionOnDrag:S,selectionMode:k,multiSelectionKeyCode:N,panActivationKeyCode:A,zoomActivationKeyCode:j,deleteKeyCode:T,onlyRenderVisibleElements:D,elementsSelectable:B,defaultViewport:F,translateExtent:G,minZoom:U,maxZoom:$,preventScrolling:K,defaultMarkerColor:W,zoomOnScroll:Z,zoomOnPinch:ee,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:I,zoomOnDoubleClick:Y,panOnDrag:q,autoPanOnSelection:se,onPaneClick:de,onPaneMouseEnter:fe,onPaneMouseMove:te,onPaneMouseLeave:V,onPaneScroll:re,onPaneContextMenu:oe,paneClickDistance:_e,nodeClickDistance:ye,onEdgeContextMenu:ke,onEdgeMouseEnter:Me,onEdgeMouseMove:Ue,onEdgeMouseLeave:Fe,reconnectRadius:Le,onReconnect:At,onReconnectStart:Dt,onReconnectEnd:Rt,noDragClassName:Ft,noWheelClassName:an,noPanClassName:wt,disableKeyboardA11y:Je,nodeExtent:pt,rfId:be,viewport:Ae,onViewportChange:He}){return Fx(e),Fx(t),TQ(),_Q(n),SQ(Ae),f.jsx(qZ,{onPaneClick:de,onPaneMouseEnter:fe,onPaneMouseMove:te,onPaneMouseLeave:V,onPaneContextMenu:oe,onPaneScroll:re,paneClickDistance:_e,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:S,selectionMode:k,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:N,panActivationKeyCode:A,zoomActivationKeyCode:j,elementsSelectable:B,zoomOnScroll:Z,zoomOnPinch:ee,zoomOnDoubleClick:Y,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:I,panOnDrag:q,autoPanOnSelection:se,defaultViewport:F,translateExtent:G,minZoom:U,maxZoom:$,onSelectionContextMenu:d,preventScrolling:K,noDragClassName:Ft,noWheelClassName:an,noPanClassName:wt,disableKeyboardA11y:Je,onViewportChange:He,isControlledViewport:!!Ae,children:f.jsxs(bQ,{children:[f.jsx(vQ,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:c,onReconnect:At,onReconnectStart:Dt,onReconnectEnd:Rt,onlyRenderVisibleElements:D,onEdgeContextMenu:ke,onEdgeMouseEnter:Me,onEdgeMouseMove:Ue,onEdgeMouseLeave:Fe,reconnectRadius:Le,defaultMarkerColor:W,noPanClassName:wt,disableKeyboardA11y:Je,rfId:be}),f.jsx(AQ,{style:w,type:C,component:b,containerStyle:_}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(JZ,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:ye,onlyRenderVisibleElements:D,noPanClassName:wt,noDragClassName:Ft,disableKeyboardA11y:Je,nodeExtent:pt,rfId:be}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}PC.displayName="GraphView";const MQ=O.memo(PC),jQ=q9(),Px=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:c,fitViewOptions:l,minZoom:u=.5,maxZoom:h=2,nodeOrigin:m,nodeExtent:d,zIndexMode:g="basic"}={})=>{const y=new Map,C=new Map,w=new Map,b=new Map,_=r??t??[],x=n??e??[],S=m??[0,0],k=d??ru;nC(w,b,_);const{nodesInitialized:N}=zg(x,y,C,{nodeOrigin:S,nodeExtent:k,zIndexMode:g});let A=[0,0,1];if(c&&i&&a){const j=Cu(y,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:T,y:D,zoom:B}=L2(j,i,a,u,h,(l==null?void 0:l.padding)??.1);A=[T,D,B]}return{rfId:"1",width:i??0,height:a??0,transform:A,nodes:x,nodesInitialized:N,nodeLookup:y,parentLookup:C,edges:_,edgeLookup:b,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:h,translateExtent:ru,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:vl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,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:c??!1,fitViewOptions:l,fitViewResolver:null,connection:{...z9},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:jQ,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:B9,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},DQ=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:c,fitViewOptions:l,minZoom:u,maxZoom:h,nodeOrigin:m,nodeExtent:d,zIndexMode:g})=>$K((y,C)=>{async function w(){const{nodeLookup:b,panZoom:_,fitViewOptions:x,fitViewResolver:S,width:k,height:N,minZoom:A,maxZoom:j}=C();_&&(await IX({nodes:b,width:k,height:N,panZoom:_,minZoom:A,maxZoom:j},x),S==null||S.resolve(!0),y({fitViewResolver:null}))}return{...Px({nodes:e,edges:t,width:i,height:a,fitView:c,fitViewOptions:l,minZoom:u,maxZoom:h,nodeOrigin:m,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:b=>{const{nodeLookup:_,parentLookup:x,nodeOrigin:S,elevateNodesOnSelect:k,fitViewQueued:N,zIndexMode:A,nodesSelectionActive:j}=C(),{nodesInitialized:T,hasSelectedNodes:D}=zg(b,_,x,{nodeOrigin:S,nodeExtent:d,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:A}),B=j&&D;N&&T?(w(),y({nodes:b,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):y({nodes:b,nodesInitialized:T,nodesSelectionActive:B})},setEdges:b=>{const{connectionLookup:_,edgeLookup:x}=C();nC(_,x,b),y({edges:b})},setDefaultNodesAndEdges:(b,_)=>{if(b){const{setNodes:x}=C();x(b),y({hasDefaultNodes:!0})}if(_){const{setEdges:x}=C();x(_),y({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:_,nodeLookup:x,parentLookup:S,domNode:k,nodeOrigin:N,nodeExtent:A,debug:j,fitViewQueued:T,zIndexMode:D}=C(),{changes:B,updatedInternals:F}=oK(b,x,S,k,N,A,D);F&&(rK(x,S,{nodeOrigin:N,nodeExtent:A,zIndexMode:D}),T?(w(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(B==null?void 0:B.length)>0&&(j&&console.log("React Flow: trigger node changes",B),_==null||_(B)))},updateNodePositions:(b,_=!1)=>{const x=[];let S=[];const{nodeLookup:k,triggerNodeChanges:N,connection:A,updateConnection:j,onNodesChangeMiddlewareMap:T}=C();for(const[D,B]of b){const F=k.get(D),G=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(B!=null&&B.position)),U={id:D,type:"position",position:G?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:_};if(F&&A.inProgress&&A.fromNode.id===F.id){const $=eo(F,A.fromHandle,Xe.Left,!0);j({...A,from:$})}G&&F.parentId&&x.push({id:D,parentId:F.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),S.push(U)}if(x.length>0){const{parentLookup:D,nodeOrigin:B}=C(),F=F2(x,k,D,B);S.push(...F)}for(const D of T.values())S=D(S);N(S)},triggerNodeChanges:b=>{const{onNodesChange:_,setNodes:x,nodes:S,hasDefaultNodes:k,debug:N}=C();if(b!=null&&b.length){if(k){const A=cZ(b,S);x(A)}N&&console.log("React Flow: trigger node changes",b),_==null||_(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:_,setEdges:x,edges:S,hasDefaultEdges:k,debug:N}=C();if(b!=null&&b.length){if(k){const A=uZ(b,S);x(A)}N&&console.log("React Flow: trigger edge changes",b),_==null||_(b)}},addSelectedNodes:b=>{const{multiSelectionActive:_,edgeLookup:x,nodeLookup:S,triggerNodeChanges:k,triggerEdgeChanges:N}=C();if(_){const A=b.map(j=>Fa(j,!0));k(A);return}k(il(S,new Set([...b]),!0)),N(il(x))},addSelectedEdges:b=>{const{multiSelectionActive:_,edgeLookup:x,nodeLookup:S,triggerNodeChanges:k,triggerEdgeChanges:N}=C();if(_){const A=b.map(j=>Fa(j,!0));N(A);return}N(il(x,new Set([...b]))),k(il(S,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:_}={})=>{const{edges:x,nodes:S,nodeLookup:k,triggerNodeChanges:N,triggerEdgeChanges:A}=C(),j=b||S,T=_||x,D=[];for(const F of j){if(!F.selected)continue;const G=k.get(F.id);G&&(G.selected=!1),D.push(Fa(F.id,!1))}const B=[];for(const F of T)F.selected&&B.push(Fa(F.id,!1));N(D),A(B)},setMinZoom:b=>{const{panZoom:_,maxZoom:x}=C();_==null||_.setScaleExtent([b,x]),y({minZoom:b})},setMaxZoom:b=>{const{panZoom:_,minZoom:x}=C();_==null||_.setScaleExtent([x,b]),y({maxZoom:b})},setTranslateExtent:b=>{var _;(_=C().panZoom)==null||_.setTranslateExtent(b),y({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:_,triggerNodeChanges:x,triggerEdgeChanges:S,elementsSelectable:k}=C();if(!k)return;const N=_.reduce((j,T)=>T.selected?[...j,Fa(T.id,!1)]:j,[]),A=b.reduce((j,T)=>T.selected?[...j,Fa(T.id,!1)]:j,[]);x(N),S(A)},setNodeExtent:b=>{const{nodes:_,nodeLookup:x,parentLookup:S,nodeOrigin:k,elevateNodesOnSelect:N,nodeExtent:A,zIndexMode:j}=C();b[0][0]===A[0][0]&&b[0][1]===A[0][1]&&b[1][0]===A[1][0]&&b[1][1]===A[1][1]||(zg(_,x,S,{nodeOrigin:k,nodeExtent:b,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:j}),y({nodeExtent:b}))},panBy:b=>{const{transform:_,width:x,height:S,panZoom:k,translateExtent:N}=C();return lK({delta:b,panZoom:k,transform:_,translateExtent:N,width:x,height:S})},setCenter:async(b,_,x)=>{const{width:S,height:k,maxZoom:N,panZoom:A}=C();if(!A)return!1;const j=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:N;return await A.setViewport({x:S/2-b*j,y:k/2-_*j,zoom:j},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{y({connection:{...z9}})},updateConnection:b=>{y({connection:b})},reset:()=>y({...Px()})}},Object.is);function RQ({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:c,initialMaxZoom:l,initialFitViewOptions:u,fitView:h,nodeOrigin:m,nodeExtent:d,zIndexMode:g,children:y}){const[C]=O.useState(()=>DQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:h,minZoom:c,maxZoom:l,fitViewOptions:u,nodeOrigin:m,nodeExtent:d,zIndexMode:g}));return f.jsx(UK,{value:C,children:f.jsx(gZ,{children:f.jsx(jZ,{children:y})})})}function LQ({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:c,fitView:l,fitViewOptions:u,minZoom:h,maxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:y}){return O.useContext(Jd)?f.jsx(f.Fragment,{children:e}):f.jsx(RQ,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:c,fitView:l,initialFitViewOptions:u,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:y,children:e})}const OQ={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function BQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:c,onNodeClick:l,onEdgeClick:u,onInit:h,onMove:m,onMoveStart:d,onMoveEnd:g,onConnect:y,onConnectStart:C,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:_,onNodeMouseEnter:x,onNodeMouseMove:S,onNodeMouseLeave:k,onNodeContextMenu:N,onNodeDoubleClick:A,onNodeDragStart:j,onNodeDrag:T,onNodeDragStop:D,onNodesDelete:B,onEdgesDelete:F,onDelete:G,onSelectionChange:U,onSelectionDragStart:$,onSelectionDrag:K,onSelectionDragStop:W,onSelectionContextMenu:Z,onSelectionStart:ee,onSelectionEnd:z,onBeforeDelete:L,connectionMode:I,connectionLineType:Y=na.Bezier,connectionLineStyle:q,connectionLineComponent:se,connectionLineContainerStyle:de,deleteKeyCode:fe="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:V=!1,selectionMode:re=iu.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:_e=au()?"Meta":"Control",zoomActivationKeyCode:ye=au()?"Meta":"Control",snapToGrid:ke,snapGrid:Me,onlyRenderVisibleElements:Ue=!1,selectNodesOnDrag:Fe,nodesDraggable:Le,autoPanOnNodeFocus:At,nodesConnectable:Dt,nodesFocusable:Rt,nodeOrigin:Ft=mC,edgesFocusable:an,edgesReconnectable:wt,elementsSelectable:Je=!0,defaultViewport:pt=nZ,minZoom:be=.5,maxZoom:Ae=2,translateExtent:He=ru,preventScrolling:Ke=!0,nodeExtent:rt,defaultMarkerColor:Pt="#b1b1b7",zoomOnScroll:ot=!0,zoomOnPinch:Pe=!0,panOnScroll:et=!1,panOnScrollSpeed:_t=.5,panOnScrollMode:ct=Va.Free,zoomOnDoubleClick:on=!0,panOnDrag:$n=!0,onPaneClick:hn,onPaneMouseEnter:bn,onPaneMouseMove:xt,onPaneMouseLeave:_n,onPaneScroll:zt,onPaneContextMenu:Pr,paneClickDistance:zn=1,nodeClickDistance:fi=0,children:ws,onReconnect:xr,onReconnectStart:An,onReconnectEnd:or,onEdgeContextMenu:Ii,onEdgeDoubleClick:me,onEdgeMouseEnter:ze,onEdgeMouseMove:qe,onEdgeMouseLeave:lt,reconnectRadius:mt=10,onNodesChange:xn,onEdgesChange:Qt,noDragClassName:Jt="nodrag",noWheelClassName:In="nowheel",noPanClassName:lr="nopan",fitView:Cs,fitViewOptions:lo,connectOnClick:ma,attributionPosition:ga,proOptions:pi,defaultEdgeOptions:Hi,elevateNodesOnSelect:mi=!0,elevateEdgesOnSelect:gi=!1,disableKeyboardA11y:vi=!1,autoPanOnConnect:yi,autoPanOnNodeDrag:sn,autoPanOnSelection:Fi=!0,autoPanSpeed:ks,connectionRadius:ei,isValidConnection:Sr,onError:co,style:uo,id:Es,nodeDragThreshold:ho,connectionDragThreshold:Pi,viewport:$i,onViewportChange:cr,width:Gn,height:le,colorMode:Ee="light",debug:Oe,onScroll:Ie,ariaLabelConfig:Ze,zIndexMode:ut="basic",...Bt},Yt){const Kn=Es||"1",As=aZ(Ee),bi=O.useCallback(Dl=>{Dl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ie==null||Ie(Dl)},[Ie]);return f.jsx("div",{"data-testid":"rf__wrapper",...Bt,onScroll:bi,style:{...uo,...OQ},ref:Yt,className:Bn(["react-flow",i,As]),id:Es,role:"application",children:f.jsxs(LQ,{nodes:e,edges:t,width:Gn,height:le,fitView:Cs,fitViewOptions:lo,minZoom:be,maxZoom:Ae,nodeOrigin:Ft,nodeExtent:rt,zIndexMode:ut,children:[f.jsx(sZ,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:C,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:_,nodesDraggable:Le,autoPanOnNodeFocus:At,nodesConnectable:Dt,nodesFocusable:Rt,edgesFocusable:an,edgesReconnectable:wt,elementsSelectable:Je,elevateNodesOnSelect:mi,elevateEdgesOnSelect:gi,minZoom:be,maxZoom:Ae,nodeExtent:rt,onNodesChange:xn,onEdgesChange:Qt,snapToGrid:ke,snapGrid:Me,connectionMode:I,translateExtent:He,connectOnClick:ma,defaultEdgeOptions:Hi,fitView:Cs,fitViewOptions:lo,onNodesDelete:B,onEdgesDelete:F,onDelete:G,onNodeDragStart:j,onNodeDrag:T,onNodeDragStop:D,onSelectionDrag:K,onSelectionDragStart:$,onSelectionDragStop:W,onMove:m,onMoveStart:d,onMoveEnd:g,noPanClassName:lr,nodeOrigin:Ft,rfId:Kn,autoPanOnConnect:yi,autoPanOnNodeDrag:sn,autoPanSpeed:ks,onError:co,connectionRadius:ei,isValidConnection:Sr,selectNodesOnDrag:Fe,nodeDragThreshold:ho,connectionDragThreshold:Pi,onBeforeDelete:L,debug:Oe,ariaLabelConfig:Ze,zIndexMode:ut}),f.jsx(MQ,{onInit:h,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:x,onNodeMouseMove:S,onNodeMouseLeave:k,onNodeContextMenu:N,onNodeDoubleClick:A,nodeTypes:a,edgeTypes:c,connectionLineType:Y,connectionLineStyle:q,connectionLineComponent:se,connectionLineContainerStyle:de,selectionKeyCode:te,selectionOnDrag:V,selectionMode:re,deleteKeyCode:fe,multiSelectionKeyCode:_e,panActivationKeyCode:oe,zoomActivationKeyCode:ye,onlyRenderVisibleElements:Ue,defaultViewport:pt,translateExtent:He,minZoom:be,maxZoom:Ae,preventScrolling:Ke,zoomOnScroll:ot,zoomOnPinch:Pe,zoomOnDoubleClick:on,panOnScroll:et,panOnScrollSpeed:_t,panOnScrollMode:ct,panOnDrag:$n,autoPanOnSelection:Fi,onPaneClick:hn,onPaneMouseEnter:bn,onPaneMouseMove:xt,onPaneMouseLeave:_n,onPaneScroll:zt,onPaneContextMenu:Pr,paneClickDistance:zn,nodeClickDistance:fi,onSelectionContextMenu:Z,onSelectionStart:ee,onSelectionEnd:z,onReconnect:xr,onReconnectStart:An,onReconnectEnd:or,onEdgeContextMenu:Ii,onEdgeDoubleClick:me,onEdgeMouseEnter:ze,onEdgeMouseMove:qe,onEdgeMouseLeave:lt,reconnectRadius:mt,defaultMarkerColor:Pt,noDragClassName:Jt,noWheelClassName:In,noPanClassName:lr,rfId:Kn,disableKeyboardA11y:vi,nodeExtent:rt,viewport:$i,onViewportChange:cr}),f.jsx(tZ,{onSelectionChange:U}),ws,f.jsx(KK,{proOptions:pi,position:ga}),f.jsx(XK,{rfId:Kn,disableKeyboardA11y:vi})]})})}var zQ=vC(BQ);function IQ({dimensions:e,lineWidth:t,variant:n,className:r}){return f.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Bn(["react-flow__background-pattern",n,r])})}function HQ({radius:e,className:t}){return f.jsx("circle",{cx:e,cy:e,r:e,className:Bn(["react-flow__background-pattern","dots",t])})}var hs;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(hs||(hs={}));const FQ={[hs.Dots]:1,[hs.Lines]:1,[hs.Cross]:6},PQ=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $C({id:e,variant:t=hs.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:c,bgColor:l,style:u,className:h,patternClassName:m}){const d=O.useRef(null),{transform:g,patternId:y}=Lt(PQ,pn),C=r||FQ[t],w=t===hs.Dots,b=t===hs.Cross,_=Array.isArray(n)?n:[n,n],x=[_[0]*g[2]||1,_[1]*g[2]||1],S=C*g[2],k=Array.isArray(a)?a:[a,a],N=b?[S,S]:x,A=[k[0]*g[2]||1+N[0]/2,k[1]*g[2]||1+N[1]/2],j=`${y}${e||""}`;return f.jsxs("svg",{className:Bn(["react-flow__background",h]),style:{...u,...tf,"--xy-background-color-props":l,"--xy-background-pattern-color-props":c},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:j,x:g[0]%x[0],y:g[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:w?f.jsx(HQ,{radius:S/2,className:m}):f.jsx(IQ,{dimensions:N,lineWidth:i,variant:t,className:m})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}$C.displayName="Background";const $Q=O.memo($C);function UQ(){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 qQ(){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 GQ(){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 VQ(){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 WQ(){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 h0({children:e,className:t,...n}){return f.jsx("button",{type:"button",className:Bn(["react-flow__controls-button",t]),...n,children:e})}const YQ=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function UC({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:c,onFitView:l,onInteractiveChange:u,className:h,children:m,position:d="bottom-left",orientation:g="vertical","aria-label":y}){const C=gn(),{isInteractive:w,minZoomReached:b,maxZoomReached:_,ariaLabelConfig:x}=Lt(YQ,pn),{zoomIn:S,zoomOut:k,fitView:N}=P2(),A=()=>{S(),a==null||a()},j=()=>{k(),c==null||c()},T=()=>{N(i),l==null||l()},D=()=>{C.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},B=g==="horizontal"?"horizontal":"vertical";return f.jsxs(ef,{className:Bn(["react-flow__controls",B,h]),position:d,style:e,"data-testid":"rf__controls","aria-label":y??x["controls.ariaLabel"],children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(h0,{onClick:A,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:_,children:f.jsx(UQ,{})}),f.jsx(h0,{onClick:j,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:b,children:f.jsx(qQ,{})})]}),n&&f.jsx(h0,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:f.jsx(GQ,{})}),r&&f.jsx(h0,{className:"react-flow__controls-interactive",onClick:D,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:w?f.jsx(WQ,{}):f.jsx(VQ,{})}),m]})}UC.displayName="Controls";O.memo(UC);function XQ({id:e,x:t,y:n,width:r,height:i,style:a,color:c,strokeColor:l,strokeWidth:u,className:h,borderRadius:m,shapeRendering:d,selected:g,onClick:y}){const{background:C,backgroundColor:w}=a||{},b=c||C||w;return f.jsx("rect",{className:Bn(["react-flow__minimap-node",{selected:g},h]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:b,stroke:l,strokeWidth:u},shapeRendering:d,onClick:y?_=>y(_,e):void 0})}const KQ=O.memo(XQ),ZQ=e=>e.nodes.map(t=>t.id),b1=e=>e instanceof Function?e:()=>e;function QQ({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=KQ,onClick:c}){const l=Lt(ZQ,pn),u=b1(t),h=b1(e),m=b1(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:l.map(g=>f.jsx(eJ,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:c,shapeRendering:d},g))})}function JQ({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:c,NodeComponent:l,onClick:u}){const{node:h,x:m,y:d,width:g,height:y}=Lt(C=>{const w=C.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const b=w.internals.userNode,{x:_,y:x}=w.internals.positionAbsolute,{width:S,height:k}=Ss(b);return{node:b,x:_,y:x,width:S,height:k}},pn);return!h||h.hidden||!G9(h)?null:f.jsx(l,{x:m,y:d,width:g,height:y,style:h.style,selected:!!h.selected,className:r(h),color:t(h),borderRadius:i,strokeColor:n(h),strokeWidth:a,shapeRendering:c,onClick:u,id:h.id})}const eJ=O.memo(JQ);var tJ=O.memo(QQ);const nJ=200,rJ=150,iJ=e=>!e.hidden,sJ=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?$9(Cu(e.nodeLookup,{filter:iJ}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},aJ="react-flow__minimap-desc";function qC({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:c,nodeComponent:l,bgColor:u,maskColor:h,maskStrokeColor:m,maskStrokeWidth:d,position:g="bottom-right",onClick:y,onNodeClick:C,pannable:w=!1,zoomable:b=!1,ariaLabel:_,inversePan:x,zoomStep:S=1,offsetScale:k=5}){const N=gn(),A=O.useRef(null),{boundingRect:j,viewBB:T,rfId:D,panZoom:B,translateExtent:F,flowWidth:G,flowHeight:U,ariaLabelConfig:$}=Lt(sJ,pn),K=(e==null?void 0:e.width)??nJ,W=(e==null?void 0:e.height)??rJ,Z=j.width/K,ee=j.height/W,z=Math.max(Z,ee),L=z*K,I=z*W,Y=k*z,q=j.x-(L-j.width)/2-Y,se=j.y-(I-j.height)/2-Y,de=L+Y*2,fe=I+Y*2,te=`${aJ}-${D}`,V=O.useRef(0),re=O.useRef();V.current=z,O.useEffect(()=>{if(A.current&&B)return re.current=vK({domNode:A.current,panZoom:B,getTransform:()=>N.getState().transform,getViewScale:()=>V.current}),()=>{var ke;(ke=re.current)==null||ke.destroy()}},[B]),O.useEffect(()=>{var ke;(ke=re.current)==null||ke.update({translateExtent:F,width:G,height:U,inversePan:x,pannable:w,zoomStep:S,zoomable:b})},[w,b,x,S,F,G,U]);const oe=y?ke=>{var Fe;const[Me,Ue]=((Fe=re.current)==null?void 0:Fe.pointer(ke))||[0,0];y(ke,{x:Me,y:Ue})}:void 0,_e=C?O.useCallback((ke,Me)=>{const Ue=N.getState().nodeLookup.get(Me).internals.userNode;C(ke,Ue)},[]):void 0,ye=_??$["minimap.ariaLabel"];return f.jsx(ef,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*z:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:Bn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:K,height:W,viewBox:`${q} ${se} ${de} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:A,onClick:oe,children:[ye&&f.jsx("title",{id:te,children:ye}),f.jsx(tJ,{onClick:_e,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:c,nodeComponent:l}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-Y},${se-Y}h${de+Y*2}v${fe+Y*2}h${-de-Y*2}z - M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}qC.displayName="MiniMap";O.memo(qC);const oJ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,lJ={[_l.Line]:"right",[_l.Handle]:"bottom-right"};function cJ({nodeId:e,position:t,variant:n=_l.Handle,className:r,style:i=void 0,children:a,color:c,minWidth:l=10,minHeight:u=10,maxWidth:h=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:g,autoScale:y=!0,shouldResize:C,onResizeStart:w,onResize:b,onResizeEnd:_}){const x=xC(),S=typeof e=="string"?e:x,k=gn(),N=O.useRef(null),A=n===_l.Handle,j=Lt(O.useCallback(oJ(A&&y),[A,y]),pn),T=O.useRef(null),D=t??lJ[n];O.useEffect(()=>{if(!(!N.current||!S))return T.current||(T.current=MK({domNode:N.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:F,transform:G,snapGrid:U,snapToGrid:$,nodeOrigin:K,domNode:W}=k.getState();return{nodeLookup:F,transform:G,snapGrid:U,snapToGrid:$,nodeOrigin:K,paneDomNode:W}},onChange:(F,G)=>{const{triggerNodeChanges:U,nodeLookup:$,parentLookup:K,nodeOrigin:W}=k.getState(),Z=[],ee={x:F.x,y:F.y},z=$.get(S);if(z&&z.expandParent&&z.parentId){const L=z.origin??W,I=F.width??z.measured.width??0,Y=F.height??z.measured.height??0,q={id:z.id,parentId:z.parentId,rect:{width:I,height:Y,...V9({x:F.x??z.position.x,y:F.y??z.position.y},{width:I,height:Y},z.parentId,$,L)}},se=F2([q],$,K,W);Z.push(...se),ee.x=F.x?Math.max(L[0]*I,F.x):void 0,ee.y=F.y?Math.max(L[1]*Y,F.y):void 0}if(ee.x!==void 0&&ee.y!==void 0){const L={id:S,type:"position",position:{...ee}};Z.push(L)}if(F.width!==void 0&&F.height!==void 0){const I={id:S,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};Z.push(I)}for(const L of G){const I={...L,type:"position"};Z.push(I)}U(Z)},onEnd:({width:F,height:G})=>{const U={id:S,type:"dimensions",resizing:!1,dimensions:{width:F,height:G}};k.getState().triggerNodeChanges([U])}})),T.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:u,maxWidth:h,maxHeight:m},keepAspectRatio:d,resizeDirection:g,onResizeStart:w,onResize:b,onResizeEnd:_,shouldResize:C}),()=>{var F;(F=T.current)==null||F.destroy()}},[D,l,u,h,m,d,w,b,_,C]);const B=D.split("-");return f.jsx("div",{className:Bn(["react-flow__resize-control","nodrag",...B,n,r]),ref:N,style:{...i,scale:j,...c&&{[A?"backgroundColor":"borderColor"]:c}},children:a})}O.memo(cJ);const _1=380,x1=12,uJ=350,hJ=150,Fg=new EventTarget;function dJ(){Fg.dispatchEvent(new Event("move"))}function fJ(e,t){const[n,r]=O.useState(null),i=O.useRef(void 0),a=O.useRef(void 0);O.useEffect(()=>{const h=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),r(null)};return Fg.addEventListener("move",h),()=>{Fg.removeEventListener("move",h),window.clearTimeout(i.current),window.clearTimeout(a.current)}},[]),O.useEffect(()=>{r(h=>{var d;if(!h)return h;const m=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return m&&h.x===m.x&&h.y===m.y&&h.width===m.width&&h.height===m.height?h:m})},[e,t]);const c=O.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{var h;r(((h=e.current)==null?void 0:h.getBoundingClientRect())??null)},uJ)},[e]),l=O.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),hJ)},[]),u=O.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:n,onMouseEnter:c,onMouseLeave:l,keepOpen:u}}function pJ(e){const t=new Date(e),n=t.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return t.toLocaleDateString(void 0,n)}function mJ({exp:e,runs:t,latestRun:n,parentSlug:r,anchor:i,onMouseEnter:a,onMouseLeave:c}){const l=r9(),u=i.right+x1+_1<=window.innerWidth,h=i.x-x1-_1>=0,m=u?"right":h?"left":i.y>window.innerHeight/2?"above":"below",{x:d,y:g}=i9({x:i.x,y:i.y,width:i.width,height:i.height,anchor:m,distance:x1},l),[y,C]=O.useState(null),w=e.parentExperimentId&&(n!=null&&n.commitSha)?n.id:null;O.useEffect(()=>{if(C(null),!w)return;let D=!1;return yT(w).then(B=>{let F=B.diff;if(B.truncated){const K=F.lastIndexOf(` -diff --git `);F=K!==-1?F.slice(0,K+1):F.slice(0,F.lastIndexOf(` -`)+1)}let G=[];try{G=F.trim()?g8(F):[]}catch{return}if(B.truncated&&G.every(K=>K.hunks.length===0))return;let U=0,$=0;for(const K of G){const W=V8(K);U+=W.additions,$+=W.deletions}D||C({fileCount:G.length,additions:U,deletions:$,truncated:B.truncated})}).catch(()=>{}),()=>{D=!0}},[w]);const b={done:0,failed:0,cancelled:0,live:0};for(const D of t)D.status==="done"?b.done+=1:D.status==="failed"?b.failed+=1:D.status==="cancelled"?b.cancelled+=1:b.live+=1;const _=n?R0((n.endedAt??Date.now())-n.createdAt):null,x=(n==null?void 0:n.status)==="failed"&&n.resultMarkdown?n.resultMarkdown:null,S=e.description||(x?null:n==null?void 0:n.resultMarkdown)||null,k=O.useRef(null),[N,A]=O.useState(!1),[j,T]=O.useState(!1);return O.useEffect(()=>{A(!1)},[S]),O.useEffect(()=>{const D=k.current;D&&T(D.scrollHeight>D.clientHeight+1)},[S,N]),n9.createPortal(f.jsxs("div",{ref:l.ref,className:"exp-hover-card",style:{width:_1,left:d,top:g,visibility:l.offsetHeight===0?"hidden":void 0},onMouseEnter:a,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(fs,{status:(n==null?void 0:n.status)??"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),S&&f.jsx("div",{className:`hc-body${N?" expanded":""}`,ref:k,children:S}),S&&(j||N)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>A(D=>!D),children:N?"Show less":"Show more"}),x&&f.jsx("div",{className:"hc-failure",children:x}),f.jsxs("div",{className:"hc-stats",children:[f.jsxs("span",{children:[t.length===1?"1 run":`${t.length} runs`,b.done>0&&` · ${b.done} done`,b.failed>0&&` · ${b.failed} failed`,b.cancelled>0&&` · ${b.cancelled} cancelled`,b.live>0&&` · ${b.live} live`]}),n&&ad(n.backend)&&f.jsx(Jw,{backend:n.backend}),_&&f.jsx("span",{children:_}),n&&f.jsx("span",{children:gs(n.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(Sl,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:["from ",f.jsx("span",{className:"hc-mono",children:r})]})]}),y&&y.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:`Committed changes vs ${r??"parent"}${y.truncated?" (diff truncated — counts are lower bounds)":""}`,children:f.jsxs("span",{children:[y.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add",children:["+",y.additions]})," ",f.jsxs("span",{className:"diff-stat-del",children:["−",y.deletions]})," · ",y.fileCount===1&&!y.truncated?"1 file":`${y.fileCount}${y.truncated?"+":""} files`]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:["created ",pJ(e.createdAt)]})]})]}),document.body)}const gJ=264,$x=132,T0=44,vJ=72,yJ=148,bJ=44;function _J(e){const t=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),n=[];for(const a of e){const c=t.get(a.id),l=a.parentExperimentId?t.get(a.parentExperimentId):void 0;l?l.children.push(c):n.push(c)}const r=(a,c)=>a.exp.createdAt-c.exp.createdAt,i=a=>{a.children.sort(r),a.children.forEach(i)};return n.sort(r),n.forEach(i),n}function xJ(e,t){const n=new Map,r=l=>{const u=n.get(l)??1+l.children.reduce((h,m)=>h+r(m),0);return n.set(l,u),u},i=new Map,a=l=>{const u=i.get(l)??(t(l)||l.children.some(a));return i.set(l,u),u};function c(l){if(t(l)){const m=[];let d=0;for(const g of l.children)a(g)?m.push(...c(g)):d+=r(g);return d>0&&m.push({kind:"elided",id:`el-${l.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:l.exp,children:m}]}if(!a(l))return[];let u=0;const h=[];return(function m(d){u+=1;for(const g of d.children)t(g)?h.push(...c(g)):a(g)?m(g):u+=r(g)})(l),[{kind:"elided",id:`el-${l.exp.id}`,count:u,children:h}]}return e.flatMap(c)}function Pg(e){return e.kind==="exp"?gJ:yJ}function d0(e){return e.kind==="exp"?e.exp.id:e.id}function M0(e){if(e.children.length===0)return Pg(e);const t=e.children.reduce((n,r)=>n+M0(r),0)+T0*(e.children.length-1);return Math.max(Pg(e),t)}function SJ(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"?"live":"other"}const wJ=O.memo(function({data:t}){const{exp:n,latestRun:r,runs:i,isBaseline:a,parentSlug:c,githubOwner:l,githubRepo:u,onOpenView:h,onOpenCodeBranch:m}=t,d=r==null?void 0:r.status,g=d==="running"||d==="starting",y=a?"Idea":g?"Building":n.mergeParentExperimentId?"Merge":"Prototype",C=i.slice(-8),w=O.useRef(null),b=fJ(w,t);return f.jsxs("div",{ref:w,className:`exp-node ${g?"live":""}`,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,children:[f.jsx(ha,{type:"target",position:Xe.Top}),f.jsxs("div",{className:"node-eyebrow",children:[f.jsxs("span",{className:"node-eyebrow-left",children:[y,f.jsx("a",{className:"icon-btn node-gh",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:Yg(l,u,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:_=>_.stopPropagation(),children:f.jsx(o2,{size:12})})]}),f.jsxs("span",{style:{display:"inline-flex",gap:6},children:[n.verdict&&f.jsx(fs,{status:n.verdict}),f.jsx(fs,{status:d??"idle"})]})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&f.jsx("div",{className:"node-title",children:n.title||n.description}),(()=>{var S;const _=(r==null?void 0:r.metricsAggregate)??((S=[...i].reverse().find(k=>k.metricsAggregate))==null?void 0:S.metricsAggregate),x=_?Object.entries(_).filter(([,k])=>typeof k=="number"):[];return x.length?f.jsx("div",{className:"node-metrics",children:x.slice(0,5).map(([k,N])=>f.jsxs("span",{className:"node-metric",title:k,children:[f.jsx("span",{className:"node-metric-k",children:k.replace(/_align$/,"").replace(/_/g," ")}),f.jsx("span",{className:"node-metric-v",children:N.toFixed(2).replace(/\.?0+$/,"")})]},k))}):null})(),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:"Runs"}),C.length>0?f.jsx("span",{className:"run-squares",children:C.map(_=>f.jsx("span",{className:`run-sq ${SJ(_.status)}`,title:_.status},_.id))}):f.jsx("span",{children:"no runs"}),f.jsx("span",{style:{flex:1}}),r&&f.jsx("span",{children:gs(r.createdAt)})]}),f.jsxs("div",{className:"node-actions",onClick:_=>_.stopPropagation(),children:[f.jsxs("button",{className:"node-action",title:"Build & play this experiment",onClick:()=>h(n.id,"play"),children:[f.jsx(t7,{size:13}),"Play"]}),f.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>h(n.id,"changes"),children:[f.jsx(Sl,{size:13}),"Changes"]}),i.length>0&&f.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>h(n.id,"terminal"),children:[f.jsx(r7,{size:13}),"Logs"]}),f.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>m(n.branchName),children:[f.jsx(Qx,{size:13}),"Code"]})]}),f.jsx(ha,{type:"source",position:Xe.Bottom}),b.rect&&f.jsx(mJ,{exp:n,runs:i,latestRun:r,parentSlug:c,anchor:b.rect,onMouseEnter:b.keepOpen,onMouseLeave:b.onMouseLeave})]})}),CJ=O.memo(function({data:t}){const{count:n,onShowProjectScope:r}=t;return f.jsxs("div",{className:"elided-node",role:"button",tabIndex:0,title:"Switch to Project to see all experiments",onClick:r,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r())},children:[f.jsx(ha,{type:"target",position:Xe.Top}),f.jsx(Xx,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[n," ",n===1?"experiment":"experiments",f.jsx("span",{className:"elided-node-sub",children:"other agents"})]}),f.jsx(ha,{type:"source",position:Xe.Bottom})]})}),kJ={exp:wJ,elided:CJ},GC={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},EJ={...GC.style,strokeDasharray:"4 4"};function AJ({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:i,agentSessionId:a,onShowProjectScope:c}){const{nodes:l,edges:u}=O.useMemo(()=>{const h=new Map;for(const x of t){const S=h.get(x.experimentId);S?S.push(x):h.set(x.experimentId,[x])}for(const x of h.values())x.sort((S,k)=>S.createdAt-k.createdAt);const m=[],d=[],g=x=>!a||x.exp.chatSessionId===a,y=xJ(_J(e),g),C=new Map(e.map(x=>[x.id,x.slug]));function w(x,S,k){const N=S-Pg(x)/2;if(x.kind==="exp"){const T=h.get(x.exp.id)??[];m.push({id:x.exp.id,type:"exp",position:{x:N,y:k},data:{exp:x.exp,latestRun:T[T.length-1]??null,runs:T,isBaseline:!x.exp.parentExperimentId,parentSlug:x.exp.parentExperimentId?C.get(x.exp.parentExperimentId)??null:null,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:i}})}else m.push({id:x.id,type:"elided",position:{x:N,y:k+($x-bJ)/2},data:{count:x.count,onShowProjectScope:c}});if(x.children.length===0)return;const A=x.children.reduce((T,D)=>T+M0(D),0)+T0*(x.children.length-1);let j=S-A/2;for(const T of x.children){const D=M0(T),B=x.kind==="elided"||T.kind==="elided";d.push({id:`e-${d0(x)}-${d0(T)}`,source:d0(x),target:d0(T),...B?{style:EJ}:{}}),w(T,j+D/2,k+$x+vJ),j+=D+T0}}let b=0;for(const x of y){const S=M0(x);w(x,b+S/2,0),b+=S+T0}const _=new Set(m.map(x=>x.id));for(const x of e)x.mergeParentExperimentId&&_.has(x.mergeParentExperimentId)&&_.has(x.id)&&d.push({id:`m-${x.mergeParentExperimentId}-${x.id}`,source:x.mergeParentExperimentId,target:x.id,style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.45,strokeDasharray:"5 4"}});return{nodes:m,edges:d}},[e,t,r,i,n.githubOwner,n.githubRepo,a,c]);return e.length===0?f.jsxs("div",{className:"empty-state empty-state-cta",children:[f.jsx("p",{className:"empty-state-title",children:"No ideas yet"}),f.jsx("p",{className:"empty-state-hint",children:"Tell the producer in chat what kind of game you want to make — it'll capture your first idea."})]}):l.length===0&&a?f.jsxs("div",{className:"empty-state empty-state-cta",children:[f.jsx("p",{className:"empty-state-title",children:"No experiments from this agent yet"}),f.jsx("p",{className:"empty-state-hint",children:"Ask this agent to create one, or switch to Project to see all experiments."})]}):f.jsx(zQ,{nodes:l,edges:u,nodeTypes:kJ,defaultEdgeOptions:GC,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:dJ,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx($Q,{variant:hs.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const f0=(e,t)=>e.id===t.id&&e.view===t.view,p0=(e,t)=>e.path===t.path&&(e.source??"repo")===(t.source??"repo")&&e.sessionId===t.sessionId&&e.ref===t.ref,Ux=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`;function NJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function TJ(e,t,n,r,i){let a=e,c;const l=t==null?void 0:t.replace(/\/+$/,""),u=r==null?void 0:r.replace(/\/+$/,"");if(!a.startsWith("/"))c=n;else if(u&&(a===u||a.startsWith(`${u}/`))){const h=a.slice(u.length).replace(/^\/+/,"");return h?{path:h,source:"files"}:null}else if(l&&(a===l||a.startsWith(`${l}/`)))a=a.slice(l.length).replace(/^\/+/,"");else{const h=i?NJ(i):"[^/]+",m=a.match(new RegExp(`/files/${h}/(.+)$`)),d=m?null:a.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),g=m||d?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"files"};d?(c=d[1],a=d[2]):g&&(a=g[1])}return a?{path:a,sessionId:c}:null}const qx="orx:onboarded",VC="orx:panel-width",rd=360,MJ=10,jJ=232,DJ=380,RJ=jJ+56,LJ=80;function $g(){return Math.max(rd,window.innerWidth-RJ-DJ)}function OJ(){const e=$g();try{const t=Number(localStorage.getItem(VC));if(Number.isFinite(t)&&t>=rd)return Math.min(t,e)}catch{}return Math.max(rd,Math.min(760,e,Math.round(window.innerWidth*.42)))}function Tc(e,t){const n=e.findIndex(i=>i.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function BJ(){var xr,An,or,Ii;const[e,t]=O.useState(null),[n,r]=O.useState(null),[i,a]=O.useState([]),[c,l]=O.useState([]),[u,h]=O.useState(null),[m,d]=O.useState("tree"),[g,y]=O.useState("project"),[C,w]=O.useState(null),b=i.length>0&&i.every(me=>me.chatSessionId),_=C&&b?g:"project",x=O.useMemo(()=>{if(_!=="agent")return c;const me=new Set(i.filter(ze=>ze.chatSessionId===C).map(ze=>ze.id));return c.filter(ze=>me.has(ze.experimentId))},[c,i,_,C]),[S,k]=O.useState(null),[N,A]=O.useState("experiments"),[j,T]=O.useState([]),[D,B]=O.useState([]),[F,G]=O.useState([]),[U,$]=O.useState([]),[K,W]=O.useState(null),[Z,ee]=O.useState(null),[z,L]=O.useState(!0),[I,Y]=O.useState(!1),[q,se]=O.useState(OJ),[de,fe]=O.useState(!0),[te,V]=O.useState(!1),[re,oe]=O.useState("chat"),[_e,ye]=O.useState(()=>{try{return localStorage.getItem(qx)==="1"}catch{return!0}}),[ke,Me]=O.useState(!1),[Ue,Fe]=O.useState(!1),Le=O.useCallback(()=>{oe("chat"),fe(!0),L(!0),Y(!1),Fe(!0)},[]),At=O.useCallback(()=>{try{localStorage.setItem(L6,"1")}catch{}Fe(!1)},[]);O.useEffect(()=>{if(!(!n||te||!_e)){try{if(localStorage.getItem(L6)==="1")return}catch{return}Le()}},[n,te,_e,Le]);const Dt=O.useRef(n);Dt.current=n,O.useEffect(()=>{WN().then(me=>{t(me),r(ze=>{var qe;return ze??((qe=me[0])==null?void 0:qe.id)??null})}).catch(()=>t([]))},[]),O.useEffect(()=>{const me=()=>se(ze=>Math.min(ze,$g()));return window.addEventListener("resize",me),()=>window.removeEventListener("resize",me)},[]),O.useEffect(()=>{n&&(iT(n).catch(()=>{}),a([]),l([]),h(null),k(null),T([]),B([]),G([]),$([]),W(null),ee(null),A("experiments"),y("project"),aT(n).then(a).catch(()=>{}),oT(n).then(l).catch(()=>{}),P3(n).then(h).catch(()=>{}))},[n]);const Rt=O.useCallback(()=>{const me=Dt.current;me&&P3(me).then(h).catch(()=>{})},[]);AM({onRun:me=>{me.projectId===Dt.current&&l(ze=>Tc(ze,me))},onExperiment:me=>{me.projectId===Dt.current&&a(ze=>Tc(ze,me))},onProject:me=>{t(ze=>ze?Tc(ze,me):[me])},onFiles:me=>{me===Dt.current&&Rt()}});const Ft=O.useCallback(()=>y("project"),[]),an=O.useCallback((me,ze="changes")=>{const qe={id:me,view:ze};T(lt=>lt.some(mt=>f0(mt,qe))?lt:[...lt,qe]),A(qe),L(!0)},[]),wt=O.useCallback(me=>{const ze=j.findIndex(lt=>f0(lt,me));if(ze===-1)return;me.view==="play"&&o7(me.id).catch(()=>{});const qe=j.filter((lt,mt)=>mt!==ze);T(qe),typeof N=="object"&&"id"in N&&f0(N,me)&&A(qe[Math.min(ze,qe.length-1)]??"experiments")},[j,N]),Je=O.useCallback((me,ze,qe)=>{const lt=e==null?void 0:e.find(xn=>xn.id===n),mt=TJ(me,lt==null?void 0:lt.repoPath,ze,lt==null?void 0:lt.filesDir,lt==null?void 0:lt.slug);mt&&(qe&&mt.source!=="files"&&(mt.ref=qe),B(xn=>xn.some(Qt=>p0(Qt,mt))?xn:[...xn,mt]),A(mt),L(!0))},[e,n]),pt=O.useCallback(me=>{const ze=D.findIndex(lt=>p0(lt,me));if(ze===-1)return;const qe=D.filter((lt,mt)=>mt!==ze);B(qe),typeof N=="object"&&"path"in N&&p0(N,me)&&A(qe[Math.min(ze,qe.length-1)]??"experiments")},[D,N]),be=O.useCallback((me,ze,qe)=>{const lt={kind:"plan",sessionId:ze,promptId:qe,plan:me};G(mt=>{const xn=mt.findIndex(Jt=>Jt.promptId===qe);if(xn===-1)return[...mt,lt];const Qt=mt.slice();return Qt[xn]=lt,Qt}),A(lt),L(!0)},[]),Ae=O.useCallback(me=>{const ze=F.findIndex(lt=>lt.promptId===me.promptId);if(ze===-1)return;const qe=F.filter((lt,mt)=>mt!==ze);G(qe),typeof N=="object"&&"kind"in N&&N.kind==="plan"&&N.promptId===me.promptId&&A(qe[Math.min(ze,qe.length-1)]??"experiments")},[F,N]),He=O.useCallback((me,ze)=>{const qe={kind:"subagent",sessionId:me,spawnPartId:ze};$(lt=>lt.some(mt=>mt.spawnPartId===ze)?lt:[...lt,qe]),A(qe),L(!0)},[]),Ke=O.useCallback(me=>{const ze=U.findIndex(lt=>lt.spawnPartId===me.spawnPartId);if(ze===-1)return;const qe=U.filter((lt,mt)=>mt!==ze);$(qe),typeof N=="object"&&"kind"in N&&N.kind==="subagent"&&N.spawnPartId===me.spawnPartId&&A(qe[Math.min(ze,qe.length-1)]??"experiments")},[U,N]),rt=O.useCallback(me=>{const ze={code:!0,sel:me,toggled:new Set};W(qe=>qe?{...qe,sel:me}:ze),A(ze),L(!0)},[]),Pt=O.useCallback(me=>{W(ze=>ze&&{...ze,...me})},[]),ot=O.useCallback(()=>{W(null),A(me=>typeof me=="object"&&"code"in me?"experiments":me)},[]),Pe=O.useCallback(me=>{ee(ze=>ze&&ze.sessionId===me?ze:{wt:!0,sessionId:me,view:"changes",toggled:new Set}),A({wt:!0,sessionId:me,view:"changes",toggled:new Set}),L(!0)},[]),et=O.useCallback(me=>{ee(ze=>ze&&{...ze,...me})},[]),_t=O.useCallback(()=>{ee(null),A(me=>typeof me=="object"&&"wt"in me?"experiments":me)},[]);O.useEffect(()=>$c(me=>{me.type==="sessionDeleted"&&ee(ze=>!ze||ze.sessionId!==me.sessionId?ze:(A(qe=>typeof qe=="object"&&"wt"in qe?"experiments":qe),null))}),[]);const ct=me=>{me.preventDefault(),me.currentTarget.setPointerCapture(me.pointerId);const ze=document.body.style.userSelect;document.body.style.userSelect="none";const qe=mt=>{const xn=Math.round(window.innerWidth-mt.clientX-MJ),Qt=$g();if(xn>Qt+LJ){Y(!0);return}Y(!1);const Jt=Math.min(Math.max(xn,rd),Qt);se(Jt);try{localStorage.setItem(VC,String(Jt))}catch{}},lt=()=>{window.removeEventListener("pointermove",qe),window.removeEventListener("pointerup",lt),window.removeEventListener("pointercancel",lt),document.body.style.userSelect=ze};window.addEventListener("pointermove",qe),window.addEventListener("pointerup",lt),window.addEventListener("pointercancel",lt)},on=me=>{t(ze=>ze?Tc(ze,me):[me]),r(me.id),V(!1)},$n=me=>{t(ze=>ze&&ze.filter(qe=>qe.id!==me)),n===me&&r(null)},hn=typeof N=="object"&&"id"in N?N:null,bn=typeof N=="object"&&"path"in N?N:null,xt=typeof N=="object"&&"kind"in N&&N.kind==="plan"?N:null,_n=typeof N=="object"&&"kind"in N&&N.kind==="subagent"?N:null,zt=typeof N=="object"&&"code"in N,Pr=typeof N=="object"&&"wt"in N,zn=(e==null?void 0:e.find(me=>me.id===n))??null,fi=hn?i.find(me=>me.id===hn.id)??null:null;if(e===null)return f.jsx("div",{className:"app",children:f.jsx("div",{className:"empty-state",children:f.jsx("span",{className:"spinner"})})});if(e.length===0)return f.jsx("div",{className:"app",children:_e?f.jsx(R6,{projects:e,onOpen:r,onCreated:on,onDeleted:$n,openNewProject:ke,onNewProjectOpened:()=>Me(!1)}):f.jsx(BG,{onDone:()=>{try{localStorage.setItem(qx,"1")}catch{}Me(!0),ye(!0)}})});const ws=f.jsx(OG,{projectName:((xr=e.find(me=>me.id===n))==null?void 0:xr.name)??"",onHome:()=>V(!0),onCollapse:()=>fe(!1)});return f.jsxs("div",{className:"app",children:[te?f.jsx(R6,{projects:e,onOpen:me=>{r(me),V(!1)},onCreated:on,onDeleted:$n}):f.jsxs("div",{className:"app-body",children:[n&&f.jsx(BP,{projectId:n,paperId:(An=e.find(me=>me.id===n))==null?void 0:An.paperId,persona:(or=e.find(me=>me.id===n))==null?void 0:or.persona,baselineBranch:(Ii=e.find(me=>me.id===n))==null?void 0:Ii.baselineBranch,railHeader:ws,railOpen:de,onShowRail:()=>fe(!0),mainView:re,onSelectMainView:oe,panelOpen:z,onTogglePanel:()=>{z&&Y(!1),L(!z)},onOpenFile:Je,onOpenPlan:be,onOpenSubagent:He,onOpenWorktree:Pe,onStartTour:Le,onActiveSessionChange:w,children:re==="files"?(()=>{const me=e.find(ze=>ze.id===n);return me?f.jsx(gG,{project:me,files:u,onChanged:Rt,onOpenStorage:()=>oe("storage")},me.id):null})():re!=="chat"?f.jsx(dP,{tab:re,project:zn,onProjectUpdated:me=>t(ze=>ze?Tc(ze,me):[me])}):null}),re==="chat"&&z&&f.jsxs("aside",{className:`right-pane floating-panel ${I?"max":""}`,style:I?void 0:{width:q},"data-onboarding":"experiments",children:[!I&&f.jsx("div",{className:"panel-resizer",onPointerDown:ct}),f.jsxs("div",{className:"tabs",children:[f.jsxs("div",{className:"tab-strip",children:[f.jsx("button",{className:`tab ${N==="experiments"?"active":""}`,onClick:()=>A("experiments"),children:"Gallery"}),j.map(me=>{const ze=i.find(qe=>qe.id===me.id);return f.jsx(Yo,{active:hn!==null&&f0(hn,me),label:ze?ze.title||ze.slug:"…",icon:me.view==="terminal"?f.jsx(r7,{size:12,style:{flexShrink:0}}):me.view==="play"?f.jsx(t7,{size:12,style:{flexShrink:0}}):f.jsx(Sl,{size:12,style:{flexShrink:0}}),onSelect:()=>A(me),onClose:()=>wt(me)},`${me.id}:${me.view}`)}),D.map(me=>f.jsx(Yo,{active:bn!==null&&p0(bn,me),label:me.path.split("/").pop()||me.path,icon:f.jsx(Kx,{size:12,style:{flexShrink:0}}),onSelect:()=>A(me),onClose:()=>pt(me)},`file:${Ux(me)}`)),F.map(me=>f.jsx(Yo,{active:xt!==null&&xt.promptId===me.promptId,label:"Plan",icon:f.jsx(n7,{size:12,style:{flexShrink:0}}),onSelect:()=>A(me),onClose:()=>Ae(me)},`plan:${me.promptId}`)),U.map(me=>f.jsx(Yo,{active:_n!==null&&_n.spawnPartId===me.spawnPartId,label:"Sub-agent",icon:f.jsx(i7,{size:12,style:{flexShrink:0}}),onSelect:()=>A(me),onClose:()=>Ke(me)},`subagent:${me.spawnPartId}`)),K&&f.jsx(Yo,{active:zt,label:"Code",icon:f.jsx(Qx,{size:12,style:{flexShrink:0}}),onSelect:()=>A(K),onClose:ot},"code"),Z&&f.jsx(Yo,{active:Pr,label:"Worktree",icon:f.jsx(qg,{size:12,style:{flexShrink:0}}),onSelect:()=>A(Z),onClose:_t},"worktree")]}),f.jsxs("div",{className:"panel-controls",children:[f.jsx("button",{className:"icon-btn",title:I?"Restore panel":"Expand panel","aria-label":I?"Restore panel":"Expand panel",onClick:()=>Y(me=>!me),children:I?f.jsx(vN,{size:14}):f.jsx(mN,{size:14})}),f.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{L(!1),Y(!1)},children:f.jsx(ll,{size:14})})]})]}),N==="experiments"?f.jsxs("div",{className:"tab-body",children:[f.jsxs("div",{className:"pane-toolbar",children:[b&&f.jsxs("div",{className:"seg",children:[f.jsx("button",{className:_==="agent"?"active":"",disabled:!C,title:C?void 0:"Open a chat session to filter to its experiments",onClick:()=>y("agent"),children:"Agent"}),f.jsx("button",{className:_==="project"?"active":"",onClick:()=>y("project"),children:"Project"})]}),f.jsx("span",{style:{flex:1}}),f.jsxs("div",{className:"seg",children:[f.jsx("button",{className:m==="tree"?"active":"",onClick:()=>d("tree"),children:"Tree"}),f.jsx("button",{className:m==="table"?"active":"",onClick:()=>d("table"),children:"Table"})]})]}),f.jsx("div",{className:"pane-content",children:m==="tree"?zn&&f.jsx(AJ,{experiments:i,runs:x,project:zn,onOpenView:an,onOpenCodeBranch:rt,agentSessionId:_==="agent"?C:null,onShowProjectScope:Ft}):f.jsx(YG,{runs:x,emptyHint:_==="agent"&&c.length>0?"No runs from this agent's experiments yet. Switch to Project to see all runs.":void 0,experiments:i,onOpen:me=>{k(me.id),an(me.experimentId,"terminal")},onOpenChanges:me=>an(me,"changes"),onCancel:me=>void a7(me).catch(()=>{})})})]}):bn?f.jsx("div",{className:"tab-body",children:n&&f.jsx(LG,{projectId:n,path:bn.path,source:bn.source,sessionId:bn.sessionId,gitRef:bn.ref,onOpenFile:Je},Ux(bn))}):xt?f.jsx("div",{className:"tab-body",children:f.jsx("div",{className:"pane-content plan-tab-content",children:f.jsx(Xa,{text:xt.plan,onOpenFile:me=>Je(me,xt.sessionId)})})}):_n?f.jsx(zP,{sessionId:_n.sessionId,spawnPartId:_n.spawnPartId,onOpenFile:me=>Je(me,_n.sessionId),onOpenSubagent:me=>He(_n.sessionId,me)},_n.spawnPartId):zt?f.jsx("div",{className:"tab-body",children:n&&zn&&K&&f.jsx(HP,{projectId:n,project:zn,experiments:i,sel:K.sel,toggled:K.toggled,onSelChange:me=>Pt({sel:me}),onToggledChange:me=>Pt({toggled:me}),onOpenFile:Je},"code")}):Pr?f.jsx("div",{className:"tab-body",children:n&&Z&&f.jsx(tG,{sessionId:Z.sessionId,projectId:n,view:Z.view,toggled:Z.toggled,onViewChange:me=>et({view:me}),onToggledChange:me=>et({toggled:me}),onOpenFile:Je},`wt:${Z.sessionId}`)}):f.jsx("div",{className:"tab-body",children:hn&&fi&&zn&&f.jsx(NG,{experiment:fi,project:zn,view:hn.view,runs:c,selectedRunId:S,onSelectRun:k,mergeParent:fi.mergeParentExperimentId?(i==null?void 0:i.find(me=>me.id===fi.mergeParentExperimentId))??null:null},`${hn.id}:${hn.view}`)})]})]}),Ue&&!te&&n&&f.jsx(QG,{onClose:At})]})}dF();uA.createRoot(document.getElementById("root")).render(f.jsx(O.StrictMode,{children:f.jsx(BJ,{})}));export{t7 as P,Qe as c,f as j,O as r}; diff --git a/ui/dist/index.html b/ui/dist/index.html index a8942cc7c..0ae9a7355 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -9,8 +9,8 @@ html { background: #ffffff; } @media (prefers-color-scheme: dark) { html { background: #0e0c0c; } } - - + +
diff --git a/ui/package.json b/ui/package.json index 2fa185b9f..62286149b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -26,10 +26,13 @@ "three": "^0.185.1" }, "devDependencies": { + "@tailwindcss/vite": "4.3.3", "@types/react": "^19.1.0", "@types/react-dom": "^19.1.0", "@types/three": "^0.185.4", "@vitejs/plugin-react": "^4.5.0", + "playwright": "1.58.0", + "tailwindcss": "4.3.3", "typescript": "^5.8.3", "vite": "^6.3.5" } diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 227f85d33..8b9a00cad 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -54,6 +54,9 @@ importers: specifier: ^0.185.1 version: 0.185.1 devDependencies: + '@tailwindcss/vite': + specifier: 4.3.3 + version: 4.3.3(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0)) '@types/react': specifier: ^19.1.0 version: 19.2.17 @@ -65,13 +68,19 @@ importers: version: 0.185.4 '@vitejs/plugin-react': specifier: ^4.5.0 - version: 4.7.0(vite@6.4.3) + version: 4.7.0(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0)) + playwright: + specifier: 1.58.0 + version: 1.58.0 + tailwindcss: + specifier: 4.3.3 + version: 4.3.3 typescript: specifier: ^5.8.3 version: 5.9.3 vite: specifier: ^6.3.5 - version: 6.4.3 + version: 6.4.3(jiti@2.7.0)(lightningcss@1.32.0) packages: @@ -479,6 +488,100 @@ packages: peerDependencies: three: '>=0.180.0' + '@tailwindcss/node@4.3.3': + resolution: {integrity: sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==} + + '@tailwindcss/oxide-android-arm64@4.3.3': + resolution: {integrity: sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [android] + + '@tailwindcss/oxide-darwin-arm64@4.3.3': + resolution: {integrity: sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [darwin] + + '@tailwindcss/oxide-darwin-x64@4.3.3': + resolution: {integrity: sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==} + engines: {node: '>= 20'} + cpu: [x64] + os: [darwin] + + '@tailwindcss/oxide-freebsd-x64@4.3.3': + resolution: {integrity: sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==} + engines: {node: '>= 20'} + cpu: [x64] + os: [freebsd] + + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.3': + resolution: {integrity: sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==} + engines: {node: '>= 20'} + cpu: [arm] + os: [linux] + + '@tailwindcss/oxide-linux-arm64-gnu@4.3.3': + resolution: {integrity: sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@tailwindcss/oxide-linux-arm64-musl@4.3.3': + resolution: {integrity: sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@tailwindcss/oxide-linux-x64-gnu@4.3.3': + resolution: {integrity: sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@tailwindcss/oxide-linux-x64-musl@4.3.3': + resolution: {integrity: sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@tailwindcss/oxide-wasm32-wasi@4.3.3': + resolution: {integrity: sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + bundledDependencies: + - '@napi-rs/wasm-runtime' + - '@emnapi/core' + - '@emnapi/runtime' + - '@tybys/wasm-util' + - '@emnapi/wasi-threads' + - tslib + + '@tailwindcss/oxide-win32-arm64-msvc@4.3.3': + resolution: {integrity: sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [win32] + + '@tailwindcss/oxide-win32-x64-msvc@4.3.3': + resolution: {integrity: sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==} + engines: {node: '>= 20'} + cpu: [x64] + os: [win32] + + '@tailwindcss/oxide@4.3.3': + resolution: {integrity: sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==} + engines: {node: '>= 20'} + + '@tailwindcss/vite@4.3.3': + resolution: {integrity: sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw==} + peerDependencies: + vite: ^5.2.0 || ^6 || ^7 || ^8 + '@tweenjs/tween.js@23.1.3': resolution: {integrity: sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==} @@ -696,6 +799,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} @@ -705,6 +812,10 @@ packages: electron-to-chromium@1.5.387: resolution: {integrity: sha512-TaxwufTFDufvPEoXdhwVrA3UdFWBeWGkYoJ1K8ldF1xe6gKfth6iRNS5lTQ5JPNOHdGQm8PT1QYKUqFLCiUefQ==} + enhanced-resolve@5.24.5: + resolution: {integrity: sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==} + engines: {node: '>=10.13.0'} + entities@6.0.1: resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} @@ -740,6 +851,11 @@ packages: fflate@0.8.3: resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -752,6 +868,9 @@ packages: gitdiff-parser@0.3.1: resolution: {integrity: sha512-YQJnY8aew65id8okGxKCksH3efDCJ9HzV7M9rsvd65habf39Pkh4cgYJ27AaoDMqo1X98pgNJhNMrm/kpV7UVQ==} + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + hast-util-from-dom@5.0.1: resolution: {integrity: sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q==} @@ -804,6 +923,10 @@ packages: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} + jiti@2.7.0: + resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} + hasBin: true + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -821,6 +944,80 @@ packages: resolution: {integrity: sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==} hasBin: true + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + lodash@4.18.1: resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} @@ -839,6 +1036,9 @@ packages: peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + markdown-table@3.0.4: resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} @@ -1005,6 +1205,16 @@ packages: resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} engines: {node: '>=12'} + playwright-core@1.58.0: + resolution: {integrity: sha512-aaoB1RWrdNi3//rOeKuMiS65UCcgOVljU46At6eFcOFPFHWtd2weHRRow6z/n+Lec0Lvu0k9ZPKJSjPugikirw==} + engines: {node: '>=18'} + hasBin: true + + playwright@1.58.0: + resolution: {integrity: sha512-2SVA0sbPktiIY/MCOPX8e86ehA/e+tDNq+e5Y8qjKYti2Z/JG7xnronT/TXTIkKbYGWlCbuucZ6dziEgkoEjQQ==} + engines: {node: '>=18'} + hasBin: true + postcss@8.5.16: resolution: {integrity: sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==} engines: {node: ^10 || ^12 || >=14} @@ -1088,6 +1298,13 @@ packages: style-to-object@1.0.14: resolution: {integrity: sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==} + tailwindcss@4.3.3: + resolution: {integrity: sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==} + + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} + engines: {node: '>=6'} + three@0.185.1: resolution: {integrity: sha512-5aojFCXKwnjBRZvUnt3WFfEcvUJgkN5LlijRFN95hMy8WVkG4I0QNcJE+OuWvuJ0bOdStrbfXn0pkd6/QyiAlg==} @@ -1512,6 +1729,74 @@ snapshots: fflate: 0.8.3 three: 0.185.1 + '@tailwindcss/node@4.3.3': + dependencies: + '@jridgewell/remapping': 2.3.5 + enhanced-resolve: 5.24.5 + jiti: 2.7.0 + lightningcss: 1.32.0 + magic-string: 0.30.21 + source-map-js: 1.2.1 + tailwindcss: 4.3.3 + + '@tailwindcss/oxide-android-arm64@4.3.3': + optional: true + + '@tailwindcss/oxide-darwin-arm64@4.3.3': + optional: true + + '@tailwindcss/oxide-darwin-x64@4.3.3': + optional: true + + '@tailwindcss/oxide-freebsd-x64@4.3.3': + optional: true + + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.3': + optional: true + + '@tailwindcss/oxide-linux-arm64-gnu@4.3.3': + optional: true + + '@tailwindcss/oxide-linux-arm64-musl@4.3.3': + optional: true + + '@tailwindcss/oxide-linux-x64-gnu@4.3.3': + optional: true + + '@tailwindcss/oxide-linux-x64-musl@4.3.3': + optional: true + + '@tailwindcss/oxide-wasm32-wasi@4.3.3': + optional: true + + '@tailwindcss/oxide-win32-arm64-msvc@4.3.3': + optional: true + + '@tailwindcss/oxide-win32-x64-msvc@4.3.3': + optional: true + + '@tailwindcss/oxide@4.3.3': + optionalDependencies: + '@tailwindcss/oxide-android-arm64': 4.3.3 + '@tailwindcss/oxide-darwin-arm64': 4.3.3 + '@tailwindcss/oxide-darwin-x64': 4.3.3 + '@tailwindcss/oxide-freebsd-x64': 4.3.3 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.3 + '@tailwindcss/oxide-linux-arm64-gnu': 4.3.3 + '@tailwindcss/oxide-linux-arm64-musl': 4.3.3 + '@tailwindcss/oxide-linux-x64-gnu': 4.3.3 + '@tailwindcss/oxide-linux-x64-musl': 4.3.3 + '@tailwindcss/oxide-wasm32-wasi': 4.3.3 + '@tailwindcss/oxide-win32-arm64-msvc': 4.3.3 + '@tailwindcss/oxide-win32-x64-msvc': 4.3.3 + + '@tailwindcss/vite@4.3.3(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0))': + dependencies: + '@tailwindcss/node': 4.3.3 + '@tailwindcss/oxide': 4.3.3 + tailwindcss: 4.3.3 + vite: 6.4.3(jiti@2.7.0)(lightningcss@1.32.0) + '@tweenjs/tween.js@23.1.3': {} '@types/babel__core@7.20.5': @@ -1607,7 +1892,7 @@ snapshots: '@ungap/structured-clone@1.3.2': {} - '@vitejs/plugin-react@4.7.0(vite@6.4.3)': + '@vitejs/plugin-react@4.7.0(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0))': dependencies: '@babel/core': 7.29.7 '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/core@7.29.7) @@ -1615,7 +1900,7 @@ snapshots: '@rolldown/pluginutils': 1.0.0-beta.27 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 6.4.3 + vite: 6.4.3(jiti@2.7.0)(lightningcss@1.32.0) transitivePeerDependencies: - supports-color @@ -1732,6 +2017,8 @@ snapshots: dequal@2.0.3: {} + detect-libc@2.1.2: {} + devlop@1.1.0: dependencies: dequal: 2.0.3 @@ -1740,6 +2027,11 @@ snapshots: electron-to-chromium@1.5.387: {} + enhanced-resolve@5.24.5: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.3 + entities@6.0.1: {} esbuild@0.25.12: @@ -1785,6 +2077,9 @@ snapshots: fflate@0.8.3: {} + fsevents@2.3.2: + optional: true + fsevents@2.3.3: optional: true @@ -1792,6 +2087,8 @@ snapshots: gitdiff-parser@0.3.1: {} + graceful-fs@4.2.11: {} + hast-util-from-dom@5.0.1: dependencies: '@types/hast': 3.0.4 @@ -1889,6 +2186,8 @@ snapshots: is-plain-obj@4.1.0: {} + jiti@2.7.0: {} + js-tokens@4.0.0: {} jsesc@3.1.0: {} @@ -1899,6 +2198,55 @@ snapshots: dependencies: commander: 8.3.0 + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + lodash@4.18.1: {} longest-streak@3.1.0: {} @@ -1915,6 +2263,10 @@ snapshots: dependencies: react: 19.2.7 + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + markdown-table@3.0.4: {} mdast-util-find-and-replace@3.0.2: @@ -2309,6 +2661,14 @@ snapshots: picomatch@4.0.5: {} + playwright-core@1.58.0: {} + + playwright@1.58.0: + dependencies: + playwright-core: 1.58.0 + optionalDependencies: + fsevents: 2.3.2 + postcss@8.5.16: dependencies: nanoid: 3.3.15 @@ -2468,6 +2828,10 @@ snapshots: dependencies: inline-style-parser: 0.2.7 + tailwindcss@4.3.3: {} + + tapable@2.3.3: {} + three@0.185.1: {} tinyglobby@0.2.17: @@ -2549,7 +2913,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite@6.4.3: + vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0): dependencies: esbuild: 0.25.12 fdir: 6.5.0(picomatch@4.0.5) @@ -2559,6 +2923,8 @@ snapshots: tinyglobby: 0.2.17 optionalDependencies: fsevents: 2.3.3 + jiti: 2.7.0 + lightningcss: 1.32.0 warning@4.0.3: dependencies: diff --git a/ui/scripts/screenshots.mjs b/ui/scripts/screenshots.mjs new file mode 100644 index 000000000..13c7ce00d --- /dev/null +++ b/ui/scripts/screenshots.mjs @@ -0,0 +1,259 @@ +// Visual baseline for the Tailwind port (docs/harness-and-upstream-review.md §5). +// +// The port converts ~6k lines of hand-written CSS into utility classes, and that +// class of migration fails SILENTLY: an invalid or forgotten utility emits +// nothing, so `tsc` and `vite build` both pass on a screen that renders wrong. +// Typechecking is not verification here — comparing pixels is. +// +// Driven by scripts/screenshots.sh, which boots the server against a frozen +// snapshot of the data dir so the same screens render the same way every run. +// +// scripts/screenshots.sh --snapshot (once) freeze the fixture +// scripts/screenshots.sh tier2 after a tier's changes +// scripts/screenshots.sh --compare tier1 tier2 +// +// Each label is a full capture; compare consecutive ones. The label for the last +// verified state is the reference for the next tier — there is no permanent +// "baseline", because the screen list grows as coverage does and a stale label +// with fewer screens compares as a pile of MISSING rather than a real signal. +// +// Add a screen by adding an entry to SCREENS, not by editing the driver. Steps +// run in order against one page and accumulate, so each entry starts wherever +// the previous one finished. + +import { chromium } from "playwright"; +import { mkdir, readdir, readFile } from "node:fs/promises"; +import { createHash } from "node:crypto"; +import path from "node:path"; + +const URL_BASE = process.env.ORX_SCREENSHOT_URL ?? "http://127.0.0.1:3399"; +const VIEWPORT = { width: 1440, height: 900 }; +const OUT_ROOT = new URL("../.screenshots/", import.meta.url).pathname; + +/** Settle time after an interaction. The dashboard streams over SSE, so + * `networkidle` never fires — every wait here is explicit and deliberately + * generous; a flaky screenshot is worse than a slow one. */ +const SETTLE = 1100; + +/** Kill anything that differs run to run. Without this the spinners and shimmer + * keyframes alone make every diff dirty. Re-applied after each navigation + * because React remounts blow the injected tag away. */ +const FREEZE = `*, *::before, *::after { + animation: none !important; + transition: none !important; + caret-color: transparent !important; +}`; + +const click = (name) => async (p) => { + const b = p.getByRole("button", { name, exact: false }).first(); + if ((await b.count()) === 0) return false; + await b.click(); + await p.waitForTimeout(SETTLE); + return true; +}; + +/** For controls whose accessible name isn't what you'd guess. The back-to-grid + * button is titled "All projects" but its *content* is the project name, and + * content wins for the accessible name — so getByRole finds nothing. */ +const clickSelector = (selector) => async (p) => { + const el = p.locator(selector).first(); + if ((await el.count()) === 0) return false; + await el.click(); + await p.waitForTimeout(SETTLE * 2); + return true; +}; + +/** For affordances that aren't buttons — the project cards on the home grid. */ +const clickText = (text) => async (p) => { + const t = p.getByText(text, { exact: false }).first(); + if ((await t.count()) === 0) return false; + await t.click(); + await p.waitForTimeout(SETTLE * 2); + return true; +}; + +/** Run steps in order, for a screen that needs to undo the previous one first. */ +const seq = (...steps) => async (p) => { + for (const step of steps) if ((await step(p)) === false) return false; + return true; +}; + +/** Move the pointer somewhere harmless. The hover card lingers otherwise and + * lands in whatever screen is captured next. */ +const unhover = () => async (p) => { + await p.mouse.move(5, 5); + await p.waitForTimeout(SETTLE); + return true; +}; + +const hover = (selector) => async (p) => { + const el = p.locator(selector).first(); + if ((await el.count()) === 0) return false; + await el.hover(); + await p.waitForTimeout(SETTLE); + return true; +}; + +/** Wait for the things that finish *after* the DOM settles and would otherwise + * land on one run and not the next: webfonts, and any image/media the chat and + * gallery panes fetch lazily. This is what makes the transcript screens + * reproducible rather than merely usually-the-same. */ +async function quiesce(page) { + await page.evaluate(async () => { + await document.fonts?.ready; + await Promise.all( + [...document.images] + .filter((i) => !i.complete) + .map((i) => new Promise((r) => { + i.addEventListener("load", r, { once: true }); + i.addEventListener("error", r, { once: true }); + })), + ); + }).catch(() => {}); + await page.waitForTimeout(SETTLE); +} + +/** Project in the fixture whose tree is worth photographing. */ +const TREE_PROJECT = process.env.ORX_SCREENSHOT_TREE_PROJECT ?? "Gambit Arena Mobile"; + +const SETTINGS_TABS = [ + "Appearance", "Persona", "Harnesses", "Generative AI", + "Compute", "Instances", "Environment", "Git", "Storage", +]; + +// `advisory: true` marks a screen that will not reproduce byte-for-byte. What's +// left after pinning the clock is the three that render async media — the +// gallery's video posters, and the tree/hover card's react-flow layout, which +// settles differently depending on what painted first. They are still worth +// capturing — you look at them after a tier — but they cannot be an automated +// gate, so `--compare` reports them separately rather than failing every run and +// training you to skim red output. +const SCREENS = [ + { name: "project-chat", advisory: true, steps: async () => {} }, + { name: "panel-gallery", advisory: true, steps: click("Gallery") }, + { name: "panel-worktree", advisory: true, steps: click("Worktree") }, + // The experiment tree, reached by backing out to the project grid and opening + // one that actually has experiments — the fixture's landing project has none, + // which is why the tree had no pixel coverage until now. + // + // Order is load-bearing twice over. These come BEFORE settings, because "All + // projects" only exists on the project view. And they come before `files`, + // because the left-rail selection is sticky across projects: clicking Files + // first means the newly opened project lands on its (empty) Files tab and the + // tree never renders — which is exactly how the first attempt produced an + // empty Files screenshot named "experiments-tree". + { name: "projects-home", steps: clickSelector('button[title="All projects"]') }, + // The New Project form had no coverage at all, which is why converting it was + // the riskiest work in the port for the least benefit. Covered now. + { name: "new-project", steps: click("New project") }, + // Advisory, like every screen with the chat pane or async media on it. These + // were gated twice on the strength of two runs and then three, and drifted + // both times: the flake rate is low, not zero, and no number of sample runs + // short of many proves otherwise. The gate is now only the screens that have + // never moved — settings, files, the project grid, the new-project form and + // the runs table — which is enough, because those are what the port edits. + { name: "experiments-tree", advisory: true, steps: seq(click("Cancel"), clickText(TREE_PROJECT)) }, + { name: "exp-hover-card", advisory: true, steps: hover(".exp-node") }, + { name: "experiments-table", advisory: true, steps: seq(unhover(), click("Table")) }, + + { name: "files", steps: click("Files") }, + { name: "skills", steps: click("Skills") }, + { name: "settings", steps: click("Settings") }, + ...SETTINGS_TABS.map((tab) => ({ + name: `settings-${tab.toLowerCase().replace(/\s+/g, "-")}`, + steps: click(tab), + })), +]; + +async function capture(label) { + const outDir = path.join(OUT_ROOT, label); + await mkdir(outDir, { recursive: true }); + + const browser = await chromium.launch({ channel: "chrome" }); + const page = await browser.newPage({ viewport: VIEWPORT }); + // The fixture is frozen but the wall clock isn't, and half these screens + // render relative times ("created 15d ago"). Without pinning "now" they drift + // by themselves overnight and every comparison starts lying. + await page.clock.setFixedTime(new Date("2026-08-14T12:00:00Z")).catch(() => {}); + await page.goto(URL_BASE, { waitUntil: "load" }); + await page.waitForTimeout(2500); + + let shot = 0, skipped = 0; + for (const screen of SCREENS) { + if ((await screen.steps(page)) === false) { + console.log(` skip ${screen.name} (entry point not on screen)`); + skipped++; + continue; + } + await quiesce(page); + await page.addStyleTag({ content: FREEZE }).catch(() => {}); + await page.screenshot({ + path: path.join(outDir, `${screen.name}.png`), + // Video posters and WebGL canvases decode/paint at their own pace, so their + // pixels are never reproducible. Masking keeps the surrounding layout — + // which is the part the port can break — under comparison. + mask: [page.locator("video"), page.locator("canvas")], + maskColor: "#ff00ff", + }); + console.log(` shot ${screen.name}`); + shot++; + } + + await browser.close(); + console.log(`\n${shot} screens -> ui/.screenshots/${label}/${skipped ? ` (${skipped} skipped)` : ""}`); + if (skipped) process.exitCode = 1; +} + +/** Hash-compare two label dirs. Deliberately not a pixel differ: a changed hash + * is the signal to open both PNGs and look. A percentage-difference number + * still needs a human to judge, so it would only add a dependency. */ +async function compare(a, b) { + const dirs = [path.join(OUT_ROOT, a), path.join(OUT_ROOT, b)]; + const hash = async (f) => + createHash("sha256").update(await readFile(f)).digest("hex").slice(0, 12); + const [filesA, filesB] = await Promise.all( + dirs.map(async (d) => new Set((await readdir(d)).filter((f) => f.endsWith(".png")))), + ); + + const advisory = new Set(SCREENS.filter((s) => s.advisory).map((s) => `${s.name}.png`)); + let changed = 0, advisoryChanged = 0; + + for (const f of [...new Set([...filesA, ...filesB])].sort()) { + const isAdvisory = advisory.has(f); + const flag = (label) => { + if (isAdvisory) { advisoryChanged++; console.log(` ${label}~ ${f} (advisory — inspect, don't gate)`); } + else { changed++; console.log(` ${label} ${f}`); } + }; + if (!filesA.has(f)) { flag("ADDED "); continue; } + if (!filesB.has(f)) { flag("MISSING"); continue; } + const [ha, hb] = await Promise.all([hash(path.join(dirs[0], f)), hash(path.join(dirs[1], f))]); + if (ha === hb) console.log(` same ${f}`); + else if (isAdvisory) { advisoryChanged++; console.log(` differs~ ${f} (advisory — inspect, don't gate)`); } + else { changed++; console.log(` CHANGED ${f} ${a}=${ha} ${b}=${hb}`); } + } + + const tail = advisoryChanged ? ` (${advisoryChanged} advisory screen(s) also moved — eyeball those)` : ""; + console.log(changed === 0 + ? `\nno gated screen changed: ${a} == ${b}${tail}` + : `\n${changed} gated screen(s) differ — open both PNGs side by side before calling the port clean${tail}`); + process.exitCode = changed === 0 ? 0 : 1; +} + +// Not covered yet: the experiment tree and runs table. Their Tree/Table segmented +// control lives in a pane that isn't open on this fixture's landing view, so +// clicking it captured the chat screen under a tree-shaped name — a baseline that +// lies about its coverage is worse than one that admits a gap. Worth wiring up +// before Tier 2 touches TreeView; it needs an entry point that opens that pane. + +const [cmd, ...rest] = process.argv.slice(2); +if (cmd === "--compare") { + if (rest.length !== 2) { + console.error("usage: screenshots.mjs --compare "); + process.exit(2); + } + await compare(rest[0], rest[1]); +} else { + const label = cmd ?? "baseline"; + console.log(`capturing "${label}" from ${URL_BASE}`); + await capture(label); +} diff --git a/ui/src/App.tsx b/ui/src/App.tsx index fb0f17380..2071e26a2 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -28,8 +28,10 @@ import { import { ChatPanel } from "./components/ChatPanel"; import { SubagentTab } from "./components/SubagentTab"; import { CodeTab } from "./components/CodeTab"; +import type { CodeBrowserView } from "./components/CodeBrowserHeader"; import { WorktreeTab, type WorktreeView } from "./components/WorktreeTab"; import { FilesTab } from "./components/FilesTab"; +import { SkillsTab } from "./components/SkillsTab"; import { ClosableTab } from "./components/ClosableTab"; import { DetailDrawer, type ExperimentView } from "./components/DetailDrawer"; import { FileViewer } from "./components/FileViewer"; @@ -108,6 +110,8 @@ interface CodeTabDef { code: true; /** Source to browse: "" = the project clone, else a branch name. */ sel: string; + /** Changes/Files, owned here so it survives the tab being fronted. */ + view: CodeBrowserView; /** Dirs the user flipped away from their depth default. */ toggled: ReadonlySet; } @@ -280,7 +284,7 @@ export default function App() { const [homeOpen, setHomeOpen] = useState(false); // What the middle pane shows: the agent chat, the project's files, or // one settings section (picked from the rail nav — no separate pages). - const [mainView, setMainView] = useState<"chat" | "files" | SettingsTab>("chat"); + const [mainView, setMainView] = useState<"chat" | "files" | "skills" | SettingsTab>("chat"); const [onboarded, setOnboarded] = useState(() => { try { return localStorage.getItem(ONBOARDED_KEY) === "1"; @@ -526,7 +530,7 @@ export default function App() { // Functional updater + no deps: a stable identity, so the TreeView cards // that receive this don't re-layout on every unrelated tab change. const openCodeTabForBranch = useCallback((branch: string) => { - const opened: CodeTabDef = { code: true, sel: branch, toggled: new Set() }; + const opened: CodeTabDef = { code: true, sel: branch, view: "files", toggled: new Set() }; setCodeTab((prev) => (prev ? { ...prev, sel: branch } : opened)); // rightTab only discriminates on the `code` flag — the pane body always // renders the live `codeTab` state, so this value's other fields are @@ -744,7 +748,9 @@ export default function App() { onStartTour={startTour} onActiveSessionChange={setActiveSessionId} > - {mainView === "files" ? ( + {mainView === "skills" ? ( + p.id === projectId) ?? null} /> + ) : mainView === "files" ? ( (() => { const project = projects.find((p) => p.id === projectId); return project ? ( @@ -947,7 +953,7 @@ export default function App() { openExperimentTab(run.experimentId, "terminal"); }} onOpenChanges={(experimentId) => openExperimentTab(experimentId, "changes")} - onCancel={(runId) => void cancelRun(runId).catch(() => {})} + onCancel={cancelRun} /> )} @@ -989,17 +995,24 @@ export default function App() { ) : codeTabActive ? (
{projectId && activeProject && codeTab && ( - updateCodeTab({ sel })} - onToggledChange={(toggled) => updateCodeTab({ toggled })} - onOpenFile={openFileTab} - /> + (() => { + // Our tab is branch-scoped; upstream's CodeTab is + // experiment-scoped, so resolve the branch to its experiment. + const codeExp = experiments.find((e) => e.branchName === codeTab.sel); + return codeExp ? ( + updateCodeTab({ view })} + onToggledChange={(toggled) => updateCodeTab({ toggled })} + onOpenFile={openFileTab} + /> + ) : null; + })() )}
) : worktreeTabActive ? ( @@ -1010,7 +1023,7 @@ export default function App() { // subscription, and request-id guard must not carry over. key={`wt:${worktreeTab.sessionId}`} sessionId={worktreeTab.sessionId} - projectId={projectId} + project={activeProject!} view={worktreeTab.view} toggled={worktreeTab.toggled} onViewChange={(view) => updateWorktreeTab({ view })} diff --git a/ui/src/api.ts b/ui/src/api.ts index c8278b759..57f41ad80 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -59,6 +59,7 @@ export interface Experiment { } export type RunStatus = "starting" | "running" | "done" | "failed" | "cancelled"; +export type RunDisplayStatus = RunStatus | "cancelling"; /** What kind of evaluation a run is (see the Phase 1 spec). */ export type RunKind = "job" | "play" | "sim" | "verify" | "ladder"; @@ -90,6 +91,12 @@ export interface Run { * "alive" = its heartbeat is fresh; "lost" = it stopped beating * (reboot, kill) and the status can no longer update on its own. */ watcher?: "alive" | "lost"; + cancelRequested: boolean; +} + +export function runDisplayStatus(run: Pick): RunDisplayStatus { + const live = run.status === "running" || run.status === "starting"; + return live && run.cancelRequested ? "cancelling" : run.status; } async function json(res: Response): Promise { @@ -164,6 +171,11 @@ export type LocalRepoInfo = export const inspectLocalRepo = (path: string) => get(`/api/local-repo?path=${encodeURIComponent(path)}`); +/** Open the OS folder chooser; resolves to null if the user cancelled. Only + * meaningful when the dashboard runs on the same machine as the browser. */ +export const pickProjectFolder = () => + post<{ path: string | null }>("/api/project-path/pick").then((r) => r.path); + export const createProject = (body: NewProject) => post<{ project: Project }>("/api/projects", body).then((r) => r.project); @@ -355,7 +367,8 @@ export const startRun = ( } = {}, ) => post<{ run: Run }>(`/api/experiments/${experimentId}/run`, body).then((r) => r.run); -export const cancelRun = (runId: string) => post<{ ok: boolean }>(`/api/runs/${runId}/cancel`); +export const cancelRun = (runId: string) => + post<{ ok: boolean }>(`/api/runs/${runId}/cancel`).then(() => undefined); // --- verdicts, metrics, artifacts, play builds (game-design experiments) ---- @@ -435,6 +448,11 @@ export interface DiffPayload { byteLimit: number; } +export const getRunDiff = (runId: string) => get(`/api/runs/${runId}/diff`); + +export const getExperimentDiff = (experimentId: string) => + get(`/api/experiments/${experimentId}/diff`); + export interface CommitInfo { sha: string; subject: string; @@ -448,7 +466,6 @@ export interface WorkingTree { truncated: boolean; } -export const getRunDiff = (runId: string) => get(`/api/runs/${runId}/diff`); export const listExperimentCommits = (experimentId: string) => get<{ commits: CommitInfo[] }>(`/api/experiments/${experimentId}/commits`).then( @@ -1157,6 +1174,11 @@ export const harnessModelLabel = (m: HarnessModel) => m.displayName ?? modelLabe export interface OptionChoice { id: string; label: string; + /** Optional explanatory line under the label. Upstream's picker renders it; + * nothing populates it on either side yet (their `with_description` has no + * callers), so it stays optional here rather than becoming a Rust field + * nothing fills. */ + description?: string; } /** @@ -1287,9 +1309,70 @@ export interface SkillInfo { name: string; description: string; argHint: string; + /** "builtin" = bundled catalog; "user" = uploaded via the Skills tab. */ + source?: "builtin" | "user"; } -export const getSkills = () => get<{ skills: SkillInfo[] }>("/api/skills").then((r) => r.skills); +export const getSkills = (projectId?: string) => + get<{ skills: SkillInfo[] }>( + `/api/skills${projectId ? `?project=${encodeURIComponent(projectId)}` : ""}`, + ).then((r) => r.skills); + +/** Where an uploaded skill applies. */ +export type SkillScope = "global" | "project"; + +/** A user-uploaded agent skill (a SKILL.md folder), managed in the Skills tab. */ +export interface UserSkill { + name: string; + description: string; + scope: SkillScope; + bytes: number; + updatedAt: number; +} + +/** Global skills plus (when a project is given) that project's own. */ +export const listUserSkills = (projectId?: string) => + get<{ skills: UserSkill[] }>( + `/api/user-skills${projectId ? `?project=${encodeURIComponent(projectId)}` : ""}`, + ).then((r) => r.skills); + +/** Upload a SKILL.md file or a .zip of a skill folder. `contentBase64` is the + * raw file bytes; `filename`'s extension selects single-file vs archive. */ +export const uploadUserSkill = (req: { + scope: SkillScope; + projectId?: string; + filename: string; + contentBase64: string; +}) => post<{ skill: UserSkill }>("/api/user-skills", req).then((r) => r.skill); + +export const deleteUserSkill = (req: { scope: SkillScope; name: string; projectId?: string }) => { + const params = new URLSearchParams({ scope: req.scope, name: req.name }); + if (req.projectId) params.set("project", req.projectId); + return fetch(`/api/user-skills?${params.toString()}`, { method: "DELETE" }).then((r) => + json<{ ok: boolean }>(r), + ); +}; + +/** A skill already installed in one of the user's coding agents, importable + * into the managed store. */ +export interface HarnessSkill { + harnessId: string; + harnessName: string; + name: string; + description: string; +} + +/** Skills found in every installed harness's global skills dir. */ +export const listHarnessSkills = () => + get<{ skills: HarnessSkill[] }>("/api/harness-skills").then((r) => r.skills); + +/** Copy a harness skill into the managed store at the given scope. */ +export const importHarnessSkill = (req: { + harness: string; + name: string; + scope: SkillScope; + projectId?: string; +}) => post<{ skill: UserSkill }>("/api/user-skills/import", req).then((r) => r.skill); /** "openai/gpt-5.5" → "GPT 5.5", "anthropic/claude-opus-4-8" → "Opus 4.8". */ export function modelLabel(id: string): string { @@ -1442,10 +1525,22 @@ export const renameChatSession = (sessionId: string, title: string) => (r) => r.session, ); +/** A message the user sent while a turn was running, parked to run next. */ +export interface QueuedMessage { + id: string; + text: string; +} + export const getChatMessages = (sessionId: string) => - get<{ messages: ChatMessage[] }>(`/api/chat/sessions/${sessionId}/messages`).then( - (r) => r.messages, - ); + get<{ messages: ChatMessage[]; queued?: QueuedMessage[] }>( + `/api/chat/sessions/${sessionId}/messages`, + ).then((r) => ({ messages: r.messages, queued: r.queued ?? [] })); + +/** Cancel a still-parked message (the ✕ on a queued chip). */ +export const cancelQueuedMessage = (sessionId: string, itemId: string) => + fetch(`/api/chat/sessions/${sessionId}/queue/${encodeURIComponent(itemId)}`, { + method: "DELETE", + }).then((r) => json<{ ok: boolean; removed: boolean }>(r)); /** Pasted image riding a chat message. */ export interface ChatImageAttachment { diff --git a/ui/src/components/BackendLogos.tsx b/ui/src/components/BackendLogos.tsx index 5e0a0e148..f86b8ab9b 100644 --- a/ui/src/components/BackendLogos.tsx +++ b/ui/src/components/BackendLogos.tsx @@ -8,6 +8,7 @@ import { Boxes, Laptop, Server } from "lucide-react"; import { backendDetail, backendKind, type Run } from "../api"; +import { MONO_CLASS_NAME } from "../styleClasses"; /** Human name for a backend kind, used as the logo's alt/label. */ function backendName(kind: string): string { @@ -41,11 +42,11 @@ function HuggingFaceLogo({ size = 16 }: { size?: number }) { ); } @@ -100,7 +101,7 @@ function ModalLogo({ size = 16 }: { size?: number }) { function KubernetesLogo({ size = 16 }: { size?: number }) { return ( ); } @@ -110,7 +111,7 @@ function KubernetesLogo({ size = 16 }: { size?: number }) { function RayLogo({ size = 16 }: { size?: number }) { return ( ); } @@ -126,13 +127,19 @@ function OpenResearchLogo({ size = 16 }: { size?: number }) { ); } +// Ray — official interconnected-nodes mark (simpleicons.org). Single path in +// Ray brand blue. + +// OpenResearch — the product favicon (openresearch.sh/favicon.svg): white flag +// mark on the brand-maroon rounded tile. + // GitHub — official octocat mark (lucide dropped brand icons). Not a compute // backend, but this file is the home for inline brand SVGs. fill=currentColor // so it inherits hover styling like lucide siblings. export function GitHubMark({ size = 16 }: { size?: number }) { return ( ); } @@ -165,12 +172,12 @@ export function BackendLogo({ kind, size = 16 }: { kind: string; size?: number } export function BackendBadge({ backend }: { backend: Run["backend"] }) { const kind = backendKind(backend); const detail = backendDetail(backend); - if (!kind) return —; + if (!kind) return —; return ( - + {backendName(kind)} - {detail && {detail}} + {detail && {detail}} ); } diff --git a/ui/src/components/BranchChanges.tsx b/ui/src/components/BranchChanges.tsx new file mode 100644 index 000000000..252cd1624 --- /dev/null +++ b/ui/src/components/BranchChanges.tsx @@ -0,0 +1,60 @@ +import { useEffect, useState } from "react"; +import { getExperimentDiff, type DiffPayload, type Experiment } from "../api"; +import { GitDiffExplorer, TruncatedDiffNotice } from "./GitDiff"; +import { CODE_TAB_BODY_CLASS_NAME, CODE_TAB_NOTE_CLASS_NAME } from "../styleClasses"; + +export function BranchChanges({ + experiment, + refreshKey, + onLoadingChange, +}: { + experiment: Experiment; + refreshKey: number; + onLoadingChange: (loading: boolean) => void; +}) { + const [diff, setDiff] = useState(null); + const [error, setError] = useState(null); + + useEffect(() => { + let cancelled = false; + onLoadingChange(true); + setError(null); + setDiff(null); + getExperimentDiff(experiment.id) + .then((payload) => { + if (!cancelled) setDiff(payload); + }) + .catch((cause: Error) => { + if (!cancelled) setError(cause.message); + }) + .finally(() => { + if (!cancelled) onLoadingChange(false); + }); + return () => { + cancelled = true; + }; + }, [experiment.id, refreshKey, onLoadingChange]); + + return ( +
_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`}> + {error ? ( +
Failed to load changes: {error}
+ ) : !diff ? ( +
Loading changes…
+ ) : !diff.diff.trim() ? ( +
+ {experiment.parentExperimentId + ? "No committed changes from the parent branch." + : "This is the baseline branch, so there is no parent comparison."} +
+ ) : ( + <> + {diff.truncated && ( + + )} + + + )} +
+ ); +} diff --git a/ui/src/components/BranchPill.tsx b/ui/src/components/BranchPill.tsx index 880ce6d4b..e14ec351e 100644 --- a/ui/src/components/BranchPill.tsx +++ b/ui/src/components/BranchPill.tsx @@ -1,6 +1,14 @@ import { githubBranchUrl } from "../api"; import { GitHubMark } from "./BackendLogos"; +const FILES_PILL_CLASS_NAME = [ + "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(" "); + /** A branch name as a pill linking to its GitHub tree view (files-pill * styling). */ export function BranchPill({ @@ -12,9 +20,12 @@ export function BranchPill({ repo: string; branch: string; }) { + if (!owner || !repo) { + return {branch}; + } return ( ; busySessions: Set; + // Messages parked behind a running turn, per session, oldest first. + queuedBySession: Record; } type Action = | { type: "reset" } - | { type: "seed"; sessionId: string; messages: ChatMessage[]; onlyIfAbsent?: boolean } + | { + type: "seed"; + sessionId: string; + messages: ChatMessage[]; + queued?: QueuedMessage[]; + onlyIfAbsent?: boolean; + } | { type: "upsertMessage"; sessionId: string; message: ChatMessage } | { type: "optimisticUser"; sessionId: string; text: string; imageUrls: string[] } | { type: "busy"; sessionId: string; busy: boolean } // `known` scopes the reseed: flags for sessions outside it (other projects — // busy events aren't project-filtered) are carried forward, not wiped. | { type: "seedBusy"; sessions: string[]; known: string[] } + | { type: "setQueued"; sessionId: string; items: QueuedMessage[] } | { type: "forget"; sessionId: string }; const LOCAL_PREFIX = "local-"; @@ -144,7 +157,7 @@ function upsertMessage(list: ChatMessage[], message: ChatMessage): ChatMessage[] function reducer(state: ChatState, action: Action): ChatState { switch (action.type) { case "reset": - return { messagesBySession: {}, busySessions: new Set() }; + return { messagesBySession: {}, busySessions: new Set(), queuedBySession: {} }; case "seed": // onlyIfAbsent: recover a failed fetch without clobbering messages that // streamed in via SSE during it (a `message` event already created the key). @@ -152,6 +165,12 @@ function reducer(state: ChatState, action: Action): ChatState { return { ...state, messagesBySession: { ...state.messagesBySession, [action.sessionId]: action.messages }, + // A seed is the authoritative snapshot, so it also (re)sets the parked + // queue — recovering it after a reload or an SSE gap. + queuedBySession: { + ...state.queuedBySession, + [action.sessionId]: action.queued ?? [], + }, }; case "upsertMessage": { const list = state.messagesBySession[action.sessionId] ?? []; @@ -195,6 +214,12 @@ function reducer(state: ChatState, action: Action): ChatState { for (const id of state.busySessions) if (!known.has(id)) busySessions.add(id); return { ...state, busySessions }; } + case "setQueued": { + return { + ...state, + queuedBySession: { ...state.queuedBySession, [action.sessionId]: action.items }, + }; + } case "forget": { // Deleted session: drop its transcript and busy flag so a same-id event // arriving late can't render stale state. @@ -202,7 +227,9 @@ function reducer(state: ChatState, action: Action): ChatState { delete messagesBySession[action.sessionId]; const busySessions = new Set(state.busySessions); busySessions.delete(action.sessionId); - return { messagesBySession, busySessions }; + const queuedBySession = { ...state.queuedBySession }; + delete queuedBySession[action.sessionId]; + return { messagesBySession, busySessions, queuedBySession }; } } } @@ -1393,8 +1420,8 @@ export function ChatPanel({ /** Reopen the rail (from the chat header's sidebar icon). */ onShowRail: () => void; /** What the middle pane shows: chat, files, or a settings section. */ - mainView: "chat" | "files" | SettingsTab; - onSelectMainView: (view: "chat" | "files" | SettingsTab) => void; + mainView: "chat" | "files" | "skills" | SettingsTab; + onSelectMainView: (view: "chat" | "files" | "skills" | SettingsTab) => void; /** Whether the right panel is showing (toggled from the chat header). */ panelOpen: boolean; onTogglePanel: () => void; @@ -1465,6 +1492,7 @@ export function ChatPanel({ const [state, dispatch] = useReducer(reducer, { messagesBySession: {}, busySessions: new Set(), + queuedBySession: {}, }); const [harnesses, setHarnesses] = useState([]); // The composer's model picker also feeds this via onHarnesses, but the @@ -1532,9 +1560,11 @@ export function ChatPanel({ } // IME guard: mid-composition text can transiently look like a full command. const composingRef = useRef(false); + // Refetch when navigating (esp. back to chat after a Skills-tab upload) so + // freshly uploaded skills appear in the `/` menu without a reload. useEffect(() => { - getSkills().then(setSkills).catch(() => {}); - }, []); + getSkills(projectId).then(setSkills).catch(() => {}); + }, [projectId, mainView]); const slashToken = !pickedSkill && draft.startsWith("/") && !/\s/.test(draft) ? draft.slice(1) : null; const skillMatches = @@ -1718,7 +1748,9 @@ export function ChatPanel({ if (!activeId || loadedSessions.current.has(activeId)) return; loadedSessions.current.add(activeId); getChatMessages(activeId) - .then((messages) => dispatch({ type: "seed", sessionId: activeId, messages })) + .then(({ messages, queued }) => + dispatch({ type: "seed", sessionId: activeId, messages, queued }), + ) .catch(() => { // Recover from a failed fetch to a usable state rather than a stuck // "Loading conversation…" spinner: seed an empty transcript (clears @@ -1784,6 +1816,9 @@ export function ChatPanel({ case "busy": dispatch({ type: "busy", sessionId: ev.sessionId, busy: ev.busy }); break; + case "queued": + dispatch({ type: "setQueued", sessionId: ev.sessionId, items: ev.items }); + break; case "usage": setSessions((cur) => cur.map((s) => (s.id === ev.sessionId ? { ...s, contextUsage: ev.usage } : s)), @@ -1813,8 +1848,8 @@ export function ChatPanel({ const reseed = (allowRetry: boolean) => { const gen = msgGen.current; getChatMessages(activeId) - .then((messages) => { - dispatch({ type: "seed", sessionId: activeId, messages }); + .then(({ messages, queued }) => { + dispatch({ type: "seed", sessionId: activeId, messages, queued }); if (allowRetry && msgGen.current !== gen) reseed(false); }) .catch(() => {}); @@ -1825,6 +1860,9 @@ export function ChatPanel({ const messages = activeId ? (state.messagesBySession[activeId] ?? []) : []; const busy = activeId ? state.busySessions.has(activeId) : false; + // Messages the user parked behind the running turn (oldest first). Populated + // by chat.queued events and the seed snapshot; each runs when its turn ends. + const queued = activeId ? (state.queuedBySession[activeId] ?? []) : []; // A session whose transcript hasn't been seeded yet: its key is absent from // messagesBySession (vs. present-but-empty for a genuinely empty session). // Switching to an existing session leaves this true for the getChatMessages @@ -2004,7 +2042,37 @@ export function ChatPanel({ }); return; } - if (busy) return; + if (busy) { + // A turn is already running: park this message (Claude-desktop steering) + // so it runs when the turn ends, instead of dropping it. The server + // enqueues it and echoes chat.queued to render the chip — no optimistic + // transcript bubble, since it hasn't run yet. + if (!activeId || !activeHarness?.agentReady) return; + const sid = activeId; + setDraft(""); + setPickedSkill(null); + setAttachments([]); + const turnOpts = composerSelection + ? { + model: composerSelection.model, + permissionMode: composerSelection.permissionMode, + reasoningLevel: composerSelection.reasoningLevel, + } + : {}; + setSessionOverride({}); + const images: ChatImageAttachment[] = pending.map((a) => ({ + mediaType: a.mediaType, + dataBase64: a.dataUrl.slice(a.dataUrl.indexOf(",") + 1), + })); + try { + await sendChatMessage(sid, text, turnOpts, images.length ? images : undefined); + } catch { + // Never reached the queue — restore the composer so a retry is one keypress. + setDraft((cur) => cur || text); + setAttachments((cur) => (cur.length ? cur : pending)); + } + return; + } if (!activeHarness?.agentReady) return; // `composerSelection` already resolves to the open session's settings (+ any // unsent tweak) or, for a new session, the global preference. @@ -2114,6 +2182,19 @@ export function ChatPanel({ if (activeId) void interruptChat(activeId); } + // Optimistic: drop locally now; the server's chat.queued echo reconciles. A + // message that already started running server-side simply isn't found. + function cancelQueued(itemId: string) { + if (!activeId) return; + const sid = activeId; + dispatch({ + type: "setQueued", + sessionId: sid, + items: queued.filter((q) => q.id !== itemId), + }); + void cancelQueuedMessage(sid, itemId).catch(() => {}); + } + // Escape stops the streaming turn and drops focus back into the composer, // mirroring the Claude Code desktop app. Harness-agnostic — `stop()` → // `interruptChat` interrupts whichever harness (Claude, Codex, OpenCode, …) @@ -2227,7 +2308,7 @@ 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) => dispatch({ type: "seed", sessionId: sid, messages })) + .then(({ messages, queued }) => dispatch({ type: "seed", sessionId: sid, messages, queued })) .catch(() => {}); listChatSessions(projectId) .then((list) => @@ -2280,6 +2361,13 @@ export function ChatPanel({ Files + + + ))} + + )}
{activeHarness && !activeHarness.agentReady && (
diff --git a/ui/src/components/ClosableTab.tsx b/ui/src/components/ClosableTab.tsx index 6dfe6ab61..f2565c664 100644 --- a/ui/src/components/ClosableTab.tsx +++ b/ui/src/components/ClosableTab.tsx @@ -18,12 +18,14 @@ export function ClosableTab({ }) { return ( + +
+ )} + {branchLabel && ( + + + {branchLabel} + + )} + {githubHref && ( +
+ + + )} + + +
+ ); +} diff --git a/ui/src/components/CodeTab.tsx b/ui/src/components/CodeTab.tsx index 809e78392..21db49130 100644 --- a/ui/src/components/CodeTab.tsx +++ b/ui/src/components/CodeTab.tsx @@ -1,12 +1,6 @@ -// The project's code browser: the committed tree of an experiment branch, or -// the hub clone's checkout, picked from a header select (opened from an -// experiment card's Code shortcut). Source + expansion state live on the -// App-side tab def (the component unmounts whenever another right-pane tab -// fronts it). The tree is built from git listings (gitignored trees -// excluded). Clicking a file opens the existing FileViewer tab, served from -// the same source. +// Files and committed changes for one experiment branch. The opening +// experiment fixes the Git source; users only switch between Files/Changes. -import { RotateCw } from "lucide-react"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { getCodeTree, @@ -15,45 +9,53 @@ import { type Experiment, type Project, } from "../api"; -import { GitHubMark } from "./BackendLogos"; +import { BranchChanges } from "./BranchChanges"; +import { CodeBrowserHeader, type CodeBrowserView } from "./CodeBrowserHeader"; import { buildTree, TreeLevel } from "./codeTree"; +import { CODE_TAB_BODY_CLASS_NAME, CODE_TAB_NOTE_CLASS_NAME } from "../styleClasses"; + +export type CodeView = CodeBrowserView; export function CodeTab({ projectId, project, - experiments, - sel, + experiment, + view, toggled, - onSelChange, + onViewChange, onToggledChange, onOpenFile, }: { projectId: string; /** Owning project — supplies owner/repo for the GitHub branch link. */ project: Project; - /** Project experiments — one selectable branch entry each (deduped). */ - experiments: Experiment[]; - /** Source to browse: "" = the project clone, else a branch name. Lives on - * the tab def so it survives unmount/remount. */ - sel: string; + /** Experiment whose committed Git branch this tab displays. */ + experiment: Experiment; + view: CodeView; /** Dirs flipped away from their depth default (lives on the tab def). */ toggled: ReadonlySet; - onSelChange: (sel: string) => void; + onViewChange: (view: CodeView) => void; onToggledChange: (toggled: ReadonlySet) => void; /** Open a file in the right pane's FileViewer, keyed to this source. */ onOpenFile: (path: string, sessionId?: string, ref?: string) => void; }) { + const branch = experiment.branchName; + const sourceKey = `${projectId}:${branch}`; const [data, setData] = useState(null); const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); + const [loading, setLoading] = useState(false); + const [changesLoading, setChangesLoading] = useState(false); + const [changesRefreshKey, setChangesRefreshKey] = useState(0); // A request id drops stale responses — from earlier sources, superseded // refreshes, and (via the effect-cleanup bump) post-unmount completions. const reqId = useRef(0); + const requestedSource = useRef(null); const load = useCallback(() => { + requestedSource.current = sourceKey; const id = ++reqId.current; setLoading(true); - getCodeTree(projectId, sel ? { ref: sel } : {}) + getCodeTree(projectId, { ref: branch }) .then((d) => { if (id !== reqId.current) return; setData(d); @@ -66,23 +68,28 @@ export function CodeTab({ .finally(() => { if (id === reqId.current) setLoading(false); }); - }, [projectId, sel]); + }, [projectId, branch, sourceKey]); - // Fetch on mount and whenever the source changes (plus manual Refresh — - // committed trees only move on commit, so there's no poll); a stale tree - // from the previous source must not linger under the new header. The - // cleanup bump invalidates in-flight responses on source change and - // unmount. + // Clear a previous branch's tree immediately and invalidate its requests. useEffect(() => { + reqId.current++; + requestedSource.current = null; setData(null); setError(null); - load(); + setLoading(false); return () => { reqId.current++; }; - }, [load]); + }, [sourceKey]); + + // Changes can open without paying for an unused tree request. Load the tree + // once when Files is first shown; manual Refresh can still call load again. + useEffect(() => { + if (view === "files" && requestedSource.current !== sourceKey) load(); + }, [view, sourceKey, load]); const tree = useMemo(() => (data ? buildTree(data.entries) : null), [data]); + const refreshing = view === "files" ? loading : changesLoading; const toggle = useCallback( (path: string) => { @@ -94,85 +101,57 @@ export function CodeTab({ [toggled, onToggledChange], ); - // One entry per branch: several experiments (e.g. baselines) can share one. - const branchOptions = useMemo(() => { - const seen = new Set(); - const options: { branch: string; label: string }[] = []; - for (const e of experiments) { - if (seen.has(e.branchName)) continue; - seen.add(e.branchName); - options.push({ branch: e.branchName, label: e.slug }); - } - return options; - }, [experiments]); - - // GitHub link target: the picked branch, or whatever the clone has - // checked out (none while detached). - const linkBranch = sel || data?.branch || null; - return ( -
-
- Source - - {linkBranch && ( - - - - )} - - -
- {data?.truncated &&
listing truncated
} - {error && tree &&
Refresh failed: {error}
} -
- {!tree ? ( -
{error ? `Failed to load: ${error}` : "Loading…"}
- ) : tree.dirs.size === 0 && tree.files.length === 0 ? ( -
No files.
- ) : ( -
- onOpenFile(path, undefined, sel || undefined)} - /> +
+ + view === "files" ? load() : setChangesRefreshKey((current) => current + 1) + } + /> + {view === "changes" ? ( + + ) : ( + <> + {data?.truncated &&
listing truncated
} + {error && tree &&
Refresh failed: {error}
} +
+ {!tree ? ( +
+ {error ? `Failed to load: ${error}` : "Loading…"} +
+ ) : tree.dirs.size === 0 && tree.files.length === 0 ? ( +
No files.
+ ) : ( +
+ onOpenFile(path, undefined, branch)} + /> +
+ )}
- )} -
+ + )}
); } diff --git a/ui/src/components/CodeView.tsx b/ui/src/components/CodeView.tsx index 6f31688f9..9bafd2033 100644 --- a/ui/src/components/CodeView.tsx +++ b/ui/src/components/CodeView.tsx @@ -1,11 +1,24 @@ // Shared source-code block: line-number gutter + refractor-highlighted -// content, used by the repo file viewer and the Files tab preview. Style +// content, used by the repo file viewer and the Artifacts tab preview. Style // scoping note: syntax token colors apply under a `.file-view` ancestor. -import { useMemo } from "react"; +import { useLayoutEffect, useMemo, useRef, useState } from "react"; import { detectSyntaxLanguageFromFilePath } from "../syntaxLanguage"; import { highlight } from "../syntaxHighlight"; -export function CodeView({ text, path }: { text: string; path: string }) { +export function CodeView({ + text, + path, + highlightLine, + scrollRequest, + onScrollRequestHandled, +}: { + text: string; + path: string; + /** 1-based line to scroll to and highlight (from a `file:line` chip). */ + highlightLine?: number; + scrollRequest?: number; + onScrollRequestHandled?: () => void; +}) { const rendered = useMemo( () => highlight(text, detectSyntaxLanguageFromFilePath(path)), [text, path], @@ -13,18 +26,65 @@ export function CodeView({ text, path }: { text: string; path: string }) { // One number per source line; a trailing newline ends a line, it doesn't // start an empty one. const lineCount = text ? text.split("\n").length - (text.endsWith("\n") ? 1 : 0) : 0; + const targetLine = highlightLine && lineCount > 0 + ? Math.min(Math.max(Math.trunc(highlightLine), 1), lineCount) + : undefined; + + const codeRef = useRef(null); + const bandRef = useRef(null); + // Highlight band geometry, measured from the code's real font metrics so it + // lands on the same row as the gutter number (both share padding/line-height). + const [band, setBand] = useState<{ line: number; top: number; height: number } | null>(null); + + useLayoutEffect(() => { + const code = codeRef.current; + if (!targetLine || !code) { + setBand(null); + return; + } + const cs = getComputedStyle(code); + const padTop = Number.parseFloat(cs.paddingTop) || 0; + const lineH = Number.parseFloat(cs.lineHeight) || 0; + if (!lineH) { + setBand(null); + return; + } + setBand({ line: targetLine, top: padTop + (targetLine - 1) * lineH, height: lineH }); + // `rendered` is a dep so the band re-measures/re-scrolls once new file + // content has laid out, not against the previous file's metrics. + }, [rendered, targetLine]); + + // Center the highlighted line in the scroll viewport once its band exists. + useLayoutEffect(() => { + if (scrollRequest === undefined) return; + if (band && band.line === targetLine) { + bandRef.current?.scrollIntoView({ block: "center" }); + onScrollRequestHandled?.(); + } else if (lineCount === 0) { + onScrollRequestHandled?.(); + } + }, [band, lineCount, onScrollRequestHandled, scrollRequest, targetLine]); + return ( -
+
{/* No numbers for an empty file — an empty gutter is just a stray bordered strip. */} {lineCount > 0 && ( -