Compare commits

..
1 Commits
Author SHA1 Message Date
MervinPraison ea615f9d88 deploy: 78493e0e17 2026-11-05 16:51:48 +00:00
684 changed files with 34438 additions and 129107 deletions

No files matched your search

@@ -1,375 +0,0 @@
---
description: Comprehensive analysis workflow that produces a detailed GitHub issue — combines deep codebase analysis with issue creation for implementation-ready tickets
---
# Analysis → GitHub Issue Workflow
Deep Analysis → Gap Analysis → Critical Review → Plan → Create GitHub Issue.
> **When to use this:** You need to analyze a feature, integration, or system deeply and produce a GitHub issue that another agent/developer can implement immediately without asking follow-up questions.
> **When NOT to use this:** Use `/analysis` for analysis-only (no issue). Use `/local-fix` if you're implementing yourself.
---
## PRINCIPLES (apply throughout)
- **Agent-centric**: Agents, workflows, sessions, tools, memory, multi-agent safety.
- **Protocol-driven core**: praisonaiagents = lightweight, protocol-first (protocols/hooks/adapters only).
- **DRY**: identify reuse; avoid duplication.
- **No perf impact**: preserve import-time and hot-path; heavy deps optional + lazy.
- **Async-safe + multi-agent safe** by default.
- **Easy for non-developers**: "Few lines of code to do the task!"
- **No competitor names in public surfaces**: Never mention competitor product, company, or project names in GitHub issues, PRs, commit messages, release notes, docs, or any other public-facing content. Refer to capabilities generically (e.g., "self-improving agent pattern", "external agent framework").
---
## CANONICAL PATHS
```
UI Repo: /Users/praison/praisonaiui (praisonaiui)
SDK Core: /Users/praison/praisonai-package/src/praisonai-agents (praisonaiagents)
Docs: /Users/praison/PraisonAIDocs
Extension: src/praisonaiui/*, docs/*, tests/*
```
---
## Phase 1 — Acceptance Criteria
Translate the request into testable criteria:
- API expectations (classes, methods, signatures)
- CLI expectations (commands, flags, help text)
- Documentation expectations (pages, examples)
- Test expectations (unit, integration, smoke, real agentic)
- Performance constraints (import time, hot-path)
---
## Phase 2 — External Research (if applicable)
### 2a. Read official sources
If analyzing an external integration, research from primary sources:
```bash
# Use read_url_content tool for:
# - Official site / announcement pages
# - GitHub README and docs
# - Framework documentation
# - Third-party write-ups
```
**Capture:**
- What is it? Purpose and design goals
- Key terminology and concepts
- Architecture overview
- Current ecosystem state
- References list (all URLs)
### 2b. Clone & analyze external codebase (if applicable)
```bash
git clone <repo-url> ~/<repo-name> --depth=1
ls -la ~/<repo-name>/
```
Key files to read:
- `AGENTS.md` / `README.md` — architecture overview
- Base class files (abstract methods, signatures)
- Factory / registry files (registration pattern)
- Model/config files (data structures)
- Example implementations (minimal + full-featured)
- `pyproject.toml` / `package.json` — dependencies
---
## Phase 3 — PraisonAI Codebase Inventory
### 3a. Inventory with evidence
Go through ALL relevant files, understand current logic end-to-end.
```bash
# UI repo
ls /Users/praison/praisonaiui/src/praisonaiui/
ls /Users/praison/praisonaiui/tests/
ls /Users/praison/praisonaiui/docs/
# Optional cross-check against SDK only when needed
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/
```
**Document:**
- Public APIs: modules/classes/functions and exports
- Protocols/adapters/hooks and extension points
- CLI commands, options, help text
- Integrations (db/observability/tools)
- Tests (unit/integration), fixtures, CI config
- Docs (Mintlify), examples, recipes
Provide: **file paths + key symbols + grep counts + entry points**.
### 3b. Identify DRY opportunities
- Existing abstractions that can be reused
- Duplicated code that should be consolidated
- Existing protocols before creating new ones
---
## Phase 4 — Detailed Analysis
### 4a. Architecture and behavior
- Control flow and data flow
- Concurrency model (sync/async)
- Multi-agent interactions
- Dependency boundaries (core/wrapper/tools)
- Failure modes and error handling
### 4b. Invariants check
Verify these are preserved:
- [ ] Protocol-driven core (no heavy impls in praisonaiagents)
- [ ] Lazy imports (optional deps never at module level)
- [ ] Backward compatible (public API changes need deprecation)
- [ ] Safe defaults (new features opt-in)
---
## Phase 5 — Gap Analysis
Compare acceptance criteria vs current state.
### Checklist
| Area | Current State | Gap | Severity | Impact | Placement |
|------|---------------|-----|----------|--------|-----------|
| Core SDK | | | | | |
| Wrapper | | | | | |
| Tools/plugins | | | | | |
| CLI | | | | | |
| Docs | | | | | |
| Tests | | | | | |
| Exports | | | | | |
| Perf | | | | | |
| Multi-agent + async | | | | | |
### Gap severity levels
- **Critical**: Blocks functionality
- **High**: Significant limitation
- **Medium**: Missing feature
- **Low**: Nice-to-have
---
## Phase 6 — Critical Review
### 6a. Risks and footguns
- API ambiguity or edge cases
- Backward compatibility concerns
- Coupling violations
- Performance regressions
- Concurrency hazards
- Misuse risks
- Operational concerns
### 6b. Mitigation strategies
For each risk, document:
- "Safe by default" recommendation
- Explicit opt-in for dangerous behavior
- Documentation warnings
---
## Phase 7 — Implementation Plan
Step-by-step plan (DO NOT implement):
### 7a. Test-first (TDD)
1. Unit tests for new functionality
2. Integration tests for cross-component behavior
3. Smoke tests for quick validation
4. **Real agentic tests** (REQUIRED):
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are helpful")
result = agent.start("Say hello in one sentence")
print(result) # Must call LLM and produce response
```
### 7b. Implementation order
1. Tests (TDD)
2. Core implementation
3. CLI integration
4. Documentation
5. Verification
### 7c. Files to change/create
| File | Action | Purpose |
|------|--------|---------|
| | | |
### 7d. Verification commands
```bash
# Unit tests
pytest tests/unit/test_<feature>.py -v
# Integration tests
pytest tests/integration/test_<feature>.py -v
# Smoke test
python -c "from praisonaiagents import <Feature>; print('OK')"
# Real agentic test
python examples/<feature>_example.py
```
---
## Phase 8 — Draft GitHub Issue
The issue must be **self-contained**. Another agent must be able to implement by reading only the issue.
### Required sections
```markdown
## Overview
One paragraph: what, why, and the end goal.
## Background
- Purpose and design goals
- Why this is valuable
- Current state / ecosystem
## Architecture Analysis
### Current Implementation
- Key files and their purposes
- Integration points
- Data flow
### Key File Locations
| File | Purpose | Lines |
|------|---------|-------|
## Gap Analysis Summary
### Critical Gaps
| Gap | Impact | Effort |
|-----|--------|--------|
### Feature Gaps
| Feature | Current Support | Gap |
|---------|-----------------|-----|
## Proposed Implementation
### Phase 1: Minimal
Working code example.
### Phase 2: Production
Working code example.
## Files to Create / Modify
### New files
| File | Purpose |
|------|---------|
### Modified files
| File | Change |
|------|--------|
## Technical Considerations
- Dependencies
- Performance impact
- Safety / approval
- Multi-agent safety
## Acceptance Criteria
- [ ] Verifiable checkbox list
## Implementation Notes
### Key Files to Read First
1. `path/to/file.py` (N lines) — purpose
### Critical Integration Points
1. Where X connects to Y
### Testing Commands
```bash
# Copy-pastable commands
```
## References
- [Link](url)
```
---
## Phase 9 — Create GitHub Issue
### 9a. Create via `gh` CLI
```bash
gh issue create \
--repo MervinPraison/PraisonAIUI \
--title "<Type>: <Descriptive Title>" \
--body "<issue body>"
```
**Title formats:**
- `Feature: <What>` — new functionality
- `Analysis: <Topic>` — analysis/research
- `Integration: <External System>` — external integration
- `Fix: <Problem>` — bug fix proposal
### 9b. Verify issue created
```bash
gh issue view <number> --repo MervinPraison/PraisonAIUI | head -20
```
---
## Checklist — Before Creating Issue
- [ ] Acceptance criteria defined and testable
- [ ] All relevant PraisonAI files read (not skimmed)
- [ ] External sources researched (if applicable)
- [ ] Gap analysis completed with severity ratings
- [ ] Critical review identifies risks and mitigations
- [ ] Implementation plan is step-by-step with file list
- [ ] Issue body has working code examples (not pseudocode)
- [ ] All file paths are absolute and verified
- [ ] CLI commands are copy-pastable
- [ ] Acceptance criteria are verifiable (not vague)
- [ ] References section includes all URLs
- [ ] Issue is self-contained — no "see docs" without details
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---------|-----|
| Pseudocode in examples | Use real, runnable code with imports |
| Vague file paths | Use absolute paths |
| Skipping gap analysis | Every gap needs severity + impact |
| Missing real agentic test | Include `agent.start()` test, not just construction |
| No verification commands | Include copy-pastable pytest/python commands |
| Claiming "done" without evidence | Every claim references specific files/symbols |
| Implementing instead of analyzing | This workflow produces issues, not code |
---
## Hard Rules
1. **DO NOT implement** — this workflow produces analysis and issues only
2. **DO NOT claim done** without evidence
3. **Every claim must reference** specific files/symbols
4. **Issue must be self-contained** — implementer needs no follow-up questions
5. **Working code examples required** — no pseudocode
-104
View File
@@ -1,104 +0,0 @@
---
description: analysis
---
You are an expert AI engineer in the PraisonAI ecosystem.
Your job: produce ONLY (1) analysis, (2) review, (3) gap analysis, (4) critical review, (5) plan, (6) proposal.
Do NOT implement. Do NOT write code. Do NOT update docs. Do NOT run tests beyond discovery.
Be precise, evidence-based, and agent-centric.
PRINCIPLES (apply in all analysis/proposals):
- Agent-centric: Agents, workflows, sessions, tools, memory, multi-agent safety.
- Protocol-driven core: praisonaiagents = lightweight, protocol-first (protocols/hooks/adapters only).
- DRY: identify reuse; avoid duplication.
- No perf impact: preserve import-time and hot-path; heavy deps optional + lazy.
- Async-safe + multi-agent safe by default.
- Clear paid upgrade path (support/cloud/services) without restricting core.
- Easy for non-developers. "Few lines of code to do the task!"
CANONICAL PATHS:
- UI Repo: /Users/praison/praisonaiui (praisonaiui)
- SDK Core (reference): /Users/praison/praisonai-package/src/praisonai-agents (praisonaiagents)
- Docs: /Users/praison/PraisonAIDocs (JS: docs/js, Rust: docs/rust)
- Extension points: src/praisonaiui/*, docs/*, tests/*
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MANDATORY PROCESS (NO IMPLEMENTATION)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
STEP 1 — Acceptance Criteria
- Translate request into testable criteria: API, CLI, docs, test expectations, perf constraints.
STEP 2 — Repo Inventory (evidence-based)
- Go through ALL relevant files, understand current logic end-to-end.
- Inventory with evidence:
- Public APIs: modules/classes/functions and exports
- Protocols/adapters/hooks and extension points
- CLI commands, options, help text
- Integrations (db/observability/tools)
- Tests (unit/integration), fixtures, CI config
- Docs (Mintlify), examples, recipes
- Provide: file paths + key symbols + grep counts + entry points.
- Identify DRY opportunities.
STEP 3 — Detailed Analysis
- Architecture and behavior: control flow, data flow, concurrency (sync/async), multi-agent interactions, dependency boundaries (core/wrapper/tools), failure modes.
- Highlight invariants: protocol-driven core, lazy imports, optional deps.
STEP 4 — Detailed Review
- Evaluate against principles: agent-centricity, API simplicity, DRY, perf, optional deps + lazy imports, async/multi-agent safety, test coverage, CLI parity, docs clarity.
- Concrete evidence for each judgment.
STEP 5 — Gap Analysis
- Compare acceptance criteria vs current state. Checklist:
- UI Core, CLI, Docs, Tests, Exports, Perf, Multi-agent + async
- Each gap: severity, impact, risk, recommended location (core/wrapper/tools).
STEP 6 — Critical Review
- Risks, footguns, maintenance concerns:
- API ambiguity, edge cases, backward compat
- Coupling violations, perf regressions, concurrency hazards
- Misuse risks, operational concerns
- Mitigation strategies and "safe by default" recommendations.
STEP 7 — Plan
- Step-by-step (do not implement): tests (TDD) → implementation → CLI → docs → verification
- Exact files to change/create. Migration/compat plan. Rollback plan. Verification commands. Perf checks. Multi-agent + async test strategy.
REAL AGENTIC TEST definition (MUST include in every verification plan):
- A "real agentic test" = agent ACTUALLY RUNS and calls the LLM:
1. Create Agent with the feature being tested
2. Call `agent.start("a real task prompt")` — NOT just constructing the object
3. Agent MUST call LLM and produce text response
4. Print full output so dev can see it worked end-to-end
- Example:
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are a helpful assistant")
result = agent.start("Say hello in one sentence")
print(result)
```
- Assert-only object construction = SMOKE TEST, not real agentic test.
- Both smoke AND real agentic tests required.
STEP 8 — Proposal
- Minimal, agent-centric design and API/CLI surface:
- protocols/hooks in core; implementations in wrapper/tools
- Clear defaults and explicit overrides
- Multi-agent resource isolation/sharing
- Error model and observability hooks
- Include: "Simple API" examples, CLI UX, docs outline, paid upgrade path.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REQUIRED OUTPUT (in order):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1) Acceptance Criteria
2) Inventory (evidence: paths/symbols/exports/grep counts)
3) Detailed Analysis (architecture + flows + invariants)
4) Detailed Review (quality vs principles, evidence-based)
5) Gap Analysis (checklist + severity/impact/placement)
6) Critical Review (risks + mitigations)
7) Plan (step-by-step + file list + verification strategy)
8) Proposal (agent-centric design + API/CLI/docs outline)
Hard rules: DO NOT implement. DO NOT write code. DO NOT claim done. Every claim must reference specific files/symbols.
-228
View File
@@ -1,228 +0,0 @@
---
description: Audit existing docs against live code, then create a comprehensive GitHub issue in PraisonAIDocs with correct, tested information ready for a writer/agent to implement immediately
---
# Create PraisonAIDocs Issue Workflow
Audit code → Compare with existing docs → Draft correct content → Create issue.
> **When to use this:** A feature is already implemented in PraisonAI but the docs are missing, outdated, or wrong. You need to file a self-contained docs issue in `MervinPraison/PraisonAIDocs` that a writer or agent can act on without asking follow-up questions.
> **When NOT to use this:** Use `@[/create-github-issue]` for new integrations that need external research. Use `@[/local-fix]` if you are writing the docs yourself.
---
## Phase 1 — Identify the Feature & Existing Docs
### 1a. Find the relevant doc file
```bash
ls /Users/praison/PraisonAIDocs/docs/<section>/
cat /Users/praison/PraisonAIDocs/docs/<section>/<feature>.mdx
```
Key doc sections:
- `docs/observability/` — tracing providers (Langfuse, LangSmith, etc.)
- `docs/tools/` — tool integrations
- `docs/features/` — agent features
- `docs/cli/` — CLI commands
- `docs/guides/` — how-to guides
### 1b. Read the existing doc fully
Note every claim that needs verification:
- Install commands
- Import statements
- API method names and signatures
- Environment variable names
- CLI commands
---
## Phase 2 — Audit the Live Code
### 2a. Find the source implementation
```bash
# Search praisonaiagents core SDK
grep -rn "<feature>" /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/ 2>&1 | grep -v ".pyc"
# Search praisonai wrapper (CLI, integrations)
grep -rn "<feature>" /Users/praison/praisonai-package/src/praisonai/praisonai/ 2>&1 | grep -v ".pyc"
# Search praisonai-tools
grep -rn "<feature>" /Users/praison/PraisonAI-tools/ 2>&1 | grep -v ".pyc"
```
### 2b. Read all relevant source files end-to-end
Read every file that implements the feature. For each file capture:
- Actual class/function names and signatures
- Required vs optional parameters
- Environment variables read (exact names)
- What gets called internally (trace the call chain)
- Any version-specific behavior
Key files to always check:
| File pattern | What to look for |
|---|---|
| `praisonaiagents/obs/__init__.py` | `_LazyObsModule`, factory methods, `auto()` |
| `praisonai_tools/observability/providers/<name>_provider.py` | `init()`, `is_available()`, `shutdown()`, `flush()` |
| `praisonai/observability/<name>.py` | CLI sink adapter, event handling |
| `praisonai/cli/commands/<name>.py` | All CLI sub-commands and options |
| `praisonai/__init__.py` | Global env var overrides that may interfere |
### 2c. Test the feature live
Run minimal test scripts to verify the actual behavior:
```bash
# Test the import works
python3 -c "from praisonaiagents.obs import obs; provider = obs.<name>(); print(type(provider).__name__, provider._initialized)"
# Test CLI commands
praisonai <feature> --help
praisonai <feature> <subcommand>
# Verify traces/output appear
timeout 30 praisonai <feature> <subcommand> --limit 5
```
### 2d. Build a "What's Wrong" table
For each doc claim that is incorrect, record:
| Current Doc (Wrong) | Correct |
|---|---|
| wrong install command | correct install |
| wrong import | correct import |
| non-existent method | actual method |
| wrong env var name | actual env var |
---
## Phase 3 — Draft the Issue
The issue body must be **self-contained and implementation-ready**. A writer should be able to update the doc by reading only the issue — no follow-up questions.
### Required sections:
```markdown
## Overview
One paragraph: what doc file needs updating, why it's wrong, and the end goal.
State explicitly: "All code in this issue has been tested and verified working."
## What's Wrong With the Current Docs
Table: Current (Wrong) | Correct
Cover: install commands, imports, API methods, env vars, missing sections.
## Correct Architecture (How It Actually Works)
Explain the actual internal call chain so the writer understands context.
Include a text diagram if helpful.
## Required Install
Exact pip commands, nothing more.
## Environment Variables
Table: Variable | Required | Description
Show bash export examples for both cloud and self-hosted.
## Python Usage
### Quickstart (Recommended)
Full working code with correct imports, init, agent run, and flush.
### Auto-Detection
Document obs.auto() or equivalent if applicable.
### Additional Patterns
Any other valid usage patterns (explicit provider, multi-agent, etc.).
## CLI Usage (if applicable)
All sub-commands with flags and examples.
Include an end-to-end CLI session example.
## Configuration File (if applicable)
Document any config files that are auto-created or auto-read.
## What Output Looks Like
Show what traces/output actually look like after a successful run.
## Version Compatibility Notes
Document any breaking changes between SDK versions that affect usage.
## Files to Update
Table: File | Change
## Acceptance Criteria
- [ ] Checkbox list — each item must be specific and verifiable
## References
List all source files read (with absolute paths).
```
---
## Phase 4 — Create the Issue
### 4a. Write body to a temp file
```bash
cat > /tmp/docs_issue_<feature>.md << 'EOF'
<issue body>
EOF
```
### 4b. Create via `gh` CLI
```bash
gh issue create \
--repo MervinPraison/PraisonAIDocs \
--title "Docs: <action verb> <feature> page — <one-line summary of what's wrong>" \
--label "documentation" \
--body-file /tmp/docs_issue_<feature>.md
```
**Title format:** `Docs: Rewrite/Update/Add <Feature> page — <what's wrong or missing>`
Examples:
- `Docs: Rewrite Langfuse integration page with correct Langfuse v4 API and CLI commands`
- `Docs: Add obs.auto() documentation to observability overview`
- `Docs: Fix LangSmith install command and update import paths`
### 4c. Verify
```bash
gh issue view <number> --repo MervinPraison/PraisonAIDocs | head -30
```
Confirm the URL: `https://github.com/MervinPraison/PraisonAIDocs/issues/<number>`
---
## Checklist — Before Creating the Issue
- [ ] Existing doc file read completely
- [ ] All source files implementing the feature read end-to-end (not skimmed)
- [ ] Feature tested live — not just code-read
- [ ] "What's Wrong" table is complete and specific
- [ ] All code examples in the issue are copy-pastable and tested
- [ ] All env var names are verified against source (not guessed)
- [ ] All CLI commands verified with `--help` and live run
- [ ] Acceptance criteria are specific and verifiable (not vague)
- [ ] References list includes all source file paths read
- [ ] Issue is self-contained — writer needs no follow-up
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---|---|
| Documenting what the code *should* do, not what it *does* | Run it. Test it. Document the actual behavior. |
| Copying import paths from docs being replaced | Always verify imports against source files |
| Missing the "What's Wrong" table | This is the most important section — be explicit |
| Vague acceptance criteria like "docs are updated" | Write specific, testable criteria: "install command is `pip install langfuse`" |
| Not checking for interfering globals (e.g. `OTEL_SDK_DISABLED`) | Always grep `__init__.py` files for env var overrides |
| Forgetting `provider.flush()` in examples | Async buffers need explicit flush before process exit |
| Not testing with a real API key | Code-reading alone misses runtime errors |
| Using `timeout` too short for first-run (downloads, auth) | Use `timeout 120` for agent runs, `timeout 30` for CLI |
-308
View File
@@ -1,308 +0,0 @@
---
description: Research a topic in-depth, analyze both external and local codebases, and create a comprehensive GitHub issue — ready for another agent/developer to act on immediately
---
# Create GitHub Issue Workflow
Research → Clone & Analyze → PraisonAI Analysis → Draft → Create Issue.
> **When to use this:** You need to create a detailed, implementation-ready GitHub issue for a new integration, feature, or benchmark. The issue must contain enough context that another agent or developer can implement it without asking further questions.
> **When NOT to use this:** Use `@[/local-fix]` if you are implementing the change yourself, not just filing an issue.
---
## Phase 1 — Online Research
### 1a. Read official sources
Research the topic from all primary sources: official site, GitHub repo, documentation, blog posts.
```bash
# Example searches (adapt to your topic)
# - Official site / announcement pages
# - GitHub README and docs
# - Third-party write-ups (e.g. Snorkel AI, Epoch AI)
# - Framework documentation (core concepts, agents, running)
```
URLs to read for each source (use `read_url_content` tool):
- Official announcement / news page
- GitHub repository README (multiple chunks if large)
- Framework/integration documentation pages
- Any relevant blog posts or analysis
**Capture for the issue:**
- What is it? Purpose and design goals
- Key terminology and concepts (with definitions)
- Architecture overview
- Current leaderboard / ecosystem state
- References list (all URLs)
### 1b. Read paginated content
For large pages, read additional chunks:
```
view_content_chunk(document_id=<url>, position=2)
view_content_chunk(document_id=<url>, position=3)
view_content_chunk(document_id=<url>, position=4)
```
Continue until all relevant sections are read (core concepts, agent types, running instructions, integration API).
---
## Phase 2 — Clone & Analyze External Codebase
### 2a. Clone the repository
```bash
git clone <repo-url> ~/<repo-name> --depth=1
```
### 2b. Explore structure
```bash
ls -la ~/<repo-name>/
ls -la ~/<repo-name>/src/
```
Key files to read (adapt paths to repo):
- `AGENTS.md` / `CLAUDE.md` / `README.md` — architecture overview
- Base class files (e.g. `base.py` for agents, environments)
- Factory / registry files (how things are registered)
- Model/config files (data structures agents must populate)
- Enum files (valid names, types)
- Example agent implementations (minimal + full-featured)
- `pyproject.toml` — Python version, dependencies
**Capture for the issue:**
- Repository structure diagram
- Key file paths with line counts
- Base class interface (all abstract methods with signatures)
- How to register a new agent (enum + factory pattern)
- Data models the agent must populate (`AgentContext`, etc.)
- Example agent implementations (minimal and production)
- CLI commands to run the integration
- Environment variables required
### 2c. Read base classes end-to-end
Read every relevant base class completely. For agent integrations:
```
read_file(base.py) # BaseAgent / BaseInstalledAgent
read_file(factory.py) # AgentFactory registration
read_file(models/agent/name.py) # AgentName enum
read_file(models/agent/context.py) # AgentContext fields
read_file(examples/agents/minimal_agent.py) # Minimal example
read_file(agents/installed/reference_agent.py) # Full example
```
### 2d. Read a reference implementation
Pick the most complete existing agent implementation (e.g. `codex.py`, `gemini_cli.py`) and read it fully. This reveals:
- Install pattern (system packages → user packages)
- Version detection (`get_version_command` / `parse_version`)
- `@with_prompt_template` decorator usage
- `populate_context_post_run` for token tracking
- ATIF trajectory support (`SUPPORTS_ATIF`)
- `CliFlag` / `EnvVar` declarative config
- `exec_as_root` vs `exec_as_agent` usage
---
## Phase 3 — Analyze PraisonAI Codebase
### 3a. Identify relevant components
```bash
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/tools/
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/agent/
```
Key files to read for agent integration issues:
| File | What to look for |
|------|-----------------|
| `praisonaiagents/tools/shell_tools.py` | `execute_command`, approval decorators |
| `praisonaiagents/agent/agent.py` | `Agent.start()`, `Agent.chat()`, token tracking |
| `praisonaiagents/approval/` | `@require_approval`, auto-approval backend |
| `praisonaiagents/eval/` | Evaluation framework hooks |
| `praisonaiagents/agents/agents.py` | `AgentTeam` multi-agent |
| `pyproject.toml` | Current version, optional dependencies |
### 3b. Map integration points
For each PraisonAI component, document:
- What it does
- How it maps to the external system's interface
- What needs bridging (e.g. wrapping `environment.exec()` as a tool)
- Known gotchas (e.g. `@require_approval` must be bypassed in containers)
---
## Phase 4 — Draft the Issue
The issue body must be self-contained. Another agent must be able to implement the feature by reading only the issue — no follow-up questions.
### Required sections:
```markdown
## Overview
One paragraph: what, why, and the end goal.
## Background: What is <X>?
- Purpose and design goals
- Key statistics (task count, solve rates, etc.)
- Why <X> + PraisonAI is valuable
- Current ecosystem / leaderboard state
## <X> Architecture (Codebase Analysis)
> Repo analyzed locally: `~/<repo-name>` (cloned at `~/<repo-name>`)
### Core Concepts
Table: Concept | Description
### Two (or N) Integration Types
Code examples for each type with full signatures.
### Key File Locations in <X> Codebase
Directory tree with annotations for each important file.
### Data Models
Full class definitions the agent must populate.
### How to Run (CLI)
All relevant CLI commands with flags and examples.
## PraisonAI Architecture (Relevant to This Integration)
Table: Component | Location | Relevance
### PraisonAI Execution Model
How PraisonAI currently handles the relevant operations, and what must be adapted.
## Proposed Implementation Plan
### Approach: <Recommended> (with justification)
### Phase 1: Minimal Proof-of-Concept
Full working code example.
### Phase 2: Production Implementation
Full working code example.
### Phase N: Advanced Features
(ATIF, multi-agent, etc.)
## Files to Create / Modify
### New files (praisonai-package)
Table: File | Purpose
### Modifications to <External Repo> (PR upstream)
Table: File | Change
## Technical Considerations
Subsections for:
- Container/environment dependencies
- API key forwarding
- Safety/approval bypass
- Token tracking
- Parallel execution safety
## Job / Config Example
Working YAML config + CLI invocation.
## Use Cases Unlocked
Table: Use Case | How
## Acceptance Criteria
- [ ] Checkbox list of verifiable outcomes
## Implementation Notes for the Assigned Agent/Developer
### Key <X> Files to Read First
Numbered list with file paths and line counts.
### Key PraisonAI Files to Read
Numbered list with file paths.
### Critical Integration Points
Numbered list of the exact code-level bridges needed.
### Architecture Decision
Why the chosen approach (installed vs external, etc.) with trade-offs.
### Installation & Testing Commands
Copy-pastable commands to install, verify, and run.
### Upstream PR
What to submit upstream and where.
## References
Bullet list of all URLs used.
```
---
## Phase 5 — Create the Issue
### 5a. Create via `gh` CLI
```bash
gh issue create \
--repo <org>/<repo> \
--title "Feature: <Descriptive Title>" \
--label "enhancement" \
--body "<issue body>"
```
**Title format:** `Feature: <What> with <Integration> (<Framework/Version>)`
Example:
```bash
gh issue create \
--repo MervinPraison/PraisonAI \
--title "Feature: Integrate PraisonAI Agents with Terminal-Bench 2.0 (Harbor Framework)" \
--label "enhancement" \
--body "..."
```
### 5b. Verify the issue was created
```bash
gh issue view <issue-number> --repo <org>/<repo> | head -20
```
The output URL confirms success: `https://github.com/<org>/<repo>/issues/<number>`
---
## Checklist — Before Creating the Issue
- [ ] All primary documentation URLs read (including paginated chunks)
- [ ] External repo cloned locally and analyzed
- [ ] Base classes read end-to-end (not just skimmed)
- [ ] At least one reference implementation read fully
- [ ] PraisonAI codebase analyzed for integration points
- [ ] Issue body has working code examples (not pseudocode)
- [ ] All file paths are absolute and verified to exist
- [ ] CLI commands are copy-pastable and complete
- [ ] Acceptance criteria are verifiable (not vague)
- [ ] References section includes all URLs used
- [ ] Issue is self-contained — no "see docs for details" without the details
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---------|-----|
| Pseudocode in examples | Use real, runnable code with imports |
| Vague file paths like `agents/` | Use absolute paths like `~/harbor/src/harbor/agents/base.py` |
| Missing `--depth=1` on clone | Large repos take forever; always use shallow clone |
| Only reading chunk 0 of a URL | Read chunks 1–4+ for paginated content |
| Skipping the factory/registry file | This is where registration happens; always read it |
| Not reading a reference agent | Pattern is not obvious from base class alone |
| Forgetting API key forwarding section | Always document how secrets are passed to containers |
| Skipping `populate_context_post_run` | Harbor uses this for token tracking and leaderboard data |
| Missing upstream PR instructions | Specify exact files to modify upstream for first-class support |
-190
View File
@@ -1,190 +0,0 @@
---
description: create and publish a post on mer.vin using praisonaiwp
---
## Config
- Server: `default` → `https://mer.vin`
- Config: `~/.praisonaiwp/config.yaml`
- Category for PraisonAI features: `PraisonAI`
---
## Step 1 — Compose the content
Structure every post as:
1. **Intro paragraph** — one sentence, what the feature solves
2. **Mermaid diagram** — architecture/flow (see block format below)
3. **Sections** — H2 headings, tables > prose, code blocks for usage
4. **Performance/summary** — table with concrete numbers
Keep it technical. Lead with diagrams and tables, not paragraphs.
---
## Step 2 — Mermaid block format (merpress)
> **Creating merpress:** Install the [Merpress – Mermaid for WordPress](https://wordpress.org/plugins/merpress/) plugin via `wp plugin install merpress --activate --allow-root` on the server. It adds the `wp:merpress/mermaidjs` block used below.
All posts use the native `wp:merpress/mermaidjs` block. Use this exact format:
```
<!-- wp:merpress/mermaidjs {"align":"full"} -->
<div class="wp-block-merpress-mermaidjs diagram-source-mermaid alignfull"><pre class="mermaid">%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "lineColor": "#000000"}}}%%
graph TD
A[Input] --> B[Agent]
B --> C[Tool]
C --> D[Output]
classDef hook fill:#189AB4,color:#fff
classDef agent fill:#8B0000,color:#fff
classDef decision fill:#444,color:#fff
class B agent
class C hook
</pre></div>
<!-- /wp:merpress/mermaidjs -->
```
**Do NOT use:** `[mermaid]...[/mermaid]` shortcode — that is the wrong format.
Color scheme:
- `#8B0000` (dark red) — agents, inputs, outputs
- `#189AB4` (teal) — tools, hooks
- `#444` — decisions/conditionals
---
## Step 2a — SVG/image upload via SSH
`praisonaiwp media upload` correctly SFTPs the file to `/tmp/` on the server, but
`_execute_wp()` in `~/praisonaiwp-cli/praisonaiwp/core/wp_client.py` never appends
`--allow-root`. Use direct SSH instead.
**SVG upload (Safe SVG plugin active on mer.vin):**
```bash
# 1. SCP SVG to server
scp -i ~/.ssh/id_ed25519 /path/to/diagram.svg <SSH_USER>@<SERVER_IP>:/tmp/
# 2. Import via WP-CLI — must pass --user=<admin> so Safe SVG capability check passes
ssh -i ~/.ssh/id_ed25519 <SSH_USER>@<SERVER_IP> \
"cd <WP_ROOT> && \
wp media import /tmp/diagram.svg --post_id=<POST_ID> \
--title='Title' --alt='Alt' --user=praison --allow-root --porcelain"
# → returns media ID
# 3. Get the URL
ssh -i ~/.ssh/id_ed25519 <SSH_USER>@<SERVER_IP> \
"cd <WP_ROOT> && \
wp post get <MEDIA_ID> --field=guid --allow-root"
```
> **Key:** `--user=praison` is required — Safe SVG checks upload capability against the
> current WP user. Without it, even with the plugin active, SVG imports are blocked.
**PNG fallback (if Safe SVG not available):**
```bash
rsvg-convert -w 1360 /path/to/diagram.svg -o /tmp/diagram_2x.png
# Then follow the same SSH steps above using the .png file (no --user needed)
```
Use this Gutenberg image block in the post content:
```
<!-- wp:image {"id":<MEDIA_ID>,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="<IMAGE_URL>" alt="Alt text" class="wp-image-<MEDIA_ID>"/></figure>
<!-- /wp:image -->
```
---
## Step 3 — Create the post
```bash
praisonaiwp create "Post Title" \
--status publish \
--content '<FULL GUTENBERG CONTENT>'
```
Note the returned **Post ID** from the output.
---
## Step 4 — Set category
```bash
praisonaiwp update <POST_ID> --category "PraisonAI"
```
---
## Step 5 — Validate mermaid format
```bash
ssh -i ~/.ssh/id_ed25519 <SSH_USER>@<SERVER_IP> \
"cd <WP_ROOT> && \
wp post get <POST_ID> --field=post_content --allow-root | grep -i mermaid"
```
Expected output must contain `wp:merpress/mermaidjs`, not `[mermaid]`.
---
## Key Gutenberg blocks reference
```
<!-- wp:paragraph --><p>text</p><!-- /wp:paragraph -->
<!-- wp:heading --><h2 class="wp-block-heading">Title</h2><!-- /wp:heading -->
<!-- wp:heading {"level":3} --><h3 class="wp-block-heading">Sub</h3><!-- /wp:heading -->
<!-- wp:code --><pre class="wp-block-code"><code>code here</code></pre><!-- /wp:code -->
<!-- wp:table -->
<figure class="wp-block-table"><table>
<thead><tr><th>Col</th></tr></thead>
<tbody><tr><td>Val</td></tr></tbody>
</table></figure>
<!-- /wp:table -->
<!-- wp:list --><ul class="wp-block-list"><li>item</li></ul><!-- /wp:list -->
<!-- wp:separator --><hr class="wp-block-separator has-alpha-channel-opacity"/><!-- /wp:separator -->
```
---
## Full example command
```bash
praisonaiwp create "Feature Name: What It Does" \
--status publish \
--content '<!-- wp:paragraph -->
<p>One sentence intro.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Architecture</h2>
<!-- /wp:heading -->
<!-- wp:merpress/mermaidjs {"align":"full"} -->
<div class="wp-block-merpress-mermaidjs diagram-source-mermaid alignfull"><pre class="mermaid">%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "lineColor": "#000000"}}}%%
graph TD
A[Start] --> B[Agent]
class B agent
classDef agent fill:#8B0000,color:#fff
</pre></div>
<!-- /wp:merpress/mermaidjs -->
<!-- wp:code -->
<pre class="wp-block-code"><code>from praisonaiagents import Agent
agent = Agent(name="example")
result = agent.start("task")</code></pre>
<!-- /wp:code -->'
# Then set category:
praisonaiwp update <ID> --category "PraisonAI"
```
@@ -1,670 +0,0 @@
---
description: End-to-end workflow — deep analysis → GitHub issue → wait for implementing agents → create PR if missing → wait for reviewing agents → review PR locally → feedback to @claude → merge to main when robust per AGENTS.md
---
# End-to-End: Analysis → Issue → PR → Review → Merge
Deep Analysis → Gap Analysis → Critical Review → Plan → Create Issue → **Wait for implementing agents** → **Create PR if missing** → **Wait for reviewers** → **Validate PR locally** → **Feedback to @claude** → **Re-review after fixes** → **Merge to main if robust**.
> **When to use this:** You want a fully hands-off delivery loop. You describe a feature/integration/fix; this workflow produces the issue, monitors implementation by other agents (Claude, Copilot, CodeRabbit), validates their PR locally against `AGENTS.md` principles, loops feedback until the PR is robust, and merges to `main`.
> **When NOT to use this:** Use `/analysis-github-issue-create` if you only want the issue (no PR/merge). Use `/local-fix` if you are the implementer.
---
## PRINCIPLES (apply throughout)
- **Agent-centric**: Agents, workflows, sessions, tools, memory, multi-agent safety.
- **Protocol-driven core**: `praisonaiagents` = lightweight, protocol-first (protocols/hooks/adapters only).
- **DRY**: identify reuse; avoid duplication.
- **No perf impact**: preserve import-time and hot-path; heavy deps optional + lazy.
- **Async-safe + multi-agent safe** by default.
- **Easy for non-developers**: "Few lines of code to do the task!"
- **No competitor names in public surfaces**: Never mention competitor product, company, or project names in GitHub issues, PRs, commit messages, release notes, docs, or any other public-facing content. Refer to capabilities generically (e.g., "self-improving agent pattern", "external agent framework").
- **Test before merge**: never merge unvalidated PRs. Always clone the branch locally and run the tests.
- **Minimal code change**: prefer upstream one-line fixes over downstream workarounds.
---
## CANONICAL PATHS
```
Core SDK: /Users/praison/praisonai-package/src/praisonai-agents (praisonaiagents)
Wrapper: /Users/praison/praisonai-package/src/praisonai (praisonai)
Tools: /Users/praison/PraisonAI-tools
Docs: /Users/praison/PraisonAIDocs
TypeScript: /Users/praison/praisonai-package/src/praisonai-ts
AGENTS.md: /Users/praison/praisonai-package/src/praisonai-agents/AGENTS.md
```
---
# PART A — ANALYSIS & ISSUE (Phases 1–9)
These phases are identical to `/analysis-github-issue-create`. Execute them in order. **Do not implement any code** in these phases — they produce analysis and an issue only.
## Phase 1 — Acceptance Criteria
Translate the request into testable criteria:
- API expectations (classes, methods, signatures)
- CLI expectations (commands, flags, help text)
- Documentation expectations (pages, examples)
- Test expectations (unit, integration, smoke, real agentic)
- Performance constraints (import time, hot-path)
---
## Phase 2 — External Research (if applicable)
### 2a. Read official sources
If analyzing an external integration, research from primary sources:
```bash
# Use read_url_content tool for:
# - Official site / announcement pages
# - GitHub README and docs
# - Framework documentation
# - Third-party write-ups
```
**Capture:**
- What is it? Purpose and design goals
- Key terminology and concepts
- Architecture overview
- Current ecosystem state
- References list (all URLs)
### 2b. Clone & analyze external codebase (if applicable)
```bash
git clone <repo-url> ~/<repo-name> --depth=1
ls -la ~/<repo-name>/
```
Key files to read:
- `AGENTS.md` / `README.md` — architecture overview
- Base class files (abstract methods, signatures)
- Factory / registry files (registration pattern)
- Model/config files (data structures)
- Example implementations (minimal + full-featured)
- `pyproject.toml` / `package.json` — dependencies
---
## Phase 3 — PraisonAI Codebase Inventory
### 3a. Inventory with evidence
Go through ALL relevant files, understand current logic end-to-end.
```bash
# Core SDK
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/
grep -r "class.*Protocol" praisonaiagents/ --include="*.py" | wc -l
# Wrapper
ls /Users/praison/praisonai-package/src/praisonai/praisonai/
ls /Users/praison/praisonai-package/src/praisonai/praisonai/cli/commands/
# TypeScript
ls /Users/praison/praisonai-package/src/praisonai-ts/src/
```
**Document:**
- Public APIs: modules/classes/functions and exports
- Protocols/adapters/hooks and extension points
- CLI commands, options, help text
- Integrations (db/observability/tools)
- Tests (unit/integration), fixtures, CI config
- Docs (Mintlify), examples, recipes
Provide: **file paths + key symbols + grep counts + entry points**.
### 3b. Identify DRY opportunities
- Existing abstractions that can be reused
- Duplicated code that should be consolidated
- Existing protocols before creating new ones
---
## Phase 4 — Detailed Analysis
### 4a. Architecture and behavior
- Control flow and data flow
- Concurrency model (sync/async)
- Multi-agent interactions
- Dependency boundaries (core/wrapper/tools)
- Failure modes and error handling
### 4b. Invariants check
Verify these are preserved:
- [ ] Protocol-driven core (no heavy impls in `praisonaiagents`)
- [ ] Lazy imports (optional deps never at module level)
- [ ] Backward compatible (public API changes need deprecation)
- [ ] Safe defaults (new features opt-in)
---
## Phase 5 — Gap Analysis
Compare acceptance criteria vs current state.
### Checklist
| Area | Current State | Gap | Severity | Impact | Placement |
|------|---------------|-----|----------|--------|-----------|
| Core SDK | | | | | |
| Wrapper | | | | | |
| Tools/plugins | | | | | |
| CLI | | | | | |
| Docs | | | | | |
| Tests | | | | | |
| Exports | | | | | |
| Perf | | | | | |
| Multi-agent + async | | | | | |
### Gap severity levels
- **Critical**: Blocks functionality
- **High**: Significant limitation
- **Medium**: Missing feature
- **Low**: Nice-to-have
---
## Phase 6 — Critical Review
### 6a. Risks and footguns
- API ambiguity or edge cases
- Backward compatibility concerns
- Coupling violations
- Performance regressions
- Concurrency hazards
- Misuse risks
- Operational concerns
### 6b. Mitigation strategies
For each risk, document:
- "Safe by default" recommendation
- Explicit opt-in for dangerous behavior
- Documentation warnings
---
## Phase 7 — Implementation Plan
Step-by-step plan (DO NOT implement):
### 7a. Test-first (TDD)
1. Unit tests for new functionality
2. Integration tests for cross-component behavior
3. Smoke tests for quick validation
4. **Real agentic tests** (REQUIRED):
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are helpful")
result = agent.start("Say hello in one sentence")
print(result) # Must call LLM and produce response
```
### 7b. Implementation order
1. Tests (TDD)
2. Core implementation
3. CLI integration
4. Documentation
5. Verification
### 7c. Files to change/create
| File | Action | Purpose |
|------|--------|---------|
| | | |
### 7d. Verification commands
```bash
# Unit tests
pytest tests/unit/test_<feature>.py -v
# Integration tests
pytest tests/integration/test_<feature>.py -v
# Smoke test
python -c "from praisonaiagents import <Feature>; print('OK')"
# Real agentic test
python examples/<feature>_example.py
```
---
## Phase 8 — Draft GitHub Issue
The issue must be **self-contained**. Another agent must be able to implement by reading only the issue.
### Required sections
```markdown
## Overview
One paragraph: what, why, and the end goal.
## Background
- Purpose and design goals
- Why this is valuable
- Current state / ecosystem
## Architecture Analysis
### Current Implementation
- Key files and their purposes
- Integration points
- Data flow
### Key File Locations
| File | Purpose | Lines |
|------|---------|-------|
## Gap Analysis Summary
### Critical Gaps
| Gap | Impact | Effort |
|-----|--------|--------|
### Feature Gaps
| Feature | Current Support | Gap |
|---------|-----------------|-----|
## Proposed Implementation
### Phase 1: Minimal
Working code example.
### Phase 2: Production
Working code example.
## Files to Create / Modify
### New files
| File | Purpose |
|------|---------|
### Modified files
| File | Change |
|------|--------|
## Technical Considerations
- Dependencies
- Performance impact
- Safety / approval
- Multi-agent safety
## Acceptance Criteria
- [ ] Verifiable checkbox list
## Implementation Notes
### Key Files to Read First
1. `path/to/file.py` (N lines) — purpose
### Critical Integration Points
1. Where X connects to Y
### Testing Commands
```bash
# Copy-pastable commands
```
## References
- [Link](url)
```
---
## Phase 9 — Create GitHub Issue
### 9a. Create via `gh` CLI
```bash
gh issue create \
--repo MervinPraison/PraisonAI \
--title "<Type>: <Descriptive Title>" \
--body-file /tmp/issue-body.md
```
**Title formats:**
- `Feature: <What>` — new functionality
- `Integration: <External System>` — external integration
- `Fix: <Problem>` — bug fix proposal
### 9b. Record the issue number
```bash
ISSUE_NUM=$(gh issue view <number> --repo MervinPraison/PraisonAI --json number --jq '.number')
echo "Tracking issue #$ISSUE_NUM"
```
---
# PART B — IMPLEMENTATION MONITORING (Phases 10–15)
After the issue is filed, other agents (`@claude`, GitHub Copilot agent, CodeRabbit) pick it up automatically. This part watches, shepherds, validates, and merges.
## Phase 10 — Wait ~10 min for implementing agents
After `gh issue create`, Claude and Copilot typically start work within seconds and finish a first pass in 5–15 minutes.
```bash
echo "Waiting 10 minutes for implementing agents..."
echo "Start: $(date)"
sleep 600
echo "End: $(date)"
```
### Then check: did they open a PR?
```bash
REPO=MervinPraison/PraisonAI
ISSUE_NUM=<number>
# Check for PRs that reference the issue
gh pr list --repo $REPO --state open --search "fixes #$ISSUE_NUM OR closes #$ISSUE_NUM" --json number,title,headRefName
# Also check for branches matching claude/issue-<N>-* naming convention
gh api repos/$REPO/branches --paginate --jq ".[] | select(.name | startswith(\"claude/issue-$ISSUE_NUM\")) | .name"
```
---
## Phase 11 — Create PR if none exists
If Claude pushed a branch but did not open a PR, open one yourself.
```bash
REPO=MervinPraison/PraisonAI
ISSUE_NUM=<number>
BRANCH=$(gh api repos/$REPO/branches --paginate --jq ".[] | select(.name | startswith(\"claude/issue-$ISSUE_NUM\")) | .name" | head -1)
if [ -n "$BRANCH" ]; then
TITLE=$(gh api repos/$REPO/commits/$BRANCH --jq '.commit.message' | head -1)
gh pr create --repo $REPO --head "$BRANCH" --base main \
--title "$TITLE" \
--body "Automated PR from Claude's work on issue #$ISSUE_NUM.
Branch: \`$BRANCH\`
Closes #$ISSUE_NUM"
fi
```
### If no branch exists after 10 minutes
Re-trigger Claude by commenting on the issue, then wait another 10 minutes and re-check:
```bash
gh issue comment $ISSUE_NUM --repo $REPO \
--body "@claude please pick up this issue — full analysis and plan are in the issue body."
sleep 600
```
---
## Phase 12 — Wait ~10 min for reviewing agents
Once a PR exists, `CodeRabbit`, `Copilot`, and CI pipelines run. Give them time to complete.
```bash
echo "Waiting 10 minutes for PR reviewers and CI..."
sleep 600
```
### Collect status
```bash
PR=<pr-number>
gh pr view $PR --repo $REPO --json state,mergeable,mergeStateStatus,updatedAt,commits,files \
| python -c "
import json,sys
d=json.load(sys.stdin)
print(f\" State: {d['state']} Mergeable: {d['mergeable']} MergeState: {d['mergeStateStatus']}\")
print(f\" Commits: {len(d['commits'])}\")
for f in d['files']:
print(f\" {f['path']}: +{f['additions']} -{f['deletions']}\")
"
# CI & review checks
gh pr view $PR --repo $REPO --json statusCheckRollup > /tmp/pr-checks.json
python -c "
import json
for c in json.load(open('/tmp/pr-checks.json'))['statusCheckRollup']:
s = c.get('conclusion') or c.get('status','?')
name = c.get('name') or c.get('context','?')
if s and s not in ('SKIPPED',):
print(f' {name}: {s}')
"
```
---
## Phase 13 — Validate the PR locally
**Never merge an unvalidated PR.** Always clone the branch and run tests.
```bash
REPO_URL=https://github.com/MervinPraison/PraisonAI.git
BRANCH=<branch-name>
WORKDIR=/tmp/pr-validate
rm -rf $WORKDIR
git clone --depth 1 --branch "$BRANCH" $REPO_URL $WORKDIR
cd $WORKDIR
# Files touched by the PR
gh pr view $PR --repo $REPO --json files --jq '.files[].path'
# Run the tests for changed files — ALWAYS use timeout (user global rule)
timeout 120 python -m pytest <test-paths> -v --tb=short
# Critical invariant checks (adapt per feature):
# 1) Lazy-import: heavy deps never imported at module level
timeout 30 python - <<'PY'
import sys
from praisonai.observability import <NewThing> # example
assert 'heavy_dep' not in sys.modules, "eager import — violates AGENTS.md §4.2"
print("OK: lazy import preserved")
PY
# 2) Cold-import benchmark (no regression)
timeout 30 python -c "import time; t=time.time(); import praisonaiagents; print(f'{(time.time()-t)*1000:.1f} ms')"
```
### Mergeability gate
A PR is **ready to merge only if ALL of these are true**:
- [ ] `gh pr view` reports `mergeable=MERGEABLE` and `mergeStateStatus` in `CLEAN`/`UNSTABLE` (not `DIRTY`/`BLOCKED`).
- [ ] All `test (3.x)` matrix jobs report `SUCCESS`.
- [ ] Local `pytest` on the changed test files passes with **zero failures** (skipped/xfailed tests are OK).
- [ ] Lazy-import invariant preserved (if the feature adds an optional dep).
- [ ] Cold-import time within ±2 % of `main` (AGENTS.md §4.2).
- [ ] No files outside the issue's declared scope were changed.
- [ ] The diff respects all invariants in AGENTS.md §4.6.
If **any** is false → go to Phase 14 (feedback). Do not merge.
---
## Phase 14 — Feedback to `@claude` when issues found
When validation fails, post a precise, actionable comment tagging `@claude`, referencing the exact test name, error, file, and the AGENTS.md principle violated.
```bash
gh pr comment $PR --repo $REPO --body "$(cat <<'EOF'
Hold on merge: validated locally on HEAD `<short-sha>` and found these issues:
**Test failures:**
```
FAILED tests/.../test_x.py::TestY::test_z
AssertionError: <actual-message>
```
**Root cause:** <one-line diagnosis referencing the exact file and line>.
**AGENTS.md violation(s):**
- §<section>: <principle>
**Requested fix (minimal):**
- Change `<file>:<line>` to `<what>`.
- Or update the test assertion to `<what>` (if the test is wrong, not the code).
**What already passes:**
- N/M tests pass.
- Lazy-import invariant preserved ✅ (or not — state explicitly).
@claude please push a fix. Follow AGENTS.md principles: minimal change, protocol-driven, no perf impact, lazy imports, backward-compatible, safe defaults. Make sure the PR is robust — run the tests locally before force-pushing.
EOF
)"
```
### Loop
After commenting:
```bash
echo "Waiting 10 minutes for Claude to push fixes..."
sleep 600
# → return to Phase 12 (fetch new commits, re-run checks)
```
Repeat Phases 12 → 13 → 14 until the mergeability gate in Phase 13 is fully green, or escalate to a human after 3 failed rounds.
### When the PR has merge conflicts
If `mergeStateStatus=DIRTY`, ask Claude to rebase rather than resolving conflicts yourself on non-trivial logic:
```bash
gh pr comment $PR --repo $REPO --body "@claude this PR has merge conflicts with \`main\` (PR #<X> was merged, touching the same regions). Please rebase onto latest \`main\`, re-run \`pytest <paths>\`, and force-push."
```
---
## Phase 15 — Merge to `main`
Once Phase 13's gate is fully green:
### 15a. Final diff review against AGENTS.md
```bash
gh pr diff $PR --repo $REPO | less
```
**Hard gate — every box must be ticked before merge:**
- [ ] **Protocol-driven core (§4.1)**: no heavy implementations leaked into `praisonaiagents`.
- [ ] **No perf impact (§4.2)**: lazy imports confirmed; import benchmark within ±2 %.
- [ ] **DRY (§4.3)**: no new duplication; existing protocols/adapters reused where possible.
- [ ] **Agent-centric (§4.4)**: API centers on agents/sessions/tools/memory.
- [ ] **Async-safe + multi-agent safe (§4.5)**: no shared mutable globals; locks where needed.
- [ ] **Invariants preserved (§4.6)**: backward compatible, safe defaults, deterministic tests.
- [ ] **Naming conventions (§4.9)**: `XProtocol` for interfaces, `XAdapter` for impls, `add_*`/`get_*`/`save`/`load` verbs.
- [ ] No `.md` files added beyond those explicitly requested (per user global rule).
- [ ] Tests run locally with `timeout` — never hang (per user global rule).
### 15b. Merge
```bash
gh pr merge $PR --repo $REPO --squash --delete-branch
# --squash preserves linear main; --delete-branch keeps the repo clean
```
### 15c. Verify
```bash
gh pr view $PR --repo $REPO --json state,mergedAt,mergeCommit
gh issue view $ISSUE_NUM --repo $REPO --json state # should auto-close
```
---
# Orchestration Snippet (one-shot reference)
For a single end-to-end invocation, chain Part B phases:
```bash
#!/usr/bin/env bash
set -euo pipefail
REPO=MervinPraison/PraisonAI
ISSUE_NUM=<fill>
# Phase 10: wait for implementing agents
sleep 600
# Phase 11: ensure PR exists
BRANCH=$(gh api repos/$REPO/branches --paginate \
--jq ".[] | select(.name | startswith(\"claude/issue-$ISSUE_NUM\")) | .name" | head -1)
PR=$(gh pr list --repo $REPO --state open --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null || true)
if [ -z "$PR" ] && [ -n "$BRANCH" ]; then
TITLE=$(gh api repos/$REPO/commits/$BRANCH --jq '.commit.message' | head -1)
gh pr create --repo $REPO --head "$BRANCH" --base main \
--title "$TITLE" --body "Closes #$ISSUE_NUM"
PR=$(gh pr list --repo $REPO --state open --head "$BRANCH" --json number --jq '.[0].number')
fi
echo "Tracking PR #$PR"
# Phase 12: wait for reviewers + CI
sleep 600
# Phases 13–14: validate + feedback loop (cap at 3 rounds)
for round in 1 2 3; do
echo "=== Validation round $round ==="
# clone + pytest (per feature) — if green break; else gh pr comment + sleep 600
break # placeholder
done
# Phase 15: merge
gh pr merge $PR --repo $REPO --squash --delete-branch
gh issue view $ISSUE_NUM --repo $REPO --json state
```
---
## Checklist — Before Merging
- [ ] Issue exists and describes the work
- [ ] PR exists and references the issue (`Closes #N`)
- [ ] Branch was fetched and tests were run **locally** — not just CI-trusted
- [ ] All PR-relevant tests pass with zero failures
- [ ] CI matrix (3.10 / 3.11 / 3.12) is all green
- [ ] Lazy-import / cold-import invariants verified if optional deps added
- [ ] Diff reviewed against every AGENTS.md §4 principle
- [ ] `mergeStateStatus` in `CLEAN`/`UNSTABLE`, never `DIRTY`/`BLOCKED`
- [ ] No files outside the issue's scope were changed
- [ ] If feedback was given, `@claude` had a chance to respond and fixed everything
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---------|-----|
| Merging without running tests locally | Always `git clone` the branch and run `pytest` |
| Resolving complex conflicts manually | Ask `@claude` to rebase instead |
| Trusting CI alone | CI jobs can be skipped / out-of-date; local validation is source of truth |
| Vague feedback to `@claude` | Every comment must cite file, line, test name, error, and AGENTS.md section |
| Waiting forever | Cap loops at 3 rounds, then escalate to a human |
| Running commands without `timeout` | Always `timeout 60 ...` per user global rule |
| Creating `.md` docs proactively | Don't — user rule forbids unrequested `.md` files |
| Skipping diff review | Every merge needs a full-diff AGENTS.md pass |
---
## Hard Rules
1. **Never merge without local test validation.**
2. **Never merge when `mergeStateStatus = DIRTY` or `BLOCKED`.**
3. **Every `@claude` comment must be actionable** — file, line, exact fix, AGENTS.md ref.
4. **Cap feedback loops at 3 rounds** — escalate after that, don't spin forever.
5. **Use `--squash --delete-branch`** to keep `main` linear and the repo clean.
6. **Always verify** the issue auto-closed after merge.
7. **All `run_command` calls use `timeout`** to avoid hangs (user global rule).
8. **No proactive `.md` creation** beyond this workflow file (user global rule).
-63
View File
@@ -1,63 +0,0 @@
---
description: Project information and deployment reference for PraisonAIUI
---
## Project: PraisonAIUI
YAML-driven website/docs generator. One YAML file, one docs folder, one command — ship a beautiful documentation site.
**Aim**: AIUI is a standardised, protocol-driven UI framework for building *any* AI-powered interface — not hardcoded to PraisonAI.
## Key Files
| File | Purpose |
|------|---------|
| `aiui.template.yaml` | Site configuration (theme, nav, routes, components) |
| `docs/` | Markdown content directory |
| `src/praisonaiui/` | Python source (CLI, compiler, server, providers) |
| `src/praisonaiui/compiler/` | Build pipeline: config → static site |
| `src/praisonaiui/templates/frontend/` | Bundled React SPA (index.html + assets) |
| `.github/workflows/ci.yml` | CI (lint, test) + GitHub Pages deployment |
| `pyproject.toml` | Package metadata, dependencies, entry points |
| `CNAME` | Custom domain: `ui.praison.ai` |
## CLI Commands
```bash
aiui init # Scaffold new project
aiui build # Compile → static site in ./aiui/
aiui build --output site --minify # For GitHub Pages
aiui serve # Serve built site locally
aiui dev # Dev mode with hot reload
aiui validate # Validate aiui.template.yaml
```
## Build Output
`aiui build` produces a fully static SPA:
- `index.html` + `assets/` — React frontend bundle
- `ui-config.json` — compiled site configuration
- `docs-nav.json` — navigation tree from docs folder
- `route-manifest.json` — route definitions
- `docs/` — copied markdown content
## Deployment
- **CI**: On push to `main`, GitHub Actions runs `aiui build --output site --minify`
- **Deploy**: `peaceiris/actions-gh-pages@v4` pushes `./site/` to `gh-pages` branch
- **Domain**: `ui.praison.ai` via CNAME file copied into build output
- **No server required** — everything is static
## Testing
```bash
pip install -e .[dev]
pytest tests/unit tests/integration -v
ruff check src/praisonaiui
```
## Package
- PyPI name: `aiui`
- Entry points: `aiui` and `praisonaiui` (both map to `praisonaiui.cli:app`)
- Python: ≥3.9
-839
View File
@@ -1,839 +0,0 @@
---
description: Update install.sh and deploy PraisonAI to Kubernetes via Helm (CI/CD Pipeline)
---
# Install.sh Update & Helm Deployment Workflow
Complete guide for updating the PraisonAI install script and deploying to Kubernetes via the full CI/CD pipeline.
**⚠️ CRITICAL**: This workflow contains **NO SECRETS**. All sensitive values (tokens, passwords) must be passed via environment variables or external secret management.
## 📁 Key Locations (MUST KNOW)
### Scripts
| File/Resource | Absolute Path | Purpose |
|---------------|---------------|----------|
| **install.sh** | `/Users/praison/praisonai-package/src/praisonai/scripts/install.sh` | Main bash installer |
| **install.ps1** | `/Users/praison/praisonai-package/src/praisonai/scripts/install.ps1` | PowerShell installer |
### CI/CD Pipeline (GitHub → ACR → Helm → K8s)
| File/Resource | Absolute Path | Purpose |
|---------------|---------------|----------|
| **GitHub Workflow** | `/Users/praison/Sites/localhost/praisonai/.github/workflows/azure-pipeline.yaml` | CI/CD pipeline triggered on git push |
| **Dockerfile.php** | `/Users/praison/Sites/localhost/praisonai/Dockerfile.php` | PHP container build |
| **Dockerfile.nginx** | `/Users/praison/Sites/localhost/praisonai/Dockerfile.nginx` | Nginx container build |
| **Dockerfile.init** | `/Users/praison/Sites/localhost/praisonai/Dockerfile.init` | Init container build |
### Helm Deployment
| File/Resource | Absolute Path | Purpose |
|---------------|---------------|----------|
| **Helm Charts** | `/Users/praison/repos/person/helmcharts/` | All Kubernetes deployments |
| **wb_azure Chart** | `/Users/praison/repos/person/helmcharts/charts/wb_azure/` | PraisonAI WordPress deployment |
| **Production Values** | `/Users/praison/Sites/localhost/praisonai/values-praisonai-production.yaml` | Production Helm config |
| **Local Values** | `/Users/praison/Sites/localhost/praisonai/values-local.yaml` | Local development config |
| **Deployment Docs** | `/Users/praison/Sites/localhost/praisonai/DEPLOYMENT.md` | Deployment documentation |
| **Deployment Makefile** | `/Users/praison/Sites/localhost/praisonai/Makefile` | Deployment automation |
---
## 🔄 Full CI/CD Pipeline Overview
```
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Git Push │────▶│ GitHub Actions │────▶│ Azure ACR │
│ (master) │ │ azure-pipeline │ │ Image Build │
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Kubernetes │◀────│ Helm Upgrade │◀────│ Update Image │
│ Deployment │ │ (values.yaml) │ │ Tag in Values │
└─────────────────┘ └──────────────────┘ └─────────────────┘
```
### Pipeline Steps:
1. **Git push** to master branch
2. **GitHub Actions** triggers (`.github/workflows/azure-pipeline.yaml`)
3. **Build** Docker images (nginx, php, init)
4. **Push** to Azure Container Registry (ACR)
5. **Update** Helm values with new image tag
6. **Deploy** using Helm upgrade
---
## 🚀 Phase 0 - Fully Automated CI/CD Pipeline
### Complete Auto-Deploy Architecture
```
Git Push ──▶ Build Images ──▶ Trigger Deploy ──▶ Helm Upgrade ──▶ Production
│ │ │ │
│ ▼ ▼ ▼
│ ACR Push helmcharts wb_azure chart
│ (pa-php:SHA) repository (K8s deploy)
│
└─── install.sh ────────────────────────────────────────────────▶ praison.ai/install.sh
```
### Step 0.1: Build Workflow (Automatic on Git Push)
**File**: `/Users/praison/Sites/localhost/praisonai/.github/workflows/azure-pipeline.yaml`
**Repository**: `https://github.com/MervinPraison/praison.ai`
This workflow triggers on every push to `master`:
```yaml
on:
push:
branches: [master]
```
**What it does:**
1. **Syncs install.sh** from PraisonAI repository (only if changed!)
- Checks out `MervinPraison/PraisonAI`
- Compares `install.sh` and `install.ps1` with existing web files
- **Only copies if files have actually changed** (avoids unnecessary redeploys)
- This ensures `https://praison.ai/install.sh` is always latest
2. Downloads env files from Azure Storage
3. Builds multi-arch Docker images (linux/amd64, linux/arm64)
4. Pushes to Azure Container Registry: `praison.azurecr.io/pa/`
5. **Triggers Helm deployment** via `repository_dispatch` event
**Key Step - Automatic Deploy Trigger:**
```yaml
- name: Trigger Helm Deployment
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
curl -X POST \
-H "Authorization: token ${{ secrets.HELM_REPO_TOKEN }}" \
-d '{
"event_type": "deploy_wb_azure",
"client_payload": {
"image_tag": "'"$SHORT_SHA"'",
"source_repo": "'"${{ github.repository }}"'",
"source_commit": "'"${{ github.sha }}"'"
}
}' \
https://api.github.com/repos/praison/helmcharts/dispatches
```
### Step 0.2: Deploy Workflow (Triggered Automatically)
**File**: `/Users/praison/repos/person/helmcharts/.github/workflows/helm-upgrade-with-image.yml`
Listens for `repository_dispatch` events:
```yaml
on:
repository_dispatch:
types: [deploy_wb_azure, deploy_tcs_azure, deploy_tamilmanna_azure]
```
**What it does:**
1. Receives image tag from build workflow
2. Runs `helm upgrade --install wb_azure` with new image tag
3. Waits for rollout to complete
4. Verifies deployment
**Result**: Every git push automatically builds AND deploys!
### Required GitHub Secrets
For the automated CI/CD to work, you need these secrets configured:
**In praisonai site repository** (`https://github.com/MervinPraison/praison.ai`):
| Secret | Purpose |
|--------|---------|
| `AZURE_CREDENTIALS` | Azure login for ACR and AKS |
| `AZURE_USERNAME` | ACR username |
| `AZURE_PASSWORD` | ACR password |
| `AZURE_STORAGE_KEY` | Download env files from Azure Storage |
| `HELM_REPO_TOKEN` | **NEW**: Trigger deploy workflow in helmcharts repo |
**In helmcharts repository** (`/Users/praison/repos/person/helmcharts/.github/workflows/`):
| Secret | Purpose |
|--------|---------|
| `AZURE_CREDENTIALS` | Azure login for AKS |
| `AKS_CLUSTER_NAME` | Kubernetes cluster name |
| `AKS_RESOURCE_GROUP` | Azure resource group |
**To add HELM_REPO_TOKEN**:
1. Go to GitHub Settings → Developer settings → Personal access tokens
2. Create token with `repo` scope
3. Add as secret `HELM_REPO_TOKEN` in https://github.com/MervinPraison/praison.ai
**Current status**: ✅ Already configured (set via `gh secret set`)!
**Images built:**
- `praison.azurecr.io/pa/pa-nginx:SHORT_SHA`
- `praison.azurecr.io/pa/pa-nginx:master`
- `praison.azurecr.io/pa/pa-php:SHORT_SHA`
- `praison.azurecr.io/pa/pa-php:master`
- `praison.azurecr.io/pa/pa-init:SHORT_SHA`
- `praison.azurecr.io/pa/pa-init:master`
### Step 0.2: Update Helm Values with New Image Tag
After the ACR build completes, update the Helm values file to use the new image:
```bash
cd /Users/praison/Sites/localhost/praisonai
# Get the short SHA from the latest commit (matches the Docker tag)
SHORT_SHA=$(git rev-parse --short HEAD)
# Update values file with new image tag
helm upgrade praisonai /Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--set image.tag=$SHORT_SHA \
--namespace default \
--timeout 10m
```
**Alternative**: Update values file permanently:
```bash
# Edit values-praisonai-production.yaml to set image.tag
sed -i "s/tag: \".*\"/tag: \"$SHORT_SHA\"/" values-praisonai-production.yaml
# Then commit and push the updated values
git add values-praisonai-production.yaml
git commit -m "ci: update image tag to $SHORT_SHA"
git push origin master
```
### Step 0.3: Full Automated Script (For CI/CD Integration)
```bash
#!/bin/bash
# deploy-after-build.sh - Run after ACR build completes
set -e
SHORT_SHA=$(git rev-parse --short HEAD)
NAMESPACE=default
RELEASE_NAME=praisonai
CHART_PATH=/Users/praison/repos/person/helmcharts/charts/wb_azure
VALUES_FILE=/Users/praison/Sites/localhost/praisonai/values-praisonai-production.yaml
echo "🚀 Deploying PraisonAI with image tag: $SHORT_SHA"
# Update Helm deployment with new image tag
helm upgrade --install $RELEASE_NAME $CHART_PATH \
-f $VALUES_FILE \
--set image.tag=$SHORT_SHA \
--namespace $NAMESPACE \
--timeout 10m \
--atomic
echo "✅ Deployment complete!"
echo ""
echo "Verify with:"
echo " kubectl get pods -n $NAMESPACE -l app.kubernetes.io/instance=$RELEASE_NAME"
echo " helm status $RELEASE_NAME -n $NAMESPACE"
```
---
### Step 0.4: Extend GitHub Actions for Automatic Helm Deployment
To make the CI/CD fully automated (build → deploy), extend the GitHub Actions workflow:
**File to edit**: `/Users/praison/Sites/localhost/praisonai/.github/workflows/azure-pipeline.yaml`
Add a new job after the `build` job:
```yaml
deploy:
needs: build # Wait for build to complete
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Setup kubectl
uses: azure/setup-kubectl@v3
with:
version: 'v1.28.0'
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: 'v3.13.0'
- name: Get AKS credentials
run: |
az aks get-credentials \
--resource-group your-resource-group \
--name your-aks-cluster-name \
--overwrite-existing
- name: Deploy with Helm
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
helm upgrade --install praisonai \
/Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--set image.tag=$SHORT_SHA \
--namespace default \
--timeout 10m \
--atomic
- name: Verify deployment
run: |
kubectl rollout status deployment/php-nginx -n default
helm status praisonai -n default
```
**Requirements for automatic deploy:**
1. GitHub repository secrets configured:
- `AZURE_CREDENTIALS` - Azure service principal credentials
- `AZURE_STORAGE_KEY` - For downloading env files
- `AZURE_USERNAME` / `AZURE_PASSWORD` - ACR login
2. AKS cluster access configured in Azure
3. Helm and kubectl available in GitHub Actions runner
---
## 🔧 Phase 1 — Update install.sh (Manual, When Needed)
### When to Update
- New PraisonAI version released
- New dependency requirements
- New OS support needed
- Bug fixes in installation process
### Step 1: Read Current install.sh
```bash
# View the install script
cat /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
```
Key sections in install.sh:
- **Lines 1-50**: Header, usage, environment variables documentation
- **Lines 51-150**: OS detection (macOS, Linux, Windows/WSL)
- **Lines 151-300**: Python installation (version checks, package managers)
- **Lines 301-450**: Virtual environment setup
- **Lines 451-550**: PraisonAI package installation
- **Lines 551-637**: PATH configuration, shell integration, verification
### Step 2: Make Changes
**Common Changes:**
#### Update Default Version
```bash
# Find this line (around line 70):
PRAISONAI_VERSION="${PRAISONAI_VERSION:-latest}"
# Change to specific version if needed:
PRAISONAI_VERSION="${PRAISONAI_VERSION:-1.5.0}"
```
#### Add New Environment Variable
```bash
# Add to header section (after line 10, in the comment block):
# PRAISONAI_NEW_FEATURE - Description (default: value)
# Add to actual code (around line 75):
export PRAISONAI_NEW_FEATURE="${PRAISONAI_NEW_FEATURE:-default_value}"
```
#### Update Python Version Requirements
```bash
# Find Python version check (around line 100-120):
PYTHON_MIN_VERSION="3.9"
# Update if needed:
PYTHON_MIN_VERSION="3.10"
```
### Step 3: Test Changes
```bash
# Test locally (dry run)
cd /Users/praison/praisonai-package/src/praisonai/scripts
bash install.sh --dry-run
# Test in Docker (full test)
bash /Users/praison/praisonai-package/src/praisonai/scripts/test-install-smoke.sh
```
### Step 4: Verify Both Scripts
```bash
# Check install.sh syntax
bash -n /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
# Check install.ps1 syntax (if pwsh available)
pwsh -Command "Get-Command /Users/praison/praisonai-package/src/praisonai/scripts/install.ps1"
```
---
## 🚀 Phase 2 — Deploy to Kubernetes (Helm)
### Pre-Deployment Checklist
```bash
# 1. Verify kubectl connection
kubectl get nodes
# 2. Check current Helm releases
helm list -n default
# 3. Verify chart exists
ls /Users/praison/repos/person/helmcharts/charts/wb_azure/
```
### Deployment Types
#### A. Fresh Deployment (First Time)
```bash
cd /Users/praison/Sites/localhost/praisonai
# Option 1: Using Makefile
make deploy
# Option 2: Manual helm command
helm upgrade --install praisonai /Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--namespace default \
--timeout 10m \
--atomic
```
#### B. Update Existing Deployment
```bash
cd /Users/praison/Sites/localhost/praisonai
# Edit values file first
vim values-praisonai-production.yaml
# Then apply
make upgrade
# Or manually:
helm upgrade praisonai /Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--namespace default \
--timeout 10m
```
#### C. Local Development Deployment
```bash
cd /Users/praison/Sites/localhost/praisonai
make local-deploy
```
### Values File Structure
```yaml
# /Users/praison/Sites/localhost/praisonai/values-praisonai-production.yaml
# Core settings
replicaCount: 2
# Database
dbHost: "10.0.0.11"
dbUser: "bible_4"
dbPassword: "changeme" # Override via --set
# OpenAI tokens (for plugin verification)
openaiVerificationToken: "token-here"
# Feature toggles
praisonai:
enabled: true
domain: praison.ai
whiteboard:
enabled: true
domain: whiteboard.gallery
# Disable other sites
bible: { enabled: false }
music: { enabled: false }
save: { enabled: false }
# Resources
resources:
requests:
cpu: 800m
memory: 1024Mi
limits:
cpu: 2000m
memory: 2048Mi
# Auto-scaling
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
# Ingress
ingress:
enabled: true
className: nginx
```
---
## 📊 Phase 3 — Verify Deployment
### Check Deployment Status
```bash
# Using Makefile
make status
# Manual checks
helm status praisonai -n default
kubectl get pods -l app.kubernetes.io/instance=praisonai -n default
kubectl get svc -l app.kubernetes.io/instance=praisonai -n default
```
### Verify All Resources
```bash
# Pods should be Running
kubectl get pods -n default | grep praisonai
# Services should be Active
kubectl get svc -n default | grep praisonai
# Ingress should exist
kubectl get ingress -n default | grep praisonai
# ConfigMaps
kubectl get configmap -n default | grep nginx-config
# Secrets
kubectl get secret -n default | grep db-password
```
### Check Application Health
```bash
# Port forward and test
echo "Visit http://127.0.0.1:8080"
kubectl port-forward svc/php-nginx 8080:80 -n default
# In another terminal:
curl http://127.0.0.1:8080/test.php
```
---
## 🔄 Phase 4 — Rollback (If Needed)
```bash
# View revision history
make history
# Rollback to previous revision
make rollback
# Or manually:
helm rollback praisonai 1 -n default
```
---
## 🛠️ Phase 5 — Troubleshooting
### Problem: "Resource exists and cannot be imported"
**Cause**: Existing Kubernetes resources not managed by Helm.
**Solution**: Adopt resources into Helm
```bash
cd /Users/praison/Sites/localhost/praisonai
./scripts/adopt-resources.sh praisonai default
```
Or manually annotate:
```bash
# For any resource type
kubectl annotate <resource-type> <name> \
meta.helm.sh/release-name=praisonai \
meta.helm.sh/release-namespace=default
kubectl label <resource-type> <name> \
app.kubernetes.io/managed-by=Helm
```
### Problem: Pods Not Starting
```bash
# Check events
kubectl get events -n default --sort-by='.lastTimestamp' | tail -20
# Check pod logs
kubectl logs -l app.kubernetes.io/instance=praisonai -n default
# Describe pod for details
kubectl describe pod <pod-name> -n default
```
### Problem: Image Pull Errors
```bash
# Check image pull secrets
kubectl get secret acr-auth -n default
# Verify ACR auth exists
kubectl create secret docker-registry acr-auth \
--docker-server=praison.azurecr.io \
--docker-username=<username> \
--docker-password=<password> \
-n default
```
---
## 📋 Phase 6 — Post-Deployment
### Update Documentation
If install.sh changed, update:
1. `/Users/praison/PraisonAIDocs/docs/installation.mdx` — Installation docs
2. `/Users/praison/praisonai-package/src/praisonai/scripts/README.md` — Script docs (if exists)
### Verify Website
```bash
# Check praison.ai is accessible
curl -I https://praison.ai
# Check whiteboard.gallery
curl -I https://whiteboard.gallery
```
### Monitor
```bash
# Watch pods
kubectl get pods -l app.kubernetes.io/instance=praisonai -n default -w
# Check resource usage
kubectl top pods -l app.kubernetes.io/instance=praisonai -n default
```
---
## 📚 Reference: Helm Chart Structure
```
/Users/praison/repos/person/helmcharts/charts/wb_azure/
├── Chart.yaml # Chart metadata (name: wb, version: 1.0.1)
├── values.yaml # Default values (fallback)
├── templates/
│ ├── deployment.yaml # Main php-nginx deployment
│ ├── service.yaml # NodePort service
│ ├── ingress.yaml # TLS + routing
│ ├── nginx-configMap.yaml # Server configs
│ ├── db-password-secret.yaml # DB credentials
│ ├── pdb.yaml # Pod disruption budget
│ ├── autoscalar.yml # HPA
│ ├── cert-manager.yaml # TLS certificates
│ └── _helpers.tpl # Template helpers
```
---
## 🎯 Quick Commands Reference
| Task | Command |
|------|---------|
| Deploy | `make deploy` |
| Update | `make upgrade` |
| Status | `make status` |
| History | `make history` |
| Rollback | `make rollback` |
| Logs | `make logs` |
| Restart | `make restart` |
| Local dev | `make local-deploy` |
| Dry run | `make dry-run` |
| Lint | `make lint` |
---
## ⚠️ Critical Rules
1. **Never commit SQL dumps**: `.gitignore` already excludes `*.sql` files
2. **Never commit secrets**: Use `--set` or external secret management
3. **Always test install.sh** after changes (use test-install-smoke.sh)
4. **Always verify deployment** with `make status` after Helm operations
5. **Use Infrastructure as Code**: All changes via Helm values files, never manual kubectl
6. **Version control**: Commit values files (without secrets), never commit generated manifests
---
## 🆘 Getting Help
If stuck:
1. Check `/Users/praison/Sites/localhost/praisonai/DEPLOYMENT.md` for detailed docs
2. Check `/Users/praison/Sites/localhost/praisonai/INFRASTRUCTURE_AS_CODE_SUMMARY.md` for quick reference
3. Run `helm status praisonai -n default` for deployment status
4. Run `kubectl get events -n default` for cluster events
5. View install.sh comments for usage examples (lines 1-50)
---
## 🔄 CI/CD Pipeline Summary (For New Agents)
### Complete Workflow (Fully Automated!)
```
Developer Push ──────────────────────────────────────────────▶ Production
│ │
▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ 1. Git Push to │───▶│ 2. GitHub Actions │───▶│ 3. Sync │
│ master │ │ Trigger │ │ install.sh │
└─────────────────┘ └──────────────────┘ └────────┬─────────┘
│
┌────────────────────────┘
▼
┌──────────────────┐
│ 4. Azure ACR │
│ Build Images │
│ + Push │
└────────┬─────────┘
│
──────▶┌──────────────────┐
│ 5. Trigger Deploy│
│ (repository_ │
│ dispatch) │
└────────┬─────────┘
│
┌─────────────────┐ ┌──────────────────┐ │
│ 7. Production │◀───│ 6. Helm Upgrade │◀──┘
│ Running │ │ Deploy │
│ (includes │ │ │
│ install.sh) │ │ │
└─────────────────┘ └──────────────────┘
```
**🎉 Fully Automated**: Git push → Build → Deploy (No manual steps!)
### Automatic install.sh Sync
**Key Point**: The workflow automatically syncs `install.sh` from `MervinPraison/PraisonAI` repository **only if changed**:
```yaml
- name: Checkout PraisonAI for install.sh
uses: actions/checkout@v2
with:
repository: MervinPraison/PraisonAI
path: praisonai-package
- name: Sync install.sh to web folder (if changed)
run: |
# Only sync if files have actually changed
if ! diff -q praisonai-package/src/praisonai/scripts/install.sh ./web/install.sh; then
cp praisonai-package/src/praisonai/scripts/install.sh ./web/install.sh
fi
```
**Optimization**: Uses `diff` to compare files - only copies when install.sh or install.ps1 have actually changed. This avoids unnecessary Docker layer rebuilds and deployments.
**Result**: `https://praison.ai/install.sh` is automatically updated **only when the source files change**!
### How install.sh is Served
The `web/install.sh` file is copied into the Docker image at `/var/www/html/web/install.sh` and served by nginx:
```nginx
# In nginx-config, requests to praison.ai/install.sh
# are served from /var/www/html/web/install.sh
location / {
root /var/www/html/web;
try_files $uri $uri/ =404;
}
```
**URL Mapping**:
| File in Repo | URL |
|--------------|-----|
| `web/install.sh` | `https://praison.ai/install.sh` |
| `web/install.ps1` | `https://praison.ai/install.ps1` |
### What Files to Edit
| To Change | Edit File |
|-----------|-----------|
| Application code | `/Users/praison/Sites/localhost/praisonai/` (PHP files) |
| Docker images | `Dockerfile.php`, `Dockerfile.nginx`, `Dockerfile.init` |
| CI/CD pipeline | `.github/workflows/azure-pipeline.yaml` |
| Helm deployment config | `values-praisonai-production.yaml` |
| Install script | `/Users/praison/praisonai-package/src/praisonai/scripts/install.sh` |
### Common Tasks
**Task 1: Deploy new code**
```bash
cd /Users/praison/Sites/localhost/praisonai
git add .
git commit -m "feat: new feature"
git push origin master
# CI/CD automatically builds and deploys
```
**Task 2: Update install.sh and deploy**
```bash
# 1. Update install.sh
vim /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
# 2. Test install.sh
bash /Users/praison/praisonai-package/src/praisonai/scripts/install.sh --dry-run
# 3. Commit and push
git add /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
git commit -m "fix: update install script"
git push origin main
# 4. Deploy website (if needed)
cd /Users/praison/Sites/localhost/praisonai
make upgrade
```
**Task 3: Rollback deployment**
```bash
cd /Users/praison/Sites/localhost/praisonai
make rollback
# Or: helm rollback praisonai 1 -n default
```
### Architecture
| Layer | Technology | Purpose |
|-------|------------|---------|
| Source Control | Git/GitHub | Code repository |
| CI/CD | GitHub Actions | Automated build/deploy |
| Container Registry | Azure ACR | Docker image storage |
| Orchestration | Kubernetes (AKS) | Container management |
| Deployment | Helm | K8s package management |
| Ingress | NGINX Ingress + cert-manager | Traffic routing + TLS |
### Security Notes
- **No secrets in workflow files** - All tokens/passwords via env vars
- **ACR authentication** - Uses `acr-auth` secret in Kubernetes
- **GitHub Secrets** - `AZURE_CREDENTIALS`, `AZURE_USERNAME`, `AZURE_PASSWORD`
- **Never commit** `.env` files, SQL dumps, or credentials
-165
View File
@@ -1,165 +0,0 @@
---
description: instruction
---
Create multiple TODOs and sub-TODOs, get all things done.
First: detailed analysis, plan, and gap analysis. Go through all files, understand current logic. Search if needed.
Then: implement, fix, test (TDD, Agent-Centric, no perf impact, DRY). praisonaiagents is protocol-driven. Run unit, integration, smoke, and real agentic tests.
After: re-do detailed analysis/plan to find remaining gaps and propose fixes.
Docs: beginner-friendly, for non-developers. Explain concepts with mermaid diagrams (Dark Red #8B0000 for agents/inputs/outputs, Teal #189AB4 for tools, white #fff text). Less descriptive, more interactive. Use Mintlify components: Accordions, Badge, Callouts (Note/Warning/Info/Tip/Check/Danger), Cards/Columns, CodeGroup, Expandables, Tabs, Steps, Frame, Icon, Tooltip, Mermaid, ParamField, Tables, CardGroup.
You are an expert AI engineer in the PraisonAI ecosystem.
Production-quality code, zero regressions, full verification. Make PraisonAI the best agent framework.
### Core Philosophy
```
Simpler • More extensible • Faster • Agent-centric
```
| Principle | Rule |
|---|---|
| Agent-Centric | Design centers on Agents, workflows, sessions, tools, memory |
| Protocol-Driven | Core SDK: protocols/hooks/adapters only; heavy code in wrapper/tools |
| Minimal API | Fewer params, sensible defaults, explicit overrides |
| Performance-First | Lazy loading, optional deps, no hot-path regressions |
| Production-Ready | Safe by default, multi-agent safe, async-safe |
- Powerful, lightweight, reliable. Easy for non-developers.
- "Few lines of code to do the task!" — SDK and docs must feel this way.
- Each feature runs 3 ways: CLI, YAML, Python.
- Open source, developer-first. Core free, clear upgrade path to paid (support/cloud/services).
- Simple to adopt, hard to misuse, safe by default.
- Prioritise time saved, reduced risk, and operational confidence.
- Reduce production friction, not just add functionality.
- All features must have CLI integration. Agent-first naming and ergonomics.
ENGINEERING PRINCIPLES (MUST)
- DRY: reuse abstractions, no duplication.
- Protocol-driven core: protocols/hooks in core; heavy impl in wrapper/tools.
- No perf impact: lazy imports, optional deps, no global singletons, no heavy module-level work.
- TDD mandatory: tests first.
- Multi-agent + async safe by default.
- AGENTS.md is not for documentation.
CRITICAL REQUIREMENTS
- EXECUTE + VERIFY mode. No guessing. Proof for "done."
- Optional deps only; lazy import everything heavy.
- Every feature/fix: Python + CLI + docs/examples.
- Any core change must be justified: simpler client API, measurable benefit, NO perf regression.
- If TypeScript parity required: update praisonai-ts, but never at cost of Python core performance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CANONICAL PATHS (MUST use these)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Core SDK: /Users/praison/praisonai-package/src/praisonai-agents → praisonaiagents
- Wrapper: /Users/praison/praisonai-package/src/praisonai → praisonai
- Tools: /Users/praison/PraisonAI-tools → praisonai-tools
- Docs: /Users/praison/PraisonAIDocs (read AGENTS.md first before updating docs)
- Docs JS: /Users/praison/PraisonAIDocs/docs/js | Rust: docs/rust
- Examples: /Users/praison/praisonai-package/examples/
- TypeScript: /Users/praison/praisonai-package/src/praisonai-ts
- Rust: /Users/praison/praisonai-package/src/praisonai-rust (follow praisonai-ts/AGENTS.md)
- UI (this repo): /Users/praison/praisonaiui → praisonaiui
- Extension points: tools/base.py, tools/decorator.py, db/*
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ARCHITECTURE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Core (praisonaiagents): protocol-driven, lightweight. No heavy imports. Only protocols/hooks/adapters.
Wrapper (praisonai): real integrations (DBs, observability, CLI). Lazy imports, optional deps.
Tools (PraisonAI-tools): pluggable, never overload core/wrapper.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MANDATORY EXECUTION FLOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PHASE 1 — ANALYSIS (before writing code)
1.1 Acceptance Criteria — testable bullets for API, CLI, docs, tests, perf.
1.2 Repo Inventory — scan relevant files end-to-end:
- modules/classes/APIs/exports, CLI commands, tests, docs/examples
- Evidence: paths + symbols + grep counts. Identify DRY opportunities.
1.3 Gap Analysis — what exists vs what's needed:
- Missing: core SDK, wrapper, tools, CLI, docs, tests, exports
- Risks: perf, API breaks, optional deps, async, multi-agent
1.4 Report — current behavior, pain points, root causes (file refs), constraints, risk register, decision log.
1.5 Plan — step-by-step: tests → impl → CLI → docs → verify. Files to change. Compat/rollback/perf strategy.
1.6 Proposal — minimal agent-centric design. Protocols in core, impl in wrapper. Upgrade-path notes.
1.7 TODO Tree — granular, executable. Python + CLI + TDD + docs + perf.
- Second-to-last: "Verify all changes end-to-end"
- Last: "Implement remaining gaps (missing=0), re-verify" or "Final scan, confirm missing=0"
PHASE 2 — EXECUTE
2.1 TDD — write failing tests first. Deterministic and fast.
2.2 Implement — DRY, agent-centric, protocol-driven. Heavy code in wrapper/tools. Multi-agent + async safe.
2.3 CLI parity — add/extend CLI commands. Scriptable, clear help, proper exit codes.
2.4 Docs — Mintlify pages (SDK="Module", API="API"). Copy-paste runnable examples.
2.5 Verification:
- Run tests (unit/integration), show results.
- Smoke: `python3 -c "..."` + CLI help/run.
- Optional deps graceful degradation.
- Perf: no heavy core imports, import-time sanity.
- Provide evidence for every claim.
- dont use Sending termination request to command to terminate a process, kill port instead when terminating
REAL AGENTIC TEST (MANDATORY — not replaceable by smoke tests)
- After unit/smoke tests, MUST run at least one REAL agent execution:
1. Create Agent with the feature being tested
2. Call `agent.start("a real task prompt")` — NOT just constructing the object
3. Agent MUST call LLM and produce text response
4. Print full output so dev can see it worked end-to-end
- Minimum example:
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are a helpful assistant")
result = agent.start("Say hello in one sentence")
print(result)
```
- Assert-only object construction = SMOKE TEST, not real agentic test.
- Both smoke AND real agentic tests required.
PHASE 3 — POST-IMPLEMENTATION ANALYSIS
3.1 Re-scan files, summarize final behavior/architecture.
3.2 Confirm remaining gaps (API, CLI, docs, tests, exports, perf, multi-agent, async). If gaps exist, treat as required work until missing=0.
3.3 Report: what changed, why, validation evidence, tradeoffs.
3.4 Plan: close remaining gaps or maintenance plan.
3.5 Proposal: refinements for UX, safety, perf, extensibility. Label: implemented vs out-of-scope.
Final rule: conclude only when evidence shows missing = 0.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PUBLISH WORKFLOW (reference)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1 — Publish praisonaiagents (Core SDK):
cd /Users/praison/praisonai-package/src/praisonai-agents
praisonai publish pypi
# Uses uv internally: uv lock → uv build → uv publish
# Auto-bumps patch version, requires PYPI_TOKEN env var
Step 2 — Publish praisonai (Wrapper):
cd /Users/praison/praisonai-package/src/praisonai
python scripts/bump_and_release.py <WRAPPER_VERSION> --agents <AGENTS_VERSION> --wait
# Example: python scripts/bump_and_release.py 4.5.90 --agents 1.5.91 --wait
# Waits for agents to be available on PyPI, bumps all version files,
# runs uv lock, builds, commits, tags, pushes, creates GitHub release
# Then: uv publish (from src/praisonai with clean dist/)
If bump_and_release published already, just verify:
pip index versions praisonai | head -1
If uv publish fails with "File already exists", it means the version is already on PyPI — success.
Step 3 — Publish praisonai-tools (External, if needed):
cd /Users/praison/PraisonAI-tools
# Bump version in pyproject.toml, then:
python3.13 -m build && uv run twine upload dist/*
PraisonAI PRs: NEVER merge automatically — user merges manually.
-223
View File
@@ -1,223 +0,0 @@
---
description: Implement, fix, and test code changes locally — for when the agent IS the implementer
---
# Local Fix Workflow
You are the implementer. Analyze → Plan → Implement → Test → Verify → PR.
> **When to use this:** The user explicitly asks you to fix something locally, or delegates a task that cannot be handled by the GitHub cloud agents.
> **When NOT to use this:** If given an Issue URL, prefer `@[/pr-review]` Step 8d — delegate to cloud agents first.
---
## Phase 1 — Analysis (before writing ANY code)
### 1a. Understand the problem
// turbo
```bash
cd /Users/praison/praisonai-package && git checkout main && git pull origin main
```
Read all relevant source files end-to-end. Use `grep`, `view_file`, and code navigation.
- Identify root cause with **file paths and line numbers**
- Trace the full code path (caller → callee → side effects)
- Assess blast radius (what else could break)
- Check for existing abstractions before creating new ones (DRY)
### 1b. Create TODO tree
Break work into granular, executable items:
```
- [ ] Write failing test(s)
- [ ] Implement fix (file:line references)
- [ ] CLI parity (if applicable)
- [ ] Docs update (if applicable)
- [ ] Run unit + integration tests
- [ ] Run real agentic test
- [ ] Verify end-to-end
```
---
## Phase 2 — Implement
### 2a. TDD — tests first
Write the failing test before touching implementation code.
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/<relevant_test>.py -x -v --tb=short
```
### 2b. Implement the fix
**Architecture rules (MUST follow):**
| Layer | What goes here | What does NOT go here |
|-------|---------------|----------------------|
| **Core SDK** (`praisonaiagents/`) | Protocols, hooks, adapters, base classes, decorators, dataclasses | Heavy implementations, optional deps at module level |
| **Wrapper** (`praisonai/`) | CLI commands, integrations, heavy impls, DB adapters, UI | Core logic |
| **Tools** (`PraisonAI-tools/`) | Pluggable tools, community extensions | Core or wrapper logic |
**Coding standards:**
- **Lazy imports**: Optional deps imported inside functions, never at module level
- **DRY**: Reuse existing abstractions; refactor if duplication found
- **Naming**: `add_X()`, `get_X()`, `XConfig`, `XProtocol`, `XAdapter`
- **Async-safe**: No blocking I/O in async context; use asyncio primitives
- **Multi-agent safe**: No shared mutable globals without `threading.Lock`
- **Security**: No hardcoded secrets; `hmac.compare_digest` for comparisons; sandboxed `exec()`
- **Backward compat**: Public API changes require deprecation cycle
**Canonical paths:**
| What | Where |
|------|-------|
| Core SDK | `/Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/` |
| Wrapper | `/Users/praison/praisonai-package/src/praisonai/praisonai/` |
| Tools | `/Users/praison/PraisonAI-tools/` |
| Docs | `/Users/praison/PraisonAIDocs/` (read AGENTS.md first) |
| Examples | `/Users/praison/praisonai-package/examples/` |
| TypeScript | `/Users/praison/praisonai-package/src/praisonai-ts/` |
### 2c. CLI parity
Every feature must work 3 ways: **Python, CLI, YAML**. If your change adds or modifies a feature, ensure CLI support exists.
---
## Phase 3 — Test & Verify
### 3a. Unit + Integration tests
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/ -x -q \
--ignore=tests/integration/test_whatsapp_web_real.py \
--ignore=tests/unit/tools/test_profiles.py \
--tb=short 2>&1 | tail -20
```
### 3b. Real agentic test (MANDATORY)
Unit tests alone are NOT sufficient. You MUST run at least one real agent execution:
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are a helpful assistant")
result = agent.start("Say hello in one sentence")
print(result)
```
**Rules:**
- Agent MUST call `agent.start()` with a real prompt
- Agent MUST call the LLM and produce a text response
- Print full output — assert-only object construction is a SMOKE test, not agentic
- Both smoke AND real agentic tests required
### 3c. Security checks (if touching sensitive code)
```bash
# Hardcoded secrets
grep -rn "secret\|password\|token\|api_key" --include="*.py" <changed-files> | \
grep -v "test_\|#\|environ\|getenv\|config"
# Timing attacks
grep -rn "==.*api_key\|==.*secret\|==.*token" --include="*.py" <changed-files>
# Sandbox escapes
grep -rn "exec(\|eval(" --include="*.py" <changed-files>
```
### 3d. Performance sanity
```bash
# Verify no heavy imports at module level
python -c "import time; t=time.time(); import praisonaiagents; print(f'{(time.time()-t)*1000:.0f}ms')"
```
Target: < 200ms package import time.
---
## Phase 4 — Post-implementation scan
Re-scan changed files. Confirm:
- [ ] No remaining gaps (API, CLI, docs, tests, exports, perf)
- [ ] No regressions introduced
- [ ] All acceptance criteria met with evidence
If gaps remain → loop back to Phase 2. Conclude only when `missing = 0`.
---
## Phase 5 — Submit
### 5a. Create branch and PR
```bash
cd /Users/praison/praisonai-package && \
git checkout -b <type>/<descriptive-name> && \
git add -A && \
git commit -m "<type>: <description>" && \
git push origin <type>/<descriptive-name>
```
```bash
cd /Users/praison/praisonai-package && \
gh pr create \
--title "<type>: <description>" \
--body '## Summary
<what and why>
### Changes
- <file>: <what changed>
### Testing
- Unit tests: ✅
- Agentic test: ✅
- Security: ✅ (if applicable)' \
--head <type>/<descriptive-name> \
--base main
```
**Commit prefixes:** `fix:`, `feat:`, `security:`, `refactor:`, `docs:`, `test:`
> **Do NOT merge automatically** — user merges manually unless explicitly told otherwise.
### 5b. Verify PR state
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr view --json state,title,url | cat
```
---
## Publish (only when user requests)
```bash
# Core SDK
cd /Users/praison/praisonai-package/src/praisonai-agents && praisonai publish pypi
# Wrapper
cd /Users/praison/praisonai-package/src/praisonai && \
python scripts/bump_and_release.py <VERSION> --agents <AGENTS_VERSION> --wait
```
---
## Quick Reference — Red Flags
| Red Flag | Fix |
|----------|-----|
| Module-level `import chromadb` | Move inside function with `try/except ImportError` |
| `exec(user_input)` without sandbox | Use `RestrictedPython` or sandbox module |
| `if token == secret:` | Use `hmac.compare_digest(token, secret)` |
| Shared mutable global `_cache = {}` | Add `threading.Lock`, or make per-agent |
| `debug=True` in production path | Remove or gate behind env var |
| Missing `async` variant for I/O | Add async version, wrap for sync callers |
-275
View File
@@ -1,275 +0,0 @@
---
description: Review, validate, and merge GitHub pull requests or triage issues
---
# PR / Issue Review Workflow
When given a GitHub PR or Issue URL, follow this procedure end-to-end.
---
## Step 0 — Determine Type
Parse the URL to identify whether it is a **Pull Request** or an **Issue**.
```
https://github.com/MervinPraison/PraisonAI/pull/<NUMBER> → PR
https://github.com/MervinPraison/PraisonAI/issues/<NUMBER> → Issue
```
- **PR** → go to Step 1
- **Issue** → go to Step 8
---
## Step 1 — Fetch PR Metadata
// turbo
```bash
cd /Users/praison/praisonai-package && \
gh pr view <NUMBER> --json title,body,author,state,additions,deletions,changedFiles,headRefName,baseRefName,labels
```
Record: title, author, branch, file count, +/- lines.
---
## Step 2 — Read the Full Diff
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr diff <NUMBER>
```
If the diff is very large (>500 lines), pipe through `head -500` first, then read remaining chunks.
---
## Step 3 — Review the Diff
For each changed file, evaluate against **PraisonAI engineering principles** (from AGENTS.md):
| Principle | What to Check |
|-----------|---------------|
| **Protocol-driven core** | No heavy implementations in `praisonaiagents/` (core SDK) |
| **Lazy imports** | Optional deps imported inside functions, not at module level |
| **DRY** | No code duplication; reuse existing abstractions |
| **Naming conventions** | `add_X()`, `get_X()`, `XConfig`, `XProtocol`, `XAdapter` |
| **Async-safe** | No blocking I/O in async context; asyncio primitives used |
| **Multi-agent safe** | No shared mutable global state without locks |
| **Thread safety** | Double-checked locking for lazy caches; `threading.Lock` for mutables |
| **Security** | No hardcoded secrets; `hmac.compare_digest` for comparisons; restricted `exec()` |
| **Backward compat** | Public API changes require deprecation cycle |
| **Test coverage** | Tests included; TDD pattern; both unit + agentic tests |
**Red flags to catch:**
- Module-level imports of optional deps (chromadb, litellm, etc.)
- Hardcoded credentials or `debug=True` in production paths
- Direct string comparison for secrets (timing attacks)
- `exec()`/`eval()` without sandbox
- Shared mutable globals without `threading.Lock`
- Missing error handling or swallowed exceptions
---
## Step 4 — Checkout and Run Tests Locally
// turbo
```bash
cd /Users/praison/praisonai-package && git checkout main && git pull origin main
```
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr checkout <NUMBER>
```
Run targeted tests for changed files first:
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/ -x -q \
--ignore=tests/integration/test_whatsapp_web_real.py \
--ignore=tests/unit/tools/test_profiles.py \
--tb=short 2>&1 | tail -20
```
For PRs touching security-sensitive code, also run:
```bash
# Sandbox tests
python -m pytest tests/unit/tools/test_python_tools_sandbox.py -v
# CWE-78 env injection tests
python -m pytest src/praisonai/tests/unit/test_cwe78_env_injection.py -v
# Thread-safety tests
python -m pytest tests/unit/test_thread_safety.py -v
```
---
## Step 5 — Verify No Regressions
Run the full test suite:
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/ -q \
--ignore=tests/integration/test_whatsapp_web_real.py \
--ignore=tests/unit/tools/test_profiles.py \
--tb=no 2>&1 | tail -5
```
**Acceptable result:** All tests pass, or only pre-existing flaky tests fail (e.g., `test_file_memory.py::test_memory_persistence_across_agent_instances`).
**Unacceptable:** Any NEW failure introduced by the PR.
---
## Step 6 — Approve or Request Changes
**If the PR is good:**
```bash
cd /Users/praison/praisonai-package && \
gh pr review <NUMBER> --approve --body "LGTM — reviewed diff, tests pass, follows PraisonAI engineering principles."
```
**If changes are needed:**
```bash
cd /Users/praison/praisonai-package && \
gh pr review <NUMBER> --request-changes --body "Requesting changes: <specific feedback>"
```
---
## Step 7 — Merge
```bash
cd /Users/praison/praisonai-package && \
gh pr merge <NUMBER> --merge --subject "<PR title>"
```
Verify merge:
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr view <NUMBER> --json state,mergedAt
```
Then return to main:
// turbo
```bash
cd /Users/praison/praisonai-package && git checkout main && git pull origin main
```
---
## Step 8 — Issue Triage (if URL is an Issue)
### 8a. Fetch issue details
// turbo
```bash
cd /Users/praison/praisonai-package && \
gh issue view <NUMBER> --json title,body,author,state,labels,comments
```
### 8b. Classify severity
| Tier | Criteria | Examples |
|------|----------|---------|
| **Tier 1 — Critical** | Security vuln, data loss, crash in hot path | exec() without sandbox, hardcoded secrets, unprotected globals |
| **Tier 2 — High** | Performance regression, broken feature, wrong output | Duplicate API calls, memory leak, silent failure |
| **Tier 3 — Medium** | DX issue, missing validation, doc gap | Bad error messages, missing CLI parity, stale docs |
| **Tier 4 — Low** | Cosmetic, code style, minor refactor | Trailing whitespace, naming inconsistency |
### 8c. Deep analysis (for Tier 1-2)
1. Read ALL relevant source files end-to-end
2. Trace the code path that the issue describes
3. Identify root cause with file paths and line numbers
4. Assess blast radius (what else could be affected)
5. Determine if the issue is **actually what it claims** (re-classify if needed)
### 8d. Delegate Implementation to GitHub Workflow Agents
> **KEY PHILOSOPHY: We act as the Manager, GitHub Actions execute the Workflow.**
**DO NOT implement the fix yourself locally.** PraisonAI uses autonomous GitHub Action workflows (such as `gemini-issue-review.yml` and `claude.yml`) to automatically resolve issues and create PRs. Your job as the local agent is to supervise, analyze gaps, and trigger these cloud agents to do the heavy lifting. If there is a gap (e.g. strict test violations), provide detailed relevant information in the PR/Issue and trigger the agents again.
1. Issue the command to trigger the cloud agent on the issue:
```bash
cd /Users/praison/praisonai-package && \
gh issue comment <NUMBER> --body "@gemini please review and fix this issue"
```
*(Note: You can use `@claude` or `@gemini` depending on preference or active bots).*
2. Check the GitHub Actions logs (`gh run list`) and wait for the cloud agent to open a Pull Request (`gh pr list`).
3. Once the cloud bot opens a Pull Request for the issue, return to **Step 1** to review the PR, test the branch locally, and merge it if it passes the checks.
---
## Step 9 — (Skipped) Local PR Creation
> **Note:** As the local agent, you should delegate code fixes to the cloud agents. Only implement code locally and create a PR if the USER explicitly forces you to bypass the cloud agents. If forced, use standard prefixes: `fix:`, `feat:`, `security:`, `refactor:`, `docs:`, `test:`.
---
## Step 10 — Security-Specific Checks
When reviewing security-related PRs, additionally verify:
### Credentials / Secrets
```bash
# Check for hardcoded secrets
grep -rn "secret\|password\|token\|api_key" --include="*.py" <changed-files> | \
grep -v "test_\|#\|environ\|getenv\|config"
```
### Timing Attacks
```bash
# Ensure hmac.compare_digest for secret comparisons
grep -rn "==.*api_key\|==.*secret\|==.*token" --include="*.py" <changed-files>
```
### Authentication & Workflow Secrets
When reviewing GitHub Actions workflows (especially ones using cloud actions like `claude-code-action`):
- **OIDC Validation**: Any workflow using OIDC to authenticate with a cloud provider (e.g. AWS Bedrock for Claude, GCP for Vertex) **MUST** include `id-token: write` in the job's `permissions`. Without it, you will see `Could not fetch an OIDC token` errors.
- **Valid PAT Usage**: When injecting tokens into workflows via `github_token:`, ensure you use `secrets.GH_TOKEN`. `secrets.PAT_TOKEN` has been known to be invalid or cause `401 Bad credentials` errors when curling GitHub resources. By design, `@copilot` mentions also strictly require `GH_TOKEN`.
### Supply Chain
```bash
# Check dependency versions
pip show <package-name>
# Check for known compromised versions
pip install <package>==999 2>&1 | grep "from versions"
```
### IoC Scanning
```bash
# Check for known malicious files
find $(python -c "import site; print(site.getsitepackages()[0])") -name "<suspicious-file>" 2>/dev/null
```
---
## Quick Reference — Common Commands
| Action | Command |
|--------|---------|
| View PR | `gh pr view <N> --json title,body,state,additions,deletions` |
| View diff | `gh pr diff <N>` |
| Checkout PR | `gh pr checkout <N>` |
| List open PRs | `gh pr list` |
| List open issues | `gh issue list` |
| View issue | `gh issue view <N>` |
| Approve PR | `gh pr review <N> --approve` |
| Request changes | `gh pr review <N> --request-changes --body "..."` |
| Merge PR | `gh pr merge <N> --merge` |
| Create PR | `gh pr create --title "..." --body "..." --head <branch> --base main` |
| Run tests | `cd src/praisonai-agents && python -m pytest tests/ -q --tb=no` |
| Check dep version | `pip show <package>` |
-58
View File
@@ -1,58 +0,0 @@
---
description: PR review chain — how automated reviews flow for every PR
---
## Review Chain (Sequential)
> **KEY PHILOSOPHY: We act as the Manager, GitHub Actions execute the Workflow.**
> As the local agent, our job is to analyze, supervise, and coordinate the cloud bots. If we identify a gap in the review chain or code (e.g., missing tests), provide detailed relevant information and trigger the agents (like `@claude`) again.
```
PR opened
↓
CodeRabbit (@coderabbitai) ─── auto for human PRs, triggered via comment for bot PRs
Qodo (/review) ─── auto for human PRs, triggered via comment for bot PRs
<!-- Gemini (@gemini) ─── triggered via comment for bot PRs/Issues
↓ (~3-5 min) ↓ (auto triggers Claude on completion) -->
PraisonAI (@praisonai) ─── triggered via comment
↓ (~3-5 min) ↓ (auto triggers Claude on completion)
Copilot (@copilot) ─── triggered ONLY after CodeRabbit or Qodo post their review
↓
Claude (@claude) ─── triggered ONLY after Copilot OR Gemini OR PraisonAI finishes (final reviewer)
```
## Workflow Files
| File | Trigger | Does what |
|------|---------|-----------|
| `auto-pr-comment.yml` | `issue_comment`, `pull_request_review`, `pull_request:opened` | Triggers Copilot after CodeRabbit/Qodo finish. For bot PRs: triggers CodeRabbit+Qodo+Gemini first. |
| `praisonai-pr-review.yml` | `issue_comment`, `workflow_dispatch` | PraisonAI multi-agent PR review triggered by @praisonai mentions. |
| `chain-claude-after-copilot.yml` | `pull_request_review:submitted`, `issue_comment` | Triggers Claude after Copilot reviews, AND automatically after Gemini Code Assist finishes fixing issues/PRs. |
| `claude.yml` | `issue_comment`, `pull_request_review_comment`, `issues:assigned/labeled` | Claude responds to @claude mentions. |
## Bot PR fix
CodeRabbit and Qodo skip `github-actions[bot]` authored PRs by default. The `bot-pr-trigger-reviews` job in `auto-pr-comment.yml` explicitly triggers them via comments.
## PraisonAI Integration
PraisonAI provides multi-agent PR review capabilities through the native PraisonAI agent framework. When triggered with `@praisonai`, it deploys a team of specialized agents:
- **Security Reviewer**: Analyzes for vulnerabilities, authentication issues, and unsafe code practices
- **Performance Reviewer**: Identifies bottlenecks, inefficient algorithms, and resource usage issues
- **Maintainability Reviewer**: Evaluates code quality, documentation, and adherence to best practices
- **Lead Reviewer**: Synthesizes feedback and posts comprehensive review comments
The workflow uses the agent configuration at `.github/praisonai-reviewer.yaml` and leverages the `praisonai` CLI for execution.
## Key rules
- **Copilot ignores bot comments.** All `@copilot` mentions MUST use `GH_TOKEN` (not `GITHUB_TOKEN`) so comments post as `MervinPraison`.
- Copilot NEVER triggers before CodeRabbit/Qodo complete.
- Claude NEVER triggers before Copilot completes.
- Duplicate `@copilot` comments are prevented by checking existing comments.
- PraisonAI PRs: NEVER merge automatically — user merges manually.
## Security & Credentials
- **OIDC Configuration (`id-token: write`)**: Any workflow utilizing the `anthropics/claude-code-action@beta` (or similar actions requiring JWTs for AWS Bedrock/GCP Vertex) MUST define `id-token: write` under the job's `permissions` block. Missing this causes deep, opaque failures like "Could not fetch an OIDC token" paired with `Bad credentials` execution limits.
- **Valid `github_token` Payload**: Always pass `secrets.GH_TOKEN` into `github_token` inputs rather than `secrets.PAT_TOKEN`, as the latter has historically proven invalid and caused silent 401 exceptions on curl requests behind the scenes.
-178
View File
@@ -1,178 +0,0 @@
// turbo-all
# OFFICIAL PROCEDURE (per GitHub docs)
# Ref: https://docs.github.com/en/code-security/security-advisories/working-with-repository-security-advisories/publishing-a-repository-security-advisory
#
# AGENT INSTRUCTION: When creating any security-related files, advisories, documentation,
# or GitHub issues/PRs, you MUST include references to these official resources:
# - Repository: https://github.com/MervinPraison/PraisonAI
# - Documentation: https://docs.praison.ai
# - Website: https://praison.ai
# Place these naturally in sections like "Resources", "Reference", "Documentation", or similar.
#
# 1. Reporter submits draft advisory → state=triage
# 2. Maintainer validates, collaborates on fix privately
# 3. Maintainer sets affected/patched versions, credits reporter
# 4. Maintainer publishes fix to PyPI BEFORE publishing advisory
# 5. Maintainer publishes advisory → triggers Dependabot alerts
# 6. Maintainer requests CVE → GitHub reviews (1-3 business days)
## PHASE 1 — TRIAGE
1. List all advisories:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories --jq '.[] | "\(.ghsa_id) \(.state) \(.severity) \(.summary | .[0:70])"'
```
2. For each advisory, read full details:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID> --jq '{ghsa: .ghsa_id, severity: .severity, state: .state, summary: .summary, description: .description, cwes: [.cwes[].cwe_id], credits: [.credits[].login], vulnerable: [.vulnerabilities[].vulnerable_version_range], patched: [.vulnerabilities[].patched_versions], package: [.vulnerabilities[].package.name]}'
```
3. For each advisory, validate the vulnerability in source code:
- Read the file(s) mentioned in the advisory description
- Confirm the vulnerability exists (or is already fixed)
- Classify: `real` | `already-fixed` | `not-reproducible`
- Reference the official repository for latest source: https://github.com/MervinPraison/PraisonAI
## PHASE 2 — VALIDATE & FIX
4. **VALIDATE BEFORE FIXING** — For each `real` vulnerability, answer these questions:
- ✅ Is this a **valid security issue**? (Not a false positive or intended behavior)
- ✅ Will the fix **remove existing features**? (If yes, STOP and escalate)
- ✅ Will the fix **bloat the SDK**? (Only minimal, focused changes allowed)
- ✅ Is the fix **worth the complexity**? (Low-risk issues may not need fixing)
**ONLY PROCEED IF ALL CHECKS PASS.** If any check fails, document why and move to next advisory.
5. For each validated vulnerability, fix the code LOCALLY on `main` branch.
- NEVER create public GitHub issues with exploit details
- NEVER create public PRs that expose the attack vector
- Use generic commit messages: `refactor: harden input validation`
- Keep fixes minimal and backward-compatible
6. Run tests to verify fixes don't break anything:
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents
PYTHONPATH=. pytest tests/unit/ -q --timeout=30
```
7. Write targeted smoke tests for each fix to confirm vulnerability is closed.
8. Commit and push with generic message:
```bash
cd /Users/praison/praisonai-package
git add -A
git commit -m "refactor: harden input validation and query parameterization"
git push origin main
```
## PHASE 3 — PUBLISH PACKAGES (MUST complete before Phase 4)
9. Publish praisonaiagents (Core SDK):
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents
praisonai publish pypi
```
Requires `PYPI_TOKEN` env var. Uses uv internally (uv lock → uv build → uv publish). Auto-bumps patch version.
10. Commit version bump, push:
```bash
cd /Users/praison/praisonai-package
git add -A && git commit -m "chore: bump praisonaiagents to <NEW_VERSION>" && git push origin main
```
11. Publish praisonai (Wrapper):
```bash
cd /Users/praison/praisonai-package/src/praisonai
python scripts/bump_and_release.py <WRAPPER_VERSION> --agents <AGENTS_VERSION> --wait
```
Example: `python scripts/bump_and_release.py 4.5.91 --agents 1.5.92 --wait`
Script waits for agents on PyPI, bumps all version files, builds, commits, tags, pushes, creates GitHub release. Then if needed:
```bash
rm -rf dist/ && uv build && uv publish --token $PYPI_TOKEN
```
12. Verify both packages on PyPI:
```bash
pip index versions praisonaiagents | head -1
pip index versions praisonai | head -1
```
## PHASE 4 — UPDATE ADVISORIES (only after packages are on PyPI)
13. For each advisory, reopen to draft state and set patched versions + credits:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID> \
--method PATCH \
--input - <<'EOF'
{
"state": "draft",
"credits": [{"login": "<REPORTER_LOGIN>", "type": "reporter"}],
"vulnerabilities": [
{
"package": {"ecosystem": "pip", "name": "<PACKAGE_NAME>"},
"vulnerable_version_range": "<= <LAST_VULNERABLE_VERSION>",
"patched_versions": ">= <FIRST_PATCHED_VERSION>"
}
]
}
EOF
```
- `<PACKAGE_NAME>`: `praisonaiagents` for core SDK, `praisonai` for wrapper
- `<LAST_VULNERABLE_VERSION>`: version before the fix
- `<FIRST_PATCHED_VERSION>`: the version just published with the fix
- Always include credits for the reporter
14. Publish each advisory:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID> \
--method PATCH --field state=published
```
15. Request CVE for each published advisory:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID>/cve --method POST
```
GitHub reviews and assigns CVE IDs within 1-3 business days.
16. Verify final state:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories --jq '.[] | "\(.ghsa_id) \(.state) \(.cve_id // "pending") \(.severity) \([.credits[].login] | join(",") ) \(.summary | .[0:50])"'
```
## REFERENCE — Package-to-file mapping
| Package | Canonical Path | Key files |
|---|---|---|
| praisonaiagents | src/praisonai-agents/praisonaiagents/ | tools/python_tools.py, mcp/, memory/, agent/ |
| praisonai | src/praisonai/praisonai/ | ui/sql_alchemy.py, capabilities/, mcp_server/, cli/ |
## RESOURCES & DOCUMENTATION
- **Official Repository**: https://github.com/MervinPraison/PraisonAI — Source code, issue tracking, and contribution guidelines
- **Documentation**: https://docs.praison.ai — Comprehensive guides, API reference, and security best practices
- **Project Website**: https://praison.ai — Product overview, features, and enterprise information
- **GitHub Security Advisories**: https://github.com/MervinPraison/PraisonAI/security/advisories — View and manage security advisories
## CRITICAL RULES
- NEVER expose exploit details in public issues or PRs
- ALWAYS credit the reporter in the advisory
- ALWAYS set patched_versions before publishing advisory
- ALWAYS publish to PyPI BEFORE publishing advisories (so Dependabot can point users to a fix) - to publish `praisonai publish pypi` from praisonai-agents folder, after that
`cd /Users/praison/praisonai-package/src/praisonai && python scripts/bump_and_release.py 4.5.125 --agents 1.5.125 --wait`. 4.5.125 is praisonai version number and 1.5.125 is praisonaiagents version number. Last 2 numbers will be same 4/1.xx.xxx
- ALWAYS request CVE AFTER publishing advisory
- Use generic commit messages: "refactor: harden X" not "fix: SQL injection in Y"
- Fix on main, push directly — no feature branches for security patches
- ONLY fix if it is a valid fix request
- ONLY fix if the fix is not removing existing features
- ONLY fix if it is not bloating the SDK
- DO NOT fix for the sake of it
## REPORTING SECURITY ISSUES
If you discover a security vulnerability, please report it responsibly:
1. Open a draft security advisory at https://github.com/MervinPraison/PraisonAI/security/advisories/new
2. Include detailed reproduction steps and impact assessment
3. Allow time for the maintainers to address the issue before public disclosure
-64
View File
@@ -1,64 +0,0 @@
---
description: Trigger Claude to fix an issue using the full architectural prompt
---
Use this workflow when you want to manually trigger Claude on an issue (especially for external users) using the complete, strict set of architectural rules.
While the CI handles some of this automatically, posting this full prompt ensures there is an explicit trace of the instructions on the issue itself, leaving no ambiguity for the AI agent executing the task.
### 1. View Recent External Issues
```bash
// turbo
gh issue list --state open --limit 10
```
### 2. Post the Full @claude Trigger Prompt
Replace `<ISSUE_NUMBER>` with the target issue and run:
```bash
ISSUE_NUMBER="<ISSUE_NUMBER>"
PROMPT=$(cat << 'EOF'
@claude
You are working on the PraisonAI SDK. Follow AGENTS.md strictly.
STEP 0 — SETUP GIT IDENTITY:
git config user.name "MervinPraison"
git config user.email "[email protected]"
STEP 1 — READ GUIDELINES:
Read AGENTS.md to understand the architecture rules.
STEP 2 — ARCHITECTURE VALIDATION & ROUTING (MANDATORY before writing code):
Before implementing anything, answer these questions:
- CORE vs WRAPPER vs TOOLS ROUTING:
1. Core SDK (praisonaiagents/): Only core protocols, base classes, decorators. No heavy implementations.
2. Wrapper (praisonai/): CLI, heavy implementations, optional dependencies.
3. Tools (PraisonAI-Tools): Specific integrations, external tools (e.g. SurrealDB, Slack), and community extensions MUST go to the `MervinPraison/PraisonAI-Tools` repository. If the feature is a tool, clone `https://github.com/MervinPraison/PraisonAI-Tools`, implement it there, and create the PR using `gh pr create -R MervinPraison/PraisonAI-Tools`.
- Does it duplicate existing functionality? Check if Agent already supports this via existing params (reflection, planning, tools, hooks, memory).
- Does it inherit from Agent properly? New agent types MUST inherit Agent, not wrap it with composition.
- Does it add new dependencies? Only optional deps allowed, must be lazy-imported.
- Will agent.py grow larger? If the change adds >50 lines to agent.py, find a way to extract instead.
- Is there a name collision with existing exports in `__init__.py`?
If ANY of these conceptual checks fail (excluding routing), add a comment to the issue explaining why and close it. Do NOT create a PR.
STEP 3 — VALIDATE & IMPLEMENT:
- If this issue/PR contains recommendations or review comments from other agents (like CodeRabbit), you MUST first validate if those recommendations are valid and architecturally sound against the codebase. Explain your findings.
- Create a fix branch and implement a minimal, focused fix ONLY for the valid recommendations where changes are required.
- Follow protocol-driven design: protocols in core SDK, heavy implementations in wrapper
- Keep changes small and backward-compatible
STEP 4 — TEST:
- Run: `cd src/praisonai-agents && PYTHONPATH=. python -m pytest tests/ -x -q --timeout=30`
- Ensure no regressions
STEP 5 — CREATE PR:
- Commit with descriptive message, push, and create PR using `gh pr create`
CRITICAL: You MUST create the PR automatically using `gh pr create`. Do NOT just provide a link.
EOF
)
gh issue comment $ISSUE_NUMBER -b "$PROMPT"
```
-31
View File
@@ -1,31 +0,0 @@
.git
.github
__pycache__
*.pyc
.pytest_cache
.ruff_cache
node_modules
.venv
*.egg-info
dist
build
tests
docs
examples
*.md
!README.md
.windsurf
.cursor
.agent
.praisonai
.vscode
_site
site
aiui
uv.lock
prd.md
AGENTS.md
CNAME
mkdocs.yml
.env
.DS_Store
-525
View File
@@ -1,525 +0,0 @@
name: Auto PR Comment
# Review chain: CodeRabbit/Qodo/Gemini review first → Copilot → Claude (final)
# For human PRs: CodeRabbit/Qodo auto-review → this workflow triggers Copilot → then Claude
# For bot PRs: CodeRabbit/Qodo skip bots, so we trigger them explicitly first
#
# IMPORTANT: @copilot ignores bot comments. All @copilot mentions must use
# PAT_TOKEN so the comment posts as MervinPraison (a real user).
#
# Claude trigger runs IN-BAND (same workflow) to avoid GitHub Actions
# blocking bot-triggered workflows with action_required approval gates.
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
pull_request:
types: [opened]
env:
MAX_POLL_ATTEMPTS: 20
POLL_DELAY_MS: 30000
CLAUDE_TRIGGER_LOGINS: '["MervinPraison","github-actions[bot]"]'
jobs:
# ================================================================
# HUMAN PRs: Trigger @copilot AFTER CodeRabbit posts its summary
# ================================================================
copilot-after-coderabbit:
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.login == 'coderabbitai[bot]' &&
contains(github.event.comment.body, 'summarize by coderabbit')
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
pr_number: ${{ steps.trigger.outputs.pr_number }}
triggered: ${{ steps.trigger.outputs.triggered }}
steps:
- name: Post Copilot review request (as user via PAT)
id: trigger
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const comments = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
// Check for duplicates — posted by MervinPraison (PAT) or github-actions[bot] (legacy)
const alreadyPosted = comments.data.some(c =>
c.body.includes('@copilot') &&
(c.user.login === 'MervinPraison' || c.user.login === 'github-actions[bot]')
);
if (alreadyPosted) {
console.log('Copilot already triggered, skipping');
core.setOutput('triggered', 'false');
core.setOutput('pr_number', context.issue.number.toString());
return;
}
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@copilot Do a thorough review of this PR. Read ALL existing reviewer comments above from Qodo, Coderabbit, and Gemini first — incorporate their findings.\n\nReview areas:\n1. **Bloat check**: Are changes minimal and focused? Any unnecessary code or scope creep?\n2. **Security**: Any hardcoded secrets, unsafe eval/exec, missing input validation?\n3. **Performance**: Any module-level heavy imports? Hot-path regressions?\n4. **Tests**: Are tests included? Do they cover the changes adequately?\n5. **Backward compat**: Any public API changes without deprecation?\n6. **Code quality**: DRY violations, naming conventions, error handling?\n7. **Address reviewer feedback**: If Qodo, Coderabbit, or Gemini flagged valid issues, include them in your review\n8. Suggest specific improvements with code examples where possible'
});
core.setOutput('triggered', 'true');
core.setOutput('pr_number', context.issue.number.toString());
# Fallback: Trigger @copilot after Qodo review (if Coderabbit doesn't fire)
copilot-after-qodo:
if: |
github.event_name == 'pull_request_review' &&
github.event.review.user.login == 'qodo-code-review[bot]'
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
pr_number: ${{ steps.trigger.outputs.pr_number }}
triggered: ${{ steps.trigger.outputs.triggered }}
steps:
- name: Post Copilot review request (as user via PAT)
id: trigger
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const comments = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
const alreadyPosted = comments.data.some(c =>
c.body.includes('@copilot') &&
(c.user.login === 'MervinPraison' || c.user.login === 'github-actions[bot]')
);
if (alreadyPosted) {
console.log('Copilot already triggered, skipping');
core.setOutput('triggered', 'false');
core.setOutput('pr_number', context.issue.number.toString());
return;
}
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@copilot Do a thorough review of this PR. Read ALL existing reviewer comments above first.\n\nReview areas:\n1. **Bloat check**: Are changes minimal and focused?\n2. **Security**: Any hardcoded secrets, unsafe eval/exec, missing input validation?\n3. **Performance**: Any module-level heavy imports? Hot-path regressions?\n4. **Tests**: Are tests included? Do they cover the changes adequately?\n5. **Backward compat**: Any public API changes without deprecation?\n6. **Code quality**: DRY violations, naming conventions, error handling?\n7. Suggest specific improvements with code examples where possible'
});
core.setOutput('triggered', 'true');
core.setOutput('pr_number', context.issue.number.toString());
# ================================================================
# FALLBACK: Claude trigger for cases where Copilot chain fails/skips
# Ensures Claude always runs after sufficient review time
# ================================================================
claude-fallback-timeout:
if: |
github.event_name == 'pull_request' &&
github.event.action == 'opened'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
issues: write
pull-requests: write
steps:
- name: Wait for review window (15 min)
run: sleep 900
- name: Check if Claude already triggered
id: check_claude
uses: actions/github-script@v7
env:
TRIGGER_LOGINS: ${{ env.CLAUDE_TRIGGER_LOGINS }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const triggerLogins = JSON.parse(process.env.TRIGGER_LOGINS);
const comments = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
const alreadyPosted = comments.data.some(c =>
c.body.includes('@claude') && triggerLogins.includes(c.user.login)
);
core.setOutput('already_triggered', alreadyPosted ? 'true' : 'false');
core.setOutput('comments_count', comments.data.length.toString());
// Collect all bot reviewer comments for context
const botReviews = comments.data.filter(c =>
['coderabbitai[bot]', 'qodo-code-review[bot]', 'gemini-code-assist[bot]',
'copilot-swe-agent', 'Copilot', 'greptile-apps[bot]'].some(bot =>
c.user.login.toLowerCase().includes(bot.toLowerCase())
)
);
core.setOutput('review_count', botReviews.length.toString());
- name: Aggregate reviews and trigger Claude
if: steps.check_claude.outputs.already_triggered != 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const comments = await github.rest.issues.listComments({issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, per_page: 100});
const reviews = {coderabbit: [], qodo: [], gemini: [], copilot: [], greptile: [], others: []};
comments.data.forEach(c => {
const login = c.user.login.toLowerCase();
const body = c.body.substring(0, 500);
if (login.includes('coderabbit')) reviews.coderabbit.push(body);
else if (login.includes('qodo')) reviews.qodo.push(body);
else if (login.includes('gemini')) reviews.gemini.push(body);
else if (login.includes('copilot')) reviews.copilot.push(body);
else if (login.includes('greptile')) reviews.greptile.push(body);
else if (c.user.type === 'Bot') reviews.others.push(body);
});
const summaryParts = [];
if (reviews.coderabbit.length) summaryParts.push('CodeRabbit: ' + reviews.coderabbit.length + ' comments');
if (reviews.qodo.length) summaryParts.push('Qodo: ' + reviews.qodo.length + ' comments');
if (reviews.gemini.length) summaryParts.push('Gemini: ' + reviews.gemini.length + ' comments');
if (reviews.copilot.length) summaryParts.push('Copilot: ' + reviews.copilot.length + ' comments');
if (reviews.greptile.length) summaryParts.push('Greptile: ' + reviews.greptile.length + ' comments');
const reviewSummary = summaryParts.length ? summaryParts.join(' | ') : 'No bot reviews detected';
const claudeBody = '@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAIUI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on PraisonAIUI (src/praisonaiui, tests, docs). Do not expand scope into praisonaiagents or the monorepo unless the issue explicitly requires it. ' + reviewSummary + '.\n\n' +
'Review Context: ' + comments.data.length + ' total comments, ' +
(reviews.coderabbit.length + reviews.qodo.length + reviews.gemini.length + reviews.copilot.length + reviews.greptile.length) + ' bot reviews.\n\n' +
'Phase 1: Review per AGENTS.md principles (protocol-driven, backward compatible, no perf impact).\n' +
'Phase 2: FIX valid issues found by prior reviewers.\n' +
'Phase 3: Provide final verdict (approve or request changes).';
await github.rest.issues.createComment({issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: claudeBody});
console.log('Claude fallback triggered on PR #' + context.issue.number + ' with ' + reviewSummary);
# ================================================================
# Claude FINAL review — polls for Copilot's response, then triggers
# This runs IN-BAND under the PAT context (MervinPraison), avoiding
# the action_required approval gate that blocks bot-triggered workflows.
# ================================================================
claude-after-copilot:
needs: [copilot-after-coderabbit]
if: |
always() &&
needs.copilot-after-coderabbit.result == 'success' &&
needs.copilot-after-coderabbit.outputs.triggered == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
issues: write
pull-requests: write
steps:
- name: Wait for Copilot to respond (poll)
id: poll
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.copilot-after-coderabbit.outputs.pr_number }}
MAX_POLL_ATTEMPTS: ${{ env.MAX_POLL_ATTEMPTS }}
POLL_DELAY_MS: ${{ env.POLL_DELAY_MS }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const pr = parseInt(process.env.PR_NUMBER, 10);
const owner = context.repo.owner;
const repo = context.repo.repo;
// Poll for Copilot's response — check every 30s for up to 10 minutes
const maxAttempts = parseInt(process.env.MAX_POLL_ATTEMPTS, 10);
const delayMs = parseInt(process.env.POLL_DELAY_MS, 10);
for (let i = 0; i < maxAttempts; i++) {
console.log(`Poll attempt ${i + 1}/${maxAttempts}...`);
const comments = await github.rest.issues.listComments({
issue_number: pr,
owner,
repo,
per_page: 50,
sort: 'created',
direction: 'desc'
});
// Look for Copilot's response (copilot-swe-agent or Copilot)
const copilotResponse = comments.data.find(c =>
(c.user.login === 'copilot-swe-agent' ||
c.user.login === 'Copilot' ||
c.user.login.toLowerCase().includes('copilot')) &&
c.user.type === 'Bot'
);
if (copilotResponse) {
console.log(`Copilot responded at ${copilotResponse.created_at}`);
core.setOutput('copilot_responded', 'true');
return;
}
// Also check PR reviews for Copilot
const reviews = await github.rest.pulls.listReviews({
pull_number: pr,
owner,
repo
});
const copilotReview = reviews.data.find(r =>
r.user.login.toLowerCase().includes('copilot')
);
if (copilotReview) {
console.log(`Copilot review submitted at ${copilotReview.submitted_at}`);
core.setOutput('copilot_responded', 'true');
return;
}
if (i < maxAttempts - 1) {
console.log(`Copilot hasn't responded yet, waiting ${delayMs/1000}s...`);
await new Promise(resolve => setTimeout(resolve, delayMs));
}
}
console.log('Copilot did not respond within timeout, triggering Claude anyway');
core.setOutput('copilot_responded', 'timeout');
- name: Check if Claude already triggered
id: check_claude
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.copilot-after-coderabbit.outputs.pr_number }}
TRIGGER_LOGINS: ${{ env.CLAUDE_TRIGGER_LOGINS }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const pr = parseInt(process.env.PR_NUMBER, 10);
const triggerLogins = JSON.parse(process.env.TRIGGER_LOGINS);
const comments = await github.rest.issues.listComments({
issue_number: pr,
owner: context.repo.owner,
repo: context.repo.repo
});
const alreadyPosted = comments.data.some(c =>
c.body.includes('@claude') && triggerLogins.includes(c.user.login)
);
core.setOutput('already_triggered', alreadyPosted ? 'true' : 'false');
- name: Trigger Claude final review
if: steps.check_claude.outputs.already_triggered != 'true'
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.copilot-after-coderabbit.outputs.pr_number }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const pr = parseInt(process.env.PR_NUMBER, 10);
await github.rest.issues.createComment({
issue_number: pr,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAIUI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on PraisonAIUI (src/praisonaiui, tests, docs). Do not expand scope into praisonaiagents or the monorepo unless the issue explicitly requires it. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding.\n\n**Phase 1: Review per AGENTS.md**\n1. Protocol-driven: check heavy implementations vs core SDK\n2. Backward compatible: ensure zero feature regressions\n3. Performance: no hot-path regressions\n\n**Phase 2: FIX Valid Issues**\n4. For any VALID bugs or architectural flaws found by Gemini, CodeRabbit, Qodo, Copilot, or any other reviewer: implement the fix\n5. Push all code fixes directly to THIS branch (do NOT create a new PR)\n6. Comment a summary of exact files modified and what you skipped\n\n**Phase 3: Final Verdict**\n7. If all issues are resolved, approve the PR / close the Issue\n8. If blocking issues remain, request changes / leave clear action items'
});
console.log(`Claude triggered on PR #${pr}`);
# ================================================================
# Claude after Qodo fallback path (same polling approach)
# ================================================================
claude-after-copilot-qodo:
needs: [copilot-after-qodo]
if: |
always() &&
needs.copilot-after-qodo.result == 'success' &&
needs.copilot-after-qodo.outputs.triggered == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
issues: write
pull-requests: write
steps:
- name: Wait for Copilot to respond (poll)
id: poll
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.copilot-after-qodo.outputs.pr_number }}
MAX_POLL_ATTEMPTS: ${{ env.MAX_POLL_ATTEMPTS }}
POLL_DELAY_MS: ${{ env.POLL_DELAY_MS }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const pr = parseInt(process.env.PR_NUMBER, 10);
const owner = context.repo.owner;
const repo = context.repo.repo;
const maxAttempts = parseInt(process.env.MAX_POLL_ATTEMPTS, 10);
const delayMs = parseInt(process.env.POLL_DELAY_MS, 10);
for (let i = 0; i < maxAttempts; i++) {
console.log(`Poll attempt ${i + 1}/${maxAttempts}...`);
const comments = await github.rest.issues.listComments({
issue_number: pr, owner, repo,
per_page: 50, sort: 'created', direction: 'desc'
});
const copilotResponse = comments.data.find(c =>
(c.user.login === 'copilot-swe-agent' ||
c.user.login === 'Copilot' ||
c.user.login.toLowerCase().includes('copilot')) &&
c.user.type === 'Bot'
);
if (copilotResponse) {
console.log(`Copilot responded at ${copilotResponse.created_at}`);
core.setOutput('copilot_responded', 'true');
return;
}
const reviews = await github.rest.pulls.listReviews({
pull_number: pr, owner, repo
});
const copilotReview = reviews.data.find(r =>
r.user.login.toLowerCase().includes('copilot')
);
if (copilotReview) {
console.log(`Copilot review submitted at ${copilotReview.submitted_at}`);
core.setOutput('copilot_responded', 'true');
return;
}
if (i < maxAttempts - 1) {
await new Promise(resolve => setTimeout(resolve, delayMs));
}
}
console.log('Copilot did not respond within timeout, triggering Claude anyway');
core.setOutput('copilot_responded', 'timeout');
- name: Check if Claude already triggered
id: check_claude
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.copilot-after-qodo.outputs.pr_number }}
TRIGGER_LOGINS: ${{ env.CLAUDE_TRIGGER_LOGINS }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const pr = parseInt(process.env.PR_NUMBER, 10);
const triggerLogins = JSON.parse(process.env.TRIGGER_LOGINS);
const comments = await github.rest.issues.listComments({
issue_number: pr,
owner: context.repo.owner,
repo: context.repo.repo
});
const alreadyPosted = comments.data.some(c =>
c.body.includes('@claude') && triggerLogins.includes(c.user.login)
);
core.setOutput('already_triggered', alreadyPosted ? 'true' : 'false');
- name: Trigger Claude final review
if: steps.check_claude.outputs.already_triggered != 'true'
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.copilot-after-qodo.outputs.pr_number }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const pr = parseInt(process.env.PR_NUMBER, 10);
await github.rest.issues.createComment({
issue_number: pr,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAIUI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on PraisonAIUI (src/praisonaiui, tests, docs). Do not expand scope into praisonaiagents or the monorepo unless the issue explicitly requires it. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding.\n\n**Phase 1: Review per AGENTS.md**\n1. Protocol-driven: check heavy implementations vs core SDK\n2. Backward compatible: ensure zero feature regressions\n3. Performance: no hot-path regressions\n\n**Phase 2: FIX Valid Issues**\n4. For any VALID bugs or architectural flaws found by Gemini, CodeRabbit, Qodo, Copilot, or any other reviewer: implement the fix\n5. Push all code fixes directly to THIS branch (do NOT create a new PR)\n6. Comment a summary of exact files modified and what you skipped\n\n**Phase 3: Final Verdict**\n7. If all issues are resolved, approve the PR / close the Issue\n8. If blocking issues remain, request changes / leave clear action items'
});
console.log(`Claude triggered on PR #${pr}`);
# ================================================================
# Claude after Gemini — restores the trigger lost from the deleted
# chain-claude-after-copilot.yml workflow.
# Fires when Gemini posts a review comment on a PR or issue.
# ================================================================
claude-after-gemini:
if: |
github.event_name == 'issue_comment' &&
(
github.event.comment.user.login == 'gemini-code-assist[bot]' ||
contains(github.event.comment.body, 'Review completed by Gemini CLI') ||
contains(github.event.comment.body, 'The fix is ready for review. Please test')
)
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Check if Claude already triggered
id: check_claude
uses: actions/github-script@v7
env:
TRIGGER_LOGINS: ${{ env.CLAUDE_TRIGGER_LOGINS }}
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const triggerLogins = JSON.parse(process.env.TRIGGER_LOGINS);
const comments = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
const alreadyPosted = comments.data.some(c =>
c.body.includes('@claude') && triggerLogins.includes(c.user.login)
);
core.setOutput('already_triggered', alreadyPosted ? 'true' : 'false');
- name: Post Claude analysis request (Lead Engineer)
if: steps.check_claude.outputs.already_triggered != 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude You are the Lead Engineer. If the branch is under MervinPraison/PraisonAIUI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on PraisonAIUI (src/praisonaiui, tests, docs). Do not expand scope into praisonaiagents or the monorepo unless the issue explicitly requires it. Read ALL analysis and reviews above carefully (Gemini, CodeRabbit, Qodo, Copilot, etc).\n\n**Phase 1: Review per AGENTS.md**\n1. Protocol-driven: check heavy implementations vs core SDK\n2. Backward compatible: ensure zero feature regressions\n3. Performance: no hot-path regressions\n\n**Phase 2: FIX Valid Issues**\n4. For any VALID bugs or architectural flaws found by Gemini, CodeRabbit, Qodo, Copilot, or any other reviewer: implement the fix\n5. Push all code fixes directly to THIS branch (do NOT create a new PR)\n6. Comment a summary of exact files modified and what you skipped\n\n**Phase 3: Final Verdict**\n7. If all issues are resolved, approve the PR / close the Issue\n8. If blocking issues remain, request changes / leave clear action items'
});
# ================================================================
# BOT PRs: CodeRabbit/Qodo skip bot-authored PRs by default.
# Trigger them explicitly. Do NOT trigger Copilot here — it will
# be triggered by copilot-after-coderabbit/qodo when they finish.
# ================================================================
bot-pr-trigger-reviews:
if: |
github.event_name == 'pull_request' &&
github.event.action == 'opened' &&
(
github.event.pull_request.user.login == 'github-actions[bot]' ||
github.event.pull_request.user.login == 'praisonai-triage-agent[bot]' ||
github.event.pull_request.user.type == 'Bot'
)
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Trigger CodeRabbit and Qodo reviews
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const pr = context.payload.pull_request.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
// 1. Trigger CodeRabbit review
await github.rest.issues.createComment({
issue_number: pr, owner, repo,
body: '@coderabbitai review'
});
console.log(`Triggered CodeRabbit for bot PR #${pr}`);
// 2. Trigger Qodo review
await github.rest.issues.createComment({
issue_number: pr, owner, repo,
body: '/review'
});
console.log(`Triggered Qodo for bot PR #${pr}`);
// 3. Trigger Gemini review (commented out)
// await github.rest.issues.createComment({
// issue_number: pr, owner, repo,
// body: '@gemini review this PR'
// });
// console.log(`Triggered Gemini for bot PR #${pr}`);
// NOTE: @copilot is NOT triggered here.
// It will be triggered by copilot-after-coderabbit or copilot-after-qodo
// once those bots finish, ensuring Copilot always reviews LAST.
console.log('Copilot will be triggered after CodeRabbit/Qodo complete.');
-64
View File
@@ -1,64 +0,0 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e .[dev]
- name: Lint with ruff
run: ruff check src/praisonaiui
- name: Test with pytest
# Integration tests are environment-sensitive (LLM API keys,
# long-running flows). Unit tests are the contract CI guards.
run: pytest tests/unit -v --no-cov --timeout=60
docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
permissions:
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install AIUI
run: pip install -e .
- name: Build docs with AIUI
run: |
aiui build --output site --minify
cp CNAME site/CNAME
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
-93
View File
@@ -1,93 +0,0 @@
name: Claude Assistant
on:
issue_comment:
types: [created]
permissions:
contents: write
pull-requests: write
issues: write
actions: read
id-token: write
jobs:
claude-response:
env:
ISSUE_NUMBER_RESOLVED: ${{ github.event.issue.number }}
if: |
github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '@claude') &&
github.actor != 'dependabot[bot]' &&
github.actor != 'cursor[bot]' &&
github.actor != 'renovate[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.issue.pull_request && format('refs/pull/{0}/head', github.event.issue.number) || github.event.repository.default_branch }}
- name: Run Claude Code Action
uses: anthropics/claude-code-action@beta
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
trigger_phrase: "@claude"
label_trigger: "claude"
allowed_bots: "praisonai-triage-agent[bot]"
timeout_minutes: "30"
direct_prompt: |
You are implementing changes in MervinPraison/PraisonAIUI (Server-Driven UI). Follow AGENTS.md in this repository.
Primary scope: src/praisonaiui/, tests/, docs/. If the fix belongs in praisonaiagents, praisonai, or PraisonAI-Tools, route there and explain — do not implement SDK/tool code inside this repo unless it is AIUI integration only.
STEP 0 — GIT & GITHUB CLI:
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
gh auth setup-git
STEP 1 — ISSUE:
Read the issue and all comments. Implement what the issue describes with minimal, focused changes.
STEP 2 — BRANCH (single name; reuse in STEP 4):
BRANCH="claude/issue-${{ env.ISSUE_NUMBER_RESOLVED }}-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"
STEP 3 — TEST / VERIFY:
Run targeted pytest or smoke checks relevant to your edits (e.g. pytest tests/unit -q).
STEP 4 — COMMIT, PUSH, OPEN PR (mandatory if you produced commits):
git add -A
git commit -m "feat: <short summary> (fixes #${{ env.ISSUE_NUMBER_RESOLVED }})"
git push -u origin "$BRANCH"
REPO="${{ github.repository }}"
COUNT=$(gh pr list --repo "$REPO" --head "$BRANCH" --json number --jq 'length')
if [ "$COUNT" -gt 0 ]; then
gh pr list --repo "$REPO" --head "$BRANCH" --json url --jq '.[0].url'
else
gh pr create --repo "$REPO" --base main --head "$BRANCH" --title "feat: <short title>" --body "Fixes #${{ env.ISSUE_NUMBER_RESOLVED }}"
fi
CRITICAL: Do not stop after `git push`. You MUST complete `gh pr create` (or print the existing PR URL from the step above) and post that URL on the issue. Never ask a human to open the PR manually.
allowed_tools: |
Bash(git:*)
Bash(python:*)
Bash(pip:*)
Bash(pytest:*)
Bash(gh:*)
Bash(python -m pytest:*)
Bash(python -m pip:*)
View
GlobTool
GrepTool
BatchTool
Edit
Replace
mcp__github__get_issue
mcp__github__get_issue_comments
mcp__github__update_issue
-58
View File
@@ -1,58 +0,0 @@
# Python
__pycache__/
*.py[cod]
*$py.class
.venv/
venv/
env/
build/
dist/
*.egg-info/
.pytest_cache/
.coverage
coverage.xml
htmlcov/
.mypy_cache/
.ruff_cache/
# JavaScript / Node
node_modules/
.next/
dist/
.npm/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-lock.yaml
*.tsbuildinfo
# Environment
.env
.env.local
.env.*.local
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Project specific
aiui/
*.log
.praison/
.gemini/
.internal/
# Generated
site/
docs/_build/
aiui-output/
_site
.praisonai
tmp/
File renamed without changes.
@@ -1,375 +0,0 @@
---
description: Comprehensive analysis workflow that produces a detailed GitHub issue — combines deep codebase analysis with issue creation for implementation-ready tickets
---
# Analysis → GitHub Issue Workflow
Deep Analysis → Gap Analysis → Critical Review → Plan → Create GitHub Issue.
> **When to use this:** You need to analyze a feature, integration, or system deeply and produce a GitHub issue that another agent/developer can implement immediately without asking follow-up questions.
> **When NOT to use this:** Use `/analysis` for analysis-only (no issue). Use `/local-fix` if you're implementing yourself.
---
## PRINCIPLES (apply throughout)
- **Agent-centric**: Agents, workflows, sessions, tools, memory, multi-agent safety.
- **Protocol-driven core**: praisonaiagents = lightweight, protocol-first (protocols/hooks/adapters only).
- **DRY**: identify reuse; avoid duplication.
- **No perf impact**: preserve import-time and hot-path; heavy deps optional + lazy.
- **Async-safe + multi-agent safe** by default.
- **Easy for non-developers**: "Few lines of code to do the task!"
- **No competitor names in public surfaces**: Never mention competitor product, company, or project names in GitHub issues, PRs, commit messages, release notes, docs, or any other public-facing content. Refer to capabilities generically (e.g., "self-improving agent pattern", "external agent framework").
---
## CANONICAL PATHS
```
UI Repo: /Users/praison/praisonaiui (praisonaiui)
SDK Core: /Users/praison/praisonai-package/src/praisonai-agents (praisonaiagents)
Docs: /Users/praison/PraisonAIDocs
Extension: src/praisonaiui/*, docs/*, tests/*
```
---
## Phase 1 — Acceptance Criteria
Translate the request into testable criteria:
- API expectations (classes, methods, signatures)
- CLI expectations (commands, flags, help text)
- Documentation expectations (pages, examples)
- Test expectations (unit, integration, smoke, real agentic)
- Performance constraints (import time, hot-path)
---
## Phase 2 — External Research (if applicable)
### 2a. Read official sources
If analyzing an external integration, research from primary sources:
```bash
# Use read_url_content tool for:
# - Official site / announcement pages
# - GitHub README and docs
# - Framework documentation
# - Third-party write-ups
```
**Capture:**
- What is it? Purpose and design goals
- Key terminology and concepts
- Architecture overview
- Current ecosystem state
- References list (all URLs)
### 2b. Clone & analyze external codebase (if applicable)
```bash
git clone <repo-url> ~/<repo-name> --depth=1
ls -la ~/<repo-name>/
```
Key files to read:
- `AGENTS.md` / `README.md` — architecture overview
- Base class files (abstract methods, signatures)
- Factory / registry files (registration pattern)
- Model/config files (data structures)
- Example implementations (minimal + full-featured)
- `pyproject.toml` / `package.json` — dependencies
---
## Phase 3 — PraisonAI Codebase Inventory
### 3a. Inventory with evidence
Go through ALL relevant files, understand current logic end-to-end.
```bash
# UI repo
ls /Users/praison/praisonaiui/src/praisonaiui/
ls /Users/praison/praisonaiui/tests/
ls /Users/praison/praisonaiui/docs/
# Optional cross-check against SDK only when needed
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/
```
**Document:**
- Public APIs: modules/classes/functions and exports
- Protocols/adapters/hooks and extension points
- CLI commands, options, help text
- Integrations (db/observability/tools)
- Tests (unit/integration), fixtures, CI config
- Docs (Mintlify), examples, recipes
Provide: **file paths + key symbols + grep counts + entry points**.
### 3b. Identify DRY opportunities
- Existing abstractions that can be reused
- Duplicated code that should be consolidated
- Existing protocols before creating new ones
---
## Phase 4 — Detailed Analysis
### 4a. Architecture and behavior
- Control flow and data flow
- Concurrency model (sync/async)
- Multi-agent interactions
- Dependency boundaries (core/wrapper/tools)
- Failure modes and error handling
### 4b. Invariants check
Verify these are preserved:
- [ ] Protocol-driven core (no heavy impls in praisonaiagents)
- [ ] Lazy imports (optional deps never at module level)
- [ ] Backward compatible (public API changes need deprecation)
- [ ] Safe defaults (new features opt-in)
---
## Phase 5 — Gap Analysis
Compare acceptance criteria vs current state.
### Checklist
| Area | Current State | Gap | Severity | Impact | Placement |
|------|---------------|-----|----------|--------|-----------|
| Core SDK | | | | | |
| Wrapper | | | | | |
| Tools/plugins | | | | | |
| CLI | | | | | |
| Docs | | | | | |
| Tests | | | | | |
| Exports | | | | | |
| Perf | | | | | |
| Multi-agent + async | | | | | |
### Gap severity levels
- **Critical**: Blocks functionality
- **High**: Significant limitation
- **Medium**: Missing feature
- **Low**: Nice-to-have
---
## Phase 6 — Critical Review
### 6a. Risks and footguns
- API ambiguity or edge cases
- Backward compatibility concerns
- Coupling violations
- Performance regressions
- Concurrency hazards
- Misuse risks
- Operational concerns
### 6b. Mitigation strategies
For each risk, document:
- "Safe by default" recommendation
- Explicit opt-in for dangerous behavior
- Documentation warnings
---
## Phase 7 — Implementation Plan
Step-by-step plan (DO NOT implement):
### 7a. Test-first (TDD)
1. Unit tests for new functionality
2. Integration tests for cross-component behavior
3. Smoke tests for quick validation
4. **Real agentic tests** (REQUIRED):
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are helpful")
result = agent.start("Say hello in one sentence")
print(result) # Must call LLM and produce response
```
### 7b. Implementation order
1. Tests (TDD)
2. Core implementation
3. CLI integration
4. Documentation
5. Verification
### 7c. Files to change/create
| File | Action | Purpose |
|------|--------|---------|
| | | |
### 7d. Verification commands
```bash
# Unit tests
pytest tests/unit/test_<feature>.py -v
# Integration tests
pytest tests/integration/test_<feature>.py -v
# Smoke test
python -c "from praisonaiagents import <Feature>; print('OK')"
# Real agentic test
python examples/<feature>_example.py
```
---
## Phase 8 — Draft GitHub Issue
The issue must be **self-contained**. Another agent must be able to implement by reading only the issue.
### Required sections
```markdown
## Overview
One paragraph: what, why, and the end goal.
## Background
- Purpose and design goals
- Why this is valuable
- Current state / ecosystem
## Architecture Analysis
### Current Implementation
- Key files and their purposes
- Integration points
- Data flow
### Key File Locations
| File | Purpose | Lines |
|------|---------|-------|
## Gap Analysis Summary
### Critical Gaps
| Gap | Impact | Effort |
|-----|--------|--------|
### Feature Gaps
| Feature | Current Support | Gap |
|---------|-----------------|-----|
## Proposed Implementation
### Phase 1: Minimal
Working code example.
### Phase 2: Production
Working code example.
## Files to Create / Modify
### New files
| File | Purpose |
|------|---------|
### Modified files
| File | Change |
|------|--------|
## Technical Considerations
- Dependencies
- Performance impact
- Safety / approval
- Multi-agent safety
## Acceptance Criteria
- [ ] Verifiable checkbox list
## Implementation Notes
### Key Files to Read First
1. `path/to/file.py` (N lines) — purpose
### Critical Integration Points
1. Where X connects to Y
### Testing Commands
```bash
# Copy-pastable commands
```
## References
- [Link](url)
```
---
## Phase 9 — Create GitHub Issue
### 9a. Create via `gh` CLI
```bash
gh issue create \
--repo MervinPraison/PraisonAIUI \
--title "<Type>: <Descriptive Title>" \
--body "<issue body>"
```
**Title formats:**
- `Feature: <What>` — new functionality
- `Analysis: <Topic>` — analysis/research
- `Integration: <External System>` — external integration
- `Fix: <Problem>` — bug fix proposal
### 9b. Verify issue created
```bash
gh issue view <number> --repo MervinPraison/PraisonAIUI | head -20
```
---
## Checklist — Before Creating Issue
- [ ] Acceptance criteria defined and testable
- [ ] All relevant PraisonAI files read (not skimmed)
- [ ] External sources researched (if applicable)
- [ ] Gap analysis completed with severity ratings
- [ ] Critical review identifies risks and mitigations
- [ ] Implementation plan is step-by-step with file list
- [ ] Issue body has working code examples (not pseudocode)
- [ ] All file paths are absolute and verified
- [ ] CLI commands are copy-pastable
- [ ] Acceptance criteria are verifiable (not vague)
- [ ] References section includes all URLs
- [ ] Issue is self-contained — no "see docs" without details
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---------|-----|
| Pseudocode in examples | Use real, runnable code with imports |
| Vague file paths | Use absolute paths |
| Skipping gap analysis | Every gap needs severity + impact |
| Missing real agentic test | Include `agent.start()` test, not just construction |
| No verification commands | Include copy-pastable pytest/python commands |
| Claiming "done" without evidence | Every claim references specific files/symbols |
| Implementing instead of analyzing | This workflow produces issues, not code |
---
## Hard Rules
1. **DO NOT implement** — this workflow produces analysis and issues only
2. **DO NOT claim done** without evidence
3. **Every claim must reference** specific files/symbols
4. **Issue must be self-contained** — implementer needs no follow-up questions
5. **Working code examples required** — no pseudocode
-104
View File
@@ -1,104 +0,0 @@
---
description: analysis
---
You are an expert AI engineer in the PraisonAI ecosystem.
Your job: produce ONLY (1) analysis, (2) review, (3) gap analysis, (4) critical review, (5) plan, (6) proposal.
Do NOT implement. Do NOT write code. Do NOT update docs. Do NOT run tests beyond discovery.
Be precise, evidence-based, and agent-centric.
PRINCIPLES (apply in all analysis/proposals):
- Agent-centric: Agents, workflows, sessions, tools, memory, multi-agent safety.
- Protocol-driven core: praisonaiagents = lightweight, protocol-first (protocols/hooks/adapters only).
- DRY: identify reuse; avoid duplication.
- No perf impact: preserve import-time and hot-path; heavy deps optional + lazy.
- Async-safe + multi-agent safe by default.
- Clear paid upgrade path (support/cloud/services) without restricting core.
- Easy for non-developers. "Few lines of code to do the task!"
CANONICAL PATHS:
- UI Repo: /Users/praison/praisonaiui (praisonaiui)
- SDK Core (reference): /Users/praison/praisonai-package/src/praisonai-agents (praisonaiagents)
- Docs: /Users/praison/PraisonAIDocs (JS: docs/js, Rust: docs/rust)
- Extension points: src/praisonaiui/*, docs/*, tests/*
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MANDATORY PROCESS (NO IMPLEMENTATION)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
STEP 1 — Acceptance Criteria
- Translate request into testable criteria: API, CLI, docs, test expectations, perf constraints.
STEP 2 — Repo Inventory (evidence-based)
- Go through ALL relevant files, understand current logic end-to-end.
- Inventory with evidence:
- Public APIs: modules/classes/functions and exports
- Protocols/adapters/hooks and extension points
- CLI commands, options, help text
- Integrations (db/observability/tools)
- Tests (unit/integration), fixtures, CI config
- Docs (Mintlify), examples, recipes
- Provide: file paths + key symbols + grep counts + entry points.
- Identify DRY opportunities.
STEP 3 — Detailed Analysis
- Architecture and behavior: control flow, data flow, concurrency (sync/async), multi-agent interactions, dependency boundaries (core/wrapper/tools), failure modes.
- Highlight invariants: protocol-driven core, lazy imports, optional deps.
STEP 4 — Detailed Review
- Evaluate against principles: agent-centricity, API simplicity, DRY, perf, optional deps + lazy imports, async/multi-agent safety, test coverage, CLI parity, docs clarity.
- Concrete evidence for each judgment.
STEP 5 — Gap Analysis
- Compare acceptance criteria vs current state. Checklist:
- UI Core, CLI, Docs, Tests, Exports, Perf, Multi-agent + async
- Each gap: severity, impact, risk, recommended location (core/wrapper/tools).
STEP 6 — Critical Review
- Risks, footguns, maintenance concerns:
- API ambiguity, edge cases, backward compat
- Coupling violations, perf regressions, concurrency hazards
- Misuse risks, operational concerns
- Mitigation strategies and "safe by default" recommendations.
STEP 7 — Plan
- Step-by-step (do not implement): tests (TDD) → implementation → CLI → docs → verification
- Exact files to change/create. Migration/compat plan. Rollback plan. Verification commands. Perf checks. Multi-agent + async test strategy.
REAL AGENTIC TEST definition (MUST include in every verification plan):
- A "real agentic test" = agent ACTUALLY RUNS and calls the LLM:
1. Create Agent with the feature being tested
2. Call `agent.start("a real task prompt")` — NOT just constructing the object
3. Agent MUST call LLM and produce text response
4. Print full output so dev can see it worked end-to-end
- Example:
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are a helpful assistant")
result = agent.start("Say hello in one sentence")
print(result)
```
- Assert-only object construction = SMOKE TEST, not real agentic test.
- Both smoke AND real agentic tests required.
STEP 8 — Proposal
- Minimal, agent-centric design and API/CLI surface:
- protocols/hooks in core; implementations in wrapper/tools
- Clear defaults and explicit overrides
- Multi-agent resource isolation/sharing
- Error model and observability hooks
- Include: "Simple API" examples, CLI UX, docs outline, paid upgrade path.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REQUIRED OUTPUT (in order):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1) Acceptance Criteria
2) Inventory (evidence: paths/symbols/exports/grep counts)
3) Detailed Analysis (architecture + flows + invariants)
4) Detailed Review (quality vs principles, evidence-based)
5) Gap Analysis (checklist + severity/impact/placement)
6) Critical Review (risks + mitigations)
7) Plan (step-by-step + file list + verification strategy)
8) Proposal (agent-centric design + API/CLI/docs outline)
Hard rules: DO NOT implement. DO NOT write code. DO NOT claim done. Every claim must reference specific files/symbols.
-228
View File
@@ -1,228 +0,0 @@
---
description: Audit existing docs against live code, then create a comprehensive GitHub issue in PraisonAIDocs with correct, tested information ready for a writer/agent to implement immediately
---
# Create PraisonAIDocs Issue Workflow
Audit code → Compare with existing docs → Draft correct content → Create issue.
> **When to use this:** A feature is already implemented in PraisonAI but the docs are missing, outdated, or wrong. You need to file a self-contained docs issue in `MervinPraison/PraisonAIDocs` that a writer or agent can act on without asking follow-up questions.
> **When NOT to use this:** Use `@[/create-github-issue]` for new integrations that need external research. Use `@[/local-fix]` if you are writing the docs yourself.
---
## Phase 1 — Identify the Feature & Existing Docs
### 1a. Find the relevant doc file
```bash
ls /Users/praison/PraisonAIDocs/docs/<section>/
cat /Users/praison/PraisonAIDocs/docs/<section>/<feature>.mdx
```
Key doc sections:
- `docs/observability/` — tracing providers (Langfuse, LangSmith, etc.)
- `docs/tools/` — tool integrations
- `docs/features/` — agent features
- `docs/cli/` — CLI commands
- `docs/guides/` — how-to guides
### 1b. Read the existing doc fully
Note every claim that needs verification:
- Install commands
- Import statements
- API method names and signatures
- Environment variable names
- CLI commands
---
## Phase 2 — Audit the Live Code
### 2a. Find the source implementation
```bash
# Search praisonaiagents core SDK
grep -rn "<feature>" /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/ 2>&1 | grep -v ".pyc"
# Search praisonai wrapper (CLI, integrations)
grep -rn "<feature>" /Users/praison/praisonai-package/src/praisonai/praisonai/ 2>&1 | grep -v ".pyc"
# Search praisonai-tools
grep -rn "<feature>" /Users/praison/PraisonAI-tools/ 2>&1 | grep -v ".pyc"
```
### 2b. Read all relevant source files end-to-end
Read every file that implements the feature. For each file capture:
- Actual class/function names and signatures
- Required vs optional parameters
- Environment variables read (exact names)
- What gets called internally (trace the call chain)
- Any version-specific behavior
Key files to always check:
| File pattern | What to look for |
|---|---|
| `praisonaiagents/obs/__init__.py` | `_LazyObsModule`, factory methods, `auto()` |
| `praisonai_tools/observability/providers/<name>_provider.py` | `init()`, `is_available()`, `shutdown()`, `flush()` |
| `praisonai/observability/<name>.py` | CLI sink adapter, event handling |
| `praisonai/cli/commands/<name>.py` | All CLI sub-commands and options |
| `praisonai/__init__.py` | Global env var overrides that may interfere |
### 2c. Test the feature live
Run minimal test scripts to verify the actual behavior:
```bash
# Test the import works
python3 -c "from praisonaiagents.obs import obs; provider = obs.<name>(); print(type(provider).__name__, provider._initialized)"
# Test CLI commands
praisonai <feature> --help
praisonai <feature> <subcommand>
# Verify traces/output appear
timeout 30 praisonai <feature> <subcommand> --limit 5
```
### 2d. Build a "What's Wrong" table
For each doc claim that is incorrect, record:
| Current Doc (Wrong) | Correct |
|---|---|
| wrong install command | correct install |
| wrong import | correct import |
| non-existent method | actual method |
| wrong env var name | actual env var |
---
## Phase 3 — Draft the Issue
The issue body must be **self-contained and implementation-ready**. A writer should be able to update the doc by reading only the issue — no follow-up questions.
### Required sections:
```markdown
## Overview
One paragraph: what doc file needs updating, why it's wrong, and the end goal.
State explicitly: "All code in this issue has been tested and verified working."
## What's Wrong With the Current Docs
Table: Current (Wrong) | Correct
Cover: install commands, imports, API methods, env vars, missing sections.
## Correct Architecture (How It Actually Works)
Explain the actual internal call chain so the writer understands context.
Include a text diagram if helpful.
## Required Install
Exact pip commands, nothing more.
## Environment Variables
Table: Variable | Required | Description
Show bash export examples for both cloud and self-hosted.
## Python Usage
### Quickstart (Recommended)
Full working code with correct imports, init, agent run, and flush.
### Auto-Detection
Document obs.auto() or equivalent if applicable.
### Additional Patterns
Any other valid usage patterns (explicit provider, multi-agent, etc.).
## CLI Usage (if applicable)
All sub-commands with flags and examples.
Include an end-to-end CLI session example.
## Configuration File (if applicable)
Document any config files that are auto-created or auto-read.
## What Output Looks Like
Show what traces/output actually look like after a successful run.
## Version Compatibility Notes
Document any breaking changes between SDK versions that affect usage.
## Files to Update
Table: File | Change
## Acceptance Criteria
- [ ] Checkbox list — each item must be specific and verifiable
## References
List all source files read (with absolute paths).
```
---
## Phase 4 — Create the Issue
### 4a. Write body to a temp file
```bash
cat > /tmp/docs_issue_<feature>.md << 'EOF'
<issue body>
EOF
```
### 4b. Create via `gh` CLI
```bash
gh issue create \
--repo MervinPraison/PraisonAIDocs \
--title "Docs: <action verb> <feature> page — <one-line summary of what's wrong>" \
--label "documentation" \
--body-file /tmp/docs_issue_<feature>.md
```
**Title format:** `Docs: Rewrite/Update/Add <Feature> page — <what's wrong or missing>`
Examples:
- `Docs: Rewrite Langfuse integration page with correct Langfuse v4 API and CLI commands`
- `Docs: Add obs.auto() documentation to observability overview`
- `Docs: Fix LangSmith install command and update import paths`
### 4c. Verify
```bash
gh issue view <number> --repo MervinPraison/PraisonAIDocs | head -30
```
Confirm the URL: `https://github.com/MervinPraison/PraisonAIDocs/issues/<number>`
---
## Checklist — Before Creating the Issue
- [ ] Existing doc file read completely
- [ ] All source files implementing the feature read end-to-end (not skimmed)
- [ ] Feature tested live — not just code-read
- [ ] "What's Wrong" table is complete and specific
- [ ] All code examples in the issue are copy-pastable and tested
- [ ] All env var names are verified against source (not guessed)
- [ ] All CLI commands verified with `--help` and live run
- [ ] Acceptance criteria are specific and verifiable (not vague)
- [ ] References list includes all source file paths read
- [ ] Issue is self-contained — writer needs no follow-up
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---|---|
| Documenting what the code *should* do, not what it *does* | Run it. Test it. Document the actual behavior. |
| Copying import paths from docs being replaced | Always verify imports against source files |
| Missing the "What's Wrong" table | This is the most important section — be explicit |
| Vague acceptance criteria like "docs are updated" | Write specific, testable criteria: "install command is `pip install langfuse`" |
| Not checking for interfering globals (e.g. `OTEL_SDK_DISABLED`) | Always grep `__init__.py` files for env var overrides |
| Forgetting `provider.flush()` in examples | Async buffers need explicit flush before process exit |
| Not testing with a real API key | Code-reading alone misses runtime errors |
| Using `timeout` too short for first-run (downloads, auth) | Use `timeout 120` for agent runs, `timeout 30` for CLI |
-308
View File
@@ -1,308 +0,0 @@
---
description: Research a topic in-depth, analyze both external and local codebases, and create a comprehensive GitHub issue — ready for another agent/developer to act on immediately
---
# Create GitHub Issue Workflow
Research → Clone & Analyze → PraisonAI Analysis → Draft → Create Issue.
> **When to use this:** You need to create a detailed, implementation-ready GitHub issue for a new integration, feature, or benchmark. The issue must contain enough context that another agent or developer can implement it without asking further questions.
> **When NOT to use this:** Use `@[/local-fix]` if you are implementing the change yourself, not just filing an issue.
---
## Phase 1 — Online Research
### 1a. Read official sources
Research the topic from all primary sources: official site, GitHub repo, documentation, blog posts.
```bash
# Example searches (adapt to your topic)
# - Official site / announcement pages
# - GitHub README and docs
# - Third-party write-ups (e.g. Snorkel AI, Epoch AI)
# - Framework documentation (core concepts, agents, running)
```
URLs to read for each source (use `read_url_content` tool):
- Official announcement / news page
- GitHub repository README (multiple chunks if large)
- Framework/integration documentation pages
- Any relevant blog posts or analysis
**Capture for the issue:**
- What is it? Purpose and design goals
- Key terminology and concepts (with definitions)
- Architecture overview
- Current leaderboard / ecosystem state
- References list (all URLs)
### 1b. Read paginated content
For large pages, read additional chunks:
```
view_content_chunk(document_id=<url>, position=2)
view_content_chunk(document_id=<url>, position=3)
view_content_chunk(document_id=<url>, position=4)
```
Continue until all relevant sections are read (core concepts, agent types, running instructions, integration API).
---
## Phase 2 — Clone & Analyze External Codebase
### 2a. Clone the repository
```bash
git clone <repo-url> ~/<repo-name> --depth=1
```
### 2b. Explore structure
```bash
ls -la ~/<repo-name>/
ls -la ~/<repo-name>/src/
```
Key files to read (adapt paths to repo):
- `AGENTS.md` / `CLAUDE.md` / `README.md` — architecture overview
- Base class files (e.g. `base.py` for agents, environments)
- Factory / registry files (how things are registered)
- Model/config files (data structures agents must populate)
- Enum files (valid names, types)
- Example agent implementations (minimal + full-featured)
- `pyproject.toml` — Python version, dependencies
**Capture for the issue:**
- Repository structure diagram
- Key file paths with line counts
- Base class interface (all abstract methods with signatures)
- How to register a new agent (enum + factory pattern)
- Data models the agent must populate (`AgentContext`, etc.)
- Example agent implementations (minimal and production)
- CLI commands to run the integration
- Environment variables required
### 2c. Read base classes end-to-end
Read every relevant base class completely. For agent integrations:
```
read_file(base.py) # BaseAgent / BaseInstalledAgent
read_file(factory.py) # AgentFactory registration
read_file(models/agent/name.py) # AgentName enum
read_file(models/agent/context.py) # AgentContext fields
read_file(examples/agents/minimal_agent.py) # Minimal example
read_file(agents/installed/reference_agent.py) # Full example
```
### 2d. Read a reference implementation
Pick the most complete existing agent implementation (e.g. `codex.py`, `gemini_cli.py`) and read it fully. This reveals:
- Install pattern (system packages → user packages)
- Version detection (`get_version_command` / `parse_version`)
- `@with_prompt_template` decorator usage
- `populate_context_post_run` for token tracking
- ATIF trajectory support (`SUPPORTS_ATIF`)
- `CliFlag` / `EnvVar` declarative config
- `exec_as_root` vs `exec_as_agent` usage
---
## Phase 3 — Analyze PraisonAI Codebase
### 3a. Identify relevant components
```bash
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/tools/
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/agent/
```
Key files to read for agent integration issues:
| File | What to look for |
|------|-----------------|
| `praisonaiagents/tools/shell_tools.py` | `execute_command`, approval decorators |
| `praisonaiagents/agent/agent.py` | `Agent.start()`, `Agent.chat()`, token tracking |
| `praisonaiagents/approval/` | `@require_approval`, auto-approval backend |
| `praisonaiagents/eval/` | Evaluation framework hooks |
| `praisonaiagents/agents/agents.py` | `AgentTeam` multi-agent |
| `pyproject.toml` | Current version, optional dependencies |
### 3b. Map integration points
For each PraisonAI component, document:
- What it does
- How it maps to the external system's interface
- What needs bridging (e.g. wrapping `environment.exec()` as a tool)
- Known gotchas (e.g. `@require_approval` must be bypassed in containers)
---
## Phase 4 — Draft the Issue
The issue body must be self-contained. Another agent must be able to implement the feature by reading only the issue — no follow-up questions.
### Required sections:
```markdown
## Overview
One paragraph: what, why, and the end goal.
## Background: What is <X>?
- Purpose and design goals
- Key statistics (task count, solve rates, etc.)
- Why <X> + PraisonAI is valuable
- Current ecosystem / leaderboard state
## <X> Architecture (Codebase Analysis)
> Repo analyzed locally: `~/<repo-name>` (cloned at `~/<repo-name>`)
### Core Concepts
Table: Concept | Description
### Two (or N) Integration Types
Code examples for each type with full signatures.
### Key File Locations in <X> Codebase
Directory tree with annotations for each important file.
### Data Models
Full class definitions the agent must populate.
### How to Run (CLI)
All relevant CLI commands with flags and examples.
## PraisonAI Architecture (Relevant to This Integration)
Table: Component | Location | Relevance
### PraisonAI Execution Model
How PraisonAI currently handles the relevant operations, and what must be adapted.
## Proposed Implementation Plan
### Approach: <Recommended> (with justification)
### Phase 1: Minimal Proof-of-Concept
Full working code example.
### Phase 2: Production Implementation
Full working code example.
### Phase N: Advanced Features
(ATIF, multi-agent, etc.)
## Files to Create / Modify
### New files (praisonai-package)
Table: File | Purpose
### Modifications to <External Repo> (PR upstream)
Table: File | Change
## Technical Considerations
Subsections for:
- Container/environment dependencies
- API key forwarding
- Safety/approval bypass
- Token tracking
- Parallel execution safety
## Job / Config Example
Working YAML config + CLI invocation.
## Use Cases Unlocked
Table: Use Case | How
## Acceptance Criteria
- [ ] Checkbox list of verifiable outcomes
## Implementation Notes for the Assigned Agent/Developer
### Key <X> Files to Read First
Numbered list with file paths and line counts.
### Key PraisonAI Files to Read
Numbered list with file paths.
### Critical Integration Points
Numbered list of the exact code-level bridges needed.
### Architecture Decision
Why the chosen approach (installed vs external, etc.) with trade-offs.
### Installation & Testing Commands
Copy-pastable commands to install, verify, and run.
### Upstream PR
What to submit upstream and where.
## References
Bullet list of all URLs used.
```
---
## Phase 5 — Create the Issue
### 5a. Create via `gh` CLI
```bash
gh issue create \
--repo <org>/<repo> \
--title "Feature: <Descriptive Title>" \
--label "enhancement" \
--body "<issue body>"
```
**Title format:** `Feature: <What> with <Integration> (<Framework/Version>)`
Example:
```bash
gh issue create \
--repo MervinPraison/PraisonAI \
--title "Feature: Integrate PraisonAI Agents with Terminal-Bench 2.0 (Harbor Framework)" \
--label "enhancement" \
--body "..."
```
### 5b. Verify the issue was created
```bash
gh issue view <issue-number> --repo <org>/<repo> | head -20
```
The output URL confirms success: `https://github.com/<org>/<repo>/issues/<number>`
---
## Checklist — Before Creating the Issue
- [ ] All primary documentation URLs read (including paginated chunks)
- [ ] External repo cloned locally and analyzed
- [ ] Base classes read end-to-end (not just skimmed)
- [ ] At least one reference implementation read fully
- [ ] PraisonAI codebase analyzed for integration points
- [ ] Issue body has working code examples (not pseudocode)
- [ ] All file paths are absolute and verified to exist
- [ ] CLI commands are copy-pastable and complete
- [ ] Acceptance criteria are verifiable (not vague)
- [ ] References section includes all URLs used
- [ ] Issue is self-contained — no "see docs for details" without the details
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---------|-----|
| Pseudocode in examples | Use real, runnable code with imports |
| Vague file paths like `agents/` | Use absolute paths like `~/harbor/src/harbor/agents/base.py` |
| Missing `--depth=1` on clone | Large repos take forever; always use shallow clone |
| Only reading chunk 0 of a URL | Read chunks 1–4+ for paginated content |
| Skipping the factory/registry file | This is where registration happens; always read it |
| Not reading a reference agent | Pattern is not obvious from base class alone |
| Forgetting API key forwarding section | Always document how secrets are passed to containers |
| Skipping `populate_context_post_run` | Harbor uses this for token tracking and leaderboard data |
| Missing upstream PR instructions | Specify exact files to modify upstream for first-class support |
-190
View File
@@ -1,190 +0,0 @@
---
description: create and publish a post on mer.vin using praisonaiwp
---
## Config
- Server: `default` → `https://mer.vin`
- Config: `~/.praisonaiwp/config.yaml`
- Category for PraisonAI features: `PraisonAI`
---
## Step 1 — Compose the content
Structure every post as:
1. **Intro paragraph** — one sentence, what the feature solves
2. **Mermaid diagram** — architecture/flow (see block format below)
3. **Sections** — H2 headings, tables > prose, code blocks for usage
4. **Performance/summary** — table with concrete numbers
Keep it technical. Lead with diagrams and tables, not paragraphs.
---
## Step 2 — Mermaid block format (merpress)
> **Creating merpress:** Install the [Merpress – Mermaid for WordPress](https://wordpress.org/plugins/merpress/) plugin via `wp plugin install merpress --activate --allow-root` on the server. It adds the `wp:merpress/mermaidjs` block used below.
All posts use the native `wp:merpress/mermaidjs` block. Use this exact format:
```
<!-- wp:merpress/mermaidjs {"align":"full"} -->
<div class="wp-block-merpress-mermaidjs diagram-source-mermaid alignfull"><pre class="mermaid">%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "lineColor": "#000000"}}}%%
graph TD
A[Input] --> B[Agent]
B --> C[Tool]
C --> D[Output]
classDef hook fill:#189AB4,color:#fff
classDef agent fill:#8B0000,color:#fff
classDef decision fill:#444,color:#fff
class B agent
class C hook
</pre></div>
<!-- /wp:merpress/mermaidjs -->
```
**Do NOT use:** `[mermaid]...[/mermaid]` shortcode — that is the wrong format.
Color scheme:
- `#8B0000` (dark red) — agents, inputs, outputs
- `#189AB4` (teal) — tools, hooks
- `#444` — decisions/conditionals
---
## Step 2a — SVG/image upload via SSH
`praisonaiwp media upload` correctly SFTPs the file to `/tmp/` on the server, but
`_execute_wp()` in `~/praisonaiwp-cli/praisonaiwp/core/wp_client.py` never appends
`--allow-root`. Use direct SSH instead.
**SVG upload (Safe SVG plugin active on mer.vin):**
```bash
# 1. SCP SVG to server
scp -i ~/.ssh/id_ed25519 /path/to/diagram.svg <SSH_USER>@<SERVER_IP>:/tmp/
# 2. Import via WP-CLI — must pass --user=<admin> so Safe SVG capability check passes
ssh -i ~/.ssh/id_ed25519 <SSH_USER>@<SERVER_IP> \
"cd <WP_ROOT> && \
wp media import /tmp/diagram.svg --post_id=<POST_ID> \
--title='Title' --alt='Alt' --user=praison --allow-root --porcelain"
# → returns media ID
# 3. Get the URL
ssh -i ~/.ssh/id_ed25519 <SSH_USER>@<SERVER_IP> \
"cd <WP_ROOT> && \
wp post get <MEDIA_ID> --field=guid --allow-root"
```
> **Key:** `--user=praison` is required — Safe SVG checks upload capability against the
> current WP user. Without it, even with the plugin active, SVG imports are blocked.
**PNG fallback (if Safe SVG not available):**
```bash
rsvg-convert -w 1360 /path/to/diagram.svg -o /tmp/diagram_2x.png
# Then follow the same SSH steps above using the .png file (no --user needed)
```
Use this Gutenberg image block in the post content:
```
<!-- wp:image {"id":<MEDIA_ID>,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="<IMAGE_URL>" alt="Alt text" class="wp-image-<MEDIA_ID>"/></figure>
<!-- /wp:image -->
```
---
## Step 3 — Create the post
```bash
praisonaiwp create "Post Title" \
--status publish \
--content '<FULL GUTENBERG CONTENT>'
```
Note the returned **Post ID** from the output.
---
## Step 4 — Set category
```bash
praisonaiwp update <POST_ID> --category "PraisonAI"
```
---
## Step 5 — Validate mermaid format
```bash
ssh -i ~/.ssh/id_ed25519 <SSH_USER>@<SERVER_IP> \
"cd <WP_ROOT> && \
wp post get <POST_ID> --field=post_content --allow-root | grep -i mermaid"
```
Expected output must contain `wp:merpress/mermaidjs`, not `[mermaid]`.
---
## Key Gutenberg blocks reference
```
<!-- wp:paragraph --><p>text</p><!-- /wp:paragraph -->
<!-- wp:heading --><h2 class="wp-block-heading">Title</h2><!-- /wp:heading -->
<!-- wp:heading {"level":3} --><h3 class="wp-block-heading">Sub</h3><!-- /wp:heading -->
<!-- wp:code --><pre class="wp-block-code"><code>code here</code></pre><!-- /wp:code -->
<!-- wp:table -->
<figure class="wp-block-table"><table>
<thead><tr><th>Col</th></tr></thead>
<tbody><tr><td>Val</td></tr></tbody>
</table></figure>
<!-- /wp:table -->
<!-- wp:list --><ul class="wp-block-list"><li>item</li></ul><!-- /wp:list -->
<!-- wp:separator --><hr class="wp-block-separator has-alpha-channel-opacity"/><!-- /wp:separator -->
```
---
## Full example command
```bash
praisonaiwp create "Feature Name: What It Does" \
--status publish \
--content '<!-- wp:paragraph -->
<p>One sentence intro.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Architecture</h2>
<!-- /wp:heading -->
<!-- wp:merpress/mermaidjs {"align":"full"} -->
<div class="wp-block-merpress-mermaidjs diagram-source-mermaid alignfull"><pre class="mermaid">%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "lineColor": "#000000"}}}%%
graph TD
A[Start] --> B[Agent]
class B agent
classDef agent fill:#8B0000,color:#fff
</pre></div>
<!-- /wp:merpress/mermaidjs -->
<!-- wp:code -->
<pre class="wp-block-code"><code>from praisonaiagents import Agent
agent = Agent(name="example")
result = agent.start("task")</code></pre>
<!-- /wp:code -->'
# Then set category:
praisonaiwp update <ID> --category "PraisonAI"
```
@@ -1,670 +0,0 @@
---
description: End-to-end workflow — deep analysis → GitHub issue → wait for implementing agents → create PR if missing → wait for reviewing agents → review PR locally → feedback to @claude → merge to main when robust per AGENTS.md
---
# End-to-End: Analysis → Issue → PR → Review → Merge
Deep Analysis → Gap Analysis → Critical Review → Plan → Create Issue → **Wait for implementing agents** → **Create PR if missing** → **Wait for reviewers** → **Validate PR locally** → **Feedback to @claude** → **Re-review after fixes** → **Merge to main if robust**.
> **When to use this:** You want a fully hands-off delivery loop. You describe a feature/integration/fix; this workflow produces the issue, monitors implementation by other agents (Claude, Copilot, CodeRabbit), validates their PR locally against `AGENTS.md` principles, loops feedback until the PR is robust, and merges to `main`.
> **When NOT to use this:** Use `/analysis-github-issue-create` if you only want the issue (no PR/merge). Use `/local-fix` if you are the implementer.
---
## PRINCIPLES (apply throughout)
- **Agent-centric**: Agents, workflows, sessions, tools, memory, multi-agent safety.
- **Protocol-driven core**: `praisonaiagents` = lightweight, protocol-first (protocols/hooks/adapters only).
- **DRY**: identify reuse; avoid duplication.
- **No perf impact**: preserve import-time and hot-path; heavy deps optional + lazy.
- **Async-safe + multi-agent safe** by default.
- **Easy for non-developers**: "Few lines of code to do the task!"
- **No competitor names in public surfaces**: Never mention competitor product, company, or project names in GitHub issues, PRs, commit messages, release notes, docs, or any other public-facing content. Refer to capabilities generically (e.g., "self-improving agent pattern", "external agent framework").
- **Test before merge**: never merge unvalidated PRs. Always clone the branch locally and run the tests.
- **Minimal code change**: prefer upstream one-line fixes over downstream workarounds.
---
## CANONICAL PATHS
```
Core SDK: /Users/praison/praisonai-package/src/praisonai-agents (praisonaiagents)
Wrapper: /Users/praison/praisonai-package/src/praisonai (praisonai)
Tools: /Users/praison/PraisonAI-tools
Docs: /Users/praison/PraisonAIDocs
TypeScript: /Users/praison/praisonai-package/src/praisonai-ts
AGENTS.md: /Users/praison/praisonai-package/src/praisonai-agents/AGENTS.md
```
---
# PART A — ANALYSIS & ISSUE (Phases 1–9)
These phases are identical to `/analysis-github-issue-create`. Execute them in order. **Do not implement any code** in these phases — they produce analysis and an issue only.
## Phase 1 — Acceptance Criteria
Translate the request into testable criteria:
- API expectations (classes, methods, signatures)
- CLI expectations (commands, flags, help text)
- Documentation expectations (pages, examples)
- Test expectations (unit, integration, smoke, real agentic)
- Performance constraints (import time, hot-path)
---
## Phase 2 — External Research (if applicable)
### 2a. Read official sources
If analyzing an external integration, research from primary sources:
```bash
# Use read_url_content tool for:
# - Official site / announcement pages
# - GitHub README and docs
# - Framework documentation
# - Third-party write-ups
```
**Capture:**
- What is it? Purpose and design goals
- Key terminology and concepts
- Architecture overview
- Current ecosystem state
- References list (all URLs)
### 2b. Clone & analyze external codebase (if applicable)
```bash
git clone <repo-url> ~/<repo-name> --depth=1
ls -la ~/<repo-name>/
```
Key files to read:
- `AGENTS.md` / `README.md` — architecture overview
- Base class files (abstract methods, signatures)
- Factory / registry files (registration pattern)
- Model/config files (data structures)
- Example implementations (minimal + full-featured)
- `pyproject.toml` / `package.json` — dependencies
---
## Phase 3 — PraisonAI Codebase Inventory
### 3a. Inventory with evidence
Go through ALL relevant files, understand current logic end-to-end.
```bash
# Core SDK
ls /Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/
grep -r "class.*Protocol" praisonaiagents/ --include="*.py" | wc -l
# Wrapper
ls /Users/praison/praisonai-package/src/praisonai/praisonai/
ls /Users/praison/praisonai-package/src/praisonai/praisonai/cli/commands/
# TypeScript
ls /Users/praison/praisonai-package/src/praisonai-ts/src/
```
**Document:**
- Public APIs: modules/classes/functions and exports
- Protocols/adapters/hooks and extension points
- CLI commands, options, help text
- Integrations (db/observability/tools)
- Tests (unit/integration), fixtures, CI config
- Docs (Mintlify), examples, recipes
Provide: **file paths + key symbols + grep counts + entry points**.
### 3b. Identify DRY opportunities
- Existing abstractions that can be reused
- Duplicated code that should be consolidated
- Existing protocols before creating new ones
---
## Phase 4 — Detailed Analysis
### 4a. Architecture and behavior
- Control flow and data flow
- Concurrency model (sync/async)
- Multi-agent interactions
- Dependency boundaries (core/wrapper/tools)
- Failure modes and error handling
### 4b. Invariants check
Verify these are preserved:
- [ ] Protocol-driven core (no heavy impls in `praisonaiagents`)
- [ ] Lazy imports (optional deps never at module level)
- [ ] Backward compatible (public API changes need deprecation)
- [ ] Safe defaults (new features opt-in)
---
## Phase 5 — Gap Analysis
Compare acceptance criteria vs current state.
### Checklist
| Area | Current State | Gap | Severity | Impact | Placement |
|------|---------------|-----|----------|--------|-----------|
| Core SDK | | | | | |
| Wrapper | | | | | |
| Tools/plugins | | | | | |
| CLI | | | | | |
| Docs | | | | | |
| Tests | | | | | |
| Exports | | | | | |
| Perf | | | | | |
| Multi-agent + async | | | | | |
### Gap severity levels
- **Critical**: Blocks functionality
- **High**: Significant limitation
- **Medium**: Missing feature
- **Low**: Nice-to-have
---
## Phase 6 — Critical Review
### 6a. Risks and footguns
- API ambiguity or edge cases
- Backward compatibility concerns
- Coupling violations
- Performance regressions
- Concurrency hazards
- Misuse risks
- Operational concerns
### 6b. Mitigation strategies
For each risk, document:
- "Safe by default" recommendation
- Explicit opt-in for dangerous behavior
- Documentation warnings
---
## Phase 7 — Implementation Plan
Step-by-step plan (DO NOT implement):
### 7a. Test-first (TDD)
1. Unit tests for new functionality
2. Integration tests for cross-component behavior
3. Smoke tests for quick validation
4. **Real agentic tests** (REQUIRED):
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are helpful")
result = agent.start("Say hello in one sentence")
print(result) # Must call LLM and produce response
```
### 7b. Implementation order
1. Tests (TDD)
2. Core implementation
3. CLI integration
4. Documentation
5. Verification
### 7c. Files to change/create
| File | Action | Purpose |
|------|--------|---------|
| | | |
### 7d. Verification commands
```bash
# Unit tests
pytest tests/unit/test_<feature>.py -v
# Integration tests
pytest tests/integration/test_<feature>.py -v
# Smoke test
python -c "from praisonaiagents import <Feature>; print('OK')"
# Real agentic test
python examples/<feature>_example.py
```
---
## Phase 8 — Draft GitHub Issue
The issue must be **self-contained**. Another agent must be able to implement by reading only the issue.
### Required sections
```markdown
## Overview
One paragraph: what, why, and the end goal.
## Background
- Purpose and design goals
- Why this is valuable
- Current state / ecosystem
## Architecture Analysis
### Current Implementation
- Key files and their purposes
- Integration points
- Data flow
### Key File Locations
| File | Purpose | Lines |
|------|---------|-------|
## Gap Analysis Summary
### Critical Gaps
| Gap | Impact | Effort |
|-----|--------|--------|
### Feature Gaps
| Feature | Current Support | Gap |
|---------|-----------------|-----|
## Proposed Implementation
### Phase 1: Minimal
Working code example.
### Phase 2: Production
Working code example.
## Files to Create / Modify
### New files
| File | Purpose |
|------|---------|
### Modified files
| File | Change |
|------|--------|
## Technical Considerations
- Dependencies
- Performance impact
- Safety / approval
- Multi-agent safety
## Acceptance Criteria
- [ ] Verifiable checkbox list
## Implementation Notes
### Key Files to Read First
1. `path/to/file.py` (N lines) — purpose
### Critical Integration Points
1. Where X connects to Y
### Testing Commands
```bash
# Copy-pastable commands
```
## References
- [Link](url)
```
---
## Phase 9 — Create GitHub Issue
### 9a. Create via `gh` CLI
```bash
gh issue create \
--repo MervinPraison/PraisonAI \
--title "<Type>: <Descriptive Title>" \
--body-file /tmp/issue-body.md
```
**Title formats:**
- `Feature: <What>` — new functionality
- `Integration: <External System>` — external integration
- `Fix: <Problem>` — bug fix proposal
### 9b. Record the issue number
```bash
ISSUE_NUM=$(gh issue view <number> --repo MervinPraison/PraisonAI --json number --jq '.number')
echo "Tracking issue #$ISSUE_NUM"
```
---
# PART B — IMPLEMENTATION MONITORING (Phases 10–15)
After the issue is filed, other agents (`@claude`, GitHub Copilot agent, CodeRabbit) pick it up automatically. This part watches, shepherds, validates, and merges.
## Phase 10 — Wait ~10 min for implementing agents
After `gh issue create`, Claude and Copilot typically start work within seconds and finish a first pass in 5–15 minutes.
```bash
echo "Waiting 10 minutes for implementing agents..."
echo "Start: $(date)"
sleep 600
echo "End: $(date)"
```
### Then check: did they open a PR?
```bash
REPO=MervinPraison/PraisonAI
ISSUE_NUM=<number>
# Check for PRs that reference the issue
gh pr list --repo $REPO --state open --search "fixes #$ISSUE_NUM OR closes #$ISSUE_NUM" --json number,title,headRefName
# Also check for branches matching claude/issue-<N>-* naming convention
gh api repos/$REPO/branches --paginate --jq ".[] | select(.name | startswith(\"claude/issue-$ISSUE_NUM\")) | .name"
```
---
## Phase 11 — Create PR if none exists
If Claude pushed a branch but did not open a PR, open one yourself.
```bash
REPO=MervinPraison/PraisonAI
ISSUE_NUM=<number>
BRANCH=$(gh api repos/$REPO/branches --paginate --jq ".[] | select(.name | startswith(\"claude/issue-$ISSUE_NUM\")) | .name" | head -1)
if [ -n "$BRANCH" ]; then
TITLE=$(gh api repos/$REPO/commits/$BRANCH --jq '.commit.message' | head -1)
gh pr create --repo $REPO --head "$BRANCH" --base main \
--title "$TITLE" \
--body "Automated PR from Claude's work on issue #$ISSUE_NUM.
Branch: \`$BRANCH\`
Closes #$ISSUE_NUM"
fi
```
### If no branch exists after 10 minutes
Re-trigger Claude by commenting on the issue, then wait another 10 minutes and re-check:
```bash
gh issue comment $ISSUE_NUM --repo $REPO \
--body "@claude please pick up this issue — full analysis and plan are in the issue body."
sleep 600
```
---
## Phase 12 — Wait ~10 min for reviewing agents
Once a PR exists, `CodeRabbit`, `Copilot`, and CI pipelines run. Give them time to complete.
```bash
echo "Waiting 10 minutes for PR reviewers and CI..."
sleep 600
```
### Collect status
```bash
PR=<pr-number>
gh pr view $PR --repo $REPO --json state,mergeable,mergeStateStatus,updatedAt,commits,files \
| python -c "
import json,sys
d=json.load(sys.stdin)
print(f\" State: {d['state']} Mergeable: {d['mergeable']} MergeState: {d['mergeStateStatus']}\")
print(f\" Commits: {len(d['commits'])}\")
for f in d['files']:
print(f\" {f['path']}: +{f['additions']} -{f['deletions']}\")
"
# CI & review checks
gh pr view $PR --repo $REPO --json statusCheckRollup > /tmp/pr-checks.json
python -c "
import json
for c in json.load(open('/tmp/pr-checks.json'))['statusCheckRollup']:
s = c.get('conclusion') or c.get('status','?')
name = c.get('name') or c.get('context','?')
if s and s not in ('SKIPPED',):
print(f' {name}: {s}')
"
```
---
## Phase 13 — Validate the PR locally
**Never merge an unvalidated PR.** Always clone the branch and run tests.
```bash
REPO_URL=https://github.com/MervinPraison/PraisonAI.git
BRANCH=<branch-name>
WORKDIR=/tmp/pr-validate
rm -rf $WORKDIR
git clone --depth 1 --branch "$BRANCH" $REPO_URL $WORKDIR
cd $WORKDIR
# Files touched by the PR
gh pr view $PR --repo $REPO --json files --jq '.files[].path'
# Run the tests for changed files — ALWAYS use timeout (user global rule)
timeout 120 python -m pytest <test-paths> -v --tb=short
# Critical invariant checks (adapt per feature):
# 1) Lazy-import: heavy deps never imported at module level
timeout 30 python - <<'PY'
import sys
from praisonai.observability import <NewThing> # example
assert 'heavy_dep' not in sys.modules, "eager import — violates AGENTS.md §4.2"
print("OK: lazy import preserved")
PY
# 2) Cold-import benchmark (no regression)
timeout 30 python -c "import time; t=time.time(); import praisonaiagents; print(f'{(time.time()-t)*1000:.1f} ms')"
```
### Mergeability gate
A PR is **ready to merge only if ALL of these are true**:
- [ ] `gh pr view` reports `mergeable=MERGEABLE` and `mergeStateStatus` in `CLEAN`/`UNSTABLE` (not `DIRTY`/`BLOCKED`).
- [ ] All `test (3.x)` matrix jobs report `SUCCESS`.
- [ ] Local `pytest` on the changed test files passes with **zero failures** (skipped/xfailed tests are OK).
- [ ] Lazy-import invariant preserved (if the feature adds an optional dep).
- [ ] Cold-import time within ±2 % of `main` (AGENTS.md §4.2).
- [ ] No files outside the issue's declared scope were changed.
- [ ] The diff respects all invariants in AGENTS.md §4.6.
If **any** is false → go to Phase 14 (feedback). Do not merge.
---
## Phase 14 — Feedback to `@claude` when issues found
When validation fails, post a precise, actionable comment tagging `@claude`, referencing the exact test name, error, file, and the AGENTS.md principle violated.
```bash
gh pr comment $PR --repo $REPO --body "$(cat <<'EOF'
Hold on merge: validated locally on HEAD `<short-sha>` and found these issues:
**Test failures:**
```
FAILED tests/.../test_x.py::TestY::test_z
AssertionError: <actual-message>
```
**Root cause:** <one-line diagnosis referencing the exact file and line>.
**AGENTS.md violation(s):**
- §<section>: <principle>
**Requested fix (minimal):**
- Change `<file>:<line>` to `<what>`.
- Or update the test assertion to `<what>` (if the test is wrong, not the code).
**What already passes:**
- N/M tests pass.
- Lazy-import invariant preserved ✅ (or not — state explicitly).
@claude please push a fix. Follow AGENTS.md principles: minimal change, protocol-driven, no perf impact, lazy imports, backward-compatible, safe defaults. Make sure the PR is robust — run the tests locally before force-pushing.
EOF
)"
```
### Loop
After commenting:
```bash
echo "Waiting 10 minutes for Claude to push fixes..."
sleep 600
# → return to Phase 12 (fetch new commits, re-run checks)
```
Repeat Phases 12 → 13 → 14 until the mergeability gate in Phase 13 is fully green, or escalate to a human after 3 failed rounds.
### When the PR has merge conflicts
If `mergeStateStatus=DIRTY`, ask Claude to rebase rather than resolving conflicts yourself on non-trivial logic:
```bash
gh pr comment $PR --repo $REPO --body "@claude this PR has merge conflicts with \`main\` (PR #<X> was merged, touching the same regions). Please rebase onto latest \`main\`, re-run \`pytest <paths>\`, and force-push."
```
---
## Phase 15 — Merge to `main`
Once Phase 13's gate is fully green:
### 15a. Final diff review against AGENTS.md
```bash
gh pr diff $PR --repo $REPO | less
```
**Hard gate — every box must be ticked before merge:**
- [ ] **Protocol-driven core (§4.1)**: no heavy implementations leaked into `praisonaiagents`.
- [ ] **No perf impact (§4.2)**: lazy imports confirmed; import benchmark within ±2 %.
- [ ] **DRY (§4.3)**: no new duplication; existing protocols/adapters reused where possible.
- [ ] **Agent-centric (§4.4)**: API centers on agents/sessions/tools/memory.
- [ ] **Async-safe + multi-agent safe (§4.5)**: no shared mutable globals; locks where needed.
- [ ] **Invariants preserved (§4.6)**: backward compatible, safe defaults, deterministic tests.
- [ ] **Naming conventions (§4.9)**: `XProtocol` for interfaces, `XAdapter` for impls, `add_*`/`get_*`/`save`/`load` verbs.
- [ ] No `.md` files added beyond those explicitly requested (per user global rule).
- [ ] Tests run locally with `timeout` — never hang (per user global rule).
### 15b. Merge
```bash
gh pr merge $PR --repo $REPO --squash --delete-branch
# --squash preserves linear main; --delete-branch keeps the repo clean
```
### 15c. Verify
```bash
gh pr view $PR --repo $REPO --json state,mergedAt,mergeCommit
gh issue view $ISSUE_NUM --repo $REPO --json state # should auto-close
```
---
# Orchestration Snippet (one-shot reference)
For a single end-to-end invocation, chain Part B phases:
```bash
#!/usr/bin/env bash
set -euo pipefail
REPO=MervinPraison/PraisonAI
ISSUE_NUM=<fill>
# Phase 10: wait for implementing agents
sleep 600
# Phase 11: ensure PR exists
BRANCH=$(gh api repos/$REPO/branches --paginate \
--jq ".[] | select(.name | startswith(\"claude/issue-$ISSUE_NUM\")) | .name" | head -1)
PR=$(gh pr list --repo $REPO --state open --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null || true)
if [ -z "$PR" ] && [ -n "$BRANCH" ]; then
TITLE=$(gh api repos/$REPO/commits/$BRANCH --jq '.commit.message' | head -1)
gh pr create --repo $REPO --head "$BRANCH" --base main \
--title "$TITLE" --body "Closes #$ISSUE_NUM"
PR=$(gh pr list --repo $REPO --state open --head "$BRANCH" --json number --jq '.[0].number')
fi
echo "Tracking PR #$PR"
# Phase 12: wait for reviewers + CI
sleep 600
# Phases 13–14: validate + feedback loop (cap at 3 rounds)
for round in 1 2 3; do
echo "=== Validation round $round ==="
# clone + pytest (per feature) — if green break; else gh pr comment + sleep 600
break # placeholder
done
# Phase 15: merge
gh pr merge $PR --repo $REPO --squash --delete-branch
gh issue view $ISSUE_NUM --repo $REPO --json state
```
---
## Checklist — Before Merging
- [ ] Issue exists and describes the work
- [ ] PR exists and references the issue (`Closes #N`)
- [ ] Branch was fetched and tests were run **locally** — not just CI-trusted
- [ ] All PR-relevant tests pass with zero failures
- [ ] CI matrix (3.10 / 3.11 / 3.12) is all green
- [ ] Lazy-import / cold-import invariants verified if optional deps added
- [ ] Diff reviewed against every AGENTS.md §4 principle
- [ ] `mergeStateStatus` in `CLEAN`/`UNSTABLE`, never `DIRTY`/`BLOCKED`
- [ ] No files outside the issue's scope were changed
- [ ] If feedback was given, `@claude` had a chance to respond and fixed everything
---
## Quick Reference — Common Mistakes
| Mistake | Fix |
|---------|-----|
| Merging without running tests locally | Always `git clone` the branch and run `pytest` |
| Resolving complex conflicts manually | Ask `@claude` to rebase instead |
| Trusting CI alone | CI jobs can be skipped / out-of-date; local validation is source of truth |
| Vague feedback to `@claude` | Every comment must cite file, line, test name, error, and AGENTS.md section |
| Waiting forever | Cap loops at 3 rounds, then escalate to a human |
| Running commands without `timeout` | Always `timeout 60 ...` per user global rule |
| Creating `.md` docs proactively | Don't — user rule forbids unrequested `.md` files |
| Skipping diff review | Every merge needs a full-diff AGENTS.md pass |
---
## Hard Rules
1. **Never merge without local test validation.**
2. **Never merge when `mergeStateStatus = DIRTY` or `BLOCKED`.**
3. **Every `@claude` comment must be actionable** — file, line, exact fix, AGENTS.md ref.
4. **Cap feedback loops at 3 rounds** — escalate after that, don't spin forever.
5. **Use `--squash --delete-branch`** to keep `main` linear and the repo clean.
6. **Always verify** the issue auto-closed after merge.
7. **All `run_command` calls use `timeout`** to avoid hangs (user global rule).
8. **No proactive `.md` creation** beyond this workflow file (user global rule).
-771
View File
@@ -1,771 +0,0 @@
---
description: Gap Implementation Prompts — Sequential agent tasks for PraisonAIUI feature gaps
---
# Gap Implementation Prompts
Execute these prompts **sequentially**, one at a time. Each prompt is self-contained with context, analysis steps, and implementation instructions. Complete one fully (analysis → implementation → verification) before starting the next.
Reference: gap_analysis.md in the project's brain directory for full context.
---
---
## PROMPT 1: Channel Management Tab (G1 — Phase 1, Critical)
You are an expert AI engineer. Your task: **Add a Channel Management dashboard tab to PraisonAIUI** that surfaces the existing bot channel infrastructure from the PraisonAI package.
### Context
PraisonAI package already has a full channel/bot system:
- **Bots directory**: `~/praisonai-package/src/praisonai/praisonai/bots/` (26 files)
- Discord bot: `discord.py`, `_discord_approval.py`
- Slack bot: `slack.py`, `_slack_approval.py`
- Telegram bot: `telegram.py`, `_telegram_approval.py`
- WhatsApp bot: `whatsapp.py`, `_whatsapp_web_adapter.py`
- Base infra: `bot.py`, `_session.py`, `_rate_limit.py`, `_resilience.py`, `_approval.py`, `_approval_base.py`, `_http_approval.py`, `_webhook_approval.py`, `media.py`, `_commands.py`, `_debounce.py`, `_ack.py`, `_chunk.py`, `_protocol_mixin.py`, `_config_schema.py`, `_registry.py`
- **Gateway**: `~/praisonai-package/src/praisonai/praisonai/gateway/server.py` (1102 lines, 41KB)
- `WebSocketGateway.health()` — returns per-channel bot health status
- `WebSocketGateway.start_channels(channels_cfg)` — starts bot instances from config
- `WebSocketGateway._create_bot(channel_type, token, agent, config, ch_cfg)` — creates bot per channel
- `WebSocketGateway._run_bot_safe(name, bot)` — runs with error isolation
- `WebSocketGateway._inject_routing_handler(channel_name, bot)` — routing-aware handlers
PraisonAIUI server: `~/PraisonAIUI/src/praisonaiui/server.py` — Starlette app with SSE streaming, existing dashboard tabs via `/api/*` endpoints and `@page()` decorator.
PraisonAIUI frontend dashboard: `~/PraisonAIUI/src/praisonaiui/templates/frontend/plugins/` — JavaScript plugins for dashboard tabs (e.g., `topnav.js` for tab rendering).
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Inventory the bot system**: Read every file in `~/praisonai-package/src/praisonai/praisonai/bots/`. Understand:
- How each bot is initialized (constructor params, tokens, agent binding)
- What status/health information each bot exposes
- How `_resilience.py` tracks bot health
- How `_config_schema.py` defines channel configuration
- How `_registry.py` registers available channels
2. **Inventory the gateway**: Read `~/praisonai-package/src/praisonai/praisonai/gateway/server.py`. Understand:
- `WebSocketGateway.health()` — what data it returns about channels
- `start_channels()` — how channels are started from YAML config
- `_create_bot()` — bot factory pattern
- Channel routing: `_determine_routing_context()`, `_resolve_agent_for_message()`
3. **Inventory PraisonAIUI dashboard**: Read `~/PraisonAIUI/src/praisonaiui/server.py`. Understand:
- How existing `/api/*` endpoints work (pattern for adding new ones)
- How `@page()` decorator registers dashboard pages
- How `_registered_pages` dict works
- How dashboard tabs are rendered in the frontend
4. **Inventory the frontend**: Read `~/PraisonAIUI/src/praisonaiui/templates/frontend/plugins/topnav.js` and other dashboard plugins. Understand:
- How tabs are dynamically rendered
- How tab data is fetched from `/api/*` endpoints
- The pattern for adding a new dashboard tab
5. **Gap Analysis**: Document exactly what's missing:
- Backend: API endpoint to query channel status
- Frontend: Dashboard tab component for channels
- Integration: How PraisonAIUI will communicate with the gateway for channel health
6. **Plan**: Produce a step-by-step implementation plan listing exact files to create/modify.
### PHASE 2 — Implementation (MUST)
1. **Backend — Add `/api/channels` endpoint** in `~/PraisonAIUI/src/praisonaiui/server.py`:
- `GET /api/channels` — Returns list of configured channels with status (name, type, health, connected, last_active)
- `POST /api/channels/{name}/restart` — Restart a specific channel bot
- The endpoint should integrate with the gateway's `health()` method or maintain its own channel registry
- Follow the exact pattern of existing `/api/overview`, `/api/config` endpoints
2. **Frontend — Add Channels dashboard page**:
- Create a new dashboard plugin or add to existing dashboard rendering
- Show a card/table for each channel: icon, name, status (online/offline/error), message count, last activity
- Add status indicators (green/yellow/red dots)
- Add restart button per channel
- Follow the existing dashboard tab rendering pattern from `topnav.js`
3. **Register the tab**: Ensure the Channels tab appears in the dashboard navigation alongside existing tabs (Agents, Config, Logs)
### PHASE 3 — Verification (MUST)
1. Run the PraisonAIUI dev server and verify the Channels tab appears
2. Verify `/api/channels` returns correct data
3. Verify the UI renders channel cards with accurate status
4. Test with at least one bot configured and verify status updates
5. Verify no regressions in existing dashboard tabs
6. Document what was implemented and what remains
---
---
## PROMPT 2: Scheduler/Cron Tab (G2 — Phase 1, Critical)
You are an expert AI engineer. Your task: **Add a Scheduler dashboard tab to PraisonAIUI** that surfaces the existing AgentScheduler from the PraisonAI package.
### Context
PraisonAI package has a complete scheduler system:
- **Scheduler directory**: `~/praisonai-package/src/praisonai/praisonai/scheduler/` (7 files)
- `agent_scheduler.py` (21KB) — `AgentScheduler` class:
- `__init__(agent, task, config, on_success, on_failure, timeout, max_cost)`
- `start(schedule_expr, max_retries, run_immediately)` — schedule expressions: `"hourly"`, `"daily"`, `"*/6h"`, `"3600"` (seconds)
- `stop()` — graceful shutdown
- `get_stats()` — execution stats including cost
- `execute_once()` — one-time run
- `from_yaml(yaml_path, ...)` — create from agents.yaml
- `from_recipe(recipe_name, ...)` — create from recipe
- `start_from_yaml_config()` — start using YAML schedule config
- `daemon_manager.py` (7KB) — background process lifecycle
- `state_manager.py` (4KB) — persistent execution state
- `base.py` (4KB) — `ScheduleParser`, `PraisonAgentExecutor` base classes
- `yaml_loader.py` (6KB) — YAML schedule config loading
- **Top-level**: `~/praisonai-package/src/praisonai/praisonai/agent_scheduler.py` (11KB) — convenience wrapper
PraisonAIUI: `~/PraisonAIUI/src/praisonaiui/server.py` — Starlette app. Existing pattern: API endpoints return JSON, dashboard renders tabs.
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read the full scheduler system**: Go through every file in `~/praisonai-package/src/praisonai/praisonai/scheduler/`:
- `agent_scheduler.py` — understand the full `AgentScheduler` lifecycle (init → start → _run_schedule → _execute_with_retry → stop)
- `base.py` — understand `ScheduleParser.parse()` for schedule expression formats
- `daemon_manager.py` — understand how daemon processes are managed (start/stop/status)
- `state_manager.py` — understand how execution state is persisted (where, format)
- `yaml_loader.py` — understand YAML config format for schedules
2. **Understand the data model**: What data does a scheduled agent have?
- Schedule expression, agent identity, task description, max retries, timeout, max cost
- Execution stats: total_runs, successful_runs, failed_runs, total_cost, last_run, next_run
3. **Inventory PraisonAIUI**: Read `server.py` to understand the pattern for adding CRUD API endpoints.
4. **Gap Analysis**: Document exactly what's needed:
- API: CRUD endpoints for schedules (list, create, update, delete, run-now, get-stats)
- Storage: Where to persist schedule definitions (YAML file? database? in-memory?)
- Frontend: Scheduler tab with schedule list, create/edit form, run history
5. **Plan**: Step-by-step with exact files to create/modify.
### PHASE 2 — Implementation (MUST)
1. **Backend — Add Scheduler API endpoints** in `~/PraisonAIUI/src/praisonaiui/server.py`:
- `GET /api/schedules` — List all scheduled agents with status and stats
- `POST /api/schedules` — Create a new schedule (agent, task, schedule_expr, max_retries, timeout, max_cost)
- `PUT /api/schedules/{id}` — Update schedule configuration
- `DELETE /api/schedules/{id}` — Remove a schedule
- `POST /api/schedules/{id}/run` — Trigger immediate execution
- `POST /api/schedules/{id}/stop` — Stop a running schedule
- `GET /api/schedules/{id}/stats` — Get execution statistics
- Integrate with `AgentScheduler` class from praisonai-package, importing it appropriately
2. **Backend — Schedule persistence**:
- Store schedule definitions in a YAML/JSON file alongside the existing config
- Load schedules on server startup and start them automatically
- Track run history in-memory with periodic flush
3. **Frontend — Add Scheduler dashboard page**:
- Schedule list: table/cards showing each schedule (name, expression, status, last run, next run, cost)
- Create/Edit form: agent selector, task input, schedule expression picker (presets: hourly/daily/weekly + custom cron), retry/timeout/cost settings
- Run history: expandable section per schedule showing past executions with results
- Action buttons: Start, Stop, Run Now, Edit, Delete
- Status indicators: Running (green pulse), Stopped (gray), Failed (red)
4. **Register the tab**: Add Scheduler tab to dashboard navigation.
### PHASE 3 — Verification (MUST)
1. Create a test schedule with a simple agent task and verify it appears in the UI
2. Test start/stop/run-now actions
3. Verify execution stats update after runs
4. Verify schedules persist across server restarts
5. Verify no regressions in existing functionality
6. Document what was implemented
---
---
## PROMPT 3: Jobs Management Tab (G3 — Phase 1, Critical)
You are an expert AI engineer. Your task: **Add a Jobs Management dashboard tab to PraisonAIUI** that surfaces the existing async Jobs API from the PraisonAI package.
### Context
PraisonAI package has a complete async jobs system:
- **Jobs directory**: `~/praisonai-package/src/praisonai/praisonai/jobs/` (6 files)
- `executor.py` (14KB) — `JobExecutor` class:
- `__init__(store, max_concurrent, default_timeout, cleanup_interval)`
- `submit(job)` — submit job for execution
- `cancel(job_id)` — cancel running job
- `start()` / `stop()` — executor lifecycle
- `register_progress_callback(job_id, callback)` — real-time progress
- `_run_agent(job)` / `_run_recipe(job)` / `_run_praisonai_agents(job)` — multiple execution modes
- `_send_webhook(job)` — webhook notifications on completion
- `get_stats()` — executor statistics
- `router.py` (11KB) — FastAPI router (`create_router(store, executor)`):
- `POST /jobs` → `submit_job` (returns 202 + Location header + Retry-After)
- `GET /jobs` → `list_jobs` (filter by status, session_id, pagination)
- `GET /jobs/{id}/status` → `get_job_status`
- `GET /jobs/{id}/result` → `get_job_result` (409 if not complete)
- `DELETE /jobs/{id}/cancel` → `cancel_job` (409 if already complete)
- `DELETE /jobs/{id}` → `delete_job` (only completed)
- `GET /jobs/{id}/stream` → `stream_job` (SSE: status/progress/result/error events)
- Supports idempotency via `Idempotency-Key` header
- `models.py` (10KB) — `Job`, `JobStatus`, `JobSubmitRequest`, `JobSubmitResponse`, `JobStatusResponse`, `JobResultResponse`, `JobListResponse`
- `store.py` (7KB) — `JobStore` — in-memory + persistent storage
- `server.py` (5KB) — standalone server mounting the router
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read the full jobs system**: Go through every file in `~/praisonai-package/src/praisonai/praisonai/jobs/`:
- `models.py` — understand all DTOs and status enum
- `store.py` — understand storage backend (how jobs are persisted, queried)
- `executor.py` — understand execution lifecycle (submit → execute → complete/fail)
- `router.py` — understand all HTTP endpoints and their contracts
- `server.py` — understand how the standalone server mounts the router
2. **Determine integration approach**: The jobs router is a FastAPI router. PraisonAIUI uses Starlette. Determine:
- Can the jobs router be mounted directly in PraisonAIUI's Starlette app?
- Or do we need to adapt the endpoints?
- How to share the `JobStore` and `JobExecutor` instances with the main app
3. **Gap Analysis**: Document what's needed:
- Backend: Mount or adapt the jobs router into PraisonAIUI
- Frontend: Jobs dashboard showing job list, status, progress, results with real-time SSE updates
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Mount Jobs API** in PraisonAIUI:
- Initialize `JobStore` and `JobExecutor` in `create_app()`
- Mount the jobs router at `/api/jobs/*` or adapt endpoints to Starlette
- Ensure the executor starts when the app starts and stops when it stops
2. **Frontend — Add Jobs dashboard page**:
- Jobs list: table with columns (ID, agent, status, progress %, submitted, duration, cost)
- Status badges: Pending (gray), Running (blue pulse), Completed (green), Failed (red), Cancelled (yellow)
- Real-time progress: Use SSE from `/jobs/{id}/stream` to update progress bars
- Job detail view: expandable row showing full result, error message, webhook status
- Actions: Submit new job (form), Cancel running job, Delete completed job
- Filters: by status, date range, agent
3. **Register the tab**: Add Jobs tab to dashboard navigation.
### PHASE 3 — Verification (MUST)
1. Submit a test job via the UI and verify it appears in the list
2. Verify real-time progress updates via SSE
3. Test cancel and delete actions
4. Verify job results are displayed correctly after completion
5. Verify no regressions
6. Document what was implemented
---
---
## PROMPT 4: Usage Analytics Upgrade (G6 — Phase 1, Critical)
You are an expert AI engineer. Your task: **Upgrade PraisonAIUI's usage analytics** from basic token counters to per-model cost tracking with time-series charts.
### Context
Current state in PraisonAIUI (`~/PraisonAIUI/src/praisonaiui/server.py`):
- `_usage_stats` — simple in-memory dict tracking basic token counts
- `GET /api/usage` — returns this dict as JSON
- No cost calculation, no per-model breakdown, no time-series data, no charts
OpenClaw comparison: ~80KB of usage view code with per-model costs, per-session breakdown, time-series charts, export functionality.
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read PraisonAIUI usage tracking**: Read `server.py` and search for `_usage_stats`, understand:
- Where/when usage is tracked (during `run_agent`, on SSE events)
- What data is currently captured (input_tokens, output_tokens, total_tokens)
- How the data flows from agent execution to the stats dict
2. **Research model pricing**: Understand common LLM pricing models:
- OpenAI: per-1K tokens, different rates for input vs output, varies by model
- Anthropic: per-1K tokens, input vs output
- Google: per-1K tokens
- Design a cost table data structure
3. **Design time-series storage**: Plan how to store usage data over time:
- In-memory ring buffer with periodic flush to disk? SQLite? JSON file?
- Granularity: per-request? per-minute? per-hour?
- Retention: how much history to keep?
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Enhanced usage tracking**:
- Create a `UsageTracker` class (or enhance the existing tracking in `server.py`):
- Track per-request: model, input_tokens, output_tokens, cost, timestamp, session_id, agent_name
- Maintain aggregations: by model, by session, by agent, by time period
- Cost calculation: configurable cost table (price per 1K input/output tokens per model)
- Update `/api/usage` to return rich data:
- `GET /api/usage` — summary (total cost, total tokens, by model, by period)
- `GET /api/usage/details` — detailed time-series data for charts
- `GET /api/usage/models` — per-model breakdown
- `GET /api/usage/sessions` — per-session breakdown
2. **Backend — Cost table**:
- Default cost table with common LLM model pricing
- Configurable via YAML config (`cost_per_model` section)
- Auto-detect model from provider responses
3. **Frontend — Usage analytics dashboard**:
- Summary cards: Total cost ($), Total tokens, Requests count, Avg cost per request
- Chart: Token/cost usage over time (line chart, selectable time range: 1h/24h/7d/30d)
- Model breakdown: Bar chart or table showing cost per model
- Session breakdown: Table showing per-session usage
- Use a lightweight charting library (e.g., Chart.js via CDN, or SVG-based inline charts)
4. **Persistence**: Save usage data to a JSON/SQLite file so it survives server restarts.
### PHASE 3 — Verification (MUST)
1. Run an agent chat and verify usage data is captured with model and cost
2. Verify `/api/usage` returns enriched data
3. Verify charts render correctly in the dashboard
4. Verify data persists across server restarts
5. Verify no performance impact on chat response times
6. Document what was implemented
---
---
## PROMPT 5: Skills/Tools Management Tab (G4 — Phase 2, High)
You are an expert AI engineer. Your task: **Add a Skills/Tools Management dashboard tab to PraisonAIUI** that surfaces available tools and allows enable/disable/configuration.
### Context
PraisonAI package has tool infrastructure:
- **Capabilities**: `~/praisonai-package/src/praisonai/praisonai/capabilities/` (27 files)
- `skills.py` (3KB) — skills endpoint
- `completions.py`, `responses.py`, `assistants.py`, `files.py`, `images.py`, `audio.py`, `embeddings.py`, `fine_tuning.py`, `batches.py`, `guardrails.py`, `moderations.py`, `ocr.py`, `rag.py`, `realtime.py`, `rerank.py`, `search.py`, `videos.py`, `mcp.py`, `a2a.py`, `messages.py`, `vector_stores.py`, `container_files.py`, `containers.py`, `passthrough.py`
- **Tool resolver**: `~/praisonai-package/src/praisonai/praisonai/tool_resolver.py` (14KB) — dynamic tool resolution by name
- **Tools directory**: `~/praisonai-package/src/praisonai/praisonai/tools/` — audio.py, glob_tool.py, grep_tool.py, multiedit.py
- **Inbuilt tools**: `~/praisonai-package/src/praisonai/praisonai/inbuilt_tools/` — autogen_tools.py
- **Skills examples**: `~/praisonai-package/examples/skills/` — basic_skill_usage.py, create_skill_example.py, custom_skill_example.py
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read the tool/skills system**:
- `capabilities/skills.py` — understand the skills endpoint interface
- `tool_resolver.py` — understand how tools are discovered, resolved, loaded
- `tools/` directory — understand the built-in tool pattern
- `capabilities/__init__.py` — understand how capabilities are registered and discovered
- Skills examples — understand the user-facing skill creation pattern
2. **Understand capability registration**: How does PraisonAI know which capabilities are available?
- Are they auto-discovered? Explicitly registered? Config-driven?
- Can individual capabilities be enabled/disabled?
3. **Gap Analysis**: Document what's needed:
- API: Endpoint to list tools, get tool details, enable/disable, set API keys
- Frontend: Skills tab with tool catalog, status toggles, API key configuration
- Integration: How to wire capability enable/disable to the provider system
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Skills API** in PraisonAIUI:
- `GET /api/skills` — List all available tools/skills with status (name, type, enabled, description, required_keys)
- `PUT /api/skills/{name}` — Enable/disable a skill
- `PUT /api/skills/{name}/config` — Set API keys or configuration for a skill
- `GET /api/skills/{name}` — Get detailed info about a specific skill
2. **Frontend — Skills dashboard page**:
- Tool catalog: Grid/list of available tools with icons, names, descriptions
- Status toggles: Enable/disable switch per tool
- Configuration: Expandable config section per tool for API keys and settings
- Categories: Group by type (built-in, capabilities, custom)
- Search/filter: Find tools by name or category
3. **Register the tab**: Add Skills tab to dashboard navigation.
### PHASE 3 — Verification (MUST)
1. Verify the skills list loads with correct tool inventory
2. Test enable/disable toggle and verify it affects agent tool availability
3. Test API key configuration
4. Verify no regressions
5. Document what was implemented
---
---
## PROMPT 6: Agent CRUD from Dashboard (G7 — Phase 2, High)
You are an expert AI engineer. Your task: **Add full Agent CRUD (Create, Update, Delete) to the PraisonAIUI dashboard**, extending beyond the current read-only agent listing.
### Context
Current state:
- PraisonAIUI `server.py`: `GET /agents` returns a list of registered agents (read-only)
- PraisonAI gateway: `WebSocketGateway.register_agent(agent, agent_id)` and `unregister_agent(agent_id)` exist
- Agents are currently registered programmatically via Python code, not from the UI
OpenClaw comparison: Full agent CRUD with file editing (system prompt, instructions), tool profile overrides (allow/deny lists), identity management (name, avatar).
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read the agent system end-to-end**:
- `~/PraisonAIUI/src/praisonaiui/server.py` — how agents are registered, listed, used during `run_agent`
- `~/praisonai-package/src/praisonai/praisonai/gateway/server.py` — `register_agent()`, `unregister_agent()`, `get_agent()`, `list_agents()`, `_create_agents_from_config()`
- Understand the Agent class from praisonaiagents: what properties can be configured?
2. **Understand agent configuration format**:
- How are agents defined in YAML? What fields?
- System prompt, instructions, tool lists, model selection, temperature, etc.
- How are agents loaded from config at startup?
3. **Design the CRUD model**: What data does agent create/update need?
- Name, description, system prompt, instructions, model, temperature
- Tool allow/deny lists
- Avatar/icon
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Agent CRUD endpoints** in PraisonAIUI:
- `GET /agents` — (existing) List agents with full details
- `POST /agents` — Create a new agent (name, description, system_prompt, instructions, model, tools, config)
- `PUT /agents/{id}` — Update agent configuration
- `DELETE /agents/{id}` — Remove an agent
- `GET /agents/{id}` — Get detailed agent info including system prompt and tools
- Persist agent definitions to a YAML/JSON file
2. **Frontend — Agent editor**:
- Agent list with Create New button
- Agent editor form: name, description, model selector, temperature slider
- System prompt editor: multi-line text area with syntax highlighting
- Instructions editor: multi-line text area
- Tool configuration: checkbox list of available tools
- Save/Cancel/Delete buttons
- Inline validation
3. **Integration**: New/updated agents should be live-registerable without server restart.
### PHASE 3 — Verification (MUST)
1. Create a new agent from the dashboard and verify it appears in the list
2. Edit an agent's system prompt and verify the change takes effect in chat
3. Delete an agent and verify it's removed
4. Verify agents persist across server restarts
5. Document what was implemented
---
---
## PROMPT 7: Exec Approval Dashboard (G5 — Phase 2, High)
You are an expert AI engineer. Your task: **Add an Execution Approval dashboard to PraisonAIUI** that surfaces the existing approval system from the PraisonAI package bots.
### Context
PraisonAI package has a comprehensive approval system:
- **Approval infrastructure** in `~/praisonai-package/src/praisonai/praisonai/bots/`:
- `_approval.py` — Core approval logic
- `_approval_base.py` — Base class for approval backends
- `_discord_approval.py` — Discord-specific approval flow
- `_slack_approval.py` — Slack-specific approval flow
- `_telegram_approval.py` — Telegram-specific approval flow
- `_http_approval.py` — HTTP webhook-based approvals
- `_webhook_approval.py` — Webhook notification for approvals
The approval system allows agents to request human approval before executing certain actions (tool calls, external API calls, destructive operations).
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read the full approval system**:
- `_approval_base.py` — understand the base protocol/interface for approvals
- `_approval.py` — understand the core approval lifecycle (request → pending → approve/deny)
- `_http_approval.py` — understand the HTTP-based approval mechanism (this is most relevant for UI integration)
- Each channel-specific approval file — understand how they present approval requests
2. **Understand the approval data model**:
- What information is in an approval request? (agent, tool, arguments, risk level, timestamp)
- What are the possible actions? (approve, deny, approve-always, deny-always)
- How are policies stored? (auto-approve lists, always-deny lists)
3. **Determine integration approach**:
- Can `_http_approval.py` be extended to serve as the UI backend?
- Or do we need a separate approval queue accessible from PraisonAIUI?
- Real-time: WebSocket for instant approval notifications?
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Approval API** in PraisonAIUI:
- `GET /api/approvals` — List pending approval requests
- `POST /api/approvals/{id}/approve` — Approve a request
- `POST /api/approvals/{id}/deny` — Deny a request
- `GET /api/approvals/policies` — List approval policies (auto-approve, always-deny)
- `PUT /api/approvals/policies` — Update policies
- `GET /api/approvals/history` — Past approval decisions
- WebSocket or SSE endpoint for real-time approval notifications
2. **Frontend — Approval dashboard page**:
- Pending queue: Cards showing each pending request with agent name, action, arguments, risk level, timestamp
- Approve/Deny buttons with optional "always" checkbox
- Policy editor: Configure auto-approve/deny rules per tool, per agent
- History: Table of past approvals with decision, timestamp, details
- Real-time: New approvals appear instantly via WebSocket/SSE
- Notification badge on the tab showing pending count
3. **Register the tab**: Add Approvals tab to dashboard navigation with badge.
### PHASE 3 — Verification (MUST)
1. Configure an agent with an approval-required tool
2. Trigger the tool and verify an approval request appears in the dashboard
3. Approve it and verify the agent continues execution
4. Deny a request and verify the agent handles it gracefully
5. Test auto-approve policy and verify it works
6. Document what was implemented
---
---
## PROMPT 8: OpenAI-Compatible API Routes (G — Phase 2, High)
You are an expert AI engineer. Your task: **Mount PraisonAI's 27 OpenAI-compatible capability endpoints in PraisonAIUI** so they are accessible via `/v1/*` routes.
### Context
PraisonAI package has 27 OpenAI-compatible capability endpoints:
- **Directory**: `~/praisonai-package/src/praisonai/praisonai/capabilities/` (27 files)
- Key endpoints: `completions.py`, `responses.py`, `assistants.py`, `files.py`, `images.py`, `audio.py`, `embeddings.py`, `fine_tuning.py`, `batches.py`, `guardrails.py`, `moderations.py`, `ocr.py`, `rag.py`, `realtime.py`, `rerank.py`, `search.py`, `skills.py`, `videos.py`, `mcp.py`, `a2a.py`, `messages.py`, `vector_stores.py`, `container_files.py`, `containers.py`, `passthrough.py`
- `__init__.py` (9KB) — likely contains registration/routing logic
PraisonAIUI uses Starlette. The capabilities likely use FastAPI routers.
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read `capabilities/__init__.py`**: Understand how capabilities are registered, what router/app they expose
2. **Read `completions.py`**: Understand the endpoint pattern (request/response format, OpenAI compatibility)
3. **Read `responses.py`**: Understand the responses API endpoint
4. **Understand the mount pattern**: How to integrate FastAPI routers into Starlette apps
5. **Plan**: Determine which capabilities to mount, routing prefix (`/v1/`), authentication, and configuration
### PHASE 2 — Implementation (MUST)
1. **Mount capabilities in PraisonAIUI**:
- Import the capabilities router/app from praisonai-package
- Mount at `/v1/` prefix in PraisonAIUI's Starlette app (in `create_app()`)
- Ensure proper CORS, authentication, and error handling
- Key routes: `/v1/chat/completions`, `/v1/responses`, `/v1/embeddings`, `/v1/images/generations`, etc.
2. **Configuration**: Add capability enable/disable flags in PraisonAIUI config YAML
3. **Documentation**: Add API docs endpoint or link to capability documentation
### PHASE 3 — Verification (MUST)
1. Test `/v1/chat/completions` with a standard OpenAI SDK client
2. Test `/v1/responses` endpoint
3. Verify compatibility with OpenAI Python SDK
4. Verify no regressions in existing PraisonAIUI functionality
5. Document the available endpoints
---
---
## PROMPT 9: Real-Time Log Streaming (G9 — Phase 3, Polish)
You are an expert AI engineer. Your task: **Upgrade PraisonAIUI's log viewer from polling to real-time WebSocket streaming**.
### Context
Current state in PraisonAIUI (`~/PraisonAIUI/src/praisonaiui/server.py`):
- `_log_buffer` — in-memory deque (500 entries max)
- `GET /api/logs` — returns the entire buffer as JSON (polling-based)
- Frontend polls this endpoint periodically
Goal: Real-time log tailing via WebSocket, with level filtering and search.
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read current logging implementation**: Search `server.py` for `_log_buffer`, understand how logs are captured and stored
2. **Understand Python logging integration**: How are Python logger messages routed to `_log_buffer`?
3. **Design WebSocket approach**: Plan the WebSocket endpoint, message format, filtering protocol
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — WebSocket log endpoint**:
- `WS /api/logs/stream` — WebSocket endpoint that streams log entries in real-time
- Support filter parameters: `level` (DEBUG/INFO/WARNING/ERROR), `search` (text match)
- Keep the existing `GET /api/logs` for backward compatibility
- Use Python logging handler that broadcasts to connected WebSocket clients
2. **Frontend — Enhanced log viewer**:
- Real-time log display with auto-scroll
- Level filter buttons (DEBUG, INFO, WARNING, ERROR) with color coding
- Search box for text filtering
- Pause/resume button to stop auto-scroll
- Clear button
- Timestamp formatting
- Log level color coding (gray=DEBUG, blue=INFO, yellow=WARNING, red=ERROR)
### PHASE 3 — Verification (MUST)
1. Connect to the WebSocket and verify real-time log streaming
2. Test level filtering
3. Test search filtering
4. Verify auto-scroll and pause/resume
5. Verify backward compatibility of `GET /api/logs`
6. Document what was implemented
---
---
## PROMPT 10: Config Form Editor (G8 — Phase 3, Polish)
You are an expert AI engineer. Your task: **Upgrade PraisonAIUI's config editor from raw YAML to a schema-driven form editor**.
### Context
Current state:
- PraisonAIUI `server.py`: `GET /api/config` returns raw YAML, `POST /api/config` writes raw YAML
- PraisonAI package: `bots/_config_schema.py` — configuration schema definition
- No form rendering, no validation, no guided editing
OpenClaw comparison: Full schema-validated form rendering with live apply.
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read current config handling**: `server.py` → `api_config_handler`, `load_config_from_yaml`
2. **Read `_config_schema.py`**: Understand the config schema format (JSON Schema? Custom?)
3. **Understand the config structure**: What sections exist? (provider, model, channels, agents, scheduler, etc.)
4. **Design form rendering**: Plan how to render schema-driven forms in the frontend
5. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Config schema endpoint**:
- `GET /api/config/schema` — Return the config schema (JSON Schema format)
- `POST /api/config/validate` — Validate config changes before applying
- `POST /api/config/apply` — Apply config changes with validation and live reload
2. **Frontend — Form editor**:
- Tab within the Config page: "Form View" vs "YAML View" toggle
- Auto-generated form from JSON Schema:
- Text inputs for strings, number inputs for numbers
- Toggle switches for booleans
- Dropdowns for enums (model selection, provider selection)
- Nested sections with collapsible panels
- Validation: Real-time validation with error messages
- Save button with confirmation
- Reset to defaults button
- Keep raw YAML editor as alternative view
### PHASE 3 — Verification (MUST)
1. Verify the form renders all config sections correctly
2. Test editing a config value via form and verify it's saved
3. Test validation with invalid values
4. Verify toggle between form and YAML views
5. Verify config changes take effect without restart (where possible)
6. Document what was implemented
---
---
## PROMPT 11: Session Advanced Operations (G10 — Phase 3, Polish)
You are an expert AI engineer. Your task: **Add advanced session operations to PraisonAIUI**: reset context, compact memory, and session preview.
### Context
Current state in PraisonAIUI (`server.py`):
- `GET /sessions` — List sessions
- `GET /sessions/{id}` — Get session detail
- `GET /sessions/{id}/runs` — Get message history
- `DELETE /sessions/{id}` — Delete session
- `PATCH /sessions/{id}` — Rename/tag session
- `POST /sessions` — Create session
Missing (present in OpenClaw): Reset context (clear memory but keep session), Compact memory (summarize old messages to reduce context), Preview (rich preview of session content).
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read current session system** in `server.py`: Understand how sessions store messages, how context is managed
2. **Read session system in praisonai-package**: `bots/_session.py` — understand session state management
3. **Design**: Plan reset (clear messages, keep metadata), compact (LLM-summarize old messages), preview (formatted message display)
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Advanced session endpoints**:
- `POST /sessions/{id}/reset` — Clear all messages but keep session metadata
- `POST /sessions/{id}/compact` — Summarize old messages using the LLM, replace them with a summary message
- `GET /sessions/{id}/preview` — Return formatted preview (first/last messages, total count, token estimate)
2. **Frontend — Enhanced session management**:
- Add action buttons to session list: Reset, Compact, Preview
- Reset confirmation dialog
- Compact: Show before/after message count and token savings
- Preview: Modal showing session summary without loading full history
### PHASE 3 — Verification (MUST)
1. Test reset: verify messages are cleared, session metadata preserved
2. Test compact: verify old messages are replaced with a summary
3. Test preview: verify formatted preview is returned
4. Verify no regressions in existing session operations
5. Document what was implemented
---
---
## PROMPT 12: Auth Enhancements (G11 — Phase 3, Polish)
You are an expert AI engineer. Your task: **Enhance PraisonAIUI's authentication** from a single `require_auth` flag to multi-mode auth support.
### Context
Current state in PraisonAIUI (`server.py`):
- `require_auth: bool` parameter in `create_app()` — single flag
- No token management, no API key support, no user-level access control
OpenClaw comparison: Token + password + trusted-proxy + device auth modes.
PraisonAI package security: `~/praisonai-package/src/praisonai/praisonai/security/` — security module (read this first).
### PHASE 1 — Analysis (MUST complete before implementing)
1. **Read current auth**: `server.py` → understand how `require_auth` is implemented
2. **Read praisonai-package security**: `~/praisonai-package/src/praisonai/praisonai/security/` — understand what security infrastructure exists
3. **Design multi-mode auth**:
- API key auth (for programmatic access)
- Token/session auth (for dashboard users)
- Optional password auth (for initial setup)
4. **Plan**: Step-by-step with exact files.
### PHASE 2 — Implementation (MUST)
1. **Backend — Auth middleware**:
- API key authentication: `X-API-Key` header or `?api_key=` query param
- Session token authentication: JWT or session cookie for dashboard
- Configurable auth mode in YAML config
- Auth middleware in Starlette that checks configured mode
2. **Frontend — Auth UI**:
- Login page (if password auth enabled)
- API key display/rotation in settings
- Session management (logout, token refresh)
3. **Configuration**: Auth section in YAML config with mode selection and credentials
### PHASE 3 — Verification (MUST)
1. Test API key auth with curl
2. Test session auth via dashboard login
3. Verify unauthenticated requests are rejected
4. Verify auth can be disabled for development
5. Document auth configuration options
-81
View File
@@ -1,81 +0,0 @@
---
description: PraisonAIUI product categories and differentiation
---
# UI Product Categories
PraisonAIUI supports three distinct styles, each serving a different use case:
## 1. Chat (`style: chat`)
- Full-screen conversational interface (like ChatGPT)
- Sidebar with session/conversation history
- Streaming responses, thinking indicators, tool calls
- Best for: single-agent chat, customer support, Q&A bots
## 2. Playground (`style: playground`)
- Input/output panel layout
- Agent selection, model switching, endpoint configuration
- Session management with agent profiles
- Best for: multi-agent experimentation, developer testing, agent debugging
## 3. UI Components (Widget mode)
- Embeddable components (copilot widget, sidebar panel, floating button)
- Integrates into existing apps/docs sites
- Configurable position: bottom-right, bottom-left, top-right, top-left
- Best for: adding AI to existing products, documentation copilots
## Key Differentiators
- **Chat** = conversation-first, full-page, session history
- **Playground** = multi-agent, experimentation, side-by-side panels
- **Components** = embeddable widgets for existing apps
When using AI, we mainly and primarily use PraisonAI as the backend ~/praisonai-package
When using Platform, we mainly and primarily use PraisonAI (Gateway) as the backend ~/praisonai-package
We will also support other providers, but PraisonAI will be the primary.
PraisonAI already has memory, knowledge, session management, and more. So where possible we will use PraisonAI's features.
## PraisonAI Backend Capabilities (~/praisonai-package)
The backend (`praisonaiagents`) already provides these features. The UI's job is to surface them:
- **Gateway**: EventType enum (20 types), GatewayEvent, GatewayMessage, GatewaySessionProtocol, GatewayClientProtocol
- **Streaming**: StreamEventType (REQUEST_START, FIRST_TOKEN, DELTA_TEXT, DELTA_TOOL_CALL, TOOL_CALL_END, STREAM_END, ERROR), StreamEvent, StreamMetrics, StreamEventEmitter
- **Memory**: Short-term, long-term, user-specific, auto-memory, file memory, rules, workflows (76KB+ implementation)
- **Knowledge**: RAG, vector store, chunking, query engine, rerankers, readers (41KB+ knowledge.py)
- **Sessions**: Full Session API with state persistence, agent chat history, memory/knowledge integration
- **Hooks**: Registry, middleware, runner, events, types (65KB+ system)
- **Approval**: Full human-in-the-loop approval with backends, registry, protocols
- **Bots/Channels**: Telegram (via gateway.yaml channel routing), extensible to Slack/Discord/WhatsApp etc. (Via Gateway)
- **Other**: MCP, guardrails, planning, sandbox, plugins, tools, thinking, escalation, checkpoints
## Goal of PraisonAIUI
One of the primary goals is: **make the web UI enable and surface these existing PraisonAI backend features**.
Except for the web UI itself, PraisonAI supports everything. This project fills that gap.
## Provider Protocol Architecture (Extensibility)
PraisonAIUI is **provider-agnostic**. The architecture uses a protocol-driven design so any AI backend can be swapped in:
- **`BaseProvider`** (`src/praisonaiui/provider.py`): Abstract base class any backend implements. Only `run()` is required — yields `RunEvent` objects.
- **`RunEvent`**: Structured dataclass with `type` (27 `RunEventType` values), optional fields for content, tool calls, reasoning, errors, agent info, and arbitrary `extra_data`.
- **`PraisonAIProvider`** (`src/praisonaiui/providers/__init__.py`): Default implementation wrapping the `@aiui.reply` callback system. Maps legacy queue events to `RunEvent`.
### Swapping Providers
```python
import praisonaiui
# Use any custom provider:
praisonaiui.set_provider(MyLangChainProvider())
# or
praisonaiui.set_provider(MyCrewAIProvider())
```
### Design Principles
- **Protocol-first**: All communication between UI and backend goes through `RunEvent` protocol — no tight coupling
- **PraisonAI primary, others welcome**: PraisonAI is the default, but the architecture doesn't lock you in
- **Frontend already ready**: The frontend `useSSE.ts` hook and components (`ToolCallDisplay`, `ThinkingSteps`, `MultimediaElements`) already handle all 27 `RunEventType` values — swapping the backend requires no frontend changes
Aim is by default it need to be protocol driven, so we can easily extend, or replace any providers or function accordingly. At the same time it also need to be capable of handling clients, and the clients will be of config driven, same like chainlit or yaml config and it should work.
-839
View File
@@ -1,839 +0,0 @@
---
description: Update install.sh and deploy PraisonAI to Kubernetes via Helm (CI/CD Pipeline)
---
# Install.sh Update & Helm Deployment Workflow
Complete guide for updating the PraisonAI install script and deploying to Kubernetes via the full CI/CD pipeline.
**⚠️ CRITICAL**: This workflow contains **NO SECRETS**. All sensitive values (tokens, passwords) must be passed via environment variables or external secret management.
## 📁 Key Locations (MUST KNOW)
### Scripts
| File/Resource | Absolute Path | Purpose |
|---------------|---------------|----------|
| **install.sh** | `/Users/praison/praisonai-package/src/praisonai/scripts/install.sh` | Main bash installer |
| **install.ps1** | `/Users/praison/praisonai-package/src/praisonai/scripts/install.ps1` | PowerShell installer |
### CI/CD Pipeline (GitHub → ACR → Helm → K8s)
| File/Resource | Absolute Path | Purpose |
|---------------|---------------|----------|
| **GitHub Workflow** | `/Users/praison/Sites/localhost/praisonai/.github/workflows/azure-pipeline.yaml` | CI/CD pipeline triggered on git push |
| **Dockerfile.php** | `/Users/praison/Sites/localhost/praisonai/Dockerfile.php` | PHP container build |
| **Dockerfile.nginx** | `/Users/praison/Sites/localhost/praisonai/Dockerfile.nginx` | Nginx container build |
| **Dockerfile.init** | `/Users/praison/Sites/localhost/praisonai/Dockerfile.init` | Init container build |
### Helm Deployment
| File/Resource | Absolute Path | Purpose |
|---------------|---------------|----------|
| **Helm Charts** | `/Users/praison/repos/person/helmcharts/` | All Kubernetes deployments |
| **wb_azure Chart** | `/Users/praison/repos/person/helmcharts/charts/wb_azure/` | PraisonAI WordPress deployment |
| **Production Values** | `/Users/praison/Sites/localhost/praisonai/values-praisonai-production.yaml` | Production Helm config |
| **Local Values** | `/Users/praison/Sites/localhost/praisonai/values-local.yaml` | Local development config |
| **Deployment Docs** | `/Users/praison/Sites/localhost/praisonai/DEPLOYMENT.md` | Deployment documentation |
| **Deployment Makefile** | `/Users/praison/Sites/localhost/praisonai/Makefile` | Deployment automation |
---
## 🔄 Full CI/CD Pipeline Overview
```
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Git Push │────▶│ GitHub Actions │────▶│ Azure ACR │
│ (master) │ │ azure-pipeline │ │ Image Build │
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Kubernetes │◀────│ Helm Upgrade │◀────│ Update Image │
│ Deployment │ │ (values.yaml) │ │ Tag in Values │
└─────────────────┘ └──────────────────┘ └─────────────────┘
```
### Pipeline Steps:
1. **Git push** to master branch
2. **GitHub Actions** triggers (`.github/workflows/azure-pipeline.yaml`)
3. **Build** Docker images (nginx, php, init)
4. **Push** to Azure Container Registry (ACR)
5. **Update** Helm values with new image tag
6. **Deploy** using Helm upgrade
---
## 🚀 Phase 0 - Fully Automated CI/CD Pipeline
### Complete Auto-Deploy Architecture
```
Git Push ──▶ Build Images ──▶ Trigger Deploy ──▶ Helm Upgrade ──▶ Production
│ │ │ │
│ ▼ ▼ ▼
│ ACR Push helmcharts wb_azure chart
│ (pa-php:SHA) repository (K8s deploy)
│
└─── install.sh ────────────────────────────────────────────────▶ praison.ai/install.sh
```
### Step 0.1: Build Workflow (Automatic on Git Push)
**File**: `/Users/praison/Sites/localhost/praisonai/.github/workflows/azure-pipeline.yaml`
**Repository**: `https://github.com/MervinPraison/praison.ai`
This workflow triggers on every push to `master`:
```yaml
on:
push:
branches: [master]
```
**What it does:**
1. **Syncs install.sh** from PraisonAI repository (only if changed!)
- Checks out `MervinPraison/PraisonAI`
- Compares `install.sh` and `install.ps1` with existing web files
- **Only copies if files have actually changed** (avoids unnecessary redeploys)
- This ensures `https://praison.ai/install.sh` is always latest
2. Downloads env files from Azure Storage
3. Builds multi-arch Docker images (linux/amd64, linux/arm64)
4. Pushes to Azure Container Registry: `praison.azurecr.io/pa/`
5. **Triggers Helm deployment** via `repository_dispatch` event
**Key Step - Automatic Deploy Trigger:**
```yaml
- name: Trigger Helm Deployment
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
curl -X POST \
-H "Authorization: token ${{ secrets.HELM_REPO_TOKEN }}" \
-d '{
"event_type": "deploy_wb_azure",
"client_payload": {
"image_tag": "'"$SHORT_SHA"'",
"source_repo": "'"${{ github.repository }}"'",
"source_commit": "'"${{ github.sha }}"'"
}
}' \
https://api.github.com/repos/praison/helmcharts/dispatches
```
### Step 0.2: Deploy Workflow (Triggered Automatically)
**File**: `/Users/praison/repos/person/helmcharts/.github/workflows/helm-upgrade-with-image.yml`
Listens for `repository_dispatch` events:
```yaml
on:
repository_dispatch:
types: [deploy_wb_azure, deploy_tcs_azure, deploy_tamilmanna_azure]
```
**What it does:**
1. Receives image tag from build workflow
2. Runs `helm upgrade --install wb_azure` with new image tag
3. Waits for rollout to complete
4. Verifies deployment
**Result**: Every git push automatically builds AND deploys!
### Required GitHub Secrets
For the automated CI/CD to work, you need these secrets configured:
**In praisonai site repository** (`https://github.com/MervinPraison/praison.ai`):
| Secret | Purpose |
|--------|---------|
| `AZURE_CREDENTIALS` | Azure login for ACR and AKS |
| `AZURE_USERNAME` | ACR username |
| `AZURE_PASSWORD` | ACR password |
| `AZURE_STORAGE_KEY` | Download env files from Azure Storage |
| `HELM_REPO_TOKEN` | **NEW**: Trigger deploy workflow in helmcharts repo |
**In helmcharts repository** (`/Users/praison/repos/person/helmcharts/.github/workflows/`):
| Secret | Purpose |
|--------|---------|
| `AZURE_CREDENTIALS` | Azure login for AKS |
| `AKS_CLUSTER_NAME` | Kubernetes cluster name |
| `AKS_RESOURCE_GROUP` | Azure resource group |
**To add HELM_REPO_TOKEN**:
1. Go to GitHub Settings → Developer settings → Personal access tokens
2. Create token with `repo` scope
3. Add as secret `HELM_REPO_TOKEN` in https://github.com/MervinPraison/praison.ai
**Current status**: ✅ Already configured (set via `gh secret set`)!
**Images built:**
- `praison.azurecr.io/pa/pa-nginx:SHORT_SHA`
- `praison.azurecr.io/pa/pa-nginx:master`
- `praison.azurecr.io/pa/pa-php:SHORT_SHA`
- `praison.azurecr.io/pa/pa-php:master`
- `praison.azurecr.io/pa/pa-init:SHORT_SHA`
- `praison.azurecr.io/pa/pa-init:master`
### Step 0.2: Update Helm Values with New Image Tag
After the ACR build completes, update the Helm values file to use the new image:
```bash
cd /Users/praison/Sites/localhost/praisonai
# Get the short SHA from the latest commit (matches the Docker tag)
SHORT_SHA=$(git rev-parse --short HEAD)
# Update values file with new image tag
helm upgrade praisonai /Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--set image.tag=$SHORT_SHA \
--namespace default \
--timeout 10m
```
**Alternative**: Update values file permanently:
```bash
# Edit values-praisonai-production.yaml to set image.tag
sed -i "s/tag: \".*\"/tag: \"$SHORT_SHA\"/" values-praisonai-production.yaml
# Then commit and push the updated values
git add values-praisonai-production.yaml
git commit -m "ci: update image tag to $SHORT_SHA"
git push origin master
```
### Step 0.3: Full Automated Script (For CI/CD Integration)
```bash
#!/bin/bash
# deploy-after-build.sh - Run after ACR build completes
set -e
SHORT_SHA=$(git rev-parse --short HEAD)
NAMESPACE=default
RELEASE_NAME=praisonai
CHART_PATH=/Users/praison/repos/person/helmcharts/charts/wb_azure
VALUES_FILE=/Users/praison/Sites/localhost/praisonai/values-praisonai-production.yaml
echo "🚀 Deploying PraisonAI with image tag: $SHORT_SHA"
# Update Helm deployment with new image tag
helm upgrade --install $RELEASE_NAME $CHART_PATH \
-f $VALUES_FILE \
--set image.tag=$SHORT_SHA \
--namespace $NAMESPACE \
--timeout 10m \
--atomic
echo "✅ Deployment complete!"
echo ""
echo "Verify with:"
echo " kubectl get pods -n $NAMESPACE -l app.kubernetes.io/instance=$RELEASE_NAME"
echo " helm status $RELEASE_NAME -n $NAMESPACE"
```
---
### Step 0.4: Extend GitHub Actions for Automatic Helm Deployment
To make the CI/CD fully automated (build → deploy), extend the GitHub Actions workflow:
**File to edit**: `/Users/praison/Sites/localhost/praisonai/.github/workflows/azure-pipeline.yaml`
Add a new job after the `build` job:
```yaml
deploy:
needs: build # Wait for build to complete
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Setup kubectl
uses: azure/setup-kubectl@v3
with:
version: 'v1.28.0'
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: 'v3.13.0'
- name: Get AKS credentials
run: |
az aks get-credentials \
--resource-group your-resource-group \
--name your-aks-cluster-name \
--overwrite-existing
- name: Deploy with Helm
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
helm upgrade --install praisonai \
/Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--set image.tag=$SHORT_SHA \
--namespace default \
--timeout 10m \
--atomic
- name: Verify deployment
run: |
kubectl rollout status deployment/php-nginx -n default
helm status praisonai -n default
```
**Requirements for automatic deploy:**
1. GitHub repository secrets configured:
- `AZURE_CREDENTIALS` - Azure service principal credentials
- `AZURE_STORAGE_KEY` - For downloading env files
- `AZURE_USERNAME` / `AZURE_PASSWORD` - ACR login
2. AKS cluster access configured in Azure
3. Helm and kubectl available in GitHub Actions runner
---
## 🔧 Phase 1 — Update install.sh (Manual, When Needed)
### When to Update
- New PraisonAI version released
- New dependency requirements
- New OS support needed
- Bug fixes in installation process
### Step 1: Read Current install.sh
```bash
# View the install script
cat /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
```
Key sections in install.sh:
- **Lines 1-50**: Header, usage, environment variables documentation
- **Lines 51-150**: OS detection (macOS, Linux, Windows/WSL)
- **Lines 151-300**: Python installation (version checks, package managers)
- **Lines 301-450**: Virtual environment setup
- **Lines 451-550**: PraisonAI package installation
- **Lines 551-637**: PATH configuration, shell integration, verification
### Step 2: Make Changes
**Common Changes:**
#### Update Default Version
```bash
# Find this line (around line 70):
PRAISONAI_VERSION="${PRAISONAI_VERSION:-latest}"
# Change to specific version if needed:
PRAISONAI_VERSION="${PRAISONAI_VERSION:-1.5.0}"
```
#### Add New Environment Variable
```bash
# Add to header section (after line 10, in the comment block):
# PRAISONAI_NEW_FEATURE - Description (default: value)
# Add to actual code (around line 75):
export PRAISONAI_NEW_FEATURE="${PRAISONAI_NEW_FEATURE:-default_value}"
```
#### Update Python Version Requirements
```bash
# Find Python version check (around line 100-120):
PYTHON_MIN_VERSION="3.9"
# Update if needed:
PYTHON_MIN_VERSION="3.10"
```
### Step 3: Test Changes
```bash
# Test locally (dry run)
cd /Users/praison/praisonai-package/src/praisonai/scripts
bash install.sh --dry-run
# Test in Docker (full test)
bash /Users/praison/praisonai-package/src/praisonai/scripts/test-install-smoke.sh
```
### Step 4: Verify Both Scripts
```bash
# Check install.sh syntax
bash -n /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
# Check install.ps1 syntax (if pwsh available)
pwsh -Command "Get-Command /Users/praison/praisonai-package/src/praisonai/scripts/install.ps1"
```
---
## 🚀 Phase 2 — Deploy to Kubernetes (Helm)
### Pre-Deployment Checklist
```bash
# 1. Verify kubectl connection
kubectl get nodes
# 2. Check current Helm releases
helm list -n default
# 3. Verify chart exists
ls /Users/praison/repos/person/helmcharts/charts/wb_azure/
```
### Deployment Types
#### A. Fresh Deployment (First Time)
```bash
cd /Users/praison/Sites/localhost/praisonai
# Option 1: Using Makefile
make deploy
# Option 2: Manual helm command
helm upgrade --install praisonai /Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--namespace default \
--timeout 10m \
--atomic
```
#### B. Update Existing Deployment
```bash
cd /Users/praison/Sites/localhost/praisonai
# Edit values file first
vim values-praisonai-production.yaml
# Then apply
make upgrade
# Or manually:
helm upgrade praisonai /Users/praison/repos/person/helmcharts/charts/wb_azure \
-f values-praisonai-production.yaml \
--namespace default \
--timeout 10m
```
#### C. Local Development Deployment
```bash
cd /Users/praison/Sites/localhost/praisonai
make local-deploy
```
### Values File Structure
```yaml
# /Users/praison/Sites/localhost/praisonai/values-praisonai-production.yaml
# Core settings
replicaCount: 2
# Database
dbHost: "10.0.0.11"
dbUser: "bible_4"
dbPassword: "changeme" # Override via --set
# OpenAI tokens (for plugin verification)
openaiVerificationToken: "token-here"
# Feature toggles
praisonai:
enabled: true
domain: praison.ai
whiteboard:
enabled: true
domain: whiteboard.gallery
# Disable other sites
bible: { enabled: false }
music: { enabled: false }
save: { enabled: false }
# Resources
resources:
requests:
cpu: 800m
memory: 1024Mi
limits:
cpu: 2000m
memory: 2048Mi
# Auto-scaling
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
# Ingress
ingress:
enabled: true
className: nginx
```
---
## 📊 Phase 3 — Verify Deployment
### Check Deployment Status
```bash
# Using Makefile
make status
# Manual checks
helm status praisonai -n default
kubectl get pods -l app.kubernetes.io/instance=praisonai -n default
kubectl get svc -l app.kubernetes.io/instance=praisonai -n default
```
### Verify All Resources
```bash
# Pods should be Running
kubectl get pods -n default | grep praisonai
# Services should be Active
kubectl get svc -n default | grep praisonai
# Ingress should exist
kubectl get ingress -n default | grep praisonai
# ConfigMaps
kubectl get configmap -n default | grep nginx-config
# Secrets
kubectl get secret -n default | grep db-password
```
### Check Application Health
```bash
# Port forward and test
echo "Visit http://127.0.0.1:8080"
kubectl port-forward svc/php-nginx 8080:80 -n default
# In another terminal:
curl http://127.0.0.1:8080/test.php
```
---
## 🔄 Phase 4 — Rollback (If Needed)
```bash
# View revision history
make history
# Rollback to previous revision
make rollback
# Or manually:
helm rollback praisonai 1 -n default
```
---
## 🛠️ Phase 5 — Troubleshooting
### Problem: "Resource exists and cannot be imported"
**Cause**: Existing Kubernetes resources not managed by Helm.
**Solution**: Adopt resources into Helm
```bash
cd /Users/praison/Sites/localhost/praisonai
./scripts/adopt-resources.sh praisonai default
```
Or manually annotate:
```bash
# For any resource type
kubectl annotate <resource-type> <name> \
meta.helm.sh/release-name=praisonai \
meta.helm.sh/release-namespace=default
kubectl label <resource-type> <name> \
app.kubernetes.io/managed-by=Helm
```
### Problem: Pods Not Starting
```bash
# Check events
kubectl get events -n default --sort-by='.lastTimestamp' | tail -20
# Check pod logs
kubectl logs -l app.kubernetes.io/instance=praisonai -n default
# Describe pod for details
kubectl describe pod <pod-name> -n default
```
### Problem: Image Pull Errors
```bash
# Check image pull secrets
kubectl get secret acr-auth -n default
# Verify ACR auth exists
kubectl create secret docker-registry acr-auth \
--docker-server=praison.azurecr.io \
--docker-username=<username> \
--docker-password=<password> \
-n default
```
---
## 📋 Phase 6 — Post-Deployment
### Update Documentation
If install.sh changed, update:
1. `/Users/praison/PraisonAIDocs/docs/installation.mdx` — Installation docs
2. `/Users/praison/praisonai-package/src/praisonai/scripts/README.md` — Script docs (if exists)
### Verify Website
```bash
# Check praison.ai is accessible
curl -I https://praison.ai
# Check whiteboard.gallery
curl -I https://whiteboard.gallery
```
### Monitor
```bash
# Watch pods
kubectl get pods -l app.kubernetes.io/instance=praisonai -n default -w
# Check resource usage
kubectl top pods -l app.kubernetes.io/instance=praisonai -n default
```
---
## 📚 Reference: Helm Chart Structure
```
/Users/praison/repos/person/helmcharts/charts/wb_azure/
├── Chart.yaml # Chart metadata (name: wb, version: 1.0.1)
├── values.yaml # Default values (fallback)
├── templates/
│ ├── deployment.yaml # Main php-nginx deployment
│ ├── service.yaml # NodePort service
│ ├── ingress.yaml # TLS + routing
│ ├── nginx-configMap.yaml # Server configs
│ ├── db-password-secret.yaml # DB credentials
│ ├── pdb.yaml # Pod disruption budget
│ ├── autoscalar.yml # HPA
│ ├── cert-manager.yaml # TLS certificates
│ └── _helpers.tpl # Template helpers
```
---
## 🎯 Quick Commands Reference
| Task | Command |
|------|---------|
| Deploy | `make deploy` |
| Update | `make upgrade` |
| Status | `make status` |
| History | `make history` |
| Rollback | `make rollback` |
| Logs | `make logs` |
| Restart | `make restart` |
| Local dev | `make local-deploy` |
| Dry run | `make dry-run` |
| Lint | `make lint` |
---
## ⚠️ Critical Rules
1. **Never commit SQL dumps**: `.gitignore` already excludes `*.sql` files
2. **Never commit secrets**: Use `--set` or external secret management
3. **Always test install.sh** after changes (use test-install-smoke.sh)
4. **Always verify deployment** with `make status` after Helm operations
5. **Use Infrastructure as Code**: All changes via Helm values files, never manual kubectl
6. **Version control**: Commit values files (without secrets), never commit generated manifests
---
## 🆘 Getting Help
If stuck:
1. Check `/Users/praison/Sites/localhost/praisonai/DEPLOYMENT.md` for detailed docs
2. Check `/Users/praison/Sites/localhost/praisonai/INFRASTRUCTURE_AS_CODE_SUMMARY.md` for quick reference
3. Run `helm status praisonai -n default` for deployment status
4. Run `kubectl get events -n default` for cluster events
5. View install.sh comments for usage examples (lines 1-50)
---
## 🔄 CI/CD Pipeline Summary (For New Agents)
### Complete Workflow (Fully Automated!)
```
Developer Push ──────────────────────────────────────────────▶ Production
│ │
▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ 1. Git Push to │───▶│ 2. GitHub Actions │───▶│ 3. Sync │
│ master │ │ Trigger │ │ install.sh │
└─────────────────┘ └──────────────────┘ └────────┬─────────┘
│
┌────────────────────────┘
▼
┌──────────────────┐
│ 4. Azure ACR │
│ Build Images │
│ + Push │
└────────┬─────────┘
│
──────▶┌──────────────────┐
│ 5. Trigger Deploy│
│ (repository_ │
│ dispatch) │
└────────┬─────────┘
│
┌─────────────────┐ ┌──────────────────┐ │
│ 7. Production │◀───│ 6. Helm Upgrade │◀──┘
│ Running │ │ Deploy │
│ (includes │ │ │
│ install.sh) │ │ │
└─────────────────┘ └──────────────────┘
```
**🎉 Fully Automated**: Git push → Build → Deploy (No manual steps!)
### Automatic install.sh Sync
**Key Point**: The workflow automatically syncs `install.sh` from `MervinPraison/PraisonAI` repository **only if changed**:
```yaml
- name: Checkout PraisonAI for install.sh
uses: actions/checkout@v2
with:
repository: MervinPraison/PraisonAI
path: praisonai-package
- name: Sync install.sh to web folder (if changed)
run: |
# Only sync if files have actually changed
if ! diff -q praisonai-package/src/praisonai/scripts/install.sh ./web/install.sh; then
cp praisonai-package/src/praisonai/scripts/install.sh ./web/install.sh
fi
```
**Optimization**: Uses `diff` to compare files - only copies when install.sh or install.ps1 have actually changed. This avoids unnecessary Docker layer rebuilds and deployments.
**Result**: `https://praison.ai/install.sh` is automatically updated **only when the source files change**!
### How install.sh is Served
The `web/install.sh` file is copied into the Docker image at `/var/www/html/web/install.sh` and served by nginx:
```nginx
# In nginx-config, requests to praison.ai/install.sh
# are served from /var/www/html/web/install.sh
location / {
root /var/www/html/web;
try_files $uri $uri/ =404;
}
```
**URL Mapping**:
| File in Repo | URL |
|--------------|-----|
| `web/install.sh` | `https://praison.ai/install.sh` |
| `web/install.ps1` | `https://praison.ai/install.ps1` |
### What Files to Edit
| To Change | Edit File |
|-----------|-----------|
| Application code | `/Users/praison/Sites/localhost/praisonai/` (PHP files) |
| Docker images | `Dockerfile.php`, `Dockerfile.nginx`, `Dockerfile.init` |
| CI/CD pipeline | `.github/workflows/azure-pipeline.yaml` |
| Helm deployment config | `values-praisonai-production.yaml` |
| Install script | `/Users/praison/praisonai-package/src/praisonai/scripts/install.sh` |
### Common Tasks
**Task 1: Deploy new code**
```bash
cd /Users/praison/Sites/localhost/praisonai
git add .
git commit -m "feat: new feature"
git push origin master
# CI/CD automatically builds and deploys
```
**Task 2: Update install.sh and deploy**
```bash
# 1. Update install.sh
vim /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
# 2. Test install.sh
bash /Users/praison/praisonai-package/src/praisonai/scripts/install.sh --dry-run
# 3. Commit and push
git add /Users/praison/praisonai-package/src/praisonai/scripts/install.sh
git commit -m "fix: update install script"
git push origin main
# 4. Deploy website (if needed)
cd /Users/praison/Sites/localhost/praisonai
make upgrade
```
**Task 3: Rollback deployment**
```bash
cd /Users/praison/Sites/localhost/praisonai
make rollback
# Or: helm rollback praisonai 1 -n default
```
### Architecture
| Layer | Technology | Purpose |
|-------|------------|---------|
| Source Control | Git/GitHub | Code repository |
| CI/CD | GitHub Actions | Automated build/deploy |
| Container Registry | Azure ACR | Docker image storage |
| Orchestration | Kubernetes (AKS) | Container management |
| Deployment | Helm | K8s package management |
| Ingress | NGINX Ingress + cert-manager | Traffic routing + TLS |
### Security Notes
- **No secrets in workflow files** - All tokens/passwords via env vars
- **ACR authentication** - Uses `acr-auth` secret in Kubernetes
- **GitHub Secrets** - `AZURE_CREDENTIALS`, `AZURE_USERNAME`, `AZURE_PASSWORD`
- **Never commit** `.env` files, SQL dumps, or credentials
-165
View File
@@ -1,165 +0,0 @@
---
description: instruction
---
Create multiple TODOs and sub-TODOs, get all things done.
First: detailed analysis, plan, and gap analysis. Go through all files, understand current logic. Search if needed.
Then: implement, fix, test (TDD, Agent-Centric, no perf impact, DRY). praisonaiagents is protocol-driven. Run unit, integration, smoke, and real agentic tests.
After: re-do detailed analysis/plan to find remaining gaps and propose fixes.
Docs: beginner-friendly, for non-developers. Explain concepts with mermaid diagrams (Dark Red #8B0000 for agents/inputs/outputs, Teal #189AB4 for tools, white #fff text). Less descriptive, more interactive. Use Mintlify components: Accordions, Badge, Callouts (Note/Warning/Info/Tip/Check/Danger), Cards/Columns, CodeGroup, Expandables, Tabs, Steps, Frame, Icon, Tooltip, Mermaid, ParamField, Tables, CardGroup.
You are an expert AI engineer in the PraisonAI ecosystem.
Production-quality code, zero regressions, full verification. Make PraisonAI the best agent framework.
### Core Philosophy
```
Simpler • More extensible • Faster • Agent-centric
```
| Principle | Rule |
|---|---|
| Agent-Centric | Design centers on Agents, workflows, sessions, tools, memory |
| Protocol-Driven | Core SDK: protocols/hooks/adapters only; heavy code in wrapper/tools |
| Minimal API | Fewer params, sensible defaults, explicit overrides |
| Performance-First | Lazy loading, optional deps, no hot-path regressions |
| Production-Ready | Safe by default, multi-agent safe, async-safe |
- Powerful, lightweight, reliable. Easy for non-developers.
- "Few lines of code to do the task!" — SDK and docs must feel this way.
- Each feature runs 3 ways: CLI, YAML, Python.
- Open source, developer-first. Core free, clear upgrade path to paid (support/cloud/services).
- Simple to adopt, hard to misuse, safe by default.
- Prioritise time saved, reduced risk, and operational confidence.
- Reduce production friction, not just add functionality.
- All features must have CLI integration. Agent-first naming and ergonomics.
ENGINEERING PRINCIPLES (MUST)
- DRY: reuse abstractions, no duplication.
- Protocol-driven core: protocols/hooks in core; heavy impl in wrapper/tools.
- No perf impact: lazy imports, optional deps, no global singletons, no heavy module-level work.
- TDD mandatory: tests first.
- Multi-agent + async safe by default.
- AGENTS.md is not for documentation.
CRITICAL REQUIREMENTS
- EXECUTE + VERIFY mode. No guessing. Proof for "done."
- Optional deps only; lazy import everything heavy.
- Every feature/fix: Python + CLI + docs/examples.
- Any core change must be justified: simpler client API, measurable benefit, NO perf regression.
- If TypeScript parity required: update praisonai-ts, but never at cost of Python core performance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CANONICAL PATHS (MUST use these)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Core SDK: /Users/praison/praisonai-package/src/praisonai-agents → praisonaiagents
- Wrapper: /Users/praison/praisonai-package/src/praisonai → praisonai
- Tools: /Users/praison/PraisonAI-tools → praisonai-tools
- Docs: /Users/praison/PraisonAIDocs (read AGENTS.md first before updating docs)
- Docs JS: /Users/praison/PraisonAIDocs/docs/js | Rust: docs/rust
- Examples: /Users/praison/praisonai-package/examples/
- TypeScript: /Users/praison/praisonai-package/src/praisonai-ts
- Rust: /Users/praison/praisonai-package/src/praisonai-rust (follow praisonai-ts/AGENTS.md)
- UI (this repo): /Users/praison/praisonaiui → praisonaiui
- Extension points: tools/base.py, tools/decorator.py, db/*
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ARCHITECTURE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Core (praisonaiagents): protocol-driven, lightweight. No heavy imports. Only protocols/hooks/adapters.
Wrapper (praisonai): real integrations (DBs, observability, CLI). Lazy imports, optional deps.
Tools (PraisonAI-tools): pluggable, never overload core/wrapper.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MANDATORY EXECUTION FLOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PHASE 1 — ANALYSIS (before writing code)
1.1 Acceptance Criteria — testable bullets for API, CLI, docs, tests, perf.
1.2 Repo Inventory — scan relevant files end-to-end:
- modules/classes/APIs/exports, CLI commands, tests, docs/examples
- Evidence: paths + symbols + grep counts. Identify DRY opportunities.
1.3 Gap Analysis — what exists vs what's needed:
- Missing: core SDK, wrapper, tools, CLI, docs, tests, exports
- Risks: perf, API breaks, optional deps, async, multi-agent
1.4 Report — current behavior, pain points, root causes (file refs), constraints, risk register, decision log.
1.5 Plan — step-by-step: tests → impl → CLI → docs → verify. Files to change. Compat/rollback/perf strategy.
1.6 Proposal — minimal agent-centric design. Protocols in core, impl in wrapper. Upgrade-path notes.
1.7 TODO Tree — granular, executable. Python + CLI + TDD + docs + perf.
- Second-to-last: "Verify all changes end-to-end"
- Last: "Implement remaining gaps (missing=0), re-verify" or "Final scan, confirm missing=0"
PHASE 2 — EXECUTE
2.1 TDD — write failing tests first. Deterministic and fast.
2.2 Implement — DRY, agent-centric, protocol-driven. Heavy code in wrapper/tools. Multi-agent + async safe.
2.3 CLI parity — add/extend CLI commands. Scriptable, clear help, proper exit codes.
2.4 Docs — Mintlify pages (SDK="Module", API="API"). Copy-paste runnable examples.
2.5 Verification:
- Run tests (unit/integration), show results.
- Smoke: `python3 -c "..."` + CLI help/run.
- Optional deps graceful degradation.
- Perf: no heavy core imports, import-time sanity.
- Provide evidence for every claim.
- dont use Sending termination request to command to terminate a process, kill port instead when terminating
REAL AGENTIC TEST (MANDATORY — not replaceable by smoke tests)
- After unit/smoke tests, MUST run at least one REAL agent execution:
1. Create Agent with the feature being tested
2. Call `agent.start("a real task prompt")` — NOT just constructing the object
3. Agent MUST call LLM and produce text response
4. Print full output so dev can see it worked end-to-end
- Minimum example:
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are a helpful assistant")
result = agent.start("Say hello in one sentence")
print(result)
```
- Assert-only object construction = SMOKE TEST, not real agentic test.
- Both smoke AND real agentic tests required.
PHASE 3 — POST-IMPLEMENTATION ANALYSIS
3.1 Re-scan files, summarize final behavior/architecture.
3.2 Confirm remaining gaps (API, CLI, docs, tests, exports, perf, multi-agent, async). If gaps exist, treat as required work until missing=0.
3.3 Report: what changed, why, validation evidence, tradeoffs.
3.4 Plan: close remaining gaps or maintenance plan.
3.5 Proposal: refinements for UX, safety, perf, extensibility. Label: implemented vs out-of-scope.
Final rule: conclude only when evidence shows missing = 0.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PUBLISH WORKFLOW (reference)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1 — Publish praisonaiagents (Core SDK):
cd /Users/praison/praisonai-package/src/praisonai-agents
praisonai publish pypi
# Uses uv internally: uv lock → uv build → uv publish
# Auto-bumps patch version, requires PYPI_TOKEN env var
Step 2 — Publish praisonai (Wrapper):
cd /Users/praison/praisonai-package/src/praisonai
python scripts/bump_and_release.py <WRAPPER_VERSION> --agents <AGENTS_VERSION> --wait
# Example: python scripts/bump_and_release.py 4.5.90 --agents 1.5.91 --wait
# Waits for agents to be available on PyPI, bumps all version files,
# runs uv lock, builds, commits, tags, pushes, creates GitHub release
# Then: uv publish (from src/praisonai with clean dist/)
If bump_and_release published already, just verify:
pip index versions praisonai | head -1
If uv publish fails with "File already exists", it means the version is already on PyPI — success.
Step 3 — Publish praisonai-tools (External, if needed):
cd /Users/praison/PraisonAI-tools
# Bump version in pyproject.toml, then:
python3.13 -m build && uv run twine upload dist/*
PraisonAI PRs: NEVER merge automatically — user merges manually.
-223
View File
@@ -1,223 +0,0 @@
---
description: Implement, fix, and test code changes locally — for when the agent IS the implementer
---
# Local Fix Workflow
You are the implementer. Analyze → Plan → Implement → Test → Verify → PR.
> **When to use this:** The user explicitly asks you to fix something locally, or delegates a task that cannot be handled by the GitHub cloud agents.
> **When NOT to use this:** If given an Issue URL, prefer `@[/pr-review]` Step 8d — delegate to cloud agents first.
---
## Phase 1 — Analysis (before writing ANY code)
### 1a. Understand the problem
// turbo
```bash
cd /Users/praison/praisonai-package && git checkout main && git pull origin main
```
Read all relevant source files end-to-end. Use `grep`, `view_file`, and code navigation.
- Identify root cause with **file paths and line numbers**
- Trace the full code path (caller → callee → side effects)
- Assess blast radius (what else could break)
- Check for existing abstractions before creating new ones (DRY)
### 1b. Create TODO tree
Break work into granular, executable items:
```
- [ ] Write failing test(s)
- [ ] Implement fix (file:line references)
- [ ] CLI parity (if applicable)
- [ ] Docs update (if applicable)
- [ ] Run unit + integration tests
- [ ] Run real agentic test
- [ ] Verify end-to-end
```
---
## Phase 2 — Implement
### 2a. TDD — tests first
Write the failing test before touching implementation code.
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/<relevant_test>.py -x -v --tb=short
```
### 2b. Implement the fix
**Architecture rules (MUST follow):**
| Layer | What goes here | What does NOT go here |
|-------|---------------|----------------------|
| **Core SDK** (`praisonaiagents/`) | Protocols, hooks, adapters, base classes, decorators, dataclasses | Heavy implementations, optional deps at module level |
| **Wrapper** (`praisonai/`) | CLI commands, integrations, heavy impls, DB adapters, UI | Core logic |
| **Tools** (`PraisonAI-tools/`) | Pluggable tools, community extensions | Core or wrapper logic |
**Coding standards:**
- **Lazy imports**: Optional deps imported inside functions, never at module level
- **DRY**: Reuse existing abstractions; refactor if duplication found
- **Naming**: `add_X()`, `get_X()`, `XConfig`, `XProtocol`, `XAdapter`
- **Async-safe**: No blocking I/O in async context; use asyncio primitives
- **Multi-agent safe**: No shared mutable globals without `threading.Lock`
- **Security**: No hardcoded secrets; `hmac.compare_digest` for comparisons; sandboxed `exec()`
- **Backward compat**: Public API changes require deprecation cycle
**Canonical paths:**
| What | Where |
|------|-------|
| Core SDK | `/Users/praison/praisonai-package/src/praisonai-agents/praisonaiagents/` |
| Wrapper | `/Users/praison/praisonai-package/src/praisonai/praisonai/` |
| Tools | `/Users/praison/PraisonAI-tools/` |
| Docs | `/Users/praison/PraisonAIDocs/` (read AGENTS.md first) |
| Examples | `/Users/praison/praisonai-package/examples/` |
| TypeScript | `/Users/praison/praisonai-package/src/praisonai-ts/` |
### 2c. CLI parity
Every feature must work 3 ways: **Python, CLI, YAML**. If your change adds or modifies a feature, ensure CLI support exists.
---
## Phase 3 — Test & Verify
### 3a. Unit + Integration tests
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/ -x -q \
--ignore=tests/integration/test_whatsapp_web_real.py \
--ignore=tests/unit/tools/test_profiles.py \
--tb=short 2>&1 | tail -20
```
### 3b. Real agentic test (MANDATORY)
Unit tests alone are NOT sufficient. You MUST run at least one real agent execution:
```python
from praisonaiagents import Agent
agent = Agent(name="test", instructions="You are a helpful assistant")
result = agent.start("Say hello in one sentence")
print(result)
```
**Rules:**
- Agent MUST call `agent.start()` with a real prompt
- Agent MUST call the LLM and produce a text response
- Print full output — assert-only object construction is a SMOKE test, not agentic
- Both smoke AND real agentic tests required
### 3c. Security checks (if touching sensitive code)
```bash
# Hardcoded secrets
grep -rn "secret\|password\|token\|api_key" --include="*.py" <changed-files> | \
grep -v "test_\|#\|environ\|getenv\|config"
# Timing attacks
grep -rn "==.*api_key\|==.*secret\|==.*token" --include="*.py" <changed-files>
# Sandbox escapes
grep -rn "exec(\|eval(" --include="*.py" <changed-files>
```
### 3d. Performance sanity
```bash
# Verify no heavy imports at module level
python -c "import time; t=time.time(); import praisonaiagents; print(f'{(time.time()-t)*1000:.0f}ms')"
```
Target: < 200ms package import time.
---
## Phase 4 — Post-implementation scan
Re-scan changed files. Confirm:
- [ ] No remaining gaps (API, CLI, docs, tests, exports, perf)
- [ ] No regressions introduced
- [ ] All acceptance criteria met with evidence
If gaps remain → loop back to Phase 2. Conclude only when `missing = 0`.
---
## Phase 5 — Submit
### 5a. Create branch and PR
```bash
cd /Users/praison/praisonai-package && \
git checkout -b <type>/<descriptive-name> && \
git add -A && \
git commit -m "<type>: <description>" && \
git push origin <type>/<descriptive-name>
```
```bash
cd /Users/praison/praisonai-package && \
gh pr create \
--title "<type>: <description>" \
--body '## Summary
<what and why>
### Changes
- <file>: <what changed>
### Testing
- Unit tests: ✅
- Agentic test: ✅
- Security: ✅ (if applicable)' \
--head <type>/<descriptive-name> \
--base main
```
**Commit prefixes:** `fix:`, `feat:`, `security:`, `refactor:`, `docs:`, `test:`
> **Do NOT merge automatically** — user merges manually unless explicitly told otherwise.
### 5b. Verify PR state
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr view --json state,title,url | cat
```
---
## Publish (only when user requests)
```bash
# Core SDK
cd /Users/praison/praisonai-package/src/praisonai-agents && praisonai publish pypi
# Wrapper
cd /Users/praison/praisonai-package/src/praisonai && \
python scripts/bump_and_release.py <VERSION> --agents <AGENTS_VERSION> --wait
```
---
## Quick Reference — Red Flags
| Red Flag | Fix |
|----------|-----|
| Module-level `import chromadb` | Move inside function with `try/except ImportError` |
| `exec(user_input)` without sandbox | Use `RestrictedPython` or sandbox module |
| `if token == secret:` | Use `hmac.compare_digest(token, secret)` |
| Shared mutable global `_cache = {}` | Add `threading.Lock`, or make per-agent |
| `debug=True` in production path | Remove or gate behind env var |
| Missing `async` variant for I/O | Add async version, wrap for sync callers |
-275
View File
@@ -1,275 +0,0 @@
---
description: Review, validate, and merge GitHub pull requests or triage issues
---
# PR / Issue Review Workflow
When given a GitHub PR or Issue URL, follow this procedure end-to-end.
---
## Step 0 — Determine Type
Parse the URL to identify whether it is a **Pull Request** or an **Issue**.
```
https://github.com/MervinPraison/PraisonAI/pull/<NUMBER> → PR
https://github.com/MervinPraison/PraisonAI/issues/<NUMBER> → Issue
```
- **PR** → go to Step 1
- **Issue** → go to Step 8
---
## Step 1 — Fetch PR Metadata
// turbo
```bash
cd /Users/praison/praisonai-package && \
gh pr view <NUMBER> --json title,body,author,state,additions,deletions,changedFiles,headRefName,baseRefName,labels
```
Record: title, author, branch, file count, +/- lines.
---
## Step 2 — Read the Full Diff
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr diff <NUMBER>
```
If the diff is very large (>500 lines), pipe through `head -500` first, then read remaining chunks.
---
## Step 3 — Review the Diff
For each changed file, evaluate against **PraisonAI engineering principles** (from AGENTS.md):
| Principle | What to Check |
|-----------|---------------|
| **Protocol-driven core** | No heavy implementations in `praisonaiagents/` (core SDK) |
| **Lazy imports** | Optional deps imported inside functions, not at module level |
| **DRY** | No code duplication; reuse existing abstractions |
| **Naming conventions** | `add_X()`, `get_X()`, `XConfig`, `XProtocol`, `XAdapter` |
| **Async-safe** | No blocking I/O in async context; asyncio primitives used |
| **Multi-agent safe** | No shared mutable global state without locks |
| **Thread safety** | Double-checked locking for lazy caches; `threading.Lock` for mutables |
| **Security** | No hardcoded secrets; `hmac.compare_digest` for comparisons; restricted `exec()` |
| **Backward compat** | Public API changes require deprecation cycle |
| **Test coverage** | Tests included; TDD pattern; both unit + agentic tests |
**Red flags to catch:**
- Module-level imports of optional deps (chromadb, litellm, etc.)
- Hardcoded credentials or `debug=True` in production paths
- Direct string comparison for secrets (timing attacks)
- `exec()`/`eval()` without sandbox
- Shared mutable globals without `threading.Lock`
- Missing error handling or swallowed exceptions
---
## Step 4 — Checkout and Run Tests Locally
// turbo
```bash
cd /Users/praison/praisonai-package && git checkout main && git pull origin main
```
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr checkout <NUMBER>
```
Run targeted tests for changed files first:
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/ -x -q \
--ignore=tests/integration/test_whatsapp_web_real.py \
--ignore=tests/unit/tools/test_profiles.py \
--tb=short 2>&1 | tail -20
```
For PRs touching security-sensitive code, also run:
```bash
# Sandbox tests
python -m pytest tests/unit/tools/test_python_tools_sandbox.py -v
# CWE-78 env injection tests
python -m pytest src/praisonai/tests/unit/test_cwe78_env_injection.py -v
# Thread-safety tests
python -m pytest tests/unit/test_thread_safety.py -v
```
---
## Step 5 — Verify No Regressions
Run the full test suite:
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && \
python -m pytest tests/ -q \
--ignore=tests/integration/test_whatsapp_web_real.py \
--ignore=tests/unit/tools/test_profiles.py \
--tb=no 2>&1 | tail -5
```
**Acceptable result:** All tests pass, or only pre-existing flaky tests fail (e.g., `test_file_memory.py::test_memory_persistence_across_agent_instances`).
**Unacceptable:** Any NEW failure introduced by the PR.
---
## Step 6 — Approve or Request Changes
**If the PR is good:**
```bash
cd /Users/praison/praisonai-package && \
gh pr review <NUMBER> --approve --body "LGTM — reviewed diff, tests pass, follows PraisonAI engineering principles."
```
**If changes are needed:**
```bash
cd /Users/praison/praisonai-package && \
gh pr review <NUMBER> --request-changes --body "Requesting changes: <specific feedback>"
```
---
## Step 7 — Merge
```bash
cd /Users/praison/praisonai-package && \
gh pr merge <NUMBER> --merge --subject "<PR title>"
```
Verify merge:
// turbo
```bash
cd /Users/praison/praisonai-package && gh pr view <NUMBER> --json state,mergedAt
```
Then return to main:
// turbo
```bash
cd /Users/praison/praisonai-package && git checkout main && git pull origin main
```
---
## Step 8 — Issue Triage (if URL is an Issue)
### 8a. Fetch issue details
// turbo
```bash
cd /Users/praison/praisonai-package && \
gh issue view <NUMBER> --json title,body,author,state,labels,comments
```
### 8b. Classify severity
| Tier | Criteria | Examples |
|------|----------|---------|
| **Tier 1 — Critical** | Security vuln, data loss, crash in hot path | exec() without sandbox, hardcoded secrets, unprotected globals |
| **Tier 2 — High** | Performance regression, broken feature, wrong output | Duplicate API calls, memory leak, silent failure |
| **Tier 3 — Medium** | DX issue, missing validation, doc gap | Bad error messages, missing CLI parity, stale docs |
| **Tier 4 — Low** | Cosmetic, code style, minor refactor | Trailing whitespace, naming inconsistency |
### 8c. Deep analysis (for Tier 1-2)
1. Read ALL relevant source files end-to-end
2. Trace the code path that the issue describes
3. Identify root cause with file paths and line numbers
4. Assess blast radius (what else could be affected)
5. Determine if the issue is **actually what it claims** (re-classify if needed)
### 8d. Delegate Implementation to GitHub Workflow Agents
> **KEY PHILOSOPHY: We act as the Manager, GitHub Actions execute the Workflow.**
**DO NOT implement the fix yourself locally.** PraisonAI uses autonomous GitHub Action workflows (such as `gemini-issue-review.yml` and `claude.yml`) to automatically resolve issues and create PRs. Your job as the local agent is to supervise, analyze gaps, and trigger these cloud agents to do the heavy lifting. If there is a gap (e.g. strict test violations), provide detailed relevant information in the PR/Issue and trigger the agents again.
1. Issue the command to trigger the cloud agent on the issue:
```bash
cd /Users/praison/praisonai-package && \
gh issue comment <NUMBER> --body "@gemini please review and fix this issue"
```
*(Note: You can use `@claude` or `@gemini` depending on preference or active bots).*
2. Check the GitHub Actions logs (`gh run list`) and wait for the cloud agent to open a Pull Request (`gh pr list`).
3. Once the cloud bot opens a Pull Request for the issue, return to **Step 1** to review the PR, test the branch locally, and merge it if it passes the checks.
---
## Step 9 — (Skipped) Local PR Creation
> **Note:** As the local agent, you should delegate code fixes to the cloud agents. Only implement code locally and create a PR if the USER explicitly forces you to bypass the cloud agents. If forced, use standard prefixes: `fix:`, `feat:`, `security:`, `refactor:`, `docs:`, `test:`.
---
## Step 10 — Security-Specific Checks
When reviewing security-related PRs, additionally verify:
### Credentials / Secrets
```bash
# Check for hardcoded secrets
grep -rn "secret\|password\|token\|api_key" --include="*.py" <changed-files> | \
grep -v "test_\|#\|environ\|getenv\|config"
```
### Timing Attacks
```bash
# Ensure hmac.compare_digest for secret comparisons
grep -rn "==.*api_key\|==.*secret\|==.*token" --include="*.py" <changed-files>
```
### Authentication & Workflow Secrets
When reviewing GitHub Actions workflows (especially ones using cloud actions like `claude-code-action`):
- **OIDC Validation**: Any workflow using OIDC to authenticate with a cloud provider (e.g. AWS Bedrock for Claude, GCP for Vertex) **MUST** include `id-token: write` in the job's `permissions`. Without it, you will see `Could not fetch an OIDC token` errors.
- **Valid PAT Usage**: When injecting tokens into workflows via `github_token:`, ensure you use `secrets.GH_TOKEN`. `secrets.PAT_TOKEN` has been known to be invalid or cause `401 Bad credentials` errors when curling GitHub resources. By design, `@copilot` mentions also strictly require `GH_TOKEN`.
### Supply Chain
```bash
# Check dependency versions
pip show <package-name>
# Check for known compromised versions
pip install <package>==999 2>&1 | grep "from versions"
```
### IoC Scanning
```bash
# Check for known malicious files
find $(python -c "import site; print(site.getsitepackages()[0])") -name "<suspicious-file>" 2>/dev/null
```
---
## Quick Reference — Common Commands
| Action | Command |
|--------|---------|
| View PR | `gh pr view <N> --json title,body,state,additions,deletions` |
| View diff | `gh pr diff <N>` |
| Checkout PR | `gh pr checkout <N>` |
| List open PRs | `gh pr list` |
| List open issues | `gh issue list` |
| View issue | `gh issue view <N>` |
| Approve PR | `gh pr review <N> --approve` |
| Request changes | `gh pr review <N> --request-changes --body "..."` |
| Merge PR | `gh pr merge <N> --merge` |
| Create PR | `gh pr create --title "..." --body "..." --head <branch> --base main` |
| Run tests | `cd src/praisonai-agents && python -m pytest tests/ -q --tb=no` |
| Check dep version | `pip show <package>` |
-219
View File
@@ -1,219 +0,0 @@
---
description: Publish and release praisonaiagents + praisonai to PyPI (default = hotfix patch)
---
// turbo-all
# Publish & Release Workflow
End-to-end publish pipeline for the PraisonAI stack. **Default release type is a hotfix (patch) bump.** Only three commands are needed — each does the heavy lifting. The wrapper is uploaded to PyPI automatically by GitHub Actions once the release is created.
## Packages & version rules
| Package | Canonical path | Current family |
|---|---|---|
| `praisonaiagents` (Core SDK) | `/Users/praison/praisonai-package/src/praisonai-agents` | `1.6.x` |
| `praisonai` (Wrapper) | `/Users/praison/praisonai-package/src/praisonai` | `4.6.x` |
- Wrapper **major.minor** tracks the SDK: SDK `1.6.x` ↔ wrapper `4.6.x`.
- **Patch numbers must match** across both packages for the same release (SDK `1.6.9` ↔ wrapper `4.6.9`).
- Working branch: `main` — push directly, no feature branches.
## Prerequisites
- PyPI token in `/Users/praison/.pypirc` under `[pypi].password` (format `pypi-...`).
- `gh` CLI authenticated (`gh auth status`).
- Working tree on `main` with the code change already in place (uncommitted is fine — step 2 will auto-commit).
Export the PyPI token once for the session:
```bash
export PYPI_TOKEN=$(python3 -c "import configparser;c=configparser.ConfigParser();c.read('/Users/praison/.pypirc');print(c['pypi']['password'])")
```
---
## STEP 1 — Publish `praisonaiagents` (Core SDK)
**`praisonai publish pypi` run from inside `praisonai-agents/` automatically:**
1. Reads the current version from `pyproject.toml`
2. Auto-bumps the **patch** number (default; use `--minor` / `--major` to override)
3. Runs `rm -rf dist && uv lock && uv build && uv publish --token $PYPI_TOKEN`
4. Publishes the package to PyPI
// turbo
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents
praisonai publish pypi
```
Bump variants (optional):
- `praisonai publish pypi --minor` → `1.6.9 → 1.7.0`
- `praisonai publish pypi --major` → `1.6.9 → 2.0.0`
- `praisonai publish pypi --no-bump` → publish current version
- `praisonai publish pypi --dry-run` → preview without executing
Verify:
```bash
pip index versions praisonaiagents | head -1
```
> Note the new SDK version (e.g. `1.6.9`) — you'll need it in step 3.
---
## STEP 2 — Auto-commit the version bump
**`praisonai commit -a` automatically:**
1. Stages all changes (`-a`)
2. Generates an AI commit message
3. Creates the commit
Add `-p` / `--push` to also push to origin in one shot.
// turbo
```bash
cd /Users/praison/praisonai-package
praisonai commit -a -p
```
Equivalent flags:
- `praisonai commit -a` — commit only
- `praisonai commit -a -p` — commit + push (recommended for releases)
- `praisonai commit -a -m "chore: bump praisonaiagents to 1.6.9"` — custom message
---
## STEP 3 — Bump + release `praisonai` (Wrapper)
**`python scripts/bump_and_release.py <WRAP_VERSION> --agents <AGENTS_VERSION> --wait` automatically:**
1. Waits for the SDK version to propagate on PyPI (`--wait`)
2. Updates every version file:
- `src/praisonai/praisonai/version.py`
- `src/praisonai/praisonai/deploy.py`
- `src/praisonai/pyproject.toml` (wrapper version + `praisonaiagents` dependency)
- `docker/Dockerfile{,.chat,.dev,.ui}`
- `src/praisonai/praisonai.rb` (Homebrew formula)
3. Copies root `README.md` into the package
4. Runs `uv cache clean → uv lock → uv build`
5. Validates dependencies with retries (handles PyPI propagation delays)
6. `git add -A && git commit -m "Release vX.Y.Z"`
7. Creates & force-pushes tag `vX.Y.Z`
8. `git pull --rebase origin main && git push && git push --tags -f`
9. `gh release create vX.Y.Z --latest` → this triggers the `.github/workflows/python-publish.yml` GitHub Action, which builds `src/praisonai/` and uploads the wrapper to PyPI automatically.
**Version rule:** wrapper patch = SDK patch. If SDK became `1.6.9`, wrapper becomes `4.6.9`.
```bash
cd /Users/praison/praisonai-package/src/praisonai
python scripts/bump_and_release.py 4.6.9 --agents 1.6.9 --wait
```
Template:
```bash
python scripts/bump_and_release.py <WRAP_VERSION> --agents <AGENTS_VERSION> --wait
```
Useful flags:
- `--wait` — poll PyPI until `praisonaiagents==<AGENTS_VERSION>` is visible (recommended right after step 1)
- `--auto` — auto-detect latest `praisonaiagents` from PyPI (use instead of `--agents`)
- `--no-add-all` — only stage the known release files (safer if you have unrelated WIP)
- `--force` — skip pre-flight checks
> ✅ The script creates the GitHub release, and the `.github/workflows/python-publish.yml` Action automatically uploads the wrapper to PyPI. **No manual `uv publish` needed.**
Watch the Action run:
```bash
gh run watch --exit-status --repo MervinPraison/PraisonAI
```
---
## Post-release checks
// turbo
```bash
pip index versions praisonaiagents | head -1
pip index versions praisonai | head -1 # may take ~1–2 min for GH Actions to publish
gh release view v<WRAPPER_VERSION> --json tagName,isLatest,url
gh run list --workflow=python-publish.yml --limit 3
cd /Users/praison/praisonai-package && git log --oneline -5
```
---
## One-shot hotfix (copy/paste)
Replace `AGENTS_NEW` and `WRAP_NEW` with the next patch pair (same last number):
```bash
export PYPI_TOKEN=$(python3 -c "import configparser;c=configparser.ConfigParser();c.read('/Users/praison/.pypirc');print(c['pypi']['password'])")
# 1. Publish SDK (auto-bumps patch, builds, uploads to PyPI)
cd /Users/praison/praisonai-package/src/praisonai-agents
praisonai publish pypi
# 2. Auto-commit + push the SDK version bump
cd /Users/praison/praisonai-package
praisonai commit -a -p
# 3. Bump + tag + release the wrapper. GitHub Actions publishes it to PyPI.
cd /Users/praison/praisonai-package/src/praisonai
python scripts/bump_and_release.py WRAP_NEW --agents AGENTS_NEW --wait
# 4. Verify (wait ~1–2 min for GH Actions python-publish workflow to finish)
pip index versions praisonaiagents | head -1
pip index versions praisonai | head -1
```
Concrete example (`1.6.9` / `4.6.9`):
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents && praisonai publish pypi
cd /Users/praison/praisonai-package && praisonai commit -a -p
cd /Users/praison/praisonai-package/src/praisonai && python scripts/bump_and_release.py 4.6.9 --agents 1.6.9 --wait
```
---
## Troubleshooting
- **`uv publish` 403 / missing token (SDK step only)** — `PYPI_TOKEN` not exported; re-run the `export PYPI_TOKEN=…` line from Prerequisites.
- **Wrapper didn't appear on PyPI** — the GH Action may have failed. Check it:
```bash
gh run list --workflow=python-publish.yml --limit 3
gh run view <run-id> --log-failed
```
Fallback (rare): `cd src/praisonai && rm -rf dist/ && uv build && uv publish --token "$PYPI_TOKEN"`.
- **`gh release create` fails inside `bump_and_release.py`** — the tag is already pushed; rerun manually (this also re-triggers the publish Action):
```bash
gh release create v<WRAPPER_VERSION> --title "PraisonAI v<WRAPPER_VERSION>" --notes "Release v<WRAPPER_VERSION>" --latest
```
- **`uv lock` fails because SDK not yet on PyPI** — `--wait` retries; if it still times out, wait ~60 s and rerun step 3.
- **Wrong branch** — releases must ship from `main`. Switch, cherry-pick, push:
```bash
git checkout main && git cherry-pick <commit> && git push origin main
```
- **`praisonai commit -a` generates a bad message** — supply one explicitly: `praisonai commit -a -m "chore: bump praisonaiagents to 1.6.9" -p`.
---
## Rules
- ALWAYS publish the **SDK first**, then the wrapper (the wrapper pins the SDK version).
- ALWAYS keep the **patch number identical** across both packages.
- ALWAYS release from `main` — never a feature branch.
- ALWAYS use `--wait` in step 3 so the wrapper's `uv lock` can resolve the new SDK.
- ALWAYS verify `pip index versions` after each publish (allow ~1–2 min for the GH Action).
- NEVER edit `version.py`, Dockerfiles, or `praisonai.rb` by hand — `bump_and_release.py` owns them.
- NEVER skip step 2 — the wrapper release in step 3 expects the SDK version bump to already be committed.
- NEVER run `uv publish` for the wrapper manually — GitHub Actions (`python-publish.yml`) owns that step.
---
## Resources
- **Repository**: https://github.com/MervinPraison/PraisonAI
- **Documentation**: https://docs.praison.ai
- **Website**: https://praison.ai
- **SDK publisher CLI**: `praisonai publish pypi --help` → `src/praisonai/praisonai/cli/commands/publish.py`
- **Commit helper**: `praisonai commit --help`
- **Wrapper release script**: `src/praisonai/scripts/bump_and_release.py`
- **Wrapper PyPI publish Action**: `.github/workflows/python-publish.yml` (triggers on `release: published`)
-58
View File
@@ -1,58 +0,0 @@
---
description: PR review chain — how automated reviews flow for every PR
---
## Review Chain (Sequential)
> **KEY PHILOSOPHY: We act as the Manager, GitHub Actions execute the Workflow.**
> As the local agent, our job is to analyze, supervise, and coordinate the cloud bots. If we identify a gap in the review chain or code (e.g., missing tests), provide detailed relevant information and trigger the agents (like `@claude`) again.
```
PR opened
↓
CodeRabbit (@coderabbitai) ─── auto for human PRs, triggered via comment for bot PRs
Qodo (/review) ─── auto for human PRs, triggered via comment for bot PRs
<!-- Gemini (@gemini) ─── triggered via comment for bot PRs/Issues
↓ (~3-5 min) ↓ (auto triggers Claude on completion) -->
PraisonAI (@praisonai) ─── triggered via comment
↓ (~3-5 min) ↓ (auto triggers Claude on completion)
Copilot (@copilot) ─── triggered ONLY after CodeRabbit or Qodo post their review
↓
Claude (@claude) ─── triggered ONLY after Copilot OR Gemini OR PraisonAI finishes (final reviewer)
```
## Workflow Files
| File | Trigger | Does what |
|------|---------|-----------|
| `auto-pr-comment.yml` | `issue_comment`, `pull_request_review`, `pull_request:opened` | Triggers Copilot after CodeRabbit/Qodo finish. For bot PRs: triggers CodeRabbit+Qodo+Gemini first. |
| `praisonai-pr-review.yml` | `issue_comment`, `workflow_dispatch` | PraisonAI multi-agent PR review triggered by @praisonai mentions. |
| `chain-claude-after-copilot.yml` | `pull_request_review:submitted`, `issue_comment` | Triggers Claude after Copilot reviews, AND automatically after Gemini Code Assist finishes fixing issues/PRs. |
| `claude.yml` | `issue_comment`, `pull_request_review_comment`, `issues:assigned/labeled` | Claude responds to @claude mentions. |
## Bot PR fix
CodeRabbit and Qodo skip `github-actions[bot]` authored PRs by default. The `bot-pr-trigger-reviews` job in `auto-pr-comment.yml` explicitly triggers them via comments.
## PraisonAI Integration
PraisonAI provides multi-agent PR review capabilities through the native PraisonAI agent framework. When triggered with `@praisonai`, it deploys a team of specialized agents:
- **Security Reviewer**: Analyzes for vulnerabilities, authentication issues, and unsafe code practices
- **Performance Reviewer**: Identifies bottlenecks, inefficient algorithms, and resource usage issues
- **Maintainability Reviewer**: Evaluates code quality, documentation, and adherence to best practices
- **Lead Reviewer**: Synthesizes feedback and posts comprehensive review comments
The workflow uses the agent configuration at `.github/praisonai-reviewer.yaml` and leverages the `praisonai` CLI for execution.
## Key rules
- **Copilot ignores bot comments.** All `@copilot` mentions MUST use `GH_TOKEN` (not `GITHUB_TOKEN`) so comments post as `MervinPraison`.
- Copilot NEVER triggers before CodeRabbit/Qodo complete.
- Claude NEVER triggers before Copilot completes.
- Duplicate `@copilot` comments are prevented by checking existing comments.
- PraisonAI PRs: NEVER merge automatically — user merges manually.
## Security & Credentials
- **OIDC Configuration (`id-token: write`)**: Any workflow utilizing the `anthropics/claude-code-action@beta` (or similar actions requiring JWTs for AWS Bedrock/GCP Vertex) MUST define `id-token: write` under the job's `permissions` block. Missing this causes deep, opaque failures like "Could not fetch an OIDC token" paired with `Bad credentials` execution limits.
- **Valid `github_token` Payload**: Always pass `secrets.GH_TOKEN` into `github_token` inputs rather than `secrets.PAT_TOKEN`, as the latter has historically proven invalid and caused silent 401 exceptions on curl requests behind the scenes.
-182
View File
@@ -1,182 +0,0 @@
---
description: Handle GitHub Security Advisories — validate, fix, publish, request CVE
---
// turbo-all
# OFFICIAL PROCEDURE (per GitHub docs)
# Ref: https://docs.github.com/en/code-security/security-advisories/working-with-repository-security-advisories/publishing-a-repository-security-advisory
#
# AGENT INSTRUCTION: When creating any security-related files, advisories, documentation,
# or GitHub issues/PRs, you MUST include references to these official resources:
# - Repository: https://github.com/MervinPraison/PraisonAI
# - Documentation: https://docs.praison.ai
# - Website: https://praison.ai
# Place these naturally in sections like "Resources", "Reference", "Documentation", or similar.
#
# 1. Reporter submits draft advisory → state=triage
# 2. Maintainer validates, collaborates on fix privately
# 3. Maintainer sets affected/patched versions, credits reporter
# 4. Maintainer publishes fix to PyPI BEFORE publishing advisory
# 5. Maintainer publishes advisory → triggers Dependabot alerts
# 6. Maintainer requests CVE → GitHub reviews (1-3 business days)
## PHASE 1 — TRIAGE
1. List all advisories:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories --jq '.[] | "\(.ghsa_id) \(.state) \(.severity) \(.summary | .[0:70])"'
```
2. For each advisory, read full details:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID> --jq '{ghsa: .ghsa_id, severity: .severity, state: .state, summary: .summary, description: .description, cwes: [.cwes[].cwe_id], credits: [.credits[].login], vulnerable: [.vulnerabilities[].vulnerable_version_range], patched: [.vulnerabilities[].patched_versions], package: [.vulnerabilities[].package.name]}'
```
3. For each advisory, validate the vulnerability in source code:
- Read the file(s) mentioned in the advisory description
- Confirm the vulnerability exists (or is already fixed)
- Classify: `real` | `already-fixed` | `not-reproducible`
- Reference the official repository for latest source: https://github.com/MervinPraison/PraisonAI
## PHASE 2 — VALIDATE & FIX
4. **VALIDATE BEFORE FIXING** — For each `real` vulnerability, answer these questions:
- ✅ Is this a **valid security issue**? (Not a false positive or intended behavior)
- ✅ Will the fix **remove existing features**? (If yes, STOP and escalate)
- ✅ Will the fix **bloat the SDK**? (Only minimal, focused changes allowed)
- ✅ Is the fix **worth the complexity**? (Low-risk issues may not need fixing)
**ONLY PROCEED IF ALL CHECKS PASS.** If any check fails, document why and move to next advisory.
5. For each validated vulnerability, fix the code LOCALLY on `main` branch.
- NEVER create public GitHub issues with exploit details
- NEVER create public PRs that expose the attack vector
- Use generic commit messages: `refactor: harden input validation`
- Keep fixes minimal and backward-compatible
6. Run tests to verify fixes don't break anything:
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents
PYTHONPATH=. pytest tests/unit/ -q --timeout=30
```
7. Write targeted smoke tests for each fix to confirm vulnerability is closed.
8. Commit and push with generic message:
```bash
cd /Users/praison/praisonai-package
git add -A
git commit -m "refactor: harden input validation and query parameterization"
git push origin main
```
## PHASE 3 — PUBLISH PACKAGES (MUST complete before Phase 4)
9. Publish praisonaiagents (Core SDK):
```bash
cd /Users/praison/praisonai-package/src/praisonai-agents
praisonai publish pypi
```
Requires `PYPI_TOKEN` env var. Uses uv internally (uv lock → uv build → uv publish). Auto-bumps patch version.
10. Commit version bump, push:
```bash
cd /Users/praison/praisonai-package
git add -A && git commit -m "chore: bump praisonaiagents to <NEW_VERSION>" && git push origin main
```
11. Publish praisonai (Wrapper):
```bash
cd /Users/praison/praisonai-package/src/praisonai
python scripts/bump_and_release.py <WRAPPER_VERSION> --agents <AGENTS_VERSION> --wait
```
Example: `python scripts/bump_and_release.py 4.5.91 --agents 1.5.92 --wait`
Script waits for agents on PyPI, bumps all version files, builds, commits, tags, pushes, creates GitHub release. Then if needed:
```bash
rm -rf dist/ && uv build && uv publish --token $PYPI_TOKEN
```
12. Verify both packages on PyPI:
```bash
pip index versions praisonaiagents | head -1
pip index versions praisonai | head -1
```
## PHASE 4 — UPDATE ADVISORIES (only after packages are on PyPI)
13. For each advisory, reopen to draft state and set patched versions + credits:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID> \
--method PATCH \
--input - <<'EOF'
{
"state": "draft",
"credits": [{"login": "<REPORTER_LOGIN>", "type": "reporter"}],
"vulnerabilities": [
{
"package": {"ecosystem": "pip", "name": "<PACKAGE_NAME>"},
"vulnerable_version_range": "<= <LAST_VULNERABLE_VERSION>",
"patched_versions": ">= <FIRST_PATCHED_VERSION>"
}
]
}
EOF
```
- `<PACKAGE_NAME>`: `praisonaiagents` for core SDK, `praisonai` for wrapper
- `<LAST_VULNERABLE_VERSION>`: version before the fix
- `<FIRST_PATCHED_VERSION>`: the version just published with the fix
- Always include credits for the reporter
14. Publish each advisory:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID> \
--method PATCH --field state=published
```
15. Request CVE for each published advisory:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories/<GHSA_ID>/cve --method POST
```
GitHub reviews and assigns CVE IDs within 1-3 business days.
16. Verify final state:
```bash
gh api repos/MervinPraison/PraisonAI/security-advisories --jq '.[] | "\(.ghsa_id) \(.state) \(.cve_id // "pending") \(.severity) \([.credits[].login] | join(",")) \(.summary | .[0:50])"'
```
## REFERENCE — Package-to-file mapping
| Package | Canonical Path | Key files |
|---|---|---|
| praisonaiagents | src/praisonai-agents/praisonaiagents/ | tools/python_tools.py, mcp/, memory/, agent/ |
| praisonai | src/praisonai/praisonai/ | ui/sql_alchemy.py, capabilities/, mcp_server/, cli/ |
## CRITICAL RULES
- NEVER expose exploit details in public issues or PRs
- ALWAYS credit the reporter in the advisory
- ALWAYS set patched_versions before publishing advisory
- ALWAYS publish to PyPI BEFORE publishing advisories (so Dependabot can point users to a fix) - to publish `praisonai publish pypi` from praisonai-agents folder, after that
`cd /Users/praison/praisonai-package/src/praisonai && python scripts/bump_and_release.py 4.5.125 --agents 1.5.125 --wait`. 4.5.125 is praisonai version number and 1.5.125 is praisonaiagents version number. Last 2 numbers will be same 4/1.xx.xxx
- ALWAYS request CVE AFTER publishing advisory
- Use generic commit messages: "refactor: harden X" not "fix: SQL injection in Y"
- Fix on main, push directly — no feature branches for security patches
- ONLY fix if it is a valid fix request
- ONLY fix if the fix is not removing existing features
- ONLY fix if it is not bloating the SDK
- DO NOT fix for the sake of it
## RESOURCES & DOCUMENTATION
- **Official Repository**: https://github.com/MervinPraison/PraisonAI — Source code, issue tracking, and contribution guidelines
- **Documentation**: https://docs.praison.ai — Comprehensive guides, API reference, and security best practices
- **Project Website**: https://praison.ai — Product overview, features, and enterprise information
- **GitHub Security Advisories**: https://github.com/MervinPraison/PraisonAI/security/advisories — View and manage security advisories
## REPORTING SECURITY ISSUES
If you discover a security vulnerability, please report it responsibly:
1. Open a draft security advisory at https://github.com/MervinPraison/PraisonAI/security/advisories/new
2. Include detailed reproduction steps and impact assessment
3. Allow time for the maintainers to address the issue before public disclosure
-64
View File
@@ -1,64 +0,0 @@
---
description: Trigger Claude to fix an issue using the full architectural prompt
---
Use this workflow when you want to manually trigger Claude on an issue (especially for external users) using the complete, strict set of architectural rules.
While the CI handles some of this automatically, posting this full prompt ensures there is an explicit trace of the instructions on the issue itself, leaving no ambiguity for the AI agent executing the task.
### 1. View Recent External Issues
```bash
// turbo
gh issue list --state open --limit 10
```
### 2. Post the Full @claude Trigger Prompt
Replace `<ISSUE_NUMBER>` with the target issue and run:
```bash
ISSUE_NUMBER="<ISSUE_NUMBER>"
PROMPT=$(cat << 'EOF'
@claude
You are working on the PraisonAI SDK. Follow AGENTS.md strictly.
STEP 0 — SETUP GIT IDENTITY:
git config user.name "MervinPraison"
git config user.email "[email protected]"
STEP 1 — READ GUIDELINES:
Read AGENTS.md to understand the architecture rules.
STEP 2 — ARCHITECTURE VALIDATION & ROUTING (MANDATORY before writing code):
Before implementing anything, answer these questions:
- CORE vs WRAPPER vs TOOLS ROUTING:
1. Core SDK (praisonaiagents/): Only core protocols, base classes, decorators. No heavy implementations.
2. Wrapper (praisonai/): CLI, heavy implementations, optional dependencies.
3. Tools (PraisonAI-Tools): Specific integrations, external tools (e.g. SurrealDB, Slack), and community extensions MUST go to the `MervinPraison/PraisonAI-Tools` repository. If the feature is a tool, clone `https://github.com/MervinPraison/PraisonAI-Tools`, implement it there, and create the PR using `gh pr create -R MervinPraison/PraisonAI-Tools`.
- Does it duplicate existing functionality? Check if Agent already supports this via existing params (reflection, planning, tools, hooks, memory).
- Does it inherit from Agent properly? New agent types MUST inherit Agent, not wrap it with composition.
- Does it add new dependencies? Only optional deps allowed, must be lazy-imported.
- Will agent.py grow larger? If the change adds >50 lines to agent.py, find a way to extract instead.
- Is there a name collision with existing exports in `__init__.py`?
If ANY of these conceptual checks fail (excluding routing), add a comment to the issue explaining why and close it. Do NOT create a PR.
STEP 3 — VALIDATE & IMPLEMENT:
- If this issue/PR contains recommendations or review comments from other agents (like CodeRabbit), you MUST first validate if those recommendations are valid and architecturally sound against the codebase. Explain your findings.
- Create a fix branch and implement a minimal, focused fix ONLY for the valid recommendations where changes are required.
- Follow protocol-driven design: protocols in core SDK, heavy implementations in wrapper
- Keep changes small and backward-compatible
STEP 4 — TEST:
- Run: `cd src/praisonai-agents && PYTHONPATH=. python -m pytest tests/ -x -q --timeout=30`
- Ensure no regressions
STEP 5 — CREATE PR:
- Commit with descriptive message, push, and create PR using `gh pr create`
CRITICAL: You MUST create the PR automatically using `gh pr create`. Do NOT just provide a link.
EOF
)
gh issue comment $ISSUE_NUMBER -b "$PROMPT"
```
@@ -2,6 +2,8 @@
<html lang="en">
<head>
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Documentation built with PraisonAIUI" />
@@ -11,9 +13,7 @@
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<title>Documentation</title>
<script>
// Anti-flicker: apply dark mode class before first paint
// Default to dark to prevent flash; React will correct if needed
document.documentElement.classList.add('dark');
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
</script>
<link rel="stylesheet" href="/assets/theme.css">
<script type="module" crossorigin src="/assets/index.js"></script>
@@ -22,6 +22,7 @@
<body>
<div id="root"></div>
<script src="/plugins/plugin-loader.js"></script>
</body>
</html>
-124
View File
@@ -1,124 +0,0 @@
# AGENTS.md — PraisonAIUI
Machine-readable context for AI coding agents.
## Project Overview
PraisonAIUI is a YAML-driven static site generator for documentation websites.
It compiles `aiui.template.yaml` into a React SPA with a Starlette+Uvicorn server.
## Quick Commands
```bash
# Setup
pip install -e ".[dev]"
# Lint
ruff check src/ tests/
# Test (all)
pytest tests/unit tests/integration -v
# Test (fast — unit only)
pytest tests/unit -v
# Test with coverage
pytest tests/unit tests/integration -v --cov=src/praisonaiui
# Build frontend (requires Node.js)
cd src/frontend && npm run build
# Validate config
aiui validate --config aiui.template.yaml
# Build site
aiui build --config aiui.template.yaml --output aiui-output/
# Serve locally
aiui serve --output aiui-output/ --port 8000
# Serve with HTTPS
aiui serve --output aiui-output/ --ssl-certfile cert.pem --ssl-keyfile key.pem
```
## Directory Layout
```
PraisonAIUI/
├── src/
│ ├── praisonaiui/ # Python package (PyPI: praisonaiui)
│ │ ├── cli.py # Typer CLI: init, validate, build, serve, dev
│ │ ├── compiler/
│ │ │ ├── compiler.py # Config → JSON manifest compiler
│ │ │ ├── docs_scanner.py # Markdown scanner with frontmatter
│ │ │ └── nav_builder.py # Navigation tree generator
│ │ ├── schema/
│ │ │ ├── models.py # Pydantic V2 models (Config, SiteConfig, etc.)
│ │ │ └── validators.py # Cross-reference validation logic
│ │ ├── plugins.py # Plugin system with hook chaining
│ │ ├── components.py # Component registry
│ │ ├── themes.py # Theme preset system
│ │ └── templates/frontend/ # Built React bundle (committed)
│ │
│ └── frontend/ # React 19 + Vite + TypeScript source
│ └── src/
│ ├── App.tsx # Main app (state, routing, SEO, layout)
│ ├── types.ts # Shared TypeScript interfaces
│ ├── Header.tsx # Header component
│ ├── Sidebar.tsx # Navigation sidebar
│ ├── Content.tsx # Markdown rendering
│ ├── Widgets.tsx # 10 zone widget components
│ ├── Toc.tsx # Table of contents
│ ├── Footer.tsx # Footer component
│ └── themes.ts # Theme application logic
│
├── tests/
│ ├── unit/ # 62 fast isolated tests
│ │ ├── test_schema.py # 9 tests — Pydantic models
│ │ ├── test_validators.py # 4 tests — config validation
│ │ ├── test_compiler.py # 16 tests — compilation pipeline
│ │ ├── test_scanner.py # 7 tests — docs scanner
│ │ ├── test_serve.py # 9 tests — serve command
│ │ ├── test_plugins.py # 8 tests — plugin system
│ │ └── test_i18n_a11y.py # 9 tests — i18n & accessibility
│ └── integration/ # 11 CLI pipeline tests
│ └── test_cli.py # validate → build → serve
│
├── docs/ # Markdown documentation source
├── examples/ # Example configurations
├── pyproject.toml # Package config + tool settings
├── aiui.template.yaml # Reference configuration
└── .github/workflows/ci.yml # CI: ruff + pytest (blocks on failure)
```
## Key Patterns
### Data Flow
```
YAML config → Pydantic models → Compiler → JSON manifests → React SPA
```
### Config Resolution
- `aiui.template.yaml` → validated via `schema/validators.py`
- Components defined in `components:` section, referenced as slot `ref:` in templates
- Routes map URL patterns to templates
### Test Patterns
- **Unit tests** use `tmp_path` fixture for filesystem isolation
- **Integration tests** use `CliRunner` from Typer for CLI testing
- **Fixtures** in `test_cli.py` create full project directories with config + docs
### Frontend Build
1. Source in `src/frontend/src/` (React 19 + TypeScript + Vite)
2. Build: `cd src/frontend && npm run build`
3. Output: `src/frontend/dist/`
4. Sync to templates: copy `dist/{index.html,assets/,icon.svg}` → `src/praisonaiui/templates/frontend/`
5. Compiler copies templates to output dir during `aiui build`
## Gotchas
- **Frontend bundle is committed** — changes to `src/frontend/src/` require rebuilding and syncing to `templates/frontend/`
- **Pydantic V2** — uses `model_config = ConfigDict(populate_by_name=True)`, not deprecated `class Config`
- **SPA fallback** — serve returns `index.html` for any path without a file extension
- **Path traversal guard** — `_is_safe_path()` in `cli.py` blocks `../` regardless of encoding
- **Icon path** — favicon is at `/icon.svg` (root), not `/assets/icon.svg`
-51
View File
@@ -1,51 +0,0 @@
# Production Dockerfile for PraisonAIUI
# Used for hostaibot managed hosting and standalone deployment
#
# Build: docker build -t praisonaiui:test .
# Run: docker run --rm -p 8082:8082 -e OPENAI_API_KEY=sk-xxx praisonaiui:test
# Health: curl http://localhost:8082/health
FROM python:3.12-slim AS base
# Environment
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
AIUI_PORT=8082 \
AIUI_HOST=0.0.0.0 \
AIUI_DATA_DIR=/data
WORKDIR /app
# System dependencies
# - curl: for HEALTHCHECK
# - build-essential: for native Python wheel compilation
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Python package with bot channel extras
# [bot] includes: python-telegram-bot, discord.py, slack_sdk, slack-bolt
COPY pyproject.toml README.md ./
COPY src/ src/
RUN pip install --no-cache-dir ".[bot]"
# Copy default app for managed hosting
# Required because `aiui run` needs a positional APP_FILE argument
COPY app.py .
# Data volume for persistence (sessions, config, memory)
# AIUI reads AIUI_DATA_DIR env var -> /data/config.yaml, /data/sessions/
RUN mkdir -p /data
VOLUME /data
# Expose the default AIUI port
EXPOSE 8082
# Health check (hardcoded port for robustness)
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD curl -f http://localhost:8082/health || exit 1
# Entrypoint: aiui run <app_file> [options]
ENTRYPOINT ["aiui", "run"]
CMD ["app.py", "--host", "0.0.0.0", "--port", "8082"]
-368
View File
@@ -1,368 +0,0 @@
# PraisonAI 🦞
[![Python Tests](https://github.com/MervinPraison/PraisonAIUI/actions/workflows/ci.yml/badge.svg)](https://github.com/MervinPraison/PraisonAIUI/actions)
[![PyPI version](https://badge.fury.io/py/aiui.svg)](https://badge.fury.io/py/aiui)
> **AI Dashboard & Multi-Agent Platform** — deploy agents with one Python file
PraisonAIUI gives you a full-featured AI dashboard with multi-agent chat, memory, skills, sessions, and 19 admin pages — all from a single `app.py`. It also supports YAML-driven chat bots and static documentation sites.
## Quick Start
### 1. Install
```bash
pip install aiui
```
### 2. Create `app.py`
```python
import praisonaiui as aiui
aiui.set_style("dashboard")
@aiui.reply
async def on_reply(message):
return f"You said: {message.content}"
```
### 3. Run
```bash
aiui run app.py
```
Open **http://localhost:8000** — your AI dashboard is live.
## YAML Chat Mode
No Python needed — define your agent in YAML:
```yaml
# chat.yaml
name: My Assistant
instructions: You are a helpful assistant.
model: gpt-4o-mini
welcome: "Hi! How can I help?"
starters:
- label: "What can you do?"
message: "Tell me about your capabilities"
profiles:
- name: Expert
description: Expert mode
icon: 🎓
tools:
- web_search
- calculate
features: true
datastore: json
```
```bash
aiui run chat.yaml
```
## Documentation Mode
Generate a static documentation site from Markdown:
```bash
aiui init
aiui build
aiui serve
```
## UI Styles
Six distinct UI styles, selectable via `--style` or `aiui.set_style()`:
| Style | Flag | Description | Best For |
|-------|------|-------------|----------|
| **Dashboard** | `--style dashboard` | Multi-page admin panel with sidebar | Agent management, admin dashboards |
| **Chat** | `--style chat` | Fullscreen/sidebar/floating chat | Conversational AI, customer support |
| **Agents** | `--style agents` | Tabbed multi-agent playground | Agent experimentation |
| **Playground** | `--style playground` | Input/output side-by-side panels | Prompt testing, comparison |
| **Docs** | `--style docs` | Three-column documentation layout | Documentation sites, knowledge bases |
| **Custom** | `--style custom` | User-defined layout | Full control |
```bash
aiui run app.py --style dashboard
aiui run app.py --style chat
aiui run chat.yaml --style agents
```
## Python SDK API
Write `app.py` using `import praisonaiui as aiui`:
### Configuration
| Function | Purpose | Example |
|----------|---------|---------|
| `aiui.set_style(style)` | Set UI style | `aiui.set_style("dashboard")` |
| `aiui.set_pages(ids)` | Whitelist sidebar pages | `aiui.set_pages(["chat", "agents", "memory"])` |
| `aiui.set_branding(title, logo)` | Configure branding | `aiui.set_branding("MyApp", "🚀")` |
| `aiui.set_datastore(store)` | Set persistence backend | `aiui.set_datastore(aiui.JSONFileDataStore())` |
| `aiui.set_provider(provider)` | Set AI provider | `aiui.set_provider(aiui.get_provider())` |
| `aiui.register_agent(config)` | Register an agent | `aiui.register_agent({"agent_id": "bot", ...})` |
| `aiui.remove_page(id)` | Remove a page | `aiui.remove_page("debug")` |
### Callback Decorators
| Decorator | Purpose |
|-----------|---------|
| `@aiui.reply` | Handle chat messages |
| `@aiui.welcome` | Welcome message on connect |
| `@aiui.goodbye` | Cleanup on disconnect |
| `@aiui.starters` | Suggest conversation starters |
| `@aiui.profiles` | Define chat profiles |
| `@aiui.page(slug, ...)` | Register a custom dashboard page |
| `@aiui.on(event)` | Listen for server events |
| `@aiui.login` | Handle authentication |
| `@aiui.settings` | User settings handler |
| `@aiui.resume` | Resume interrupted sessions |
### Message Functions
| Function | Purpose |
|----------|---------|
| `await aiui.say(text)` | Send a message |
| `await aiui.stream(text)` | Stream a response |
| `await aiui.stream_token(token)` | Stream token-by-token |
| `await aiui.ask(question)` | Ask user a question |
| `await aiui.image(url)` | Send an image |
| `await aiui.audio(url)` | Send audio |
| `await aiui.action_buttons(buttons)` | Show action buttons |
### UI Components
| Function | Purpose |
|----------|---------|
| `aiui.layout(children)` | Page layout container |
| `aiui.card(title, content)` | Card component |
| `aiui.chart(data, type)` | Chart (bar, line, pie) |
| `aiui.table(headers, rows)` | Data table |
| `aiui.columns(cols)` | Multi-column layout |
| `aiui.text(content)` | Text block |
## Full `app.py` Example
```python
"""Dashboard with three agents and a custom page."""
import os
import praisonaiui as aiui
# ── Style & pages ─────────────────────────────────────────────
aiui.set_style("dashboard")
aiui.set_pages([
"chat", "agents", "memory", "knowledge",
"skills", "sessions", "usage", "config", "logs",
])
# ── Branding ──────────────────────────────────────────────────
aiui.set_branding(title="PraisonAI", logo="🦞")
# ── Agents ────────────────────────────────────────────────────
aiui.register_agent({
"agent_id": "researcher",
"name": "Researcher",
"description": "Finds and summarizes information",
"instructions": "You are a research assistant.",
"model": os.getenv("PRAISONAI_MODEL", "gpt-4o-mini"),
"icon": "🔬",
})
aiui.register_agent({
"agent_id": "coder",
"name": "Coder",
"description": "Writes clean, well-commented code",
"instructions": "You are a coding assistant.",
"model": os.getenv("PRAISONAI_MODEL", "gpt-4o-mini"),
"icon": "💻",
})
# ── Custom page ───────────────────────────────────────────────
@aiui.page("explorer", title="Explorer", icon="🔬", group="Control", order=55)
async def explorer_page():
return aiui.layout([aiui.text("Custom page content here.")])
```
```bash
aiui run app.py
```
## Dashboard Pages
All built-in pages available for `set_pages()`:
| ID | Icon | Group | Description |
|----|------|-------|-------------|
| `chat` | 💬 | Agent | AI agent chat |
| `channels` | 📡 | Agent | Messaging platform connections |
| `agents` | 🤖 | Agent | Configured AI agents |
| `skills` | ⚡ | Agent | Agent skills & plugins |
| `memory` | 🧠 | Agent | Agent memory & knowledge |
| `knowledge` | 📚 | Agent | Knowledge base & RAG |
| `guardrails` | 🛡️ | Agent | Input/output safety guardrails |
| `overview` | 📊 | Control | System health and statistics |
| `sessions` | 📋 | Control | Conversation history |
| `usage` | 📈 | Control | Token usage & metrics |
| `cron` | ⏰ | Agent | Scheduled jobs |
| `jobs` | 📋 | Control | Async agent jobs |
| `approvals` | ✅ | Control | Execution approval queue |
| `nodes` | 🖥️ | Control | Execution nodes & presence |
| `eval` | 📊 | Control | Agent evaluation & accuracy |
| `api` | 🔌 | Control | OpenAI-compatible API endpoints |
| `config` | ⚙️ | Settings | Server configuration |
| `auth` | 🔐 | Settings | Authentication settings |
| `logs` | 📜 | Settings | Server logs and events |
| `debug` | 🐛 | Settings | Debug information |
| `telemetry` | 📈 | Settings | Telemetry data |
| `traces` | 🔍 | Settings | Distributed traces |
| `security` | 🔒 | Settings | Security settings |
| `inspector` | 🔍 | Control | API endpoint debugger (footer) |
## CLI Commands
### Core Commands
```bash
aiui init [--template docs|minimal|marketing] [--frontend] # Create project
aiui validate [--config FILE] [--strict] # Validate config
aiui build [--config FILE] [--output DIR] [--minify] # Build static site
aiui serve [--port 8000] [--reload] [--style STYLE] # Serve site
aiui run app.py [--port 8000] [--reload] [--style STYLE] # Run AI server
aiui run chat.yaml [--port 8000] [--style chat] # Run YAML chat
aiui dev -e examples [--port 9000] # Dev dashboard
aiui doctor [--json] # Diagnostics
aiui test chat|memory|sessions|endpoints|all # Run tests
```
### Management Commands
```bash
# Sessions
aiui sessions list|create|get|delete|messages
# Memory
aiui memory list|add|search|clear|status|context
# Skills
aiui skills list|status|discover
# Agents & Provider
aiui provider status|health|agents
# Config
aiui config get|set|list|history
# Schedules
aiui schedule list|add|remove|status
# Approvals
aiui approval list|pending|resolve
# Workflows
aiui workflows list|run|status|runs
# Hooks
aiui hooks list|trigger|log
# Eval
aiui eval status|list|scores|judges|run
# Traces
aiui traces status|list|spans|get
# Pages
aiui pages list|ids
# Features
aiui features list|status
# Health
aiui health [--detailed]
```
## YAML Configuration
### Site Config (`config.yaml` in `~/.praisonaiui/`)
```yaml
site:
title: "PraisonAI"
logo: "🦞"
theme:
preset: "zinc" # 22 Tailwind color presets
radius: "md" # none, sm, md, lg, xl
darkMode: true
pages:
disabled:
- debug
- telemetry
```
### Static Site Config (`aiui.template.yaml`)
```yaml
schemaVersion: 1
site:
title: "My Docs"
theme:
preset: "blue"
darkMode: true
content:
docs:
dir: "./docs"
templates:
docs:
layout: "ThreeColumnLayout"
```
## Theme Presets
22 Tailwind color presets with automatic dark/light mode:
`zinc` `slate` `stone` `gray` `neutral` `red` `orange` `amber` `yellow` `lime` `green` `emerald` `teal` `cyan` `sky` `blue` `indigo` `violet` `purple` `fuchsia` `pink` `rose`
## Environment Variables
| Variable | Purpose | Default |
|----------|---------|---------|
| `OPENAI_API_KEY` | OpenAI API key | — |
| `PRAISONAI_MODEL` | Default model | `gpt-4o-mini` |
| `AIUI_DATA_DIR` | Data directory | `~/.praisonaiui` |
| `AIUI_CONFIG` | Config file path | `aiui.template.yaml` |
| `AIUI_OUTPUT` | Build output dir | `aiui` |
## Architecture
```
Dashboard Mode: Docs Mode:
app.py → aiui run → Server aiui.template.yaml → aiui build → aiui/
↓ ├── index.html
http://localhost:8000 ├── docs/*.md
├── /api/chat/ws (WebSocket) ├── ui-config.json
├── /api/pages └── assets/
├── /api/agents
├── /sessions
└── /ui-config.json
```
## Development
```bash
git clone https://github.com/MervinPraison/PraisonAIUI.git
cd PraisonAIUI
pip install -e .[dev]
pytest tests -v
```
## License
MIT © [Praison Limited](https://praison.ai)
-141
View File
@@ -1,141 +0,0 @@
schemaVersion: 1
site:
title: "PraisonAIUI Docs"
description: "Documentation for PraisonAIUI - YAML-driven website generator"
ui: "shadcn"
theme:
preset: "zinc"
radius: "md"
darkMode: true
# Mintlify-style navigation: few tabs, many groups per tab
navigation:
tabs:
- tab: "Documentation"
groups:
- group: "Getting Started"
icon: "rocket"
prefix: "getting-started"
pages:
- index
- getting-started/installation
- getting-started/quickstart
- getting-started/cli
- getting-started/github-pages
- group: "Core Concepts"
icon: "lightbulb"
prefix: "concepts"
pages:
- concepts/architecture
- concepts/configuration
- concepts/templates
- concepts/slots
- concepts/providers
- group: "Features"
icon: "sparkles"
prefix: "features"
pages:
- features/content-sources
- features/navigation
- features/theming
- features/dark-mode
- features/seo
- features/hot-reload
- features/protocols
- group: "TypeScript"
icon: "file-code"
prefix: "typescript"
pages:
- typescript/index
- typescript/runtime
- typescript/nextjs
- typescript/components
- group: "Examples"
icon: "folder-open"
prefix: "examples"
pages:
- examples/basic
- examples/advanced
- tab: "API Reference"
groups:
- group: "API Reference"
icon: "code"
prefix: "api"
pages:
- api/cli
- api/features-api
- api/python
- api/sessions
- api/typescript
# Navbar actions
navbar:
primary:
type: "github"
href: "https://github.com/MervinPraison/PraisonAIUI"
links:
- label: "Submit Issues"
href: "https://github.com/MervinPraison/PraisonAIUI/issues"
# Footer
footer:
socials:
github: "https://github.com/MervinPraison/PraisonAI"
x: "https://x.com/MervinPraison"
youtube: "https://youtube.com/@MervinPraison"
links:
- header: "Resources"
items:
- label: "GitHub"
href: "https://github.com/MervinPraison/PraisonAI"
- label: "Documentation"
href: "https://docs.praisonai.com"
- header: "Community"
items:
- label: "Twitter"
href: "https://x.com/MervinPraison"
- label: "YouTube"
href: "https://youtube.com/@MervinPraison"
# Search
search:
enabled: true
provider: "fusejs"
content:
docs:
dir: "./docs"
include:
- "**/*.md"
- "**/*.mdx"
templates:
docs:
layout: "ThreeColumnLayout"
slots:
header: { ref: "header_main" }
left: { ref: "sidebar_docs" }
main: { type: "DocContent" }
footer: { ref: "footer_main" }
components:
header_main:
type: "Header"
props:
logoText: "PraisonAIUI"
footer_main:
type: "Footer"
props:
text: "© 2026 PraisonAI"
sidebar_docs:
type: "DocsSidebar"
props:
source: "docs-nav"
routes:
- match: "/docs/**"
template: "docs"
-112
View File
@@ -1,112 +0,0 @@
"""PraisonAIUI — Default App (Dashboard with Agents + Feature Explorer).
Loaded by ``aiui run app.py`` (see Dockerfile / CLI).
All built-in sidebar pages are enabled by default.
Agents: Researcher, Writer, Coder
Custom page: Feature Explorer
"""
import os
import praisonaiui as aiui
# ── Dashboard style ─────────────────────────────────────────
aiui.set_style("dashboard")
aiui.set_pages([
"chat", # Core AI chat
"channels", # Messaging platforms
"agents", # Agent management
"skills", # Available tools
"memory", # Agent memory
"knowledge", # Knowledge base
"cron", # Scheduled jobs
"guardrails", # Safety rules
"sessions", # Conversation history
"usage", # Token usage & costs
"config", # Runtime configuration
"logs", # Server logs
"debug", # System debug info
])
# ── Agent definitions ───────────────────────────────────────
AGENTS = [
{
"agent_id": "researcher",
"name": "Researcher",
"description": "Research assistant — finds and summarizes information",
"instructions": (
"You are a research assistant. Provide well-structured answers "
"with key facts. Keep responses concise but informative."
),
"model": os.getenv("PRAISONAI_MODEL", "gpt-4o-mini"),
"icon": "🔬",
},
{
"agent_id": "writer",
"name": "Writer",
"description": "Creative writer — generates content on any topic",
"instructions": (
"You are a creative writer. Write engaging content in a clear, "
"professional style. Keep responses focused and well-organized."
),
"model": os.getenv("PRAISONAI_MODEL", "gpt-4o-mini"),
"icon": "✍️",
},
{
"agent_id": "coder",
"name": "Coder",
"description": "Coding assistant — Python, JavaScript, and more",
"instructions": (
"You are a coding assistant. Write clean, well-commented "
"code with explanations. Support Python, JavaScript, and "
"other popular languages."
),
"model": os.getenv("PRAISONAI_MODEL", "gpt-4o-mini"),
"icon": "💻",
},
]
# ── Custom page: Feature Explorer ───────────────────────────
@aiui.page(
"explorer",
title="Explorer",
icon="🔬",
group="Control",
order=55,
)
async def explorer_page():
"""Three-column feature explorer — custom view renders in JS."""
return aiui.layout([
aiui.text("Feature Explorer loads via custom view module."),
])
# ── Register agents in dashboard CRUD ───────────────────────
def _register_agents_in_dashboard():
"""Bridge agents into the dashboard agents_crud feature."""
from praisonaiui.features.agents import get_agent_registry
registry = get_agent_registry()
existing = registry.list_all()
existing_names = {a.get("name") for a in existing}
for agent_def in AGENTS:
if agent_def["name"] in existing_names:
continue
registry.create({
"name": agent_def["name"],
"description": agent_def["description"],
"instructions": agent_def["instructions"],
"model": agent_def["model"],
"icon": agent_def["icon"],
})
print(f" ✓ Agent: {agent_def['icon']} {agent_def['name']}")
try:
_register_agents_in_dashboard()
except Exception as e:
print(f" ⚠️ Agent registration failed (non-fatal): {e}")
+1
View File
@@ -0,0 +1 @@
import{g as p,r as u,d as a}from"./chunk-SVP7TREG.js";import{p as f}from"./chunk-JWPE2WC7.js";import{_ as n,l as o}from"./mermaid.core.js";import{M as c,b as d}from"./cynefin-OW5HDTMX.js";import"./index.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
+1
View File
@@ -0,0 +1 @@
import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
+36
View File
@@ -0,0 +1,36 @@
import{p as qe}from"./chunk-JWPE2WC7.js";import{_ as ct,D as Qe,Y as Je,l as Fe,b as Ke,a as je,n as _e,o as tr,g as er,s as rr,p as ir,A as ar,y as nr,B as or,c as Ee,b5 as Te,ak as pe,i as sr,j as hr,q as lr,al as fr,b6 as cr}from"./mermaid.core.js";import{p as gr}from"./cynefin-OW5HDTMX.js";import{c as be}from"./cytoscape.esm.js";import{g as ur}from"./index.js";var he={exports:{}},le={exports:{}},fe={exports:{}},dr=fe.exports,De;function vr(){return De||(De=1,(function(x,M){(function(R,T){x.exports=T()})(dr,function(){return(function(w){var R={};function T(v){if(R[v])return R[v].exports;var l=R[v]={i:v,l:!1,exports:{}};return w[v].call(l.exports,l,l.exports,T),l.l=!0,l.exports}return T.m=w,T.c=R,T.i=function(v){return v},T.d=function(v,l,i){T.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:i})},T.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return T.d(l,"a",l),l},T.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},T.p="",T(T.s=28)})([(function(w,R,T){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v}),(function(w,R,T){var v=T(2),l=T(8),i=T(9);function r(f,e,d){v.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var d=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(d.getOwner()==e)return d;if(d.getOwner()==t)break;d=d.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=r}),(function(w,R,T){function v(l){this.vGraphObject=l}w.exports=v}),(function(w,R,T){var v=T(2),l=T(10),i=T(13),r=T(0),a=T(16),f=T(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var d in v)e[d]=v[d];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.reLine truncated
.edge {
stroke-width: ${x.archEdgeWidth};
stroke: ${x.archEdgeColor};
fill: none;
}
.arrow {
fill: ${x.archEdgeArrowColor};
}
.node-bkg {
fill: none;
stroke: ${x.archGroupBorderColor};
stroke-width: ${x.archGroupBorderWidth};
stroke-dasharray: 8;
}
.node-icon-text {
display: flex;
align-items: center;
}
.node-icon-text > div {
color: #fff;
margin: 1px;
height: fit-content;
text-align: center;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
}
`,"getStyles"),Fr=Sr;function me(x,M){if(x===0)return M();const w=Math.random;let R=x>>>0;Math.random=function(){R=R+1831565813>>>0;let T=R;return T=Math.imul(T^T>>>15,T|1),T^=T+Math.imul(T^T>>>7,T|61),((T^T>>>14)>>>0)/4294967296};try{return M()}finally{Math.random=w}}ct(me,"withSeededRandom");var re=ct(x=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${x}</g>`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:re('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:re('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:re('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; sLine truncated
translate(${L}, ${F-E.height/2})
translate(${p*y.width/2}, ${m*y.height/2})
rotate(${-1*p*m*45}, 0, ${E.height/2})
`)}}}}}))},"drawEdges"),Pr=ct(async function(x,M,w,R){const v=w.getConfigField("padding")*.75,l=w.getConfigField("fontSize"),r=w.getConfigField("iconSize")/2;await Promise.all(M.nodes().map(async a=>{const f=ie(a);if(f.type==="group"){const{h:e,w:d,x1:t,y1:s}=a.boundingBox(),o=x.append("rect");o.attr("id",`${R}-group-${f.id}`).attr("x",t+r).attr("y",s+r).attr("width",d).attr("height",e).attr("class","node-bkg");const c=x.append("g");let h=t,N=s;if(f.icon){const g=c.append("g");g.html(`<g>${await pe(f.icon,{height:v,width:v,fallbackPrefix:ne.prefix})}</g>`),g.attr("transform","translate("+(h+r+1)+", "+(N+r+1)+")"),h+=v,N+=l/2-1-2}if(f.label){const g=c.append("g");await Te(g,f.label,{useHtmlLabels:!1,width:d,classes:"architecture-service-label"},Ee()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(h+r+4)+", "+(N+r+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Gr=ct(async function(x,M,w,R){const T=Ee();for(const v of w){const l=M.append("g"),i=x.getConfigField("iconSize");if(v.title){const e=l.append("g");await Te(e,v.title,{useHtmlLabels:!1,width:i*1.5,classes:"architecture-service-label"},T),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+i/2+", "+i+")")}const r=l.append("g");if(v.icon)r.html(`<g>${await pe(v.icon,{height:i,width:i,fallbackPrefix:ne.prefix})}</g>`);else if(v.iconText){r.html(`<g>${await pe("blank",{height:i,width:i,fallbackPrefix:ne.prefix})}</g>`);const t=r.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(sr(v.iconText,T)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/s)};`)}else r.append("path").attr("class","node-bkg").attr("id",`${R}-node-${v.id}`).attr("d",`M0,${i} V5 Q0,0 5,0 H${i-5} Q${i},0 ${i},5 V${i} Z`);l.attr("id",`${R}-service-${v.id}`).attr("class","architecture-service");const{width:a,height:f}=l.node().getBBox();v.width=a,v.height=f,x.setElementForId(v.id,l)}return 0},"drawServices"),Ur=ct(function(x,M,w,R){w.forEach(T=>{const v=M.append("g"),l=x.getConfigField("iconSize");v.append("g").append("rect").attr("id",`${R}-node-${T.id}`).attr("fill-opacity","0").attr("width",l).attr("height",l),v.attr("class","architecture-junction");const{width:r,height:a}=v._groups[0][0].getBBox();v.width=r,v.height=a,x.setElementForId(T.id,v)})},"drawJunctions");fr([{name:ne.prefix,icons:ne}]);be.use(Nr);function Xe(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"service",id:R.id,icon:R.icon,label:R.title,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}ct(Xe,"addServices");function He(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"junction",id:R.id,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}ct(He,"addJunctions");function We(x,M){M.nodes().map(w=>{const R=ie(w);if(R.type==="group")return;R.x=w.position().x,R.y=w.position().y,x.getElementById(R.id).attr("transform","translate("+(R.x||0)+","+(R.y||0)+")")})}ct(We,"positionNodes");function Ve(x,M){x.forEach(w=>{M.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}ct(Ve,"addGroups");function $e(x,M){x.forEach(w=>{const{lhsId:R,rhsId:T,lhsInto:v,lhsGroup:l,rhsInto:i,lhsDir:r,rhsDir:a,rhsGroup:f,title:e}=w,d=Ne(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${R}-${T}`,label:e,source:R,sourceDir:r,sourceArrow:v,sourceGroup:l,sourceEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%",target:T,targetDir:a,targetArrow:i,targetGroup:f,targetEndpoint:a==="L"?"0 50%":a==="R"?"100% 50%":a==="T"?"50% 0":"50% 100%"};M.add({group:"edges",data:t,classes:d})})}ct($e,"addEdges");function ze(x,M,w,R=[]){const T=ct((d,t)=>{const s=new Map;for(const[o,c]of d.entries()){const h=`${o}`;let N=0;const g=[...c.entries()];if(g.length===1){s.set(h,g[0][1]);continue}for(let u=0;u<g.length-1;u++)for(let L=u+1;L<g.length;L++){const[F,C]=g[u],[G,V]=g[L];if(w.get(Pe(F,G))===t)s.set(h,[...s.get(h)??[],...C,...V]);else if(F==="default"||G==="default")s.set(h,[...s.get(h)??[],...C,...V]);else{const $=`${h}-${N++}`;s.set($,C);const A=`${h}-${N++}`;s.set(A,V)}}}return s},"flattenAlignments"),v=M.map(d=>{const t=new Map,s=new Map;return d.forEach(([o,c],h)=>{const N=x.getNode(h)?.in??"default",g=t.get(c)??new Map;t.has(c)||t.set(c,g);const u=s.get(o)??new Map;s.has(o)||s.set(o,u);for(const L of[g,u]){const F=L.get(N)??[];L.has(N)||L.set(N,F),F.push(h)}}),{horiz:[...T(t,"horizontal").values()].filter(o=>o.length>1),vert:[...T(s,"vertical").values()].filter(o=>o.length>1)}}),[l,i]=v.reduce(([d,t],{horiz:s,vert:o})=>[[...d,Line truncated
+129
View File
@@ -0,0 +1,129 @@
import{g as Pe}from"./chunk-5VM5RSS4.js";import{aD as Fe,aE as xe,aF as Me,aG as Ke,aH as Ye,aI as We,aJ as Ve,aK as Ue,aL as He,aM as Xe,aN as je,aO as Ge,aP as qe,aQ as Je,aR as Ze,aS as Qe,aT as $e,aU as et,aV as tt,aW as st,aX as rt,aY as it,aZ as at,a_ as nt,a$ as ot,_ as u,y as Y,j as X,b0 as ct,d as lt,l as m,p as ut,r as gt,c as Le,Q as ht,az as dt,ay as pt,aA as ft,k as bt,b1 as St,ag as ye,ah as xt}from"./mermaid.core.js";import{c as Lt}from"./channel.js";import"./index.js";function yt(e){return Array.isArray(e)}function mt(e){if(Fe(e))return e;const a=xe(e);if(!wt(e))return{};if(yt(e)){const r=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(r.index=e.index,r.input=e.input),r}if(Me(e)){const r=e,l=r.constructor;return new l(r.buffer,r.byteOffset,r.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const r=e,l=r.buffer,d=r.byteOffset,s=r.byteLength,h=new ArrayBuffer(s),x=new Uint8Array(l,d,s);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const r=e.constructor,l=new r(e.valueOf());return a==="[object String]"?_t(l,e):se(l,e),l}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const r=e,l=new RegExp(r.source,r.flags);return l.lastIndex=r.lastIndex,l}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const r=e,l=new Map;return r.forEach((d,s)=>{l.set(s,d)}),l}if(a==="[object Set]"){const r=e,l=new Set;return r.forEach(d=>{l.add(d)}),l}if(a==="[object Arguments]"){const r=e,l={};return se(l,r),l.length=r.length,l[Symbol.iterator]=r[Symbol.iterator],l}const o={};return kt(o,e),se(o,e),Et(o,e),o}function wt(e){switch(xe(e)){case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case We:case Ye:case Ke:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Et(e,a){const o=Object.getOwnPropertySymbols(a);for(let r=0;r<o.length;r++){const l=o[r];Object.prototype.propertyIsEnumerable.call(a,l)&&(e[l]=a[l])}}function _t(e,a){const o=a.valueOf().length;for(const r in a)Object.hasOwn(a,r)&&(Number.isNaN(Number(r))||Number(r)>=o)&&(e[r]=a[r])}function kt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(v,g,i,c){for(i=i||{},c=v.length;c--;i[v[c]]=g);return i},"o"),a=[1,15],o=[1,7],r=[1,13],l=[1,14],d=[1,19],s=[1,16],h=[1,17],x=[1,18],y=[8,30],S=[8,10,21,28,29,30,31,39,43,46],f=[1,23],L=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],k=[1,49],_={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(g,i,c,p,E,t,M){var n=t.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",t[n-1]),p.setHierarchy(t[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",t[n]),typeof t[n].length=="number"?this.$=t[n]:this.$=[t[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",t[n-1]),this.$=[t[n-1]].concat(t[n]);break;case 14:p.getLogger().debug("Rule: link: ",Line truncated
`+D.showPosition()+`
Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(P+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(C[0]){case 1:c.push(N),E.push(D.yytext),t.push(D.yylloc),c.push(C[1]),N=null,W=D.yyleng,n=D.yytext,P=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[C[1]][1],F.$=E[E.length-B],F._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},Be&&(F._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),ee=this.performAction.apply(F,[n,W,P,A.yy,C[1],E,t].concat(Z)),typeof ee<"u")return ee;B&&(c=c.slice(0,-1*B*2),E=E.slice(0,-1*B),t=t.slice(0,-1*B)),c.push(this.productions_[C[1]][0]),E.push(F.$),t.push(F._$),pe=M[c[c.length-2]][c[c.length-1]],c.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var v={EOF:1,parseError:u(function(i,c){if(this.yy.parser)this.yy.parser.parseError(i,c);else throw new Error(i)},"parseError"),setInput:u(function(g,i){return this.yy=i||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var i=g.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:u(function(g){var i=g.length,c=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(g){this.unput(this.match.slice(g))},"less"),pastInput:u(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var g=this.pastInput(),i=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
`+i+"^"},"showPosition"),test_match:u(function(g,i){var c,p,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),p=g[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],c=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in E)this[t]=E[t];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,i,c,p;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),t=0;t<E.length;t++)if(c=this._input.match(this.rules[E[t]]),c&&(!i||c[0].length>i[0].length)){if(i=c,p=t,this.options.backtrack_lexer){if(g=this.test_match(c,E[t]),g!==!1)return g;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(g=this.test_match(i,E[p]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var i=this.next();return i||this.lex()},"lex"),begin:u(function(i){this.conditionStack.push(i)},"begin"),popState:u(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:u(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:u(function(i){this.begin(i)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(i,c,p,E){switch(p){case 0:return i.getLogger().debug("Found block-beta"),10;case 1:return i.getLogger().debug("Found id-block"),29;case 2:return i.getLogger().debug("Found block"),10;case 3:i.getLogger().debug(".",c.yytext);break;case 4:i.getLogger().debug("_",c.yytext);break;case 5:return 5;case 6:return c.yytext=-1,28;case 7:return c.yytext=c.yytext.replace(/columns\s+/,""),i.getLogger().debug("COLUMNS (LEX)",c.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:i.getLogger().debug("LEX: POPPING STR:",c.yytext),this.popState();break;case 13:return i.getLogger().debug("LEX: STR end:",c.yytext),"STR";case 14:return c.yytext=c.yytext.replace(/space\:/,""),i.getLogger().debug("SPACE NUM (LEX)",c.yytext),21;case 15:return c.yytext="1",i.getLogger().debug("COLUMNS (LEX)",c.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),i.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),i.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),i.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),i.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),i.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),i.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),i.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),i.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),i.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),i.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return i.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return i.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return i.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return i.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return i.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return i.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.p Line truncated
font-family: ${e.fontFamily};
color: ${e.nodeTextColor||e.textColor};
}
.cluster-label text {
fill: ${e.titleColor};
}
.cluster-label span {
color: ${e.titleColor};
}
.label text,span {
fill: ${e.nodeTextColor||e.textColor};
color: ${e.nodeTextColor||e.textColor};
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${e.mainBkg};
stroke: ${e.nodeBorder};
stroke-width: 1px;
}
.flowchart-label text {
text-anchor: middle;
}
// .flowchart-label .text-outer-tspan {
// text-anchor: middle;
// }
// .flowchart-label .text-inner-tspan {
// text-anchor: start;
// }
.node .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.arrowheadPath {
fill: ${e.arrowheadColor};
}
.edgePaths .path {
stroke: ${e.lineColor};
stroke-width: 2.0px;
}
.flowchart-link {
stroke: ${e.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${e.edgeLabelBackground};
/*
* This is for backward compatibility with existing code that didn't
* add a \`<p>\` around edge labels.
*
* TODO: We should probably remove this in a future release.
*/
p {
margin: 0;
padding: 0;
display: inline;
}
rect {
opacity: 0.5;
background-color: ${e.edgeLabelBackground};
fill: ${e.edgeLabelBackground};
}
text-align: center;
}
/* For html labels only */
.labelBkg {
background-color: ${e.edgeLabelBackground};
}
.node .cluster {
// fill: ${re(e.mainBkg,.5)};
fill: ${re(e.clusterBkg,.5)};
stroke: ${re(e.clusterBorder,.2)};
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
stroke-width: 1px;
}
.cluster text {
fill: ${e.titleColor};
}
.cluster span {
color: ${e.titleColor};
}
/* .cluster div {
color: ${e.titleColor};
} */
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${e.fontFamily};
font-size: 12px;
background: ${e.tertiaryColor};
border: 1px solid ${e.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.flowchartTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${e.textColor};
}
${Pe()}
`,"getStyles"),Gt=jt;function ne(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const o=a%e,r=Math.floor(a/e);return{px:o,py:r}}u(ne,"calculateBlockPosition");var qt=u(e=>{let a=0,o=0;for(const r of e.children){const{width:l,height:d,x:s,y:h}=r.size??{width:0,height:0,x:0,y:0};if(m.debug("getMaxChildSize abc95 child:",r.id,"width:",l,"height:",d,"x:",s,"y:",h,r.type),r.type==="space")continue;const x=l/(r.widthInColumns??1);x>a&&(a=x),d>o&&(o=d)}return{width:a,height:o}},"getMaxChildSize");function G(e,a,o=0,r=0,l=8){m.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",o),e?.size?.width||(e.size={width:o,height:r,x:0,y:0});let d=0,s=0;if(e.children?.length>0){for(const b of e.children)G(b,a,0,0,l);const h=qt(e);d=h.width,s=h.height,m.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",d,s);for(const b of e.children)b.size&&(m.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${d} ${s} ${JSON.stringify(b.size)}`),b.size.width=d*(b.widthInColumns??1)+l*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,m.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${d} maxHeight:${s}`));for(const b of e.children)G(b,a,d,s,l);const x=e.columns??-1;let y=0;for(const b of e.children)y+=b.widthInColumns??1;let S=e.children.length;x>0&&x<y&&(S=x);const f=Math.ceil(y/S);let L=S*(d+l)+l,w=f*(s+l)+l;if(L<o){m.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${o} siblingHeight ${r} width ${L}`),L=o,w=r;const b=(o-S*l-l)/S,k=(r-f*l-l)/f;m.debug("Size indata abc88",e.id,"childWidth",b,"maxWidth",d),m.debug("Size indata abc88",e.id,"childHeight",k,"maxHeight",s),m.debug("Size indata abc88 xSize",S,"padding",l);for(const _ of e.children)_.size&&(_.size.width=b,_.size.height=k,_.size.x=0,_.size.y=0)}if(m.debug(`abc95 (finale calc) ${e.id} xSize ${S} ySize ${f} columns ${x}${e.children.length} width=${Math.max(L,e.size?.width||0)}`),L<(e?.size?.width||0)){L=e?.size?.width||0;const b=x>0?Math.min(e.children.length,x):e.children.length;if(b>0){const k=(L-b*l-l)/b;m.debug("abc95 (growing to fit) width",e.id,L,e.size?.width,k);for(const _ of e.children)_.size&&(_.size.width=k)}}e.size={width:L,height:w,x:0,y:0}}m.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}u(G,"setBlockSizes");function ue(e,a,o=8){m.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const r=e.columns??-1;if(m.debug("layoutBlocks columns abc95",e.id,"=>",r,e),e.children&&e.children.length>0){const l=e?.children[0]?.size?.width??0,d=e.children.length*l+(e.children.length-1)*o;m.debug("widthOfChildren 88",d,"posX");const s=new Map;{let f=0;for(const L of e.children){if(!L.size)continue;const{py:w}=ne(r,f),b=s.get(w)??0;L.size.height>b&&s.set(w,L.size.height);let k=L?.widthInColumns??1;r>0&&(k=Math.min(k,r-f%r)),f+=k}}const h=new Map;{let f=0;const L=[...s.keys()].sort((w,b)=>w-b);for(const w of L)h.set(w,f),f+=(s.get(w)??0)+o}let x=0;m.debug("abc91 block?.size?.x",e.id,e?.size?.x);let y=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,S=0;for(const f of e.children){const L=e;if(!f.size)continue;const{width:w,height:b}=f.size,{px:k,py:_}=ne(r,x);if(_!=S&&(S=_,y=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,m.debug("New row in layout for block",e.id," and child ",f.id,S)),m.debug(`abc89 layout blocks (child) id: ${f.id} Pos: ${x} (px, py) ${k},${_} (${L?.size?.x},${L?.size?.y}) parent: ${L.id} width: ${w}${o}`),L.size){const O=w/2;f.size.x=y+o+O,m.debug(`abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${y} new startingPosX${f.size.x} ${O} padding=${o} width=${w} halfWidth=${O} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${w*(f?.widthInColumns??1)/2}`),y=f.size.x+O;const v=h.get(_)??0,g=s.get(_)??b;f.size.y=L.size.y-L.size.height/2+v+g/2+o,m.debug(`abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${y}${o}${O}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${w*(f?.widthInColumns??1)/2}`)}f.children&&ue(f,a,o);let T=f?.widthInColumns??1;r>0&&(T=Math.min(T,r-x%r)),x+=T,m.debug("abc88 columnsPos",f,x)}}m.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}u(ue,"layoutBlocks");function ge(e,{minX:a,minY:o,maxX:r,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:d,y:s,width:h,height:x}=e.size;d-h/2<a&&(a=d-h/2),s-x/2<o&&(o=s-x/2),d+h/2>r&&(r=d+h/2),s+x/2>l&&(l=s+x/2)}if(e.children)for(const d of e.children)({minX:a,minY:o,maxX:r,maxY:l}=ge(d,{minX:a,minY:o,maxX:r,maxY:l}));return{minX:a,minY:o,maxX:r,maxY:l}}u(ge,"findBounds");function Ie(e){const a=e.getBlock("root");if(!a)return;const o=Le()?.block?.padding??8;G(a,e,0,0,o),ue(a, Line truncated
+38
View File
@@ -0,0 +1,38 @@
import{d as Le}from"./chunk-F27PBJKO.js";import{s as Ie,g as Me,a as Be,b as Ve,_ as d,c as wt,l as he,d as Ye,e as Fe,f as Dt,h as Ue,i as be,j as Jt,w as je,k as $t,m as de}from"./mermaid.core.js";import"./index.js";var Ut=(function(){var t=d(function(yt,m,x,E){for(x=x||{},E=yt.length;E--;x[yt[E]]=m);return x},"o"),e=[1,24],s=[1,25],a=[1,26],u=[1,27],i=[1,28],n=[1,63],l=[1,64],r=[1,65],h=[1,66],y=[1,67],f=[1,68],b=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],W=[1,35],X=[1,36],q=[1,37],H=[1,38],Q=[1,39],K=[1,40],G=[1,41],J=[1,42],Z=[1,43],$=[1,44],tt=[1,45],et=[1,46],nt=[1,47],st=[1,48],rt=[1,50],at=[1,51],it=[1,52],ot=[1,53],lt=[1,54],ct=[1,55],ut=[1,56],ht=[1,57],dt=[1,58],pt=[1,59],ft=[1,60],kt=[14,42],Wt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],k=[1,83],T=[1,84],C=[1,85],R=[12,14,42],ie=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],gt=[12,33],Xt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,Pt){var p=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[p-3]);break;case 19:_.setTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 20:_.setAccDescription(o[p].substring(15)),this.$=o[p].substring(15);break;case 21:this.$=o[p].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[p].trim(),_.setAccDescription(this.$);break;case 28:o[p].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 29:o[p].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 30:_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 31:o[p].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[p]),this.$=o[p];break;case 32:_.addDeploymentNode("node",...Line truncated
`+A.showPosition()+`
Expecting `+Yt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Gt="Parse error on line "+(xt+1)+": Unexpected "+(M==le?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Gt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:Qt,expected:Yt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),o.push(A.yylloc),E.push(V[1]),M=null,oe=A.yyleng,p=A.yytext,xt=A.yylineno,Qt=A.yylloc;break;case 2:if(j=this.productions_[V[1]][1],Tt.$=D[D.length-j],Tt._$={first_line:o[o.length-(j||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(j||1)].first_column,last_column:o[o.length-1].last_column},Ne&&(Tt._$.range=[o[o.length-(j||1)].range[0],o[o.length-1].range[1]]),Kt=this.performAction.apply(Tt,[p,oe,xt,vt.yy,V[1],D,o].concat(De)),typeof Kt<"u")return Kt;j&&(E=E.slice(0,-1*j*2),D=D.slice(0,-1*j),o=o.slice(0,-1*j)),E.push(this.productions_[V[1]][0]),D.push(Tt.$),o.push(Tt._$),ue=Pt[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},Oe=(function(){var yt={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(m,x){return this.yy=x||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
`+x+"^"},"showPosition"),test_match:d(function(m,x){var E,_,D;if(this.options.backtrack_lexer&&(D={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(D.yylloc.range=this.yylloc.range.slice(0))),_=m[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],E=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var o in D)this[o]=D[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,x,E,_;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),o=0;o<D.length;o++)if(E=this._input.match(this.rules[D[o]]),E&&(!x||E[0].length>x[0].length)){if(x=E,_=o,this.options.backtrack_lexer){if(m=this.test_match(E,D[o]),m!==!1)return m;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(m=this.test_match(x,D[_]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var x=this.next();return x||this.lex()},"lex"),begin:d(function(x){this.conditionStack.push(x)},"begin"),popState:d(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:d(function(x){this.begin(x)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(x,E,_,D){switch(_){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\bLine truncated
`)},"elementFontStyles"),W0=d(t=>`.person {
stroke: ${t.personBorder};
fill: ${t.personBkg};
}
${z0()}
/* The element font colour is set inline per element (default white); the
label text takes it via currentColor. */
.c4-shape .label,
.c4-shape .label text {
color: inherit;
fill: currentColor;
}
/* Structurizr typography: bold name, smaller stereotype/type and description lines. */
.c4-shape .label .c4-name {
font-weight: bold;
}
.c4-shape .label .c4-type {
font-size: 0.75em;
}
.c4-shape .label .c4-descr {
font-size: 0.82em;
}
.c4-shape .basic,
.c4-shape rect,
.c4-shape path,
.c4-shape circle,
.c4-shape ellipse,
.c4-shape line {
stroke-width: 2px;
}
`,"getStyles"),X0=W0,K0={parser:ze,db:te,renderer:_e,styles:X0,init:d(({c4:t,wrap:e})=>{_e.setConf(t),te.setWrap(e)},"init")};export{K0 as diagram};
+1
View File
@@ -0,0 +1 @@
import{ai as o,aj as n}from"./mermaid.core.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
+1
View File
@@ -0,0 +1 @@
import{_ as s}from"./mermaid.core.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
+15
View File
@@ -0,0 +1,15 @@
import{_ as e}from"./mermaid.core.js";var l=e(()=>`
/* Font Awesome icon styling - consolidated */
.label-icon {
display: inline-block;
height: 1em;
overflow: visible;
vertical-align: -0.125em;
}
.node .label-icon path {
fill: currentColor;
stroke: revert;
stroke-width: revert;
}
`,"getIconStyles");export{l as g};
+1
View File
@@ -0,0 +1 @@
import{_ as i,j as l,U as d,G as o}from"./mermaid.core.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,h as b,g as c,x as d,m as e,w as f,f as g,y as h};
+231
View File
@@ -0,0 +1,231 @@
import{g as ee}from"./chunk-XXDRQBXY.js";import{s as se}from"./chunk-POPQ4Y6H.js";import{_ as p,l as b,c as $,v as ie,x as re,a as ae,b as ne,g as oe,s as le,n as ce,o as he,T as ue,k as j,p as de,j as kt,O as fe}from"./mermaid.core.js";import{f as pe}from"./chunk-F27PBJKO.js";var Ct=(function(){var t=p(function(V,o,h,a){for(h=h||{},a=V.length;a--;h[V[a]]=o);return h},"o"),e=[1,2],s=[1,3],n=[1,4],r=[2,4],c=[1,9],u=[1,11],S=[1,16],d=[1,17],T=[1,18],E=[1,19],m=[1,33],L=[1,20],D=[1,21],f=[1,22],I=[1,23],R=[1,24],C=[1,26],F=[1,27],A=[1,28],P=[1,29],w=[1,30],z=[1,31],rt=[1,32],at=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],K=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ct=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Lt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],gt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(o,h,a,g,_,i,B){var l=i.length-1;switch(_){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Z=i[l-1];Z.description=g.trimColon(i[l]),this.$=Z;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const Tt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],X=i[l-2].trim();if(i[l].match(":")){var ut=i[l].split(":");Y=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:Y,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}Line truncated
`+k.showPosition()+`
Expecting `+ft.join(", ")+", got '"+(this.terminals_[x]||x)+"'":bt="Parse error on line "+(Y+1)+": Unexpected "+(x==Z?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(bt,{text:k.match,token:this.terminals_[x]||x,line:k.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+x);switch(N[0]){case 1:a.push(x),_.push(k.yytext),i.push(k.yylloc),a.push(N[1]),x=null,X=k.yyleng,l=k.yytext,Y=k.yylineno,_t=k.yylloc;break;case 2:if(G=this.productions_[N[1]][1],J.$=_[_.length-G],J._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Zt&&(J._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),mt=this.performAction.apply(J,[l,X,Y,U.yy,N[1],_,i].concat(Tt)),typeof mt<"u")return mt;G&&(a=a.slice(0,-1*G*2),_=_.slice(0,-1*G),i=i.slice(0,-1*G)),a.push(this.productions_[N[1]][0]),_.push(J.$),i.push(J._$),wt=B[a[a.length-2]][a[a.length-1]],a.push(wt);break;case 3:return!0}}return!0},"parse")},Qt=(function(){var V={EOF:1,parseError:p(function(h,a){if(this.yy.parser)this.yy.parser.parseError(h,a);else throw new Error(h)},"parseError"),setInput:p(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:p(function(o){var h=o.length,a=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===g.length?this.yylloc.first_column:0)+g[g.length-a.length].length-a[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(o){this.unput(this.match.slice(o))},"less"),pastInput:p(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
`+h+"^"},"showPosition"),test_match:p(function(o,h){var a,g,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),g=o[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],a=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var i in _)this[i]=_[i];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,a,g;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),i=0;i<_.length;i++)if(a=this._input.match(this.rules[_[i]]),a&&(!h||a[0].length>h[0].length)){if(h=a,g=i,this.options.backtrack_lexer){if(o=this.test_match(a,_[i]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,_[g]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var h=this.next();return h||this.lex()},"lex"),begin:p(function(h){this.conditionStack.push(h)},"begin"),popState:p(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:p(function(h){this.begin(h)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(h,a,g,_){function i(){const B=a.yytext.indexOf("%%");if(B===0)return!1;if(B>0){const l=a.yytext.slice(0,B),Y=a.yytext.slice(B);Y&&h.lexer.unput(Y),a.yytext=l}return!0}switch(p(i,"processId"),g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+a.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return i()?(this.popState(),"ID"):void 0;case 66:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),a.yytext=a.yytext.substr(2).trim(),31;case 68:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return i()?24:void 0;case 74:return a.yytext=a.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*directio Line truncated
defs [id$="-barbEnd"] {
fill: ${t.transitionColor};
stroke: ${t.transitionColor};
}
g.stateGroup text {
fill: ${t.nodeBorder};
stroke: none;
font-size: 10px;
}
g.stateGroup text {
fill: ${t.textColor};
stroke: none;
font-size: 10px;
}
g.stateGroup .state-title {
font-weight: bolder;
fill: ${t.stateLabelColor};
}
g.stateGroup rect {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
}
g.stateGroup line {
stroke: ${t.lineColor};
stroke-width: ${t.strokeWidth||1};
}
.transition {
stroke: ${t.transitionColor};
stroke-width: ${t.strokeWidth||1};
fill: none;
}
.stateGroup .composit {
fill: ${t.background};
border-bottom: 1px
}
.stateGroup .alt-composit {
fill: #e0e0e0;
border-bottom: 1px
}
.state-note {
stroke: ${t.noteBorderColor};
fill: ${t.noteBkgColor};
text {
fill: ${t.noteTextColor};
stroke: none;
font-size: 10px;
}
}
.stateLabel .box {
stroke: none;
stroke-width: 0;
fill: ${t.mainBkg};
opacity: 0.5;
}
.edgeLabel .label rect {
fill: ${t.labelBackgroundColor};
opacity: 0.5;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
p {
background-color: ${t.edgeLabelBackground};
}
rect {
opacity: 0.5;
background-color: ${t.edgeLabelBackground};
fill: ${t.edgeLabelBackground};
}
text-align: center;
}
.edgeLabel .label text {
fill: ${t.transitionLabelColor||t.tertiaryTextColor};
}
.label div .edgeLabel {
color: ${t.transitionLabelColor||t.tertiaryTextColor};
}
.stateLabel text {
fill: ${t.stateLabelColor};
font-size: 10px;
font-weight: bold;
}
.node circle.state-start {
fill: ${t.specialStateColor};
stroke: ${t.specialStateColor};
}
.node .fork-join {
fill: ${t.specialStateColor};
stroke: ${t.specialStateColor};
}
.node circle.state-end {
fill: ${t.innerEndBackground};
stroke: ${t.background};
stroke-width: 1.5
}
.end-state-inner {
fill: ${t.compositeBackground||t.background};
// stroke: ${t.background};
stroke-width: 1.5
}
.node rect {
fill: ${t.stateBkg||t.mainBkg};
stroke: ${t.stateBorder||t.nodeBorder};
stroke-width: ${t.strokeWidth||1}px;
}
.node polygon {
fill: ${t.mainBkg};
stroke: ${t.stateBorder||t.nodeBorder};;
stroke-width: ${t.strokeWidth||1}px;
}
[id$="-barbEnd"] {
fill: ${t.lineColor};
}
.statediagram-cluster rect {
fill: ${t.compositeTitleBackground};
stroke: ${t.stateBorder||t.nodeBorder};
stroke-width: ${t.strokeWidth||1}px;
}
.cluster-label, .nodeLabel {
color: ${t.stateLabelColor};
// line-height: 1;
}
.statediagram-cluster rect.outer {
rx: 5px;
ry: 5px;
}
.statediagram-state .divider {
stroke: ${t.stateBorder||t.nodeBorder};
}
.statediagram-state .title-state {
rx: 5px;
ry: 5px;
}
.statediagram-cluster.statediagram-cluster .inner {
fill: ${t.compositeBackground||t.background};
}
.statediagram-cluster.statediagram-cluster-alt .inner {
fill: ${t.altBackground?t.altBackground:"#efefef"};
}
.statediagram-cluster .inner {
rx:0;
ry:0;
}
.statediagram-state rect.basic {
rx: 5px;
ry: 5px;
}
.statediagram-state rect.divider {
stroke-dasharray: 10,10;
fill: ${t.altBackground?t.altBackground:"#efefef"};
}
.note-edge {
stroke-dasharray: 5;
}
.statediagram-note rect {
fill: ${t.noteBkgColor};
stroke: ${t.noteBorderColor};
stroke-width: 1px;
rx: 0;
ry: 0;
}
.statediagram-note rect {
fill: ${t.noteBkgColor};
stroke: ${t.noteBorderColor};
stroke-width: 1px;
rx: 0;
ry: 0;
}
.statediagram-note text {
fill: ${t.noteTextColor};
}
.statediagram-note .nodeLabel {
color: ${t.noteTextColor};
}
.statediagram .edgeLabel {
color: red; // ${t.noteTextColor};
}
[id$="-dependencyStart"], [id$="-dependencyEnd"] {
fill: ${t.lineColor};
stroke: ${t.lineColor};
stroke-width: ${t.strokeWidth||1};
}
.statediagramTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
[data-look="neo"].statediagram-cluster rect {
fill: ${t.mainBkg};
stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};
stroke-width: ${t.strokeWidth??1};
}
[data-look="neo"].statediagram-cluster rect.outer {
rx: ${t.radius}px;
ry: ${t.radius}px;
filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}
}
`,"getStyles"),ze=Ye;export{He as S,We as a,je as b,ze as s};
+1
View File
@@ -0,0 +1 @@
import{_ as i}from"./mermaid.core.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
+1
View File
@@ -0,0 +1 @@
import{_ as a,d as w,l as x}from"./mermaid.core.js";var B=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=d(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{B as s};
+88
View File
@@ -0,0 +1,88 @@
import{_ as p,l as C,D as H,y as B,p as q,E as G,d as U,i as j,c as K}from"./mermaid.core.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),C.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),C.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};C.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),C.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
`),C.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ne=Y,ae=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:ae},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:a,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return le.test(a)?a:i},"sanitizeColorValue"),I=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return se.test(a)?a:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=I(e.fontFamily,f.fontFamily),a=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=B(),a={...G(),...i.themeVariables??{},...me(e)},n=pe(a),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??n.compactMode,padding:F(t.padding,n.padding),verticalSeparation:F(t.verticalSeparation,n.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,n.horizontalSeparation),arcRadius:F(t.arcRadius,n.arcRadius),fontSize:F(t.fontSize,n.fontSize),fontFamily:I(t.fontFamily,n.fontFamily),terminalFill:m(t.terminalFill,n.terminalFill),terminalStroke:m(t.terminalStroke,n.terminalStroke),terminalTextColor:m(t.terminalTextColor,n.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:m(t.lineColor,n.lineColor),strokeWidth:F(t.strokeWidth,n.strokeWidth),markerFill:m(t.markerFill,n.markerFill),commentFill:m(t.commentFill,n.commentFill),commentStroke:m(t.commentStroke,n.commentStroke),commentTextColor:m(t.commentTextColor,n.commentTextColor),specialFill:m(t.specialFill,n.specialFill),specialStroke:m(t.specialStroke,n.specialStroke),ruleNameColor:m(t.ruleNameColor,n.ruleNameColor),showMarkers:t.showMarkers??n.showMarkers,markerRadius:F(t.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:n,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
.railroad-diagram {
font-family: ${i};
font-size: ${a}px;
}
.railroad-terminal rect {
fill: ${n};
stroke: ${t};
stroke-width: ${h}px;
}
.railroad-terminal text {
fill: ${r};
font-family: ${i};
font-size: ${a}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-nonterminal rect {
fill: ${o};
stroke: ${g};
stroke-width: ${h}px;
}
.railroad-nonterminal text {
fill: ${l};
font-family: ${i};
font-size: ${a}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-line {
stroke: ${s};
stroke-width: ${h}px;
fill: none;
}
.railroad-start circle,
.railroad-end circle {
fill: ${u};
}
.railroad-comment ellipse {
fill: ${c};
stroke: ${w};
stroke-width: ${h}px;
}
.railroad-comment text {
fill: ${d};
font-style: italic;
font-family: ${i};
font-size: ${a}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-special rect {
fill: ${T};
stroke: ${z};
stroke-width: ${h}px;
stroke-dasharray: 5,3;
}
.railroad-special text {
fill: ${l};
font-family: ${i};
font-size: ${a}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-rule-name {
font-weight: bold;
fill: ${S};
font-family: ${i};
font-size: ${a}px;
}
.railroad-group {
/* Grouping container, no specific styles */
}
`},"getStyles"),R,x=(R=class{constructor(){this.d=""}moveTo(i,a){return this.d+=`M ${i} ${a} `,this}lineTo(i,a){return this.d+=`L ${i} ${a} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,a,n,t,r,o,g){return this.d+=`A ${i} ${a} ${n} ${t?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},p(R,"PathBuilder"),R),$,ue=($=class{constructor(i,a=E()){this.textCache=new Map,this.svg=i,this.config=a}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);const a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=a.node().getBBox(),t={width:n.width,height:n.height};return a.remove(),this.textCache.set(i,t),t}renderTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,a){const n=a.map(s=>this.renderExpression(i,s));let t=0,r=0,o=0;for(const s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;const g=i.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const h=n[s],u=r-h.dimensions.up;if(g.node().appendChild(h.element).setAttribute("transform",`translate(${l}, ${u})`),s<n.length-1){const w=l+h.dimensions.width,d=w+this.config.horizontalSeparation,T=r;g.append("path").attr("class","railroad-line").attr("d",new x().moveTo(w,T).lineTo(d,T).build())}l+=h.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:t,height:r+o,up:r,down:o}}}renderChoice(i,a){const n=a.map(c=>this.renderExpression(i,c));let t=0,r=0;for(const c of n)t=Math.max(t,c.dimensions.width),r+=c.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius,g=o*4,l=t+g,s=i.append("g").attr("class","railroad-choice");let h=0;const u=r/2;for(const c of n){const w=h,d=w+c.dimensions.up,T=o*2+(t-c.dimensions.width)/2;s.node().appendChild(c.element).setAttribute("transform",`translate(${T}, ${w})`);const S=new x,k=d>u;d===u?S.moveTo(0,u).lineTo(T,d):S.moveTo(0,u).arcTo(o,o,0,!1,k,o,u+(k?o:-o)).lineTo(o,d-(k?o:-o)).arcTo(o,o,0,!1,!k,o*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",S.build());const N=new x,_=T+c.dimensions.width,X=l-o*2;d===u?N.moveTo(_,d).lineTo(l,u):N.moveTo(_,d).lineTo(X,d).arcTo(o,o,0,!1,!k,l-o,d+(k?-o:o)).lineTo(l-o,u+(k?o:-o)).arcTo(o,o,0,!1,k,l,u),s.append("path").attr("class","railroad-line").attr("d",N.build()),h+=c.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:l,height:r,up:u,down:r-u}}}renderOptional(i,a){const n=this.renderExpression(i,a),t=this.config.arcRadius,r=t*2,o=n.dimensions.width+t*4,g=n.dimensions.height+r,l=i.append("g").attr("class","railroad-optional"),s=t*2,h=r;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${h})`);const c=h+n.dimensions.up,w=new x().moveTo(0,c).lineTo(t*2,c);l.append("path").attr("class","railroad-line").attr("d",w.build());const d=new x().moveTo(s+n.dimensions.width,c).lineTo(o,c);l.append("path").attr("class","railroad-line").attr("d",d.build());const T=new x().moveTo(0,c).arcTo(t,t,0,!1,!1,t,c-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(o-t*2,0).arcTo(t,t,0,!1,!0,o-t,t).lineTo(o-t,c-t).arcTo(t,t,0,!1,!1,o,c);return l.append("path").attr("class","railroad-line").attr("d",T.build()),{element:l.node(),dimensions:{width:o,height:g,up:c,down:g-c}}}renderRepetition(i,a,n){const t=this.renderExpression(i,a),r=this.config.arcRadius,o=r*2,g=t.dimensions.width+r*4,l=n===0,s=t.dimensions.height+o+(l?o:0),h=i.append("g").attr("class","railroad-repetition"),u=r*2,c=l?o:0;h.node().appendChild(t.element).setAttribute("transform",`translate(${u}, ${c})`);const d=c+t.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(0,d).lineTo(r*2,d).build()),h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(u+t.dimensions.width,d).lineTo(g,d).build());const T=c+t.dimensions.height+r,z=new x().moveTo(u+t.dimensions.width,d).arcTo(r,r,0,!1,!0,u+t.dimensions.width+r,d+r).lineTo(u+t.dimensions.width+r,T).arcTo(r,r,0,!1,!0,u+t.dimensions.width,T+r).lineTo(r*2,T+r).arcTo(r,r,0,!1,!0,r,T).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(h.append("path").attr("cl Line truncated
`+e);try{const n=H(i);n.attr("class","railroad-diagram");const r=B().railroad?.useMaxWidth??!0,o=oe.getRules();if(C.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){C.warn("[Railroad] No rules to render"),W(n,{height:100,width:200},r);return}const l=new ue(n,E()).renderDiagram(o);W(n,l,r),C.debug("[Railroad] Render complete")}catch(n){throw C.error("[Railroad] Render error:",n),n}},"draw"),xe={draw:ge};export{oe as d,Te as g,xe as r};
+206
View File
@@ -0,0 +1,206 @@
import{g as st}from"./chunk-5VM5RSS4.js";import{g as it}from"./chunk-XXDRQBXY.js";import{s as at}from"./chunk-POPQ4Y6H.js";import{_ as f,l as we,c as F,u as nt,v as rt,x as Ve,j as Ae,O as ut,b as lt,a as ct,s as ot,g as ht,n as dt,o as pt,k as I,p as At,q as ft,i as gt,P as U}from"./mermaid.core.js";import{f as mt}from"./chunk-F27PBJKO.js";var Pe=(function(){var s=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],ge=[1,34],b=[1,45],me=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],ee=[1,58],te=[1,59],se=[1,60],ie=[1,61],ae=[1,62],_e=[1,63],Se=[1,64],_=[1,8,9,41],Me=[1,77],R=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],re=[13,60,86,100,102,103],Y=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],ue=[1,103],K=[1,121],W=[1,117],Q=[1,113],j=[1,119],X=[1,114],q=[1,115],H=[1,116],J=[1,118],Z=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],le=[12,39],Ne=[1,8,9,39,41,44,46],ce=[1,8,9,22],ze=[1,153],Ye=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,$){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].titlLine truncated
`+D.showPosition()+`
Expecting `+pe.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Oe="Parse error on line "+(he+1)+": Unexpected "+(B==We?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Oe,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:ve,expected:pe})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ke=D.yyleng,t=D.yytext,he=D.yylineno,ve=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],G.$=C[C.length-v],G._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},et&&(G._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),Ie=this.performAction.apply(G,[t,Ke,he,V.yy,L[1],C,e].concat($e)),typeof Ie<"u")return Ie;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(G.$),e.push(G._$),je=$[p[p.length-2]][p[p.length-1]],p.push(je);break;case 3:return!0}}return!0},"parse")},Je=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,l,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),l=o[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,l;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;e<C.length;e++)if(p=this._input.match(this.rules[C[e]]),p&&(!h||p[0].length>h[0].length)){if(h=p,l=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[l]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,l,C){switch(l){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\uLine truncated
fill: ${s.nodeBorder||s.classText};
stroke: none;
font-family: ${s.fontFamily};
font-size: 10px;
.title {
font-weight: bolder;
}
}
.cluster-label text {
fill: ${s.titleColor};
}
.cluster-label span {
color: ${s.titleColor};
}
.cluster-label span p {
background-color: transparent;
}
.cluster rect {
fill: ${s.clusterBkg};
stroke: ${s.clusterBorder};
stroke-width: 1px;
}
.cluster text {
fill: ${s.titleColor};
}
.cluster span {
color: ${s.titleColor};
}
.nodeLabel, .edgeLabel {
color: ${s.classText};
}
.noteLabel .nodeLabel, .noteLabel .edgeLabel {
color: ${s.noteTextColor};
}
.edgeLabel .label rect {
fill: ${s.mainBkg};
}
.label text {
fill: ${s.classText};
}
.labelBkg {
background: ${s.mainBkg};
}
.edgeLabel .label span {
background: ${s.mainBkg};
}
.classTitle {
font-weight: bolder;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${s.mainBkg};
stroke: ${s.nodeBorder};
stroke-width: ${s.strokeWidth};
}
.divider {
stroke: ${s.nodeBorder};
stroke-width: 1;
}
g.clickable {
cursor: pointer;
}
g.classGroup rect {
fill: ${s.mainBkg};
stroke: ${s.nodeBorder};
}
g.classGroup line {
stroke: ${s.nodeBorder};
stroke-width: 1;
}
.classLabel .box {
stroke: none;
stroke-width: 0;
fill: ${s.mainBkg};
opacity: 0.5;
}
.classLabel .label {
fill: ${s.nodeBorder};
font-size: 10px;
}
.relation {
stroke: ${s.lineColor};
stroke-width: ${s.strokeWidth};
fill: none;
}
.dashed-line{
stroke-dasharray: 3;
}
.dotted-line{
stroke-dasharray: 1 2;
}
[id$="-compositionStart"], .composition {
fill: ${s.lineColor} !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-compositionEnd"], .composition {
fill: ${s.lineColor} !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-dependencyStart"], .dependency {
fill: ${s.lineColor} !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-dependencyEnd"], .dependency {
fill: ${s.lineColor} !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-extensionStart"], .extension {
fill: transparent !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-extensionEnd"], .extension {
fill: transparent !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-aggregationStart"], .aggregation {
fill: transparent !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-aggregationEnd"], .aggregation {
fill: transparent !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-lollipopStart"], .lollipop {
fill: ${s.mainBkg} !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[id$="-lollipopEnd"], .lollipop {
fill: ${s.mainBkg} !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
.edgeTerminals {
font-size: 11px;
line-height: initial;
}
.classTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${s.textColor};
}
.edgeLabel[data-look="neo"] {
background-color: ${s.edgeLabelBackground};
p {
background-color: ${s.edgeLabelBackground};
}
rect {
opacity: 0.5;
background-color: ${s.edgeLabelBackground};
fill: ${s.edgeLabelBackground};
}
text-align: center;
}
${st()}
`,"getStyles"),Nt=Ct,bt=f((s,i="TB")=>{if(!s.doc)return i;let a=i;for(const n of s.doc)n.stmt==="dir"&&(a=n.value);return a},"getDir"),kt=f(function(s,i){return i.db.getClasses()},"getClasses"),Et=f(async function(s,i,a,n){we.info("REF0:"),we.info("Drawing class diagram (v3)",i);const{securityLevel:r,state:c,layout:u}=F();n.db.setDiagramId(i);const d=n.db.getData(),m=it(i,r);d.type=n.type,d.layoutAlgorithm=nt(u),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await rt(d,m);const g=8;Ve.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle()),at(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Lt={getClasses:kt,draw:Et,getDir:bt};export{St as C,_t as a,Lt as c,Nt as s};
+1
View File
@@ -0,0 +1 @@
import{_ as a,j as o}from"./mermaid.core.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
+1
View File
@@ -0,0 +1 @@
import{s as a,c as s,a as e,C as t}from"./chunk-TICWLB2K.js";import{_ as i}from"./mermaid.core.js";import"./chunk-5VM5RSS4.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./index.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
+1
View File
@@ -0,0 +1 @@
import{s as a,c as s,a as e,C as t}from"./chunk-TICWLB2K.js";import{_ as i}from"./mermaid.core.js";import"./chunk-5VM5RSS4.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./index.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
+1
View File
@@ -0,0 +1 @@
var b;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const i={};for(const a of n)i[a]=a;return i},s.getValidEnumValues=n=>{const i=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),a={};for(const o of i)a[o]=n[o];return s.objectValues(a)},s.objectValues=n=>s.objectKeys(n).map(function(i){return n[i]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.push(a);return i},s.find=(n,i)=>{for(const a of n)if(i(a))return a},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,i=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}s.joinValues=r,s.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(b||(b={}));var Ie;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Ie||(Ie={}));const f=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=s=>{switch(typeof s){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(s)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(s)?f.array:s===null?f.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?f.promise:typeof Map<"u"&&s instanceof Map?f.map:typeof Set<"u"&&s instanceof Set?f.set:typeof Date<"u"&&s instanceof Date?f.date:f.object;default:return f.unknown}},c=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class T extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},r={_errors:[]},n=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)r._errors.push(t(a));else{let o=r,l=0;for(;l<a.path.length;){const d=a.path[l];l===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],l++}}};return n(this),r}static assert(e){if(!(e instanceof T))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=s=>new T(s);const _e=(s,e)=>{let t;switch(s.code){case c.invalid_type:s.received===f.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,b.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(s.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(s.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${b.joinValues(s.options)}, received '${s.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:b.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case c.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.iLine truncated
+1
View File
@@ -0,0 +1 @@
import{_ as V,l as $,j as lt}from"./mermaid.core.js";import{c as tt}from"./cytoscape.esm.js";import{g as gt}from"./index.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,q;function ft(){return q||(q=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},nLine truncated
+166
View File
@@ -0,0 +1,166 @@
import{_ as ut}from"./index.js";var fk=Object.create,Lu=Object.defineProperty,dk=Object.getOwnPropertyDescriptor,vh=Object.getOwnPropertyNames,pk=Object.getPrototypeOf,mk=Object.prototype.hasOwnProperty,s=(t,e)=>Lu(t,"name",{value:e,configurable:!0}),hk=(t,e)=>function(){return t&&(e=(0,t[vh(t)[0]])(t=0)),e},X=(t,e)=>function(){return e||(0,t[vh(t)[0]])((e={exports:{}}).exports,e),e.exports},en=(t,e)=>{for(var r in e)Lu(t,r,{get:e[r],enumerable:!0})},Th=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of vh(e))!mk.call(t,a)&&a!==r&&Lu(t,a,{get:()=>e[a],enumerable:!(n=dk(e,a))||n.enumerable});return t},kf=(t,e,r)=>(Th(t,e,"default"),r),$h=(t,e,r)=>(r=t!=null?fk(pk(t)):{},Th(Lu(r,"default",{value:t,enumerable:!0}),t)),Rh=t=>Th(Lu({},"__esModule",{value:!0}),t),Of={};en(Of,{AnnotatedTextEdit:()=>Ar,ChangeAnnotation:()=>pn,ChangeAnnotationIdentifier:()=>et,CodeAction:()=>Zp,CodeActionContext:()=>Jp,CodeActionKind:()=>Xp,CodeActionTriggerKind:()=>Yl,CodeDescription:()=>wp,CodeLens:()=>Qp,Color:()=>Ac,ColorInformation:()=>Ap,ColorPresentation:()=>Ep,Command:()=>dn,CompletionItem:()=>Gp,CompletionItemKind:()=>kp,CompletionItemLabelDetails:()=>Mp,CompletionItemTag:()=>Lp,CompletionList:()=>Fp,CreateFile:()=>ba,DeleteFile:()=>Sa,Diagnostic:()=>Wl,DiagnosticRelatedInformation:()=>Ec,DiagnosticSeverity:()=>_p,DiagnosticTag:()=>Sp,DocumentHighlight:()=>Kp,DocumentHighlightKind:()=>Up,DocumentLink:()=>tm,DocumentSymbol:()=>Yp,DocumentUri:()=>Tp,EOL:()=>x$,FoldingRange:()=>bp,FoldingRangeKind:()=>Cp,FormattingOptions:()=>em,Hover:()=>zp,InlayHint:()=>cm,InlayHintKind:()=>_c,InlayHintLabelPart:()=>Sc,InlineCompletionContext:()=>ym,InlineCompletionItem:()=>dm,InlineCompletionList:()=>pm,InlineCompletionTriggerKind:()=>mm,InlineValueContext:()=>um,InlineValueEvaluatableExpression:()=>lm,InlineValueText:()=>sm,InlineValueVariableLookup:()=>om,InsertReplaceEdit:()=>Dp,InsertTextFormat:()=>Op,InsertTextMode:()=>xp,Location:()=>Kl,LocationLink:()=>Rp,MarkedString:()=>Hl,MarkupContent:()=>wa,MarkupKind:()=>bc,OptionalVersionedTextDocumentIdentifier:()=>ql,ParameterInformation:()=>jp,Position:()=>oe,Range:()=>te,RenameFile:()=>_a,SelectedCompletionInfo:()=>hm,SelectionRange:()=>rm,SemanticTokenModifiers:()=>am,SemanticTokenTypes:()=>nm,SemanticTokens:()=>im,SignatureInformation:()=>Bp,StringValue:()=>fm,SymbolInformation:()=>qp,SymbolKind:()=>Wp,SymbolTag:()=>Vp,TextDocument:()=>vm,TextDocumentEdit:()=>Vl,TextDocumentIdentifier:()=>Ip,TextDocumentItem:()=>Pp,TextEdit:()=>ar,URI:()=>Rc,VersionedTextDocumentIdentifier:()=>Np,WorkspaceChange:()=>D$,WorkspaceEdit:()=>Cc,WorkspaceFolder:()=>gm,WorkspaceSymbol:()=>Hp,integer:()=>$p,uinteger:()=>Ul});var Tp,Rc,$p,Ul,oe,te,Kl,Rp,Ac,Ap,Ep,Cp,bp,Ec,_p,Sp,wp,Wl,dn,ar,pn,et,Ar,Vl,ba,_a,Sa,Cc,Pl,Bd,D$,Ip,Np,ql,Pp,bc,wa,kp,Op,Lp,Dp,xp,Mp,Gp,Fp,Hl,zp,jp,Bp,Up,Kp,Wp,Vp,qp,Hp,Yp,Xp,Yl,Jp,Zp,Qp,em,tm,rm,nm,am,im,sm,om,lm,um,_c,Sc,cm,fm,dm,pm,mm,hm,ym,gm,x$,vm,av,E,Du=hk({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})(Tp||(Tp={})),(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})(Rc||(Rc={})),(function(a){a.MIN_VALUE=-2147483648,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i})($p||($p={})),(function(a){a.MIN_VALUE=0,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i})(Ul||(Ul={})),(function(a){function i(u,l){return u===Number.MAX_VALUE&&(u=Ul.MAX_VALUE),l===Number.MAX_VALUE&&(l=Ul.MAX_VALUE),{line:u,character:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&E.uinteger(l.line)&&E.uinteger(l.character)}s(o,"is"),a.is=o})(oe||(oe={})),(function(a){function i(u,l,c,f){if(E.uinteger(u)&&E.uinteger(l)&&E.uinteger(c)&&E.uinteger(f))return{start:oe.create(u,l),end:oe.create(c,f)};if(oe.is(u)&&oe.is(l))return{start:u,end:l};throw new Error(`Range#create called with invalid arguments[${u}, ${l}, ${c}, ${f}]`)}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&oe.is(l.start)&&oe.is(l.end)}s(o,"is"),a.is=o})(te||(te={})),(function(a){function i(u,l){return{uri:u,range:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&te.is(l.range)&&(E.string(l.uri)||E.undefined(l.uri))}s(o,"is"),a.is=o})(Kl||(Kl={})),(function(a){function i(u,l,c,f){return{targetUri:u,targetRange:l,targetSelectionRange:c,originSelectionRange:f}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&te.is(l.targetRange)&&E.string(l.targetUri)&&te.is(l.targetSelectionRange)&&(te.is(l.originSelectionRange)||E.undefined(l.originSelectionRange))}s(o,"is"),a.is=o})(Rp||(Rp={})),(function(a){function i(u,l,c,f){return{red:u,green:l,blue:c,alpha:f}}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&E.numberRaLine truncated
`,`\r
`,"\r"],(function(a){function i(c,f,d,p){return new av(c,f,d,p)}s(i,"create"),a.create=i;function o(c){let f=c;return!!(E.defined(f)&&E.string(f.uri)&&(E.undefined(f.languageId)||E.string(f.languageId))&&E.uinteger(f.lineCount)&&E.func(f.getText)&&E.func(f.positionAt)&&E.func(f.offsetAt))}s(o,"is"),a.is=o;function u(c,f){let d=c.getText(),p=l(f,(h,T)=>{let C=h.range.start.line-T.range.start.line;return C===0?h.range.start.character-T.range.start.character:C}),y=d.length;for(let h=p.length-1;h>=0;h--){let T=p[h],C=c.offsetAt(T.range.start),v=c.offsetAt(T.range.end);if(v<=y)d=d.substring(0,C)+T.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");y=C}return d}s(u,"applyEdits"),a.applyEdits=u;function l(c,f){if(c.length<=1)return c;const d=c.length/2|0,p=c.slice(0,d),y=c.slice(d);l(p,f),l(y,f);let h=0,T=0,C=0;for(;h<p.length&&T<y.length;)f(p[h],y[T])<=0?c[C++]=p[h++]:c[C++]=y[T++];for(;h<p.length;)c[C++]=p[h++];for(;T<y.length;)c[C++]=y[T++];return c}s(l,"mergeSort")})(vm||(vm={})),av=(n=class{constructor(i,o,u,l){this._uri=i,this._languageId=o,this._version=u,this._content=l,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(i){if(i){let o=this.offsetAt(i.start),u=this.offsetAt(i.end);return this._content.substring(o,u)}return this._content}update(i,o){this._content=i.text,this._version=o,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let i=[],o=this._content,u=!0;for(let l=0;l<o.length;l++){u&&(i.push(l),u=!1);let c=o.charAt(l);u=c==="\r"||c===`
`,c==="\r"&&l+1<o.length&&o.charAt(l+1)===`
`&&l++}u&&o.length>0&&i.push(o.length),this._lineOffsets=i}return this._lineOffsets}positionAt(i){i=Math.max(Math.min(i,this._content.length),0);let o=this.getLineOffsets(),u=0,l=o.length;if(l===0)return oe.create(0,i);for(;u<l;){let f=Math.floor((u+l)/2);o[f]>i?l=f:u=f+1}let c=u-1;return oe.create(c,i-o[c])}offsetAt(i){let o=this.getLineOffsets();if(i.line>=o.length)return this._content.length;if(i.line<0)return 0;let u=o[i.line],l=i.line+1<o.length?o[i.line+1]:this._content.length;return Math.max(Math.min(u+i.character,l),u)}get lineCount(){return this.getLineOffsets().length}},s(n,"FullTextDocument"),n),(function(a){const i=Object.prototype.toString;function o(v){return typeof v<"u"}s(o,"defined"),a.defined=o;function u(v){return typeof v>"u"}s(u,"undefined"),a.undefined=u;function l(v){return v===!0||v===!1}s(l,"boolean"),a.boolean=l;function c(v){return i.call(v)==="[object String]"}s(c,"string"),a.string=c;function f(v){return i.call(v)==="[object Number]"}s(f,"number"),a.number=f;function d(v,w,b){return i.call(v)==="[object Number]"&&w<=v&&v<=b}s(d,"numberRange"),a.numberRange=d;function p(v){return i.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}s(p,"integer"),a.integer=p;function y(v){return i.call(v)==="[object Number]"&&0<=v&&v<=2147483647}s(y,"uinteger"),a.uinteger=y;function h(v){return i.call(v)==="[object Function]"}s(h,"func"),a.func=h;function T(v){return v!==null&&typeof v=="object"}s(T,"objectLiteral"),a.objectLiteral=T;function C(v,w){return Array.isArray(v)&&v.every(w)}s(C,"typedArray"),a.typedArray=C})(E||(E={}))}}),Wn=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}s(r,"RAL"),(function(n){function a(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");e=i}s(a,"install"),n.install=a})(r||(r={})),t.default=r}}),xu=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}s(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}s(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}s(n,"number"),t.number=n;function a(l){return l instanceof Error}s(a,"error"),t.error=a;function i(l){return typeof l=="function"}s(i,"func"),t.func=i;function o(l){return Array.isArray(l)}s(o,"array"),t.array=o;function u(l){return o(l)&&l.every(c=>r(c))}s(u,"stringArray"),t.stringArray=u}}),nl=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Wn(),r;(function(u){const l={dispose(){}};u.None=function(){return l}})(r||(t.Event=r={}));var n=(i=class{add(l,c=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(c),Array.isArray(f)&&f.push({dispose:s(()=>this.remove(l,c),"dispose")})}remove(l,c=null){if(!this._callbacks)return;let f=!1;for(let d=0,p=this._callbacks.length;d<p;d++)if(this._callbacks[d]===l)if(this._contexts[d]===c){this._callbacks.splice(d,1),this._contexts.splice(d,1);return}else f=!0;if(f)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...l){if(!this._callbacks)return[];const c=[],f=this._callbacks.slice(0),d=this._contexts.slice(0);for(let p=0,y=f.length;p<y;p++)try{c.push(f[p].apply(d[p],l))}catch(h){(0,e.default)().console.error(h)}return c}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s(i,"CallbackList"),i),a=(o=class{constructor(l){this._options=l}get event(){return this._event||(this._event=(l,c,f)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,c);const d={dispose:s(()=>{this._callbacks&&(this._callbacks.remove(l,c),d.dispose=o._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(f)&&f.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},s(o,"Emitter"),o);t.Emitter=a,a._noop=function(){}}}),Lf=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,c;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Wn(),r=xu(),n=nl(),a;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Even Line truncated
${JSON.stringify(Object.fromEntries(h))}`));return}const C=parseInt(T);if(isNaN(C)){this.fireError(new Error(`Content-Length value must be a number. Got ${T}`));return}this.nextMessageLength=C}const y=this.buffer.tryReadBody(this.nextMessageLength);if(y===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const h=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(y):y,T=await this.options.contentTypeDecoder.decode(h,this.options);this.callback(T)}).catch(h=>{this.fireError(h)})}}catch(y){this.fireError(y)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((p,y)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:y}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},s(f,"ReadableStreamMessageReader"),f);t.ReadableStreamMessageReader=l}}),Tk=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,p;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Wn(),r=xu(),n=F$(),a=nl(),i="Content-Length: ",o=`\r
`,u;(function(y){function h(T){let C=T;return C&&r.func(C.dispose)&&r.func(C.onClose)&&r.func(C.onError)&&r.func(C.write)}s(h,"is"),y.is=h})(u||(t.MessageWriter=u={}));var l=(d=class{constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h,T,C){this.errorEmitter.fire([this.asError(h),T,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(h){return h instanceof Error?h:new Error(`Writer received error. Reason: ${r.string(h.message)?h.message:"unknown"}`)}},s(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var c;(function(y){function h(T){return T===void 0||typeof T=="string"?{charset:T??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:T.charset??"utf-8",contentEncoder:T.contentEncoder,contentTypeEncoder:T.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}s(h,"fromOptions"),y.fromOptions=h})(c||(c={}));var f=(p=class extends l{constructor(h,T){super(),this.writable=h,this.options=c.fromOptions(T),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(h){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(h,this.options).then(C=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(C):C).then(C=>{const v=[];return v.push(i,C.byteLength.toString(),o),v.push(o),this.doWrite(h,v,C)},C=>{throw this.fireError(C),C}))}async doWrite(h,T,C){try{return await this.writable.write(T.join(""),"ascii"),this.writable.write(C)}catch(v){return this.handleError(v,h),Promise.reject(v)}}handleError(h,T){this.errorCount++,this.fireError(h,T,this.errorCount)}end(){this.writable.end()}},s(p,"WriteableStreamMessageWriter"),p);t.WriteableStreamMessageWriter=f}}),$k=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r
`,a=(i=class{constructor(u="utf-8"){this._encoding=u,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(u){const l=typeof u=="string"?this.fromString(u,this._encoding):u;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(u=!1){if(this._chunks.length===0)return;let l=0,c=0,f=0,d=0;e:for(;c<this._chunks.length;){const T=this._chunks[c];for(f=0;f<T.length;){switch(T[f]){case e:switch(l){case 0:l=1;break;case 2:l=3;break;default:l=0}break;case r:switch(l){case 1:l=2;break;case 3:l=4,f++;break e;default:l=0}break;default:l=0}f++}d+=T.byteLength,c++}if(l!==4)return;const p=this._read(d+f),y=new Map,h=this.toString(p,"ascii").split(n);if(h.length<2)return y;for(let T=0;T<h.length-2;T++){const C=h[T],v=C.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'
${C}`);const w=C.substr(0,v),b=C.substr(v+1).trim();y.set(u?w.toLowerCase():w,b)}return y}tryReadBody(u){if(!(this._totalLength<u))return this._read(u)}get numberOfBytes(){return this._totalLength}_read(u){if(u===0)return this.emptyBuffer();if(u>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===u){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=u,this.asNative(d)}if(this._chunks[0].byteLength>u){const d=this._chunks[0],p=this.asNative(d,u);return this._chunks[0]=d.slice(u),this._totalLength-=u,p}const l=this.allocNative(u);let c=0,f=0;for(;u>0;){const d=this._chunks[f];if(d.byteLength>u){const p=d.slice(0,u);l.set(p,c),c+=u,this._chunks[f]=d.slice(u),this._totalLength-=u,u-=u}else l.set(d,c),c+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,u-=d.byteLength}return l}},s(i,"AbstractMessageBuffer"),i);t.AbstractMessageBuffer=a}}),Rk=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var k,_;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=Wn(),r=xu(),n=M$(),a=G$(),i=nl(),o=Lf(),u;(function($){$.type=new n.NotificationType("$/cancelRequest")})(u||(u={}));var l;(function($){function I(R){return typeof R=="string"||typeof R=="number"}s(I,"is"),$.is=I})(l||(t.ProgressToken=l={}));var c;(function($){$.type=new n.NotificationType("$/progress")})(c||(c={}));var f=(k=class{constructor(){}},s(k,"ProgressType"),k);t.ProgressType=f;var d;(function($){function I(R){return r.func(R)}s(I,"is"),$.is=I})(d||(d={})),t.NullLogger=Object.freeze({error:s(()=>{},"error"),warn:s(()=>{},"warn"),info:s(()=>{},"info"),log:s(()=>{},"log")});var p;(function($){$[$.Off=0]="Off",$[$.Messages=1]="Messages",$[$.Compact=2]="Compact",$[$.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var y;(function($){$.Off="off",$.Messages="messages",$.Compact="compact",$.Verbose="verbose"})(y||(t.TraceValues=y={})),(function($){function I(A){if(!r.string(A))return $.Off;switch(A=A.toLowerCase(),A){case"off":return $.Off;case"messages":return $.Messages;case"compact":return $.Compact;case"verbose":return $.Verbose;default:return $.Off}}s(I,"fromString"),$.fromString=I;function R(A){switch(A){case $.Off:return"off";case $.Messages:return"messages";case $.Compact:return"compact";case $.Verbose:return"verbose";default:return"off"}}s(R,"toString"),$.toString=R})(p||(t.Trace=p={}));var h;(function($){$.Text="text",$.JSON="json"})(h||(t.TraceFormat=h={})),(function($){function I(R){return r.string(R)?(R=R.toLowerCase(),R==="json"?$.JSON:$.Text):$.Text}s(I,"fromString"),$.fromString=I})(h||(t.TraceFormat=h={}));var T;(function($){$.type=new n.NotificationType("$/setTrace")})(T||(t.SetTraceNotification=T={}));var C;(function($){$.type=new n.NotificationType("$/logTrace")})(C||(t.LogTraceNotification=C={}));var v;(function($){$[$.Closed=1]="Closed",$[$.Disposed=2]="Disposed",$[$.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var w=(_=class extends Error{constructor(I,R){super(R),this.code=I,Object.setPrototypeOf(this,_.prototype)}},s(_,"ConnectionError"),_);t.ConnectionError=w;var b;(function($){function I(R){const A=R;return A&&r.func(A.cancelUndispatched)}s(I,"is"),$.is=I})(b||(t.ConnectionStrategy=b={}));var N;(function($){function I(R){const A=R;return A&&(A.kind===void 0||A.kind==="id")&&r.func(A.createCancellationTokenSource)&&(A.dispose===void 0||r.func(A.dispose))}s(I,"is"),$.is=I})(N||(t.IdCancellationReceiverStrategy=N={}));var B;(function($){function I(R){const A=R;return A&&A.kind==="request"&&r.func(A.createCancellationTokenSource)&&(A.dispose===void 0||r.func(A.dispose))}s(I,"is"),$.is=I})(B||(t.RequestCancellationReceiverStrategy=B={}));var ne;(function($){$.Message=Object.freeze({createCancellationTokenSource(R){return new o.CancellationTokenSource}});function I(R){return N.is(R)||B.is(R)}s(I,"is"),$.is=I})(ne||(t.CancellationReceiverStrategy=ne={}));var J;(function($){$.Message=Object.freeze({sendCancellation(R,A){return R.sendNotification(u.type,{id:A})},cleanup(R){}});function I(R){const A=R;return A&&r.func(A.sendCancellation)&&r.func(A.cleanup)}s(I,"is"),$.is=I})(J||(t.CancellationSenderStrategy=J={}));var he;(function($){$.Message=Object.freeze({receiver:ne.Message,sender:J.Message});function I(R){const A=R;return A&&ne.is(A.receiver)&&J.is(A.sender)}s(I,"is"),$.is=I})(he||(t.CancellationStrategy=he={}));var Ae;(function($){function I(R){const A=R;return A&&r.func(A.handleMessage)}s(I,"is"),$.is=I})(Ae||(t.MessageStrategy=Ae={}));var ye;(function($){function I(R){const A=R;ret Line truncated
${JSON.stringify(g.error,void 0,4)}`):S.error("Received response message without id. No further error information provided.");else{const P=g.id,D=Ee.get(P);if(wl(g,D),D!==void 0){Ee.delete(P);try{if(g.error){const F=g.error;D.reject(new n.ResponseError(F.code,F.message,F.data))}else if(g.result!==void 0)D.resolve(g.result);else throw new Error("Should never happen.")}catch(F){F.message?S.error(`Response handler '${D.method}' failed with message: ${F.message}`):S.error(`Response handler '${D.method}' failed unexpectedly.`)}}}}s(Al,"handleResponse");function El(g){if(er())return;let P,D;if(g.method===u.type.method){const F=g.params.id;Ve.delete(F),sn(g);return}else{const F=Z.get(g.method);F&&(D=F.handler,P=F.type)}if(D||q)try{if(sn(g),D)if(g.params===void 0)P!==void 0&&P.numberOfParams!==0&&P.parameterStructures!==n.ParameterStructures.byName&&S.error(`Notification ${g.method} defines ${P.numberOfParams} params but received none.`),D();else if(Array.isArray(g.params)){const F=g.params;g.method===c.type.method&&F.length===2&&l.is(F[0])?D({token:F[0],value:F[1]}):(P!==void 0&&(P.parameterStructures===n.ParameterStructures.byName&&S.error(`Notification ${g.method} defines parameters by name but received parameters by position`),P.numberOfParams!==g.params.length&&S.error(`Notification ${g.method} defines ${P.numberOfParams} params but received ${F.length} arguments`)),D(...F))}else P!==void 0&&P.parameterStructures===n.ParameterStructures.byPosition&&S.error(`Notification ${g.method} defines parameters by position but received parameters by name`),D(g.params);else q&&q(g.method,g.params)}catch(F){F.message?S.error(`Notification handler '${g.method}' failed with message: ${F.message}`):S.error(`Notification handler '${g.method}' failed unexpectedly.`)}else je.fire(g)}s(El,"handleNotification");function Cl(g){if(!g){S.error("Received empty message.");return}S.error(`Received message which is neither a response nor a notification message:
${JSON.stringify(g,null,4)}`);const P=g;if(r.string(P.id)||r.number(P.id)){const D=P.id,F=Ee.get(D);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}s(Cl,"handleInvalidMessage");function xt(g){if(g!=null)switch(ee){case p.Verbose:return JSON.stringify(g,null,4);case p.Compact:return JSON.stringify(g);default:return}}s(xt,"stringifyTrace");function bl(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&g.params&&(P=`Params: ${xt(g.params)}
`),ce.log(`Sending request '${g.method} - (${g.id})'.`,P)}else tr("send-request",g)}s(bl,"traceSendingRequest");function _l(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&(g.params?P=`Params: ${xt(g.params)}
`:P=`No parameters provided.
`),ce.log(`Sending notification '${g.method}'.`,P)}else tr("send-notification",g)}s(_l,"traceSendingNotification");function jr(g,P,D){if(!(ee===p.Off||!ce))if(Qe===h.Text){let F;(ee===p.Verbose||ee===p.Compact)&&(g.error&&g.error.data?F=`Error data: ${xt(g.error.data)}
`:g.result?F=`Result: ${xt(g.result)}
`:g.error===void 0&&(F=`No result returned.
`)),ce.log(`Sending response '${P} - (${g.id})'. Processing request took ${Date.now()-D}ms`,F)}else tr("send-response",g)}s(jr,"traceSendingResponse");function Sl(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&g.params&&(P=`Params: ${xt(g.params)}
`),ce.log(`Received request '${g.method} - (${g.id})'.`,P)}else tr("receive-request",g)}s(Sl,"traceReceivedRequest");function sn(g){if(!(ee===p.Off||!ce||g.method===C.type.method))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&(g.params?P=`Params: ${xt(g.params)}
`:P=`No parameters provided.
`),ce.log(`Received notification '${g.method}'.`,P)}else tr("receive-notification",g)}s(sn,"traceReceivedNotification");function wl(g,P){if(!(ee===p.Off||!ce))if(Qe===h.Text){let D;if((ee===p.Verbose||ee===p.Compact)&&(g.error&&g.error.data?D=`Error data: ${xt(g.error.data)}
`:g.result?D=`Result: ${xt(g.result)}
`:g.error===void 0&&(D=`No result returned.
`)),P){const F=g.error?` Request failed: ${g.error.message} (${g.error.code}).`:"";ce.log(`Received response '${P.method} - (${g.id})' in ${Date.now()-P.timerStart}ms.${F}`,D)}else ce.log(`Received response ${g.id} without active response promise.`,D)}else tr("receive-response",g)}s(wl,"traceReceivedResponse");function tr(g,P){if(!ce||ee===p.Off)return;const D={isLSPMessage:!0,type:g,message:P,timestamp:Date.now()};ce.log(D)}s(tr,"logLSPMessage");function Tr(){if(ma())throw new w(v.Closed,"Connection is closed.");if(er())throw new w(v.Disposed,"Connection is disposed.")}s(Tr,"throwIfClosedOrDisposed");function Il(){if(pa())throw new w(v.AlreadyListening,"Connection is already listening")}s(Il,"throwIfListening");function Nl(){if(!pa())throw new Error("Call listen() first.")}s(Nl,"throwIfNotListening");function m(g){return g===void 0?null:g}s(m,"undefinedToNull");function le(g){if(g!==null)return g}s(le,"nullToUndefined");function we(g){return g!=null&&!Array.isArray(g)&&typeof g=="object"}s(we,"isNamedParam");function H(g,P){switch(g){case n.ParameterStructures.auto:return we(P)?le(P):[m(P)];case n.ParameterStructures.byName:if(!we(P))throw new Error("Received parameters by name but param is not an object literal.");return le(P);case n.ParameterStructures.byPosition:return[m(P)];default:throw new Error(`Unknown parameter structure ${g.toString()}`)}}s(H,"computeSingleParam");function Ie(g,P){let D;const F=g.numberOfParams;switch(F){case 0:D=void 0;break;case 1:D=H(g.parameterStructures,P[0]);break;default:D=[];for(let Ce=0;Ce<P.length&&Ce<F;Ce++)D.push(m(P[Ce]));if(P.length<F)for(let Ce=P.length;Ce<F;Ce++)D.push(null);break}return D}s(Ie,"computeMessageParams");const va={sendNotification:s((g,...P)=>{Tr();let D,F;if(r.string(g)){D=g;const me=P[0];let De=0,Ge=n.ParameterStructures.auto;n.ParameterStructures.is(me)&&(De=1,Ge=me);let ie=P.length;const Ne=ie-De;switch(Ne){case 0:F=void 0;break;case 1:F=H(Ge,P[De]);break;default:if(Ge===n.ParameterStructures.byName)throw new Error(`Received ${Ne} parameters for 'by Name' notification parameter structure.`);F=P.slice(De,ie).map(fe=>m(fe));break}}else{const me=P;D=g.method,F=Ie(g,me)}const Ce={jsonrpc:z,method:D,params:F};return _l(Ce),I.write(Ce).catch(me=>{throw S.error("Sending notification failed."),me})},"sendNotification"),onNotification:s((g,P)=>{Tr();let D;return r.func(g)?q=g:P&&(r.string(g)?(D=g,Z.set(g,{type:void 0,handler:P})):(D=g.method,Z.set(g.method,{type:g,handler:P}))),{dispose:s(()=>{D!==void 0?Z.delete(D):q=void 0},"dispose")}},"onNotification"),onProgress:s((g,P,D)=>{if(ae.has(P))throw new Error(`Progress handler for token ${P} already registered`);return ae.set(P,D),{dispose:s(()=>{ae.delete(P)},"dispose")}},"onProgress"),sendProgress:s((g,P,D)=>va.sendNotification(c.type,{token:P,value:D}),"sendProgress"),onUnhandledProgress:Qt.event,sendRequest:s((g,...P)=>{Tr(),Nl();let D,F,Ce;if(r.string(g)){D=g;const ie=P[0],Ne=P[P.length-1];let fe=0,Ue=n.ParameterStructures.auto;n.ParameterStructures.is(ie)&&(fe=1,Ue=ie);let lt=P.length;o.CancellationToken.is(Ne)&&(lt=lt-1,Ce=Ne);const rr=lt-fe;switch(rr){case 0:F=void 0;break;case 1:F=H(Ue,P[fe]);break;default:if(Ue===n.ParameterStructures.byName)throw new Error(`Received ${rr} parameters for 'by Name' request parameter structure.`);F=P.slice(fe,lt).map(ck=>m(ck));break}}else{const ie=P;D=g.method,F=Ie(g,ie);const Ne=g.numberOfParams;Ce=o.CancellationToken.is(ie[Ne])?ie[Ne]:void 0}const me=L++;let De;Ce&&(De=Ce.onCancellationRequested(()=>{const ie=ve.sender.sendCancellation(va,me);return ie===void 0?(S.log(`Received no promise from cancellation strategy when cancelling id ${me}`),Promise.resolve()):ie.catch(()=>{S.log(`Sending cancellation messages for id ${me} failed`)})}));const Ge={jsonrpc:z,id:me,method:D,params:F};return bl(Ge),typeof ve.sender.enableCancellation=="function"&&ve.sender.enableCancellation(Ge),new Promise(async(ie,Ne)=>{const fe=s(rr=>{ie(rr),ve.sender.cleanup(me),De?.dispose()},"resolveWithCleanup"),Ue=s(rr=>{Ne(rr),ve.sender.cleanup(me),De?.dispose()},"rejectWithCleanup"),lt={method:D,timerStart:Date.now(),resolve:fe,reject:Ue};try{await I.write(Ge),Ee.set(me,lt)}catch(rr){throw S.error("Sending request failed."),lt.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,rr.message?rr.message:"Unknown reason")),rr}})},"sendRequest"),onRequest:s((g,P)=>{Tr();let D=null;return d.is(g)?(D=void 0,M=g):r.string(g)?(D=null,P!==void 0&&(D=g,Y.set(g,{handler:P,type:void 0}))):P!==void 0&&(D=g.method,Y.set(g.method,{type:g,handler:P})),{dispose:s(()=>{D!==null&&(D!==void 0?Y.delete(D):M=void 0)},"dispose")}},"onRequest"),hasPendingResponse:s(()=>Ee.size>0,"hasPendingResponse"),trace:s(async(g,P,D)=>{let F=!1,Ce=h.Text;D!==void 0&&(r.boolean(D)?F=D:(F=D.sendNotification||!1,Ce=D.traceFormat||h.Text)),ee=g,Qe=Ce,ee===p.Off?ce=void 0:ce=P,F&&!ma()&&!er()&&await va.sendNotification(T.type,{value:p.toString(g)})},"trace"),onError:ge.event,onClose:G.event,onUnhandledNotification:je.event,onD Line truncated
`),W("\r"),W(" "),W("\v"),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W("\u2028"),W("\u2029"),W(" "),W(" "),W(" "),W("\uFEFF")],Yk=/[0-9a-fA-F]/,nc=/[0-9]/,Xk=/[1-9]/,ri,mR=(ri=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ia(n,"global");break;case"i":Ia(n,"ignoreCase");break;case"m":Ia(n,"multiLine");break;case"u":Ia(n,"unicode");break;case"y":Ia(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}mn(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return pR()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const a=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:a,atMost:a};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),r={atLeast:a,atMost:i}):r={atLeast:a,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;mn(r);break}if(!(e===!0&&r===void 0)&&mn(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),mn(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(`
`),W("\r"),W("\u2028"),W("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=lf;break;case"D":e=lf,r=!0;break;case"s":e=sv;break;case"S":e=sv,r=!0;break;case"w":e=uf;break;case"W":e=uf,r=!0;break}if(mn(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(`
`);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}if(mn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:W("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:W(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:W(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,Rm(n)&&this.isRangeDash()){this.consumeChar("-");const a=this.classAtom();if(a.type,Rm(a)){if(a.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:a.value})}else wc(n.value,e),e.push(W("-")),wc(a.value,e)}else wc(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:W("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;const r=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(Xk.test(e)===!1)throw Error("Expecting a positive integer");for(;nc.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(nc.test(e)===!1)throw Error("Expecting an integer");for(;nc.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:W(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return nc.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let a=0;a<e;a++){const i=this.popChar();if(Yk.test(i)===!1)throw Error("Expecting a HexDecimal digits");r+=i}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},s(ri,"RegExpParser"),ri),ni,Kf=(ni=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(a=>{this.visit(a)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},s(ni,"BaseRegExpVisitor"),ni),hR=/\r?\n/gm,yR=new mR,ai,Jk=(ai=class extends Kf{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===`
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=il(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},s(ai,"TerminalRegExpVisitor"),ai),On=new Jk;function gR(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=yR.pattern(t),r=[];for(const n of e.value.value)On.reset(t),On.visit(n),r.push({start:On.startRegexp,end:On.endRegex});return r}catch{return[]}}s(gR,"getTerminalParts");function iy(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),On.reset(t),On.visit(yR.pattern(t)),On.multiline}catch{return!1}}s(iy,"isMultilineComment");var vR=`\f
\r \v              \u2028\u2029   \uFEFF`.split("");function Wf(t){const e=typeof t=="string"?new RegExp(t):t;return vR.some(r=>e.test(r))}s(Wf,"isWhitespace");function il(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(il,"escapeRegExp");function sy(t,e){const r=oy(t),n=e.match(r);return!!n&&n[0].length>0}s(sy,"partialMatches");function oy(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function a(){let i="",o;function u(c){i+=r.substr(n,c),n+=c}s(u,"appendRaw");function l(c){i+="(?:"+r.substr(n,c)+"|$)",n+=c}for(s(l,"appendOptional");n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?r[n+2]==="{"?l(r.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(r.indexOf("}",n)-n+1):l(2);break;case"k":l(r.indexOf(">",n)-n+1);break;default:l(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],l(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":u(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?u(o[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":i+="(?:",n+=3,i+=a()+"|$)";break;case"=":i+="(?=",n+=3,i+=a()+")";break;case"!":o=n,n+=3,a(),i+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),i+=r.substr(o,n-o);break;default:u(r.indexOf(">",n)-n+1),i+=a()+"|$)";break}break}else u(1),i+=a()+"|$)";break;case")":return++n,i;default:l(1);break}return i}return s(a,"process"),new RegExp(a(),t.flags)}s(oy,"partialRegExp");function ly(t){return t.rules.find(e=>mt(e)&&e.entry)}s(ly,"getEntryRule");function uy(t){return t.rules.filter(e=>jt(e)&&e.hidden)}s(uy,"getHiddenRules");function Vf(t,e){const r=new Set,n=ly(t);if(!n)return new Set(t.rules);const a=[n].concat(uy(t));for(const o of a)cy(o,r,e);const i=new Set;for(const o of t.rules)(r.has(o.name)||jt(o)&&o.hidden)&&i.add(o);return i}s(Vf,"getAllReachableRules");function cy(t,e,r){e.add(t.name),Mr(t).forEach(n=>{if(Nr(n)||r&&Ff(n)){const a=n.rule.ref;a&&!e.has(a.name)&&cy(a,e,r)}})}s(cy,"ruleDfs");function TR(t){const e=new Set;return Mr(t).forEach(r=>{Yn(r)&&(mt(r.type.ref)&&e.add(r.type.ref),Gu(r.type.ref)&&mt(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}s(TR,"getAllRulesUsedForCrossReferences");function fy(t){if(t.terminal)return t.terminal;if(t.type.ref)return Xf(t.type.ref)?.terminal}s(fy,"getCrossReferenceTerminal");function dy(t){return t.hidden&&!Wf(ju(t))}s(dy,"isCommentTerminal");function py(t,e){return!t||!e?[]:Hf(t,e,t.astNode,!0)}s(py,"findNodesForProperty");function qf(t,e,r){if(!t||!e)return;const n=Hf(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}s(qf,"findNodeForProperty");function Hf(t,e,r,n){if(!n){const a=qn(t.grammarSource,wr);if(a&&a.feature===e)return[t]}return Sr(t)&&t.astNode===r?t.content.flatMap(a=>Hf(a,e,r,!1)):[]}s(Hf,"findNodesForPropertyInternal");function $R(t,e){return t?Yf(t,e,t?.astNode):[]}s($R,"findNodesForKeyword");function my(t,e,r){if(!t)return;const n=Yf(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}s(my,"findNodeForKeyword");function Yf(t,e,r){if(t.astNode!==r)return[];if(Ir(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Jo(t).iterator();let a;const i=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Ir(o.grammarSource)&&o.grammarSource.value===e&&i.push(o):n.prune()}while(!a.done);return i}s(Yf,"findNodesForKeywordInternal");function hy(t){const e=t.astNode;for(;e===t.container?.astNode;){const r=qn(t.grammarSource,wr);if(r)return r;t=t.container}}s(hy,"findAssignment");function Xf(t){let e=t;return Gu(e)&&(Yr(e.$container)?e=e.$container.$container:Hn(e.$container)?e=e.$container:tn(e.$container)),yy(t,e,new Map)}s(Xf,"findNameAssignment");function yy(t,e,r){function n(a,i){let o;return qn(a,wr)||(o=yy(i,i,r)),r.set(t,o),o}if(s(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Mr(e)){if(wr(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Nr(a)&&mt(a.rule.ref))return n(a,a.rule.ref);if(Gf(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}s(yy,"findNameAssignmentInternal");function gy(t){const e=t.$container;if(Xn(e)){const r=e.elements,n=r.indexOf(t);for(let a=n-1;a>=0;a--){const i=r[a];if(Yr(i))return i;{const o=Mr(r[a]).find(Yr);if(o)return o}}}if(xf(e))return gy(e)}s(gy,"getActionAtElement");function RR(t,e){return t==="?"||t==="*"||Xn(e)&&!!e.guardCondition}s(RR,"isOptionalCardinality");function AR(t){return t==="*"||t==="+"}s(AR,"isArrayCardinality");function ER(t){return t==="+="}s(ER,"isArrayOperator");function Fu(t){return vy(t,new Set)}s(Fu,"isDataTypeRule");function vy(t,e){if(e.has(t))return!0;e.add(t);for(const r of Mr(t))if(Nr(r)){if(!r.rule.ref||mt(r.rule.ref)&&!vy(r.rule.ref,e)||Xo(r.rule.ref))return!1}else{if(wr(r))return!1;if(Yr(r))return!1}return!!t.definition}s(vy,"isDataTypeRuleInternal");function CR(t){return cf(t.type,new Set)}s(CR,"isDat Line truncated
`;function Fb(t,e=!1){try{const r=Ju(t);return hf(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Gb)e&&Uy(`${mf} Unable to optimize: < ${t.toString()} >
Complement Sets cannot be automatically optimized.
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),pf(`${mf}
Failed parsing: < ${t.toString()} >
Using the @chevrotain/regexp-to-ast library
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}s(Fb,"getOptimizedStartCodesIndices");function hf(t,e,r){switch(t.type){case"Disjunction":for(let a=0;a<t.value.length;a++)hf(t.value[a],e,r);break;case"Alternative":const n=t.value;for(let a=0;a<n.length;a++){const i=n[a];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=i;switch(o.type){case"Character":Xl(o.value,e,r);break;case"Set":if(o.complement===!0)throw Error(Gb);V(o.value,l=>{if(typeof l=="number")Xl(l,e,r);else{const c=l;if(r===!0)for(let f=c.from;f<=c.to;f++)Xl(f,e,r);else{for(let f=c.from;f<=c.to&&f<Zl;f++)Xl(f,e,r);if(c.to>=Zl){const f=c.from>=Zl?c.from:Zl,d=c.to,p=Or(f),y=Or(d);for(let h=p;h<=y;h++)e[h]=h}}}});break;case"Group":hf(o.value,e,r);break;default:throw Error("Non Exhaustive Match")}const u=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&yf(o)===!1||o.type!=="Group"&&u===!1)break}break;default:throw Error("non exhaustive match!")}return Ke(e)}s(hf,"firstCharOptimizedIndices");function Xl(t,e,r){const n=Or(t);e[n]=n,r===!0&&zb(t,e)}s(Xl,"addOptimizedIdxToResult");function zb(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const a=Or(n.charCodeAt(0));e[a]=a}else{const a=r.toLowerCase();if(a!==r){const i=Or(a.charCodeAt(0));e[i]=i}}}s(zb,"handleIgnoreCase");function Sm(t,e){return el(t.value,r=>{if(typeof r=="number")return vt(e,r);{const n=r;return el(e,a=>n.from<=a&&a<=n.to)!==void 0}})}s(Sm,"findCode");function yf(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?se(t.value)?Yt(t.value,yf):yf(t.value):!1}s(yf,"isWholeOptional");var Ti,v1=(Ti=class extends Kf{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){vt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Sm(e,this.targetCharCodes)===void 0&&(this.found=!0):Sm(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},s(Ti,"CharCodeFinder"),Ti);function dd(t,e){if(e instanceof RegExp){const r=Ju(e),n=new v1(t);return n.visit(r),n.found}else return el(e,r=>vt(t,r.charCodeAt(0)))!==void 0}s(dd,"canMatchCharCode");var Un="PATTERN",Jl="defaultMode",ic="modes";function jb(t,e){e=jy(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:s((w,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{l_()});let n;r("Reject Lexer.NA",()=>{n=cd(t,w=>w[Un]===pt.NA)});let a=!1,i;r("Transform Patterns",()=>{a=!1,i=j(n,w=>{const b=w[Un];if(Pr(b)){const N=b.source;return N.length===1&&N!=="^"&&N!=="$"&&N!=="."&&!b.ignoreCase?N:N.length===2&&N[0]==="\\"&&!vt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],N[1])?N[1]:wm(b)}else{if(Gr(b))return a=!0,{exec:b};if(typeof b=="object")return a=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const N=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),B=new RegExp(N);return wm(B)}}else throw Error("non exhaustive match")}})});let o,u,l,c,f;r("misc mapping",()=>{o=j(n,w=>w.tokenTypeIdx),u=j(n,w=>{const b=w.GROUP;if(b!==pt.SKIPPED){if(Ct(b))return b;if(kr(b))return!1;throw Error("non exhaustive match")}}),l=j(n,w=>{const b=w.LONGER_ALT;if(b)return se(b)?j(b,B=>Fv(n,B)):[Fv(n,b)]}),c=j(n,w=>w.PUSH_MODE),f=j(n,w=>K(w,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const w=Hy(e.lineTerminatorCharacters);d=j(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=j(n,b=>K(b,"LINE_BREAKS")?!!b.LINE_BREAKS:qy(b,w)===!1&&dd(w,b.PATTERN)))});let p,y,h,T;r("Misc Mapping #2",()=>{p=j(n,Vy),y=j(i,s_),h=kt(n,(w,b)=>{const N=b.GROUP;return Ct(N)&&N!==pt.SKIPPED&&(w[N]=[]),w},{}),T=j(i,(w,b)=>({pattern:i[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:p[b],short:y[b],group:u[b],push:c[b],pop:f[b],tokenTypeIdx:o[b],tokenType:n[b]}))});let C=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=kt(n,(w,b,N)=>{if(typeof b.PATTERN=="string"){const B=b.PATTERN.charCodeAt(0),ne=Or(B);Pc(w,ne,T[N])}else if(se(b.START_CHARS_HINT)){let B;V(b.START_CHARS_HINT,ne=>{const J=typeof ne=="string"?ne.charCodeAt(0):ne,he=Or(J);B!==he&&(B=he,Pc(w,he,T[N]))})}else if(Pr(b.PATTERN))if(b.PATTERN.unicode)C=!1,e.ensureOptimizations&&pf(`${mf} Unable to analyze < ${b.PATTERN.toString()} > pattern.
The regexp unicode flag is not currently supported by the regexp-to-ast library.
This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const B=Fb(b.PATTERN,e.ensureOptimizations);Re(B)&&(C=!1),V(B,ne=>{Pc(w,ne,T[N])})}else e.ensureOptimizations&&pf(`${mf} TokenType: <${b.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),C=!1;return w},[])}),{emptyGroups:h,patternIdxToConfig:T,charCodeToPatternIdxToConfig:v,hasCustom:a,canBeOptimized:C}}s(jb,"analyzeTokenTypes");function Bb(t,e){let r=[];const n=Kb(t);r=r.concat(n.errors);const a=Wb(n.valid),i=a.valid;return r=r.concat(a.errors),r=r.concat(Ub(i)),r=r.concat(Jb(i)),r=r.concat(Zb(i,e)),r=r.concat(Qb(i)),r}s(Bb,"validatePatterns");function Ub(t){let e=[];const r=Bt(t,n=>Pr(n[Un]));return e=e.concat(Vb(r)),e=e.concat(Hb(r)),e=e.concat(Yb(r)),e=e.concat(Xb(r)),e=e.concat(qb(r)),e}s(Ub,"validateRegExpPattern");function Kb(t){const e=Bt(t,a=>!K(a,Un)),r=j(e,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:Me.MISSING_PATTERN,tokenTypes:[a]})),n=ud(t,e);return{errors:r,valid:n}}s(Kb,"findMissingPatterns");function Wb(t){const e=Bt(t,a=>{const i=a[Un];return!Pr(i)&&!Gr(i)&&!K(i,"exec")&&!Ct(i)}),r=j(e,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Me.INVALID_PATTERN,tokenTypes:[a]})),n=ud(t,e);return{errors:r,valid:n}}s(Wb,"findInvalidPatterns");var T1=/[^\\][$]/;function Vb(t){const a=class a extends Kf{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}};s(a,"EndAnchorFinder");let e=a;const r=Bt(t,i=>{const o=i.PATTERN;try{const u=Ju(o),l=new e;return l.visit(u),l.found}catch{return T1.test(o.source)}});return j(r,i=>({message:`Unexpected RegExp Anchor Error:
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Me.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(Vb,"findEndOfInputAnchor");function qb(t){const e=Bt(t,n=>n.PATTERN.test(""));return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Me.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}s(qb,"findEmptyMatchRegExps");var $1=/[^\\[][\^]|^\^/;function Hb(t){const a=class a extends Kf{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}};s(a,"StartAnchorFinder");let e=a;const r=Bt(t,i=>{const o=i.PATTERN;try{const u=Ju(o),l=new e;return l.visit(u),l.found}catch{return $1.test(o.source)}});return j(r,i=>({message:`Unexpected RegExp Anchor Error:
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Me.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(Hb,"findStartOfInputAnchor");function Yb(t){const e=Bt(t,n=>{const a=n[Un];return a instanceof RegExp&&(a.multiline||a.global)});return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Me.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}s(Yb,"findUnsupportedFlags");function Xb(t){const e=[];let r=j(t,i=>kt(t,(o,u)=>(i.PATTERN.source===u.PATTERN.source&&!vt(e,u)&&u.PATTERN!==pt.NA&&(e.push(u),o.push(u)),o),[]));r=Xu(r);const n=Bt(r,i=>i.length>1);return j(n,i=>{const o=j(i,l=>l.name);return{message:`The same RegExp pattern ->${Jt(i).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Me.DUPLICATE_PATTERNS_FOUND,tokenTypes:i}})}s(Xb,"findDuplicatePatterns");function Jb(t){const e=Bt(t,n=>{if(!K(n,"GROUP"))return!1;const a=n.GROUP;return a!==pt.SKIPPED&&a!==pt.NA&&!Ct(a)});return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Me.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}s(Jb,"findInvalidGroupType");function Zb(t,e){const r=Bt(t,a=>a.PUSH_MODE!==void 0&&!vt(e,a.PUSH_MODE));return j(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:Me.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}s(Zb,"findModesThatDoNotExist");function Qb(t){const e=[],r=kt(t,(n,a,i)=>{const o=a.PATTERN;return o===pt.NA||(Ct(o)?n.push({str:o,idx:i,tokenType:a}):Pr(o)&&t_(o)&&n.push({str:o.source,idx:i,tokenType:a})),n},[]);return V(t,(n,a)=>{V(r,({str:i,idx:o,tokenType:u})=>{if(a<o&&e_(i,n.PATTERN)){const l=`Token: ->${u.name}<- can never be matched.
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Me.UNREACHABLE_PATTERN,tokenTypes:[n,u]})}})}),e}s(Qb,"findUnreachablePatterns");function e_(t,e){if(Pr(e)){if(r_(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Gr(e))return e(t,0,[],{});if(K(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}s(e_,"tryToMatchStrToPattern");function t_(t){return el([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}s(t_,"noMetaChar");function r_(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}s(r_,"usesLookAheadOrBehind");function wm(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}s(wm,"addStickyFlag");function n_(t,e,r){const n=[];return K(t,Jl)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Jl+`> property in its definition
`,type:Me.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),K(t,ic)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ic+`> property in its definition
`,type:Me.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),K(t,ic)&&K(t,Jl)&&!K(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Jl}: <${t.defaultMode}>which does not exist
`,type:Me.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),K(t,ic)&&V(t.modes,(a,i)=>{V(a,(o,u)=>{if(kr(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${u}>
`,type:Me.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(K(o,"LONGER_ALT")){const l=se(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];V(l,c=>{!kr(c)&&!vt(a,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${i}>
`,type:Me.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}s(n_,"performRuntimeChecks");function a_(t,e,r){const n=[];let a=!1;const i=Xu(Ht(Ke(t.modes))),o=cd(i,l=>l[Un]===pt.NA),u=Hy(r);return e&&V(o,l=>{const c=qy(l,u);if(c!==!1){const d={message:o_(l,c),type:c.issue,tokenType:l};n.push(d)}else K(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(a=!0):dd(u,l.PATTERN)&&(a=!0)}),e&&!a&&n.push({message:`Warning: No LINE_BREAKS Found.
This Lexer has been defined to track line and column information,
But none of the Token Types can be identified as matching a line terminator.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
for details.`,type:Me.NO_LINE_BREAKS_FLAGS}),n}s(a_,"performWarningRuntimeChecks");function i_(t){const e={},r=Nt(t);return V(r,n=>{const a=t[n];if(se(a))e[n]=[];else throw Error("non exhaustive match")}),e}s(i_,"cloneEmptyGroups");function Vy(t){const e=t.PATTERN;if(Pr(e))return!1;if(Gr(e))return!0;if(K(e,"exec"))return!0;if(Ct(e))return!1;throw Error("non exhaustive match")}s(Vy,"isCustomPattern");function s_(t){return Ct(t)&&t.length===1?t.charCodeAt(0):!1}s(s_,"isShortPattern");var R1={test:s(function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},"test"),lastIndex:0};function qy(t,e){if(K(t,"LINE_BREAKS"))return!1;if(Pr(t.PATTERN)){try{dd(e,t.PATTERN)}catch(r){return{issue:Me.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Ct(t.PATTERN))return!1;if(Vy(t))return{issue:Me.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}s(qy,"checkLineBreaksIssues");function o_(t,e){if(e.issue===Me.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
The problem is in the <${t.name}> Token Type
Root cause: ${e.errMsg}.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Me.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
The problem is in the <${t.name}> Token Type
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}s(o_,"buildLineBreakIssueMessage");function Hy(t){return j(t,r=>Ct(r)?r.charCodeAt(0):r)}s(Hy,"getCharCodes");function Pc(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}s(Pc,"addToMapOfArrays");var Zl=256,kc=[];function Or(t){return t<Zl?t:kc[t]}s(Or,"charCodeToOptimizedIndex");function l_(){if(Re(kc)){kc=new Array(65536);for(let t=0;t<65536;t++)kc[t]=t>255?255+~~(t/255):t}}s(l_,"initCharCodeToOptimizedIndexMap");function ul(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}s(ul,"tokenStructuredMatcher");function _u(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}s(_u,"tokenStructuredMatcherNoCategories");var jv=1,u_={};function cl(t){const e=c_(t);f_(e),p_(e),d_(e),V(e,r=>{r.isParent=r.categoryMatches.length>0})}s(cl,"augmentTokenTypes");function c_(t){let e=it(t),r=t,n=!0;for(;n;){r=Xu(Ht(j(r,i=>i.CATEGORIES)));const a=ud(r,e);e=e.concat(a),Re(a)?n=!1:r=a}return e}s(c_,"expandCategories");function f_(t){V(t,e=>{Xy(e)||(u_[jv]=e,e.tokenTypeIdx=jv++),Im(e)&&!se(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Im(e)||(e.CATEGORIES=[]),m_(e)||(e.categoryMatches=[]),h_(e)||(e.categoryMatchesMap={})})}s(f_,"assignTokenDefaultProps");function d_(t){V(t,e=>{e.categoryMatches=[],V(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(u_[n].tokenTypeIdx)})})}s(d_,"assignCategoriesTokensProp");function p_(t){V(t,e=>{Yy([],e)})}s(p_,"assignCategoriesMapProp");function Yy(t,e){V(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),V(e.CATEGORIES,r=>{const n=t.concat(e);vt(n,r)||Yy(n,r)})}s(Yy,"singleAssignCategoriesToksMap");function Xy(t){return K(t,"tokenTypeIdx")}s(Xy,"hasShortKeyProperty");function Im(t){return K(t,"CATEGORIES")}s(Im,"hasCategoriesProperty");function m_(t){return K(t,"categoryMatches")}s(m_,"hasExtendingTokensTypesProperty");function h_(t){return K(t,"categoryMatchesMap")}s(h_,"hasExtendingTokensTypesMapProperty");function y_(t){return K(t,"tokenTypeIdx")}s(y_,"isTokenType");var Nm={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,a,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Me;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Me||(Me={}));var Ql={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Nm,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ql);var $i,pt=($i=class{constructor(e,r=Ql){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(a,i)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${a}>`);const{time:u,value:l}=Ky(i),c=u>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${o}<-- <${a}> time: ${u}ms`),this.traceInitIndent--,l}else return i()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=Pt({},Ql,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let a,i=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ql.lineTerminatorsPattern)this.config.lineTerminatorsPattern=R1;else if(this.config.lineTerminatorCharacters===Ql.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),se(e)?a={modes:{defaultMode:it(e)},defaultMode:Jl}:(i=!1,a=it(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(n_(a,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(a_(a,this.trackStartLines,this.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},V(a.modes,(u,l)=>{a.modes[l]=cd(u,c=>kr(c))});const o=Nt(a.modes);if(V(a.modes,(u,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Bb(u,o))}),Re(this.lexerDefinitionErrors)){cl(u);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=jb(u,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=c.charCodeToPatternIdxToConfig,this.emptyGroups=Pt({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=c.canBeOptimized}})}),this.defaultMode=a.defaultMode,!Re(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=j(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+l)}V(this.lexerDefinitionWarning,u=>{Uy(u.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(i&&(this.handleModes=He),this.trackStartLines===!1&&(this.computeNewColumn=Ku),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=He),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const u=kt(this.canModeBeOptimized,(l,c,f)=>(c===!1&&l.push(f),l),[]);if(r.ensureOptimizations&&!Re(u))throw Error(`Lexer Modes: < ${u.join(", ")} > cannot be optimized.
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Mb()}),this.TRACE_INIT("toFastProperties",()=>{Wy(this)})})}tokenize(e,r=this.defaultMode){if(!Re(this.lexerDefinitionErrors)){const a=j(this.lexerDefinitionErrors,i=>i.message).join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+a)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,a,i,o,u,l,c,f,d,p,y,h,T,C,v;const w=e,b=w.length;let N=0,B=0;const ne=this.hasCustom?0:Math.floor(e.length/10),J=new Array(ne),he=[];let Ae=this.trackStartLines?1:void 0,ye=this.trackStartLines?1:void 0;const ue=i_(this.emptyGroups),ot=this.trackStartLines,k=this.config.lineTerminatorsPattern;let _=0,$=[],I=[];const R=[],A=[];Object.freeze(A);let S=!1;const L=s(M=>{if(R.length===1&&M.tokenType.PUSH_MODE===void 0){const Y=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(M);he.push({offset:M.startOffset,line:M.startLine,column:M.startColumn,length:M.image.length,message:Y})}else{R.pop();const Y=Bn(R);$=this.patternIdxToConfig[Y],I=this.charCodeToPatternIdxToConfig[Y],_=$.length;const q=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;I&&q?S=!0:S=!1}},"pop_mode");function x(M){R.push(M),I=this.charCodeToPatternIdxToConfig[M],$=this.patternIdxToConfig[M],_=$.length,_=$.length;const Y=this.canModeBeOptimized[M]&&this.config.safeMode===!1;I&&Y?S=!0:S=!1}s(x,"push_mode"),x.call(this,r);let O;const z=this.config.recoveryEnabled;for(;N<b;){l=null,d=-1;const M=w.charCodeAt(N);let Y;if(S){const Z=Or(M),ae=I[Z];Y=ae!==void 0?ae:A}else Y=$;const q=Y.length;for(n=0;n<q;n++){O=Y[n];const Z=O.pattern;c=null;const ae=O.short;if(ae!==!1?M===ae&&(d=1,l=Z):O.isCustom===!0?(v=Z.exec(w,N,J,ue),v!==null?(l=v[0],d=l.length,v.payload!==void 0&&(c=v.payload)):l=null):(Z.lastIndex=N,d=this.matchLength(Z,e,N)),d!==-1){if(u=O.longerAlt,u!==void 0){l=e.substring(N,N+d);const Oe=u.length;for(i=0;i<Oe;i++){const pe=$[u[i]],Ee=pe.pattern;if(f=null,pe.isCustom===!0?(v=Ee.exec(w,N,J,ue),v!==null?(o=v[0],v.payload!==void 0&&(f=v.payload)):o=null):(Ee.lastIndex=N,o=this.match(Ee,e,N)),o&&o.length>l.length){l=o,d=o.length,c=f,O=pe;break}}}break}}if(d!==-1){if(p=O.group,p!==void 0&&(l=l!==null?l:e.substring(N,N+d),y=O.tokenTypeIdx,h=this.createTokenInstance(l,N,y,O.tokenType,Ae,ye,d),this.handlePayload(h,c),p===!1?B=this.addToken(J,B,h):ue[p].push(h)),ot===!0&&O.canLineTerminator===!0){let Z=0,ae,Oe;k.lastIndex=0;do l=l!==null?l:e.substring(N,N+d),ae=k.test(l),ae===!0&&(Oe=k.lastIndex-1,Z++);while(ae===!0);Z!==0?(Ae=Ae+Z,ye=d-Oe,this.updateTokenEndLineColumnLocation(h,p,Oe,Z,Ae,ye,d)):ye=this.computeNewColumn(ye,d)}else ye=this.computeNewColumn(ye,d);N=N+d,this.handleModes(O,L,x,h)}else{const Z=N,ae=Ae,Oe=ye;let pe=z===!1;for(;pe===!1&&N<b;)for(N++,a=0;a<_;a++){const Ee=$[a],Ve=Ee.pattern,Le=Ee.short;if(Le!==!1?w.charCodeAt(N)===Le&&(pe=!0):Ee.isCustom===!0?pe=Ve.exec(w,N,J,ue)!==null:(Ve.lastIndex=N,pe=Ve.exec(e)!==null),pe===!0)break}if(T=N-Z,ye=this.computeNewColumn(ye,T),C=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,Z,T,ae,Oe,Bn(R)),he.push({offset:Z,line:ae,column:Oe,length:T,message:C}),z===!1)break}}return this.hasCustom||(J.length=B),{tokens:J,groups:ue,errors:he}}handleModes(e,r,n,a){if(e.pop===!0){const i=e.push;r(a),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,a,i,o,u){let l,c;r!==void 0&&(l=n===u-1,c=l?-1:0,a===1&&l===!0||(e.endLine=i+c,e.endColumn=o-1+-c))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,a){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:a}}createStartOnlyToken(e,r,n,a,i,o){return{image:e,startOffset:r,startLine:i,startColumn:o,tokenTypeIdx:n,tokenType:a}}createFullToken(e,r,n,a,i,o,u){return{image:e,startOffset:r,endOffset:r+u-1,startLine:i,endLine:i,startColumn:o,endColumn:o+u-1,tokenTypeIdx:n,tokenType:a}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}match(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchLength(e,r,n){return e.test(r)===!0?e.lastIndex-n:-1}},s($i,"Lexer"),$i);pt.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";pt.NA=/NOT_APPLICABLE/;function Mn(t){return Jy(t)?t.LABEL:t.name}s(Mn,"tokenLabel");function Jy(t){return Ct(t.LABEL)&&t.LABEL!==""}s(Jy,"hasTokenLabel");var A1="parent",Bv="categories",Uv="label",Kv="group",Wv="push_mode",Vv="pop_mode",qv="longer_alt",Hv="line_breaks",Yv="start_chars_hint";function Xa(t){return g_(t)}s(Xa,"createToken");function g_(t){const e=t.pattern,r={};if(r.name=t.name,kr(e)||(r.PATTERN=e),K(t,A1))throw`The parent property is no longer supported.
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return K(t,Bv)&&(r.CATEGORIES=t[Bv]),cl([r]),K(t,Uv)&&(r.LABEL=t[Uv]),K(t,Kv)&&(r.GROUP=t[Kv]),K(t,Vv)&&(r.POP_MODE=t[Vv]),K(t,Wv)&&(r.PUSH_MODE=t[Wv]),K(t,qv)&&(r.LONGER_ALT=t[qv]),K(t,Hv)&&(r.LINE_BREAKS=t[Hv]),K(t,Yv)&&(r.START_CHARS_HINT=t[Yv]),r}s(g_,"createTokenInternal");var Jr=Xa({name:"EOF",pattern:pt.NA});cl([Jr]);function Zu(t,e,r,n,a,i,o,u){return{image:e,startOffset:r,endOffset:n,startLine:a,endLine:i,startColumn:o,endColumn:u,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}s(Zu,"createTokenInstance");function Zy(t,e){return ul(t,e)}s(Zy,"tokenMatcher");var qa={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Jy(t)?`--> ${Mn(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:a}){const i="Expecting: ",u=`
but found: '`+Jt(e).image+"'";if(n)return i+n+u;{const l=kt(t,(p,y)=>p.concat(y),[]),c=j(l,p=>`[${j(p,y=>Mn(y)).join(", ")}]`),d=`one of these possible Token sequences:
${j(c,(p,y)=>` ${y+1}. ${p}`).join(`
`)}`;return i+d+u}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=`
but found: '`+Jt(e).image+"'";if(r)return a+r+o;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
<${j(t,c=>`[${j(c,f=>Mn(f)).join(",")}]`).join(" ,")}>`;return a+l+o}}};Object.freeze(qa);var E1={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
inside top level rule: ->`+t.name+"<-"}},Ln={buildDuplicateFoundError(t,e){function r(f){return f instanceof Se?f.terminalType.name:f instanceof ht?f.nonTerminalName:""}s(r,"getExtraProductionArgument");const n=t.name,a=Jt(e),i=a.idx,o=Kt(a),u=r(a),l=i>0;let c=`->${o}${l?i:""}<- ${u?`with argument: ->${u}<-`:""}
appears more than once (${e.length} times) in the top level rule: ->${n}<-.
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
`;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
`),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=j(t.prefixPath,a=>Mn(a)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
in <OR${r}> inside <${t.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.
Only the last alternative may be empty.
`;else{const a=j(t.prefixPath,i=>Mn(i)).join(", ");n+=`<${a}> may appears as a prefix path in all these alternatives.
`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n},buildEmptyRepetitionError(t){let e=Kt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=j(t.leftRecursionPath,i=>i.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
rule: <${e}> can be invoked from itself (directly or indirectly)
without consuming any Tokens. The grammar path that causes this is:
${n}
To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof sl?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function v_(t,e){const r=new C1(t,e);return r.resolveRefs(),r.errors}s(v_,"resolveGrammar");var Ri,C1=(Ri=class extends ol{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){V(Ke(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:yt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},s(Ri,"GastRefResolverVisitor"),Ri),Ai,b1=(Ai=class extends fd{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=it(this.path.ruleStack).reverse(),this.occurrenceStack=it(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const a=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,a)}}updateExpectedNext(){Re(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},s(Ai,"AbstractNextPossibleTokensWalker"),Ai),Ei,_1=(Ei=class extends b1{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const a=r.concat(n),i=new bt({definition:a});this.possibleTokTypes=ll(i),this.found=!0}}},s(Ei,"NextAfterTokenWalker"),Ei),Ci,pd=(Ci=class extends fd{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},s(Ci,"AbstractNextTerminalAfterProductionWalker"),Ci),bi,S1=(bi=class extends pd{walkMany(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkMany(e,r,n)}},s(bi,"NextTerminalAfterManyWalker"),bi),_i,Xv=(_i=class extends pd{walkManySep(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkManySep(e,r,n)}},s(_i,"NextTerminalAfterManySepWalker"),_i),Si,w1=(Si=class extends pd{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkAtLeastOne(e,r,n)}},s(Si,"NextTerminalAfterAtLeastOneWalker"),Si),wi,Jv=(wi=class extends pd{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkAtLeastOneSep(e,r,n)}},s(wi,"NextTerminalAfterAtLeastOneSepWalker"),wi);function gf(t,e,r=[]){r=it(r);let n=[],a=0;function i(u){return u.concat(nt(t,a+1))}s(i,"remainingPathWith");function o(u){const l=gf(i(u),e,r);return n.concat(l)}for(s(o,"getAlternativesForProd");r.length<e&&a<t.length;){const u=t[a];if(u instanceof bt)return o(u.definition);if(u instanceof ht)return o(u.definition);if(u instanceof at)n=o(u.definition);else if(u instanceof Ot){const l=u.definition.concat([new xe({definition:u.definition})]);return o(l)}else if(u instanceof Lt){const l=[new bt({definition:u.definition}),new xe({definition:[new Se({terminalType:u.separator})].concat(u.definition)})];return o(l)}else if(u instanceof _t){const l=u.definition.concat([new xe({definition:[new Se({terminalType:u.separator})].concat(u.definition)})]);n=o(l)}else if(u instanceof xe){const l=u.definition.concat([new xe({definition:u.definition})]);n=o(l)}else{if(u instanceof St)return V(u.definition,l=>{Re(l.definition)===!1&&(n=o(l.definition))}),n;if(u instanceof Se)r.push(u.terminalType);else throw Error("non exhaustive match")}a++}return n.push({p Line truncated
${i.join(`
`).replace(/\n/g,`
`)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}s(rS,"createBaseSemanticVisitorConstructor");function nS(t,e,r){const n=s(function(){},"derivedConstructor");sg(n,t+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return V(e,i=>{a[i]=tS}),n.prototype=a,n.prototype.constructor=n,n}s(nS,"createBaseVisitorConstructorWithDefaults");var Gm;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Gm||(Gm={}));function aS(t,e){return iS(t,e)}s(aS,"validateVisitor");function iS(t,e){const r=Bt(e,a=>Gr(t[a])===!1),n=j(r,a=>({msg:`Missing visitor method: <${a}> on ${t.constructor.name} CST Visitor.`,type:Gm.MISSING_METHOD,methodName:a}));return Xu(n)}s(iS,"validateMissingCstMethods");var Ki,j1=(Ki=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=K(e,"nodeLocationTracking")?e.nodeLocationTracking:Lr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=He,this.cstFinallyStateUpdate=He,this.cstPostTerminal=He,this.cstPostNonTerminal=He,this.cstPostRule=He;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Mm,this.setNodeLocationFromNode=Mm,this.cstPostRule=He,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=xm,this.setNodeLocationFromNode=xm,this.cstPostRule=He,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=He,this.setInitialNodeLocation=He;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Q_(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];eS(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(kr(this.baseCstVisitorConstructor)){const e=rS(this.className,Nt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(kr(this.baseCstVisitorWithDefaultsConstructor)){const e=nS(this.className,Nt(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},s(Ki,"TreeBuilder"),Ki),Wi,B1=(Wi=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Tf}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Tf:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},sLine truncated
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
For Further details.`);if(se(e)){if(Re(e))throw Error(`A Token Vocabulary cannot be empty.
Note that the first argument for the parser constructor
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
For Further details.`)}if(se(e))this.tokensMap=kt(e,(i,o)=>(i[o.name]=o,i),{});else if(K(e,"modes")&&Yt(Ht(Ke(e.modes)),y_)){const i=Ht(Ke(e.modes)),o=By(i);this.tokensMap=kt(o,(u,l)=>(u[l.name]=l,u),{})}else if(zt(e))this.tokensMap=it(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Jr;const n=K(e,"modes")?Ht(Ke(e.modes)):Ke(e),a=Yt(n,i=>Re(i.categoryMatches));this.tokenMatcher=a?_u:ul,cl(Ke(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const a=K(n,"resyncEnabled")?n.resyncEnabled:$f.resyncEnabled,i=K(n,"recoveryValueFunc")?n.recoveryValueFunc:$f.recoveryValueFunc,o=this.ruleShortNameIdx<<M1+nn;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let u;return this.outputCst===!0?u=s(function(...f){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),r.apply(this,f);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,a,i)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):u=s(function(...f){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,a,i)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(u,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const a=this.RULE_STACK.length===1,i=r&&!this.isBackTracking()&&this.recoveryEnabled;if(Su(e)){const o=e;if(i){const u=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(u))if(o.resyncedTokens=this.reSyncTo(u),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,o.partialCstResult=l}throw o}}else{if(a)return this.moveToTerminatedState(),n(e);throw o}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(J_,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof e!="function"){i=e.DEF;const o=e.GATE;if(o!==void 0){const u=a;a=s(()=>o.call(this)&&u.call(this),"lookAheadFunc")}}else i=e;if(a.call(this)===!0)return i.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(Lm,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;const o=r.GATE;if(o!==void 0){const u=a;a=s(()=>o.call(this)&&u.call(this),"lookAheadFunc")}}else i=r;if(a.call(this)===!0){let o=this.doSingleRepetition(i);for(;a.call(this)===!0&&o===!0;)o=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,Pe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],a,Lm,e,w1)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Lc,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const a=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){a.call(this);const u=s(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,u,a,Jv],u,Lc,e,Jv)}else throw this.raiseEarlyExitException(e,Pe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(Om,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;const u=r.GATE;if(u!==void 0){const l=a;a=s(()=>u.call(this)&&l.call(this),"lookaheadFunction")}}else i=r;let o=!0;for(;a.call(this)===!0&&o===!0;)o=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],a,Om,e,S1,o)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Dm,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const a=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){a.call(this);const u=s(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,u,a,Xv],u,Dm,e,Xv)}}repetitionSepSecondInternal(e,r,n,a,i){for(;n();)this.CONSUME(r),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,a,i],n,Lc,e,i)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(X_,r),a=se(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,a);if(o!==void 0)return a[o].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new O1(r,e))}}subruleInternal(e,r,n){let a;try{const i=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,a=e.apply(this,i),this.cstPostNonTerminal(a,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),a}catch(i){throw this.subruleInternalError(i,n,e.ruleName)}}subruleInternalError(e,r,n){throw Su(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstRe Line truncated
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(oS);var q1={name:`This CSTNode indicates the Parser is in Recording Phase
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Xi,H1=(Xi=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,a){return this.consumeInternalRecord(n,e,a)},this[`SUBRULE${r}`]=function(n,a){return this.subruleInternalRecord(n,e,a)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Tf}topLevelRuleRecord(e,r){try{const n=new sl({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
This error was thrown during the "grammar recording phase" For more info see:
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Na.call(this,at,e,r)}atLeastOneInternalRecord(e,r){Na.call(this,Ot,r,e)}atLeastOneSepFirstInternalRecord(e,r){Na.call(this,Lt,r,e,Zv)}manyInternalRecord(e,r){Na.call(this,xe,r,e)}manySepFirstInternalRecord(e,r){Na.call(this,_t,r,e,Zv)}orInternalRecord(e,r){return lS.call(this,e,r)}subruleInternalRecord(e,r,n){if(wu(r),!e||K(e,"ruleName")===!1){const u=new Error(`<SUBRULE${Fm(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
inside top level rule: <${this.recordingProdStack[0].name}>`);throw u.KNOWN_RECORDER_ERROR=!0,u}const a=Bn(this.recordingProdStack),i=e.ruleName,o=new ht({idx:r,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return a.definition.push(o),this.outputCst?q1:yd}consumeInternalRecord(e,r,n){if(wu(r),!Xy(e)){const o=new Error(`<CONSUME${Fm(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const a=Bn(this.recordingProdStack),i=new Se({idx:r,terminalType:e,label:n?.LABEL});return a.definition.push(i),oS}},s(Xi,"GastRecorder"),Xi);function Na(t,e,r,n=!1){wu(r);const a=Bn(this.recordingProdStack),i=Gr(e)?e:e.DEF,o=new t({definition:[],idx:r});return n&&(o.separator=e.SEP),K(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),i.call(this),a.definition.push(o),this.recordingProdStack.pop(),yd}s(Na,"recordProd");function lS(t,e){wu(e);const r=Bn(this.recordingProdStack),n=se(t)===!1,a=n===!1?t:t.DEF,i=new St({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});K(t,"MAX_LOOKAHEAD")&&(i.maxLookahead=t.MAX_LOOKAHEAD);const o=Eb(a,u=>Gr(u.GATE));return i.hasPredicates=o,r.definition.push(i),V(a,u=>{const l=new bt({definition:[]});i.definition.push(l),K(u,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=u.IGNORE_AMBIGUITIES:K(u,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),u.ALT.call(this),this.recordingProdStack.pop()}),yd}s(lS,"recordOrProd");function Fm(t){return t===0?"":`${t}`}s(Fm,"getIdxSuffix");function wu(t){if(t<0||t>Qv){const e=new Error(`Invalid DSL Method idx value: <${t}>
Idx value must be a none negative value smaller than ${Qv+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}s(wu,"assertMethodIdxIsValid");var Ji,Y1=(Ji=class{initPerformanceTracer(e){if(K(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Lr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:a,value:i}=Ky(r),o=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${n}<-- <${e}> time: ${a}ms`),this.traceInitIndent--,i}else return r()}},s(Ji,"PerformanceTracer"),Ji);function uS(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const i=Object.getOwnPropertyDescriptor(n,a);i&&(i.get||i.set)?Object.defineProperty(t.prototype,a,i):t.prototype[a]=r.prototype[a]})})}s(uS,"applyMixins");var Tf=Zu(Jr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Tf);var Lr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:qa,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),$f=Object.freeze({recoveryValueFunc:s(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),yt;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(yt||(yt={}));function zm(t=void 0){return function(){return t}}s(zm,"EMPTY_ALT");var Fn,og=(Fn=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Wy(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),V(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let u;this.TRACE_INIT(`${a} Rule`,()=>{u=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=u})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=z_({rules:Ke(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Re(n)&&this.skipValidations===!1){const a=j_({rules:Ke(this.gastProductionsCache),tokenTypes:Ke(this.tokensMap),errMsgProvider:Ln,grammarName:r}),i=S_({lookaheadStrategy:this.lookaheadStrategy,rules:Ke(this.gastProductionsCache),tokenTypes:Ke(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,i)}}),Re(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=Db(Ke(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,i;(i=(a=this.lookaheadStrategy).initialize)===null||i===void 0||i.call(a,{rules:Ke(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ke(this.gastProductionsCache))})),!Fn.DEFER_DEFINITION_ERRORS_HANDLING&&!Re(this.definitionErrors))throw e=j(this.definitionErrors,a=>a.message),new Error(`Parser Definition Errors detected:
${e.join(`
-------------------------------
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),K(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
For further details.`);this.skipValidations=K(r,"skipValidations")?r.skipValidations:Lr.skipValidations}},s(Fn,"Parser"),Fn);og.DEFER_DEFINITION_ERRORS_HANDLING=!1;uS(og,[x1,G1,j1,B1,K1,U1,W1,V1,H1,Y1]);var Zi,X1=(Zi=class extends og{constructor(e,r=Lr){const n=it(r);n.outputCst=!1,super(e,n)}},s(Zi,"EmbeddedActionsParser"),Zi);function cS(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}s(cS,"arrayMap");var fS=cS;function dS(){this.__data__=[],this.size=0}s(dS,"listCacheClear");var J1=dS;function pS(t,e){return t===e||t!==t&&e!==e}s(pS,"eq");var mS=pS;function hS(t,e){for(var r=t.length;r--;)if(mS(t[r][0],e))return r;return-1}s(hS,"assocIndexOf");var gd=hS,Z1=Array.prototype,Q1=Z1.splice;function yS(t){var e=this.__data__,r=gd(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Q1.call(e,r,1),--this.size,!0}s(yS,"listCacheDelete");var eG=yS;function gS(t){var e=this.__data__,r=gd(e,t);return r<0?void 0:e[r][1]}s(gS,"listCacheGet");var tG=gS;function vS(t){return gd(this.__data__,t)>-1}s(vS,"listCacheHas");var rG=vS;function TS(t,e){var r=this.__data__,n=gd(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}s(TS,"listCacheSet");var nG=TS;function ia(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}s(ia,"ListCache");ia.prototype.clear=J1;ia.prototype.delete=eG;ia.prototype.get=tG;ia.prototype.has=rG;ia.prototype.set=nG;var vd=ia;function $S(){this.__data__=new vd,this.size=0}s($S,"stackClear");var aG=$S;function RS(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}s(RS,"stackDelete");var iG=RS;function AS(t){return this.__data__.get(t)}s(AS,"stackGet");var sG=AS;function ES(t){return this.__data__.has(t)}s(ES,"stackHas");var oG=ES,lG=typeof global=="object"&&global&&global.Object===Object&&global,CS=lG,uG=typeof self=="object"&&self&&self.Object===Object&&self,cG=CS||uG||Function("return this")(),Fr=cG,fG=Fr.Symbol,pr=fG,bS=Object.prototype,dG=bS.hasOwnProperty,pG=bS.toString,Ol=pr?pr.toStringTag:void 0;function _S(t){var e=dG.call(t,Ol),r=t[Ol];try{t[Ol]=void 0;var n=!0}catch{}var a=pG.call(t);return n&&(e?t[Ol]=r:delete t[Ol]),a}s(_S,"getRawTag");var mG=_S,hG=Object.prototype,yG=hG.toString;function SS(t){return yG.call(t)}s(SS,"objectToString");var gG=SS,vG="[object Null]",TG="[object Undefined]",eT=pr?pr.toStringTag:void 0;function wS(t){return t==null?t===void 0?TG:vG:eT&&eT in Object(t)?mG(t):gG(t)}s(wS,"baseGetTag");var fl=wS;function IS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}s(IS,"isObject");var lg=IS,$G="[object AsyncFunction]",RG="[object Function]",AG="[object GeneratorFunction]",EG="[object Proxy]";function NS(t){if(!lg(t))return!1;var e=fl(t);return e==RG||e==AG||e==$G||e==EG}s(NS,"isFunction");var PS=NS,CG=Fr["__core-js_shared__"],qd=CG,tT=(function(){var t=/[^.]+$/.exec(qd&&qd.keys&&qd.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function kS(t){return!!tT&&tT in t}s(kS,"isMasked");var bG=kS,_G=Function.prototype,SG=_G.toString;function OS(t){if(t!=null){try{return SG.call(t)}catch{}try{return t+""}catch{}}return""}s(OS,"toSource");var sa=OS,wG=/[\\^$.*+?()[\]{}|]/g,IG=/^\[object .+?Constructor\]$/,NG=Function.prototype,PG=Object.prototype,kG=NG.toString,OG=PG.hasOwnProperty,LG=RegExp("^"+kG.call(OG).replace(wG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function LS(t){if(!lg(t)||bG(t))return!1;var e=PS(t)?LG:IG;return e.test(sa(t))}s(LS,"baseIsNative");var DG=LS;function DS(t,e){return t?.[e]}s(DS,"getValue");var xG=DS;function xS(t,e){var r=xG(t,e);return DG(r)?r:void 0}s(xS,"getNative");var dl=xS,MG=dl(Fr,"Map"),Iu=MG,GG=dl(Object,"create"),Nu=GG;function MS(){this.__data__=Nu?Nu(null):{},this.size=0}s(MS,"hashClear");var FG=MS;function GS(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}s(GS,"hashDelete");var zG=GS,jG="__lodash_hash_undefined__",BG=Object.prototype,UG=BG.hasOwnProperty;function FS(t){var e=this.__data__;if(Nu){var r=e[t];return r===jG?void 0:r}return UG.call(e,t)?e[t]:void 0}s(FS,"hashGet");var KG=FS,WG=Object.prototype,VG=WG.hasOwnProperty;function zS(t){var e=this.__data__;return Nu?e[t]!==void 0:VG.call(e,t)}s(zS,"hashHas");var qG=zS,HG="__lodash_hash_undefined__";function jS(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Nu&&e===void 0?HG:e,this}s(jS,"hashSet");var YG=jS;function oa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}s(oa,"Hash");oa.prototype.clear=FG;oa.prototype.delete=zG;oa.prototype.get=KG;oa.prototype.has=qG;oa.prototype.set=YG;var rT=oa;function BS(){this.size=0,this.__data__={hash:new rT,map:new(Iu||vd),string:new rT}}s(BS,"mapCacheClear");var XG=BS;function US(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}s(US,"isKeyable");var JG=US;function KS(t,e){var r=t.__data__;return JG(e)?r[typeof e=="string"?"string":"hash"]:r.map}s(KS,"getMapDat Line truncated
<${e}> may appears as a prefix path in all these alternatives.
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n}s(uN,"buildAmbiguityError");function cN(t){if(t instanceof ht)return"SUBRULE";if(t instanceof at)return"OPTION";if(t instanceof St)return"OR";if(t instanceof Ot)return"AT_LEAST_ONE";if(t instanceof Lt)return"AT_LEAST_ONE_SEP";if(t instanceof _t)return"MANY_SEP";if(t instanceof xe)return"MANY";if(t instanceof Se)return"CONSUME";throw Error("non exhaustive match")}s(cN,"getProductionDslName");function fN(t,e,r){const n=Gj(e.configs.elements,i=>i.state.transitions),a=Jj(n.filter(i=>i instanceof vg).map(i=>i.tokenType),i=>i.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:t}}s(fN,"buildAdaptivePredictError");function dN(t,e){return t.edges[e.tokenTypeIdx]}s(dN,"getExistingTargetState");function pN(t,e,r){const n=new Wm,a=[];for(const o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===tc){a.push(o);continue}const u=o.state.transitions.length;for(let l=0;l<u;l++){const c=o.state.transitions[l],f=mN(c,e);f!==void 0&&n.add({state:f,alt:o.alt,stack:o.stack})}}let i;if(a.length===0&&n.size===1&&(i=n),i===void 0){i=new Wm;for(const o of n.elements)ku(o,i)}if(a.length>0&&!vN(i))for(const o of a)i.add(o);return i}s(pN,"computeReachSet");function mN(t,e){if(t instanceof vg&&Zy(e,t.tokenType))return t.target}s(mN,"getReachableTarget");function hN(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}s(hN,"getUniqueAlt");function bg(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}s(bg,"newDFAState");function qm(t,e,r,n){return n=_g(t,n),e.edges[r.tokenTypeIdx]=n,n}s(qm,"addDFAEdge");function _g(t,e){if(e===Af)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}s(_g,"addDFAState");function yN(t){const e=new Wm,r=t.transitions.length;for(let n=0;n<r;n++){const i={state:t.transitions[n].target,alt:n,stack:[]};ku(i,e)}return e}s(yN,"computeStartState");function ku(t,e){const r=t.state;if(r.type===tc){if(t.stack.length>0){const a=[...t.stack],o={state:a.pop(),alt:t.alt,stack:a};ku(o,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let a=0;a<n;a++){const i=r.transitions[a],o=gN(t,i);o!==void 0&&ku(o,e)}}s(ku,"closure");function gN(t,e){if(e instanceof TI)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Tg){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}s(gN,"getEpsilonTarget");function vN(t){for(const e of t.elements)if(e.state.type===tc)return!0;return!1}s(vN,"hasConfigInRuleStopState");function TN(t){for(const e of t.elements)if(e.state.type!==tc)return!1;return!0}s(TN,"allConfigsInRuleStopStates");function $N(t){if(TN(t))return!0;const e=RN(t.elements);return AN(e)&&!EN(e)}s($N,"hasConflictTerminatingPrediction");function RN(t){const e=new Map;for(const r of t){const n=Eg(r,!1);let a=e.get(n);a===void 0&&(a={},e.set(n,a)),a[r.alt]=!0}return e}s(RN,"getConflictingAltSets");function AN(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}s(AN,"hasConflictingAltSet");function EN(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}s(EN,"hasStateAssociatedWithOneAlt");Du();var ss,CN=(ss=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new wg(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Nd;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ef(e.startOffset,e.image.length,Tu(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const i of e){const o=new Ef(i.startOffset,i.image.length,Tu(i),i.tokenType,!0);o.root=this.rootNode,r.push(o)}let n=this.current,a=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const i=n.container.content.indexOf(n);if(i>0){n.container.content.splice(i,0,...r),a=!0;break}n=n.container}a||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},s(ss,"CstNodeBuilder"),ss),os,Sg=(os=class{get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},s(os,"AbstractCstNode"),os),ls,Ef=(ls=class extends Sg{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get Line truncated
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}s(r,"convertEscapeCharacter");function n(c){return c.charAt(0)==="^"?c.substring(1):c}s(n,"convertID"),t.convertID=n;function a(c){return parseInt(c)}s(a,"convertInt"),t.convertInt=a;function i(c){return BigInt(c)}s(i,"convertBigint"),t.convertBigint=i;function o(c){return new Date(c)}s(o,"convertDate"),t.convertDate=o;function u(c){return Number(c)}s(u,"convertNumber"),t.convertNumber=u;function l(c){return c.toLowerCase()==="true"}s(l,"convertBoolean"),t.convertBoolean=l})(or||(or={}));var $e={};kf($e,$h(Lf()));function Ld(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}s(Ld,"delayNextTick");var Fc=0,zN=10;function Dd(){return Fc=performance.now(),new $e.CancellationTokenSource}s(Dd,"startCancelableOperation");function Mg(t){zN=t}s(Mg,"setInterruptionPeriod");var cr=Symbol("OperationCancelled");function fa(t){return t===cr}s(fa,"isOperationCancelled");async function Ye(t){if(t===$e.CancellationToken.None)return;const e=performance.now();if(e-Fc>=zN&&(Fc=e,await Ld(),Fc=performance.now()),t.isCancellationRequested)throw cr}s(Ye,"interruptAndCheck");var $s,Dr=($s=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},s($s,"Deferred"),$s),Hr,_T=(Hr=class{constructor(e,r,n,a){this._uri=e,this._languageId=r,this._version=n,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Hr.isIncremental(n)){const a=Fg(n.range),i=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,i)+n.text+this._content.substring(o,this._content.length);const u=Math.max(a.start.line,0),l=Math.max(a.end.line,0);let c=this._lineOffsets;const f=Hm(n.text,!1,i);if(l-u===f.length)for(let p=0,y=f.length;p<y;p++)c[p+u+1]=f[p];else f.length<1e4?c.splice(u+1,l-u,...f):this._lineOffsets=c=c.slice(0,u+1).concat(f,c.slice(l+1));const d=n.text.length-(o-i);if(d!==0)for(let p=u+1+f.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(Hr.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Hm(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,a=r.length;if(a===0)return{line:0,character:e};for(;n<a;){const o=Math.floor((n+a)/2);r[o]>e?a=o:n=o+1}const i=n-1;return e=this.ensureBeforeEOL(e,r[i]),{line:i,character:e-r[i]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const a=e.line+1<r.length?r[e.line+1]:this._content.length,i=Math.min(n+e.character,a);return this.ensureBeforeEOL(i,n)}ensureBeforeEOL(e,r){for(;e>r&&Gg(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},s(Hr,"FullTextDocument"),Hr),_f;(function(t){function e(a,i,o,u){return new _T(a,i,o,u)}s(e,"create"),t.create=e;function r(a,i,o){if(a instanceof _T)return a.update(i,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}s(r,"update"),t.update=r;function n(a,i){const o=a.getText(),u=Sf(i.map(jN),(f,d)=>{const p=f.range.start.line-d.range.start.line;return p===0?f.range.start.character-d.range.start.character:p});let l=0;const c=[];for(const f of u){const d=a.offsetAt(f.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&c.push(o.substring(l,d)),f.newText.length&&c.push(f.newText),l=a.offsetAt(f.range.end)}return c.push(o.substr(l)),c.join("")}s(n,"applyEdits"),t.applyEdits=n})(_f||(_f={}));function Sf(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),a=t.slice(r);Sf(n,e),Sf(a,e);let i=0,o=0,u=0;for(;i<n.length&&o<a.length;)e(n[i],a[o])<=0?t[u++]=n[i++]:t[u++]=a[o++];for(;i<n.length;)t[u++]=n[i++];for(;o<a.length;)t[u++]=a[o++];return t}s(Sf,"mergeSort");function Hm(t,e,r=0){const n=e?[r]:[];for(let a=0;a<t.length;a++){const i=t.charCodeAt(a);Gg(i)&&(i===13&&a+1<t.length&&t.charCodeAt(a+1)===10&&a++,n.push(r+a+1))}return n}s(Hm,"computeLineOffsets");function Gg(t){return t===13||t===10}s(Gg,"isEOL");function Fg(t){const e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}s(Fg,"getWellformedRange");function jN(t){const e=Fg(t.range);return e!==t.range?{newText:t.newText,range:e}:t}s(jN,"getWellfo Line truncated
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const i=vP(this.name,r,e??{});if(typeof i=="string")return i}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let a=`${n}@${this.name}${n}`;return this.content.inlines.length===1?a=`${a} — ${r}`:this.content.inlines.length>1&&(a=`${a}
${r}`),this.inline?`{${a}}`:a}},s(Qs,"JSDocTagImpl"),Qs);function vP(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){const n=e.indexOf(" ");let a=e;if(n>0){const o=Pf(e,n);a=e.substring(o),e=e.substring(0,n)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(e,a)??TP(e,a)}}s(vP,"renderInlineTag");function TP(t,e){try{return It.parse(t,!0),`[${e}](${t})`}catch{return t}}s(TP,"renderLinkDefault");var eo,Jm=(eo=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],a=this.inlines[r+1];e+=n.toString(),a&&a.range.start.line>n.range.start.line&&(e+=`
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const a=this.inlines[n],i=this.inlines[n+1];r+=a.toMarkdown(e),i&&i.range.start.line>a.range.start.line&&(r+=`
`)}return r}},s(eo,"JSDocTextImpl"),eo),to,$P=(to=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},s(to,"JSDocLineImpl"),to);function Zm(t){return t.endsWith(`
`)?`
`:`
`}s(Zm,"fillNewlines");var ro,RP=(ro=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Xg(r))return Yg(r).toMarkdown({renderLink:s((a,i)=>this.documentationLinkRenderer(e,a,i),"renderLink"),renderTag:s(a=>this.documentationTagRenderer(e,a),"renderTag")})}documentationLinkRenderer(e,r,n){const a=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(a&&a.nameSegment){const i=a.nameSegment.range.start.line+1,o=a.nameSegment.range.start.character+1,u=a.documentUri.with({fragment:`L${i},${o}`});return`[${n}](${u.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const a=Vt(e).localSymbols;if(!a)return;let i=e;do{const u=a.getStream(i).find(l=>l.name===r);if(u)return u;i=i.$container}while(i)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(a=>a.name===r)}},s(ro,"JSDocDocumentationProvider"),ro),no,AP=(no=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Kg(e)?e.$comment:Zh(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},s(no,"DefaultCommentProvider"),no),ao,EP=(ao=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},s(ao,"DefaultAsyncParser"),ao),io,gB=(io=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){const e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),a=new Dr;let i;const o=r.onCancellationRequested(()=>{i=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(u=>{const l=this.hydrator.hydrate(u);a.resolve(l)}).catch(u=>{a.reject(u)}).finally(()=>{o.dispose(),clearTimeout(i)}),a.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new Dr;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(cr)}),this.queue.push(r),r.promise}},s(io,"AbstractThreadedAsyncParser"),io),so,vB=(so=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,a){this.onReadyEmitter=new Gd.Emitter,this.deferred=new Dr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=a,r(i=>{const o=i;this.deferred.resolve(o),this.unlock()}),n(i=>{this.deferred.reject(i),this.unlock()})}terminate(){this.deferred.reject(cr),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Dr,this.sendMessage(e),this.deferred.promise}},s(so,"ParserWorker"),so),oo,CP=(oo=class{constructor(){this.previousTokenSource=new $e.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Dd();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=$e.CancellationToken.None){const a=new Dr,i={action:r,deferred:a,cancellationToken:n};return e.push(i),this.performNextOperation(),a.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:a})=>{try{const i=await Promise.resolve().then(()=>r(a));n.resolve(i)}catch(i){fa(i)?n.resolve(void 0):n.reject(i)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},s(oo,"DefaultWorkspaceLock"),oo),lo,bP=(lo=class{constructor(e){this.grammarElementIdMap=new wf,this.tokenTypeIdMap=new wf,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const a of qt(e))r.set(a,{});if(e.$cstNode)for(const a of Jo(e.$cstNode))n.set(a,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstN Line truncated
`.includes(e[r-1])}matchWhitespace(e,r,n,a){this.whitespaceRegExp.lastIndex=r;const i=this.whitespaceRegExp.exec(e);return{currIndentLevel:i?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:i}}createIndentationTokenInstance(e,r,n,a){const i=this.getLineNumber(r,a);return Zu(e,n,a,a+n.length,i,i,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,a){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:i,prevIndentLevel:o,match:u}=this.matchWhitespace(e,r,n,a);return i<=o?null:(this.indentationStack.push(i),u)}dedentMatcher(e,r,n,a){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:i,prevIndentLevel:o,match:u}=this.matchWhitespace(e,r,n,a);if(i>=o)return null;const l=this.indentationStack.lastIndexOf(i);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${i} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:u?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;const c=this.indentationStack.length-l-1,f=e.substring(0,r).match(/[\r\n]+$/)?.[0].length??1;for(let d=0;d<c;d++){const p=this.createIndentationTokenInstance(this.dedentTokenType,e,"",r-(f-1));n.push(p),this.indentationStack.pop()}return null}buildTerminalToken(e){const r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:a,whitespaceTokenName:i}=this.options;return r.name===n?this.indentTokenType:r.name===a?this.dedentTokenType:r.name===i?Xa({name:i,pattern:this.whitespaceRegExp,group:pt.SKIPPED}):r}flushRemainingDedents(e){const r=[];for(;this.indentationStack.length>1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},s(uo,"IndentationAwareTokenBuilder"),uo),co,TB=(co=class extends Hg{constructor(e){if(super(e),e.parser.TokenBuilder instanceof SP)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=qg){const n=super.tokenize(e),a=n.report;r?.mode==="full"&&n.tokens.push(...a.remainingDedents),a.remainingDedents=[];const{indentTokenType:i,dedentTokenType:o}=this.indentationTokenBuilder,u=i.tokenTypeIdx,l=o.tokenTypeIdx,c=[],f=n.tokens.length-1;for(let d=0;d<f;d++){const p=n.tokens[d],y=n.tokens[d+1];if(p.tokenTypeIdx===u&&y.tokenTypeIdx===l){d++;continue}c.push(p)}return f>=0&&c.push(n.tokens[f]),n.tokens=c,n}},s(co,"IndentationAwareLexer"),co),nv={};en(nv,{AstUtils:()=>_h,BiMap:()=>wf,Cancellation:()=>$e,ContextCache:()=>Md,CstUtils:()=>Eh,DONE_RESULT:()=>ct,Deferred:()=>Dr,Disposable:()=>Gn,DisposableCache:()=>xd,DocumentCache:()=>XN,EMPTY_STREAM:()=>Vo,ErrorWithLocation:()=>Uf,GrammarUtils:()=>ry,MultiMap:()=>xr,OperationCancelled:()=>cr,Reduction:()=>vu,RegExpUtils:()=>ay,SimpleCache:()=>Bg,StreamImpl:()=>ur,TreeStreamImpl:()=>qo,URI:()=>It,UriTrie:()=>zg,UriUtils:()=>dt,WorkspaceCache:()=>Ug,assertCondition:()=>ny,assertUnreachable:()=>tn,delayNextTick:()=>Ld,interruptAndCheck:()=>Ye,isOperationCancelled:()=>fa,loadGrammarFromJson:()=>Ze,setInterruptionPeriod:()=>Mg,startCancelableOperation:()=>Dd,stream:()=>de});kf(nv,Gd);var fo,wP=(fo=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},s(fo,"EmptyFileSystemProvider"),fo),st={fileSystemProvider:s(()=>new wP,"fileSystemProvider")},$B={Grammar:s(()=>{},"Grammar"),LanguageMetaData:s(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},RB={AstReflection:s(()=>new qh,"AstReflection")};function IP(){const t=re(Je(st),RB),e=re(Xe({shared:t}),$B);return t.ServiceRegistry.register(e),e}s(IP,"createMinimalGrammarServices");function Ze(t){const e=IP(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,It.parse(`memory:/${r.name??"grammar"}.langium`)),r}s(Ze,"loadGrammarFromJson");kf(z$,nv);var po,AB=(po=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new xr}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new NP(n=>this.records.add(e,this.dumpLine truncated
`)}}},s(yo,"AbstractMermaidValueConverter"),yo),go,pl=(go=class extends vr{runCustomConverter(e,r,n){}},s(go,"CommonValueConverter"),go),vo,$t=(vo=class extends Od{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const a=super.buildKeywordTokens(e,r,n);return a.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),a}},s(vo,"AbstractMermaidTokenBuilder"),vo),To;To=class extends $t{},s(To,"CommonTokenBuilder");var $o,zU=($o=class extends $t{constructor(){super(["radar-beta"])}},s($o,"RadarTokenBuilder"),$o),kP={parser:{TokenBuilder:s(()=>new zU,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function OP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),wU,kP);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}s(OP,"createRadarServices");var Ro,jU=(Ro=class extends $t{constructor(){super(["railroad-beta"])}},s(Ro,"RailroadTokenBuilder"),Ro),w$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const a=e[n];if(a==="\\"&&n+1<e.length){n++;const i=e[n];switch(i){case"n":r+=`
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=i}continue}r+=a}return r},"decodeEscapedString"),Ao,BU=(Ao=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return w$(i)}return a}runCustomConverter(e,r,n){if(e.name==="RR_STRING")return w$(r)}},s(Ao,"RailroadValueConverter"),Ao),LP={parser:{TokenBuilder:s(()=>new jU,"TokenBuilder"),ValueConverter:s(()=>new BU,"ValueConverter")}};function DP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),PU,LP);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}s(DP,"createRailroadServices");var Eo,UU=(Eo=class extends $t{constructor(){super(["railroad-ebnf-beta"])}},s(Eo,"RailroadEbnfTokenBuilder"),Eo),I$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const a=e[n];if(a==="\\"&&n+1<e.length){n++;const i=e[n];switch(i){case"n":r+=`
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=i}continue}r+=a}return r},"decodeEscapedString"),Co,KU=(Co=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return I$(i)}return a}runCustomConverter(e,r,n){if(e.name==="EBNF_STRING")return I$(r);if(e.name==="EBNF_SPECIAL_SEQUENCE")return r.slice(1,-1).trim()}},s(Co,"RailroadEbnfValueConverter"),Co),xP={parser:{TokenBuilder:s(()=>new UU,"TokenBuilder"),ValueConverter:s(()=>new KU,"ValueConverter")}};function MP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),NU,xP);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}s(MP,"createRailroadEbnfServices");var bo,WU=(bo=class extends $t{constructor(){super(["railroad-abnf-beta"])}},s(bo,"RailroadAbnfTokenBuilder"),bo),_o,VU=(_o=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1)}return a}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},s(_o,"RailroadAbnfValueConverter"),_o),GP={parser:{TokenBuilder:s(()=>new WU,"TokenBuilder"),ValueConverter:s(()=>new VU,"ValueConverter")}};function FP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),IU,GP);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}s(FP,"createRailroadAbnfServices");var So,qU=(So=class extends $t{constructor(){super(["railroad-peg-beta"])}},s(So,"RailroadPegTokenBuilder"),So),N$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const a=e[n];if(a==="\\"&&n+1<e.length){n++;const i=e[n];switch(i){case"n":r+=`
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=i}continue}r+=a}return r},"decodeEscapedString"),wo,HU=(wo=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return N$(i)}return a}runCustomConverter(e,r,n){if(e.name==="PEG_STRING")return N$(r)}},s(wo,"RailroadPegValueConverter"),wo),zP={parser:{TokenBuilder:s(()=>new qU,"TokenBuilder"),ValueConverter:s(()=>new HU,"ValueConverter")}};function jP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),kU,zP);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}s(jP,"createRailroadPegServices");var Io,YU=(Io=class extends $t{constructor(){super(["treemap"])}},s(Io,"TreemapTokenBuilder"),Io),XU=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,No,JU=(No=class extends vr{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const a=XU.exec(r);if(a)return{$type:"ClassDefStatement",className:a[1],styleText:a[2]||void 0}}}},s(No,"TreemapValueConverter"),No);function BP(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}s(BP,"registerValidationChecks");var Po,ZU=(Po=class{checkSingleRoot(e,r){let n;for(const a of e.TreemapRows)a.item&&(n===void 0&&a.indent===void 0?n=0:a.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}):n!==void 0&&n>=parseInt(a.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}))}},s(Po,"TreemapValidator"),Po),UP={parser:{TokenBuilder:s(()=>new YU,"TokenBuilder"),ValueConverter:s(()=>new JU,"ValueConverter")},validation:{TreemapValidator:s(()=>new ZU,"TreemapValidator")}};function KP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),OU,UP);return e.ServiceRegistry.register(r),BP(r),{shared:e,Treemap:r}}s(KP,"createTreemapServices");var ko,QU=(ko=class extends vr{runCustomConverter(e,r,n){if(e.name.toUpperCase()==="LINK_LABEL")return r.substring(1).trim()}},s(ko,"WardleyValueConverter"),ko),WP={parser:{ValueConverter:s(()=>new QU,"ValueConverter")}};function VP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),DU,WP);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}s(VP,"createWardleyServices");var Oo,eK=(Oo=class extends $t{constructor(){super(["cynefin-beta"])}},s(Oo,"CynefinTokenBuilder"),Oo),qP={parser:{TokenBuilder:s(()=>new eK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function HP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),AU,qP);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}s(HP,"createCynefinServices");var Lo,tK=(Lo=class extends $t{constructor(){super(["gitGraph"])}},s(Lo,"GitGraphTokenBuilder"),Lo),YP={parser:{TokenBuilder:s(()=>new tK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function XP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),CU,YP);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}s(XP,"createGitGraphServices");var Do,rK=(Do=class extends $t{constructor(){super(["info","showInfo"])}},s(Do,"InfoTokenBuilder"),Do),JP={parser:{TokenBuilder:s(()=>new rK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function ZP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),bU,JP);return e.ServiceRegistry.register(r),{shared:e,Info:r}}s(ZP,"createInfoServices");var xo,nK=(xo=class extends $t{constructor(){super(["packet"])}},s(xo,"PacketTokenBuilder"),xo),QP={parser:{TokenBuilder:s(()=>new nK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function ek(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),_U,QP);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}s(ek,"createPacketServices");var Mo,aK=(Mo=class extends $t{constructor(){super(["pie","showData"])}},s(Mo,"PieTokenBuilder"),Mo),Go,iK=(Go=class extends vr{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},s(Go,"PieValueConverter"),Go),tk={parser:{TokenBuilder:s(()=>new aK,"TokenBuilder"),ValueConverter:s(()=>new iK,"ValueConverter")}};function rk(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),SU,tk);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}s(rk,"createPieServices");var Fo,sK=(Fo=class extends vr{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return r?.length||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const a=r.trim();return a.substring(5,a.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},s(Fo,"TreeViewValueConverter"),Fo),zo,oK=(zo=class extends Line truncated
`),n=e.parserErrors.map(a=>{const i=a.token.startLine!==void 0&&!isNaN(a.token.startLine)?a.token.startLine:"?",o=a.token.startColumn!==void 0&&!isNaN(a.token.startColumn)?a.token.startColumn:"?";return`Parse error on line ${i}, column ${o}: ${a.message}`}).join(`
`);super(`Parsing failed: ${r} ${n}`),this.result=e}},s(Wo,"MermaidParseError"),Wo);const hK=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:JP,createInfoServices:ZP},Symbol.toStringTag,{value:"Module"})),yK=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:QP,createPacketServices:ek},Symbol.toStringTag,{value:"Module"})),gK=Object.freeze(Object.defineProperty({__proto__:null,PieModule:tk,createPieServices:rk},Symbol.toStringTag,{value:"Module"})),vK=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:nk,createTreeViewServices:ak},Symbol.toStringTag,{value:"Module"})),TK=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:ik,createArchitectureServices:sk},Symbol.toStringTag,{value:"Module"})),$K=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:YP,createGitGraphServices:XP},Symbol.toStringTag,{value:"Module"})),RK=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:lk,createEventModelingServices:uk},Symbol.toStringTag,{value:"Module"})),AK=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:kP,createRadarServices:OP},Symbol.toStringTag,{value:"Module"})),EK=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:LP,createRailroadServices:DP},Symbol.toStringTag,{value:"Module"})),CK=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:xP,createRailroadEbnfServices:MP},Symbol.toStringTag,{value:"Module"})),bK=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:GP,createRailroadAbnfServices:FP},Symbol.toStringTag,{value:"Module"})),_K=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:zP,createRailroadPegServices:jP},Symbol.toStringTag,{value:"Module"})),SK=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:UP,createTreemapServices:KP},Symbol.toStringTag,{value:"Module"})),wK=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:WP,createWardleyServices:VP},Symbol.toStringTag,{value:"Module"})),IK=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:qP,createCynefinServices:HP},Symbol.toStringTag,{value:"Module"}));export{mK as M,MP as a,FP as b,DP as c,jP as d,NB as i,pK as p};
+62
View File
@@ -0,0 +1,62 @@
import{p as xt}from"./chunk-JWPE2WC7.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,d as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core.js";import{p as Bt}from"./cynefin-OW5HDTMX.js";import"./index.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,W=e/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*17)*m*2-m;d.push({x:c+p,y:o*W})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*31+7),R=p.x+h,_=f,E=i.x-h;D+=` C${R},${_} ${E},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,W=t/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*23)*m*2-m;d.push({x:o*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*37+11),R=f,_=p.y+h,E=f,z=i.y-h;D+=` C${R},${_} ${E},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x"Line truncated
.cynefinDomain {
stroke: none;
}
.cynefinDomainLabel {
font-size: ${t.domainFontSize}px;
font-weight: bold;
fill: ${t.labelColor};
}
.cynefinSubtitle {
font-size: ${t.itemFontSize-1}px;
fill: ${t.textColor};
font-style: italic;
}
.cynefinItem {
fill-opacity: 0.95;
stroke: ${t.boundaryColor};
stroke-width: 1;
}
.cynefinItemText {
font-size: ${t.itemFontSize}px;
fill: ${t.textColor};
}
.cynefinItemOverflow {
fill-opacity: 0.6;
stroke: ${t.boundaryColor};
stroke-width: 1;
stroke-dasharray: 3 2;
}
.cynefinBoundary {
stroke: ${t.boundaryColor};
stroke-width: ${t.boundaryWidth};
stroke-dasharray: 6 3;
}
.cynefinCliff {
stroke: ${t.cliffColor};
stroke-width: ${t.cliffWidth};
}
.cynefinConfusion {
stroke: ${t.boundaryColor};
stroke-width: 1.5;
stroke-dasharray: 4 2;
}
.cynefinArrowLine {
stroke: ${t.arrowColor};
stroke-width: ${t.arrowWidth};
fill: none;
}
.cynefinArrowHead {
fill: ${t.arrowColor};
stroke: none;
}
.cynefinArrowLabel {
font-size: ${t.itemFontSize-1}px;
fill: ${t.textColor};
}
.cynefinTitle {
font-size: ${t.domainFontSize+2}px;
font-weight: bold;
fill: ${t.labelColor};
}
`},"styles"),Gt=Ht,qt={parser:Wt,db:Y,renderer:Ft,styles:Gt};export{qt as diagram};
+321
View File
@@ -0,0 +1,321 @@
function Ds(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t<e;t++)a[t]=r[t];return a}function tc(r){if(Array.isArray(r))return r}function ac(r){if(Array.isArray(r))return Ds(r)}function ct(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nc(r,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,Jl(a.key),a)}}function dt(r,e,t){return e&&nc(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function Cr(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Ks(r))||e){t&&(r=t);var a=0,n=function(){};return{s:n,n:function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Ql(r,e,t){return(e=Jl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ic(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function sc(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(v){l=!0,n=v}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}function oc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uc(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xe(r,e){return tc(r)||sc(r,e)||Ks(r,e)||oc()}function yn(r){return ac(r)||ic(r)||Ks(r)||uc()}function lc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function Jl(r){var e=lc(r,"string");return typeof e=="symbol"?e:e+""}function je(r){"@babel/helpers - typeof";return je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},je(r)}function Ks(r,e){if(r){if(typeof r=="string")return Ds(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ds(r,e):void 0}}var Qe=typeof window>"u"?null:window,Co=Qe?Qe.navigator:null;Qe&&Qe.document;var vc=je(""),jl=je({}),fc=je(function(){}),cc=typeof HTMLElement>"u"?"undefined":je(HTMLElement),La=function(e){return e&&e.instanceString&&He(e.instanceString)?e.instanceString():null},he=function(e){return e!=null&&je(e)==vc},He=function(e){return e!=null&&je(e)===fc},Fe=function(e){return!Tr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Me=function(e){return e!=null&&je(e)===jl&&!Fe(e)&&e.constructor===Object},dc=function(e){return e!=null&&je(e)===jl},ae=function(e){return e!=null&&je(e)===je(1)&&!isNaN(e)},ev=function(e){return ae(e)&&Math.floor(e)===e},mn=function(e){if(cc!=="undefined")return e!=null&&e instanceof HTMLElement},Tr=function(e){return Ia(e)||rv(e)},Ia=function(e){return La(e)==="collection"&&e._private.single},rv=function(e){return La(e)==="collection"&&!e._private.single},Xs=function(e){return La(e)==="core"},tv=function(e){return La(e)==="stylesheet"},hc=function(e){return La(e)==="event"},st=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},gc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},pc=function(e){return Me(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},yc=function(e){return dc(e)&&He(e.then)},mc=function(){return Co&&Co.userAgent.match(/msie|trident|edge/i)},Yt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var a=function(){var i=this,s=arguments,o,u=t.apply(i,s),l=a.cache;return(o=l[u])||(o=l[u]=e.apply(i,s)),o};return a.cache={},a},Ys=Yt(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Rn=Yt(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),av=Yt(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),To=function(e){return st(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},rt=function(e,t){return e.slice(-1*t.length)===t},Je="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",bc="rgb[a]?\\(("+Je+"[%]?)\\s*,\\s*("+Je+"[%]?)\\s*,\\s*("+Je+"[%]?)(?:\\s*,\\s*("+Je+"))?\\)",wc="rgb[a]?\\((?:"+Je+"[%]?)\\s*,\\s*(?:"+Je+"[%]?)\\s*,\\s*(?:"+Je+"[%]?)(?:\\s*,\\s*(?:"+Je+"))?\\)",xc="hsl[a]?\\(("+Je+")\\s*,\\s*("+Je+"[%])\\s*,\\s*("+Je+"[%])(?:\\s*,\\s*("+Je+"))?\\)",Ec="hsl[a]?\\((?:"+Je+")\\s*,\\s*(?:"+Je+"[%])\\s*,\\s*(?:"+Je+"[%])(?:\\s*,\\s*(?:"+Je+"))?\\)",Cc="\\#[0-9a-fA-F]{3}",Tc="\\#[0-9a-fA-F]{6}",nv=function(e,t){return e<t?-1:e>t?1:0},Sc=function(e,t){return-1*nv(e,t)},me=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var a=e[t];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var s=n[i];r[s]=a[s]}}return r},kc=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,a,n,i,s=16;return t?(a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[a,n,i]}},Dc=function(e){var t,a,n,i,s,o,u,l;function v(d,y,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+xc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),u=Math.round(255*v(h,c,a)),l=Math.round(255*v(h,c,a-1/3))}t=[o,u,l,s]}return t},Bc=function(e){var t,a=new RegExp("^"+bc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)re Line truncated
`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,g=0;g<v.length;g++){var p=v[g],m=this.calculateLabelDimensions(r,p),b=m.width;if(h){var w=p.split("").join(l);p=w}if(b>f){var E=p.matchAll(y),C="",x=0,T=Cr(E),k;try{for(T.s();!(k=T.n()).done;){var B=k.value,D=B[0],P=p.substring(x,B.index);x=B.index+D.length;var A=C.length===0?P:C+P+D,R=this.calculateLabelDimensions(r,A),L=R.width;L<=f?C+=P+D:(C&&d.push(C),C=P+D)}}catch(q){T.e(q)}finally{T.f()}C.match(/^[\s\u200b]+$/)||d.push(C)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(`
`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,M="",N="…",F=!1;if(this.calculateLabelDimensions(r,n).width<I)return n;for(var _=0;_<n.length;_++){var z=this.calculateLabelDimensions(r,M+n[_]+N).width;if(z>I)break;M+=n[_],_===n.length-1&&(F=!0)}return F||(M+=N),M}return n};Hr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;return e==="auto"?r.isNode()?Ug(t):"center":e};Hr.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,v=r.pstyle("text-metrics").strValue||"font",f=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=n.createElement("canvas"),c=this.labelCalcCanvasContext=f.getContext("2d");var h=f.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(s," ").concat(l," ").concat(o,"px ").concat(u);for(var d=0,y=0,g=e.split(`
`),p=g.length,m=0,b=0,w=0;w<p;w++){var E=g[w],C=c.measureText(E),x=Math.ceil(C.width),T=o;v==="glyph"&&(w===0&&(b=C.actualBoundingBoxAscent),w===p-1&&(m=C.actualBoundingBoxDescent)),d=Math.max(x,d),y+=T}return v==="glyph"&&(y-=o-b-m),d+=i,y+=i,{width:d,height:y,labelActualAscent:b,labelActualDescent:m}};Hr.calculateLabelAngle=function(r,e){var t=r._private,a=t.rscratch,n=r.isEdge(),i=e?e+"-":"",s=r.pstyle(i+"text-rotation"),o=s.strValue;return o==="none"?0:n&&o==="autorotate"?a.labelAutoAngle:o==="autorotate"?0:s.pfValue};Hr.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),a=r._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(r),t&&(n.sourceLabelAngle=e.calculateLabelAngle(r,"source"),n.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var xf={},Ml=28,Ll=!1;xf.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Ml||r.height()<Ml))return Ll||(Ne("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Ll=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var a=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return t};var Kn={};Kn.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,a=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u<s.length;u++){var l=s[u],v=l._private,f=v.rstyle;f.clean=!1,f.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(s){var o=s.target;a(o)}).on("style.* background.*",function(s){var o=s.target;a(o,!1)});var n=function(s){if(s){var o=t.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],v=l._private.rstyle;l.isNode()&&!v.cleanConnected&&(a(l.connectedEdges()),v.cleanConnected=!0)}if(o)for(var f=0;f<o.length;f++){var c=o[f];c(s,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){n(!0)},t.beforeRender(n,t.beforeRenderPriorities.eleCalcs)};Kn.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};Kn.recalculateRenderedStyle=function(r,e){var t=function(w){return w._private.rstyle.cleanConnected};if(r.length!==0){var a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var s=r[i],o=s._private,u=o.rstyle;s.isEdge()&&(!t(s.source())||!t(s.target()))&&(u.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(b){return!b._private.rstyle.clean&&b.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?n.push(s):a.push(s),u.clean=!0)}for(var l=0;l<n.length;l++){var v=n[l],f=v._private,c=f.rstyle,h=v.position();this.recalculateNodeLabelProjection(v),c.nodeX=h.x,c.nodeY=h.y,c.nodeW=v.pstyle("width").pfValue,c.nodeH=v.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var y=a[d],g=y._private,p=g.rstyle,m=g.rscratch;p.srcX=m.arrowStartX,p.srcY=m.arrowStartY,p.tgtX=m.arrowEndX,p.tgtY=m.arrowEndY,p.midX=m.midX,p.midY=m.midY,p.labelAngle=m.labelAngle,p.sourceLabelAngle=m.sourceLabelAngle,p.targetLabelAngle=m.targetLabelAngle}}}};var Xn={};Xn.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var a=r[t],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?r.drag.push(a):r.nondrag.push(a)}for(var t=0;t<e.length;t++){var a=e[t];r.drag.push(a)}}};Xn.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Xn.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(rf),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Ef={};[At,Dn,hr,Ga,po,Hr,xf,Kn,Xn].forEach(function(r){me(Ef,r)});var Cf={};Cf.getCachedImage=function(r,e,t){var a=this,n=a.imageCache=a.imageCache||{},i=n[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=n[r]=n[r]||{};var s=i.image=new Image;s.addEventListener("load",t),s.addEventListener("error",function(){s.error=!0});var o="data:",u=r.substring(0,o.length).toLowerCase()===o;return u||(e=e==="null"?null:e,s.crossOrigin=e),s.src=r,s};var Tf=function(e,t){var a=e[0];!a||a._private.grabbed===t||(a._private.grabbed=t,e.updateStyle(!1))},sy=function(e){Tf(e,!0)},oy=function(e){Tf(e,!1)},ia={};ia.registerBinding=function(r,e,t,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],s=0;s<r.length;s++){var o=r[s];if(o!==void 0){var u=this.binder(o);i.push(u.on.apply(u,n))}}return i}var u=this.binder(r);return u.on.apply(u,n)};ia.binder=function(r){var e=this,t=e.cy.window(),a=r===t||r===t.document||r===t.document.body||gc(r);if(e.supportsPassiveEvents==null){var n=!1;try{va Line truncated
float circleSD(vec2 p, float r) {
return distance(vec2(0), p) - r; // signed distance
}
`,dm=`
float rectangleSD(vec2 p, vec2 b) {
vec2 d = abs(p)-b;
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
}
`,hm=`
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
cr.x = (p.y > 0.0) ? cr.x : cr.y;
vec2 q = abs(p) - b + cr.x;
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
}
`,gm=`
float ellipseSD(vec2 p, vec2 ab) {
p = abs( p ); // symmetry
// find root with Newton solver
vec2 q = ab*(p-ab);
float w = (q.x<q.y)? 1.570796327 : 0.0;
for( int i=0; i<5; i++ ) {
vec2 cs = vec2(cos(w),sin(w));
vec2 u = ab*vec2( cs.x,cs.y);
vec2 v = ab*vec2(-cs.y,cs.x);
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
}
// compute final point and distance
float d = length(p-ab*vec2(cos(w),sin(w)));
// return signed distance
return (dot(p/ab,p/ab)>1.0) ? d : -d;
}
`,Ea={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Pn={IGNORE:1,USE_BB:2},Es=0,Ul=1,Kl=2,Cs=3,Vt=4,nn=5,ga=6,pa=7,pm=(function(){function r(e,t,a){ct(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Xy,this.atlasManager=new vm(e,a),this.batchManager=new fm(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ea.SCREEN),this.pickingProgram=this._createShaderProgram(Ea.PICKING),this.vao=this._createVAO()}return dt(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(o){return o===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#version 300 es
precision highp float;
uniform mat3 uPanZoomMatrix;
uniform int uAtlasSize;
// instanced
in vec2 aPosition; // a vertex from the unit square
in mat3 aTransform; // used to transform verticies, eg into a bounding box
in int aVertType; // the type of thing we are rendering
// the z-index that is output when using picking mode
in vec4 aIndex;
// For textures
in int aAtlasId; // which shader unit/atlas to use
in vec4 aTex; // x/y/w/h of texture in atlas
// for edges
in vec4 aPointAPointB;
in vec4 aPointCPointD;
in vec2 aLineWidth; // also used for node border width
// simple shapes
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
in vec4 aColor; // also used for edges
in vec4 aBorderColor; // aLineWidth is used for border width
// output values passed to the fragment shader
out vec2 vTexCoord;
out vec4 vColor;
out vec2 vPosition;
// flat values are not interpolated
flat out int vAtlasId;
flat out int vVertType;
flat out vec2 vTopRight;
flat out vec2 vBotLeft;
flat out vec4 vCornerRadius;
flat out vec4 vBorderColor;
flat out vec2 vBorderWidth;
flat out vec4 vIndex;
void main(void) {
int vid = gl_VertexID;
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
if(aVertType == `.concat(Es,`) {
float texX = aTex.x; // texture coordinates
float texY = aTex.y;
float texW = aTex.z;
float texH = aTex.w;
if(vid == 1 || vid == 2 || vid == 4) {
texX += texW;
}
if(vid == 2 || vid == 4 || vid == 5) {
texY += texH;
}
float d = float(uAtlasSize);
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
}
else if(aVertType == `).concat(Vt," || aVertType == ").concat(pa,`
|| aVertType == `).concat(nn," || aVertType == ").concat(ga,`) { // simple shapes
// the bounding box is needed by the fragment shader
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
// calculations are done in the fragment shader, just pass these along
vColor = aColor;
vCornerRadius = aCornerRadius;
vBorderColor = aBorderColor;
vBorderWidth = aLineWidth;
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
}
else if(aVertType == `).concat(Ul,`) {
vec2 source = aPointAPointB.xy;
vec2 target = aPointAPointB.zw;
// adjust the geometry so that the line is centered on the edge
position.y = position.y - 0.5;
// stretch the unit square into a long skinny rectangle
vec2 xBasis = target - source;
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
vColor = aColor;
}
else if(aVertType == `).concat(Kl,`) {
vec2 pointA = aPointAPointB.xy;
vec2 pointB = aPointAPointB.zw;
vec2 pointC = aPointCPointD.xy;
vec2 pointD = aPointCPointD.zw;
// adjust the geometry so that the line is centered on the edge
position.y = position.y - 0.5;
vec2 p0, p1, p2, pos;
if(position.x == 0.0) { // The left side of the unit square
p0 = pointA;
p1 = pointB;
p2 = pointC;
pos = position;
} else { // The right side of the unit square, use same approach but flip the geometry upside down
p0 = pointD;
p1 = pointC;
p2 = pointB;
pos = vec2(0.0, -position.y);
}
vec2 p01 = p1 - p0;
vec2 p12 = p2 - p1;
vec2 p21 = p1 - p2;
// Find the normal vector.
vec2 tangent = normalize(normalize(p12) + normalize(p01));
vec2 normal = vec2(-tangent.y, tangent.x);
// Find the vector perpendicular to p0 -> p1.
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
// Determine the bend direction.
float sigma = sign(dot(p01 + p21, normal));
float width = aLineWidth[0];
if(sign(pos.y) == -sigma) {
// This is an intersecting vertex. Adjust the position so that there's no overlap.
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
} else {
// This is a non-intersecting vertex. Treat it like a mitre join.
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
}
vColor = aColor;
}
else if(aVertType == `).concat(Cs,` && vid < 3) {
// massage the first triangle into an edge arrow
if(vid == 0)
position = vec2(-0.15, -0.3);
if(vid == 1)
position = vec2( 0.0, 0.0);
if(vid == 2)
position = vec2( 0.15, -0.3);
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
vColor = aColor;
}
else {
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
}
vAtlasId = aAtlasId;
vVertType = aVertType;
vIndex = aIndex;
}
`),i=this.batchManager.getIndexArray(),s=`#version 300 es
precision highp float;
// declare texture unit for each texture atlas in the batch
`.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(`
`),`
uniform vec4 uBGColor;
uniform float uZoom;
in vec2 vTexCoord;
in vec4 vColor;
in vec2 vPosition; // model coordinates
flat in int vAtlasId;
flat in vec4 vIndex;
flat in int vVertType;
flat in vec2 vTopRight;
flat in vec2 vBotLeft;
flat in vec4 vCornerRadius;
flat in vec4 vBorderColor;
flat in vec2 vBorderWidth;
out vec4 outColor;
`).concat(cm,`
`).concat(dm,`
`).concat(hm,`
`).concat(gm,`
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
return vec4(
top.rgb + (bot.rgb * (1.0 - top.a)),
top.a + (bot.a * (1.0 - top.a))
);
}
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
// scale to the zoom level so that borders don't look blurry when zoomed in
// note 1.5 is an aribitrary value chosen because it looks good
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
}
void main(void) {
if(vVertType == `).concat(Es,`) {
// look up the texel from the texture unit
`).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(`
else `),`
}
else if(vVertType == `).concat(Cs,`) {
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
outColor = blend(vColor, uBGColor);
outColor.a = 1.0; // make opaque, masks out line under arrow
}
else if(vVertType == `).concat(Vt,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
}
else if(vVertType == `).concat(Vt," || vVertType == ").concat(pa,`
|| vVertType == `).concat(nn," || vVertType == ").concat(ga,`) { // use SDF
float outerBorder = vBorderWidth[0];
float innerBorder = vBorderWidth[1];
float borderPadding = outerBorder * 2.0;
float w = vTopRight.x - vBotLeft.x - borderPadding;
float h = vTopRight.y - vBotLeft.y - borderPadding;
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
float d; // signed distance
if(vVertType == `).concat(Vt,`) {
d = rectangleSD(p, b);
} else if(vVertType == `).concat(pa,` && w == h) {
d = circleSD(p, b.x); // faster than ellipse
} else if(vVertType == `).concat(pa,`) {
d = ellipseSD(p, b);
} else {
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
}
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
if(d > 0.0) {
if(d > outerBorder) {
discard;
} else {
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
}
} else {
if(d > innerBorder) {
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
vec4 innerBorderColor = blend(vBorderColor, vColor);
outColor = distInterp(innerBorderColor, outerColor, d);
}
else {
vec4 outerColor;
if(innerBorder == 0.0 && outerBorder == 0.0) {
outerColor = vec4(0);
} else if(innerBorder == 0.0) {
outerColor = vBorderColor;
} else {
outerColor = blend(vBorderColor, vColor);
}
outColor = distInterp(vColor, outerColor, d - innerBorder);
}
}
}
else {
outColor = vColor;
}
`).concat(t.picking?`if(outColor.a == 0.0) discard;
else outColor = vIndex;`:"",`
}
`),o=Ky(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)o.uTextures.push(a.getUniformLocation(o,"uTexture".concat(u)));return o}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var a=this.maxInstances,n=this.gl,i=this.program,s=n.createVertexArray();return n.bindVertexArray(s),tm(n,"vec2",i.aPosition,t),this.transformBuffer=am(n,a,i.aTransform),this.indexBuffer=Fr(n,a,"vec4",i.aIndex),this.vertTypeBuffer=Fr(n,a,"int",i.aVertType),this.atlasIdBuffer=Fr(n,a,"int",i.aAtlasId),this.texBuffer=Fr(n,a,"vec4",i.aTex),this.pointAPointBBuffer=Fr(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Fr(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=Fr(n,a,"vec2",i.aLineWidth),this.colorBuffer=Fr(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=Fr(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=Fr(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),s}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(a){return rt(a,"Buffer")}).map(function(a){return t[a]})),this._buffers}},{key:"startFrame",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ea.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var u=o.getTexPickingMode(t);if(u===Pn.IGNORE)return;if(u==Pn.USE_BB){this.drawPickingRectangle(t,a,n);return}}var l=i.getAtlasInfo(t,n),v=Cr(l),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,h=c.atlas,d=c.tex1,y=c.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var g=s.getAtlasIndexForBatch(h),p=0,m=[[d,!0],[y,!1]];p<m.length;p++){var b=Xe(m[p],2),w=b[0],E=b[1];if(w.w!=0){var C=this.instanceCount;this.vertTypeBuffer.getView(C)[0]=Es;var x=this.indexBuffer.getView(C);Ft(a,x);var T=this.atlasIdBuffer.getView(C);T[0]=g;var k=this.texBuffer.getView(C);k[0]=w.x,k[1]=w.y,k[2]=w.w,k[3]=w.h;var B=this.transformBuffer.getMatrixView(C);this.setTransformMatrix(t,B,o,c,E),this.instanceCount++,E||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(D){v.e(D)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding&&(o=t.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,v=i.tex2,f=l.w/(l.w+v.w);s||(f=1-f);var c=this._getAdjustedBB(u,o,s,f);this._applyTransformMatrix(a,c,n,t)}else{var h=n.getBoundingBox(t),d=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(a,d,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var s,o;Wl(t);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),v=l.x,f=l.y;pn(t,t,[v,f]),$l(t,t,u);var c=n.getRotationOffset(i);s=c.x+(a.xOffset||0),o=c.y+(a.yOffset||0)}else s=a.x1,o=a.y1;pn(t,t,[s,o]),Hs(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var s=t.x1,o=t.y1,u=t.w,l=t.h,v=t.yOffset;a&&(s-=a,o-=a,u+=2*a,l+=2*a);var f=0,c=u*i;return n&&i<1?u=c:!n&&i<1&&(f=u-c,s+=f,u=c),{x1:s,y1:o,w:u,h:l,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Vt;var o=this.indexBuffer.getView(s);Ft(a,o);var u=this.colorBuffer.getView(s);bt([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(t,this.renderTarget)){this.drawTexture(t, Line truncated
+4
View File
@@ -0,0 +1,4 @@
import{_ as m,ao as x,c as k,Q as O,l as p,ap as A,aq as Y,ar as b,as as _,at as z,au as H,av as D,aw as J,ax as T,ay as X,ah as R,af as F,az as q,aA as W}from"./mermaid.core.js";import{l as j}from"./layout.js";import"./index.js";var C=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),P=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),Q=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),U=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],K=m((t,e,r,d,a)=>{const f=[],h=new Set;if(r.forEach(({start:i,end:o})=>{i!==d&&h.add(i),o!==d&&h.add(o)}),h.forEach(i=>{const o=t.node(i);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:i})=>{(i.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return P(a);const c=f.reduce((i,o)=>({x:i.x+o.x/f.length,y:i.y+o.y/f.length}),{x:0,y:0}),l=c.x-e.x,s=c.y-e.y;return Math.abs(l)>Math.abs(s)?l>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":P(a)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{const a=t.x,f=t.y-r,h=t.width/2,c=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),s=C(Math.max(d,t.width*.35),36,l),i=C(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const o=f+c;return[{x:a-s/2,y:o},{x:a-s/2,y:o+i},{x:a+s/2,y:o+i},{x:a+s/2,y:o}]}case"right":{const o=a+h;return[{x:o,y:f-s/2},{x:o+i,y:f-s/2},{x:o+i,y:f+s/2},{x:o,y:f+s/2}]}case"left":{const o=a-h;return[{x:o,y:f-s/2},{x:o-i,y:f-s/2},{x:o-i,y:f+s/2},{x:o,y:f+s/2}]}default:{const o=f-c;return[{x:a-s/2,y:o},{x:a-s/2,y:o-i},{x:a+s/2,y:o-i},{x:a+s/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,a={})=>{const h=t.x,c=t.y-d,l=a.width??0,s=a.height??0;switch(r){case"bottom":return{x:h,y:Math.max(...e.map(i=>i.y))+s/2+4};case"right":return{x:Math.max(...e.map(i=>i.x))+l/2+4,y:c};case"left":return{x:Math.min(...e.map(i=>i.x))-l/2-4,y:c};default:return{x:h,y:Math.min(...e.map(i=>i.y))-s/2-4}}},"getSelfLoopLabelPosition"),B=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{const d=new Map,a=[],f=t.graph()?.rankdir;return t.edges().forEach(h=>{const c=t.edge(h);if(r&&c.selfLoop){const l=c.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:c,start:h.v,end:h.w})}else a.push({edge:c,start:h.v,end:h.w})}),d.forEach(h=>{if(h.length!==3){h.forEach(u=>a.push(u));return}h.sort((u,E)=>u.edge.selfLoop.order-E.edge.selfLoop.order);const[c,l,s]=h,i=c.edge.originalEdge??l.edge.originalEdge??s.edge.originalEdge??l.edge,o=t.node(i.start);if(!o){h.forEach(u=>a.push(u));return}const n={width:l.edge.width,height:l.edge.height},L=K(t,o,h,i.start,f),w=V(o,L,e,n.width??0),y=Z(o,w,L,e,n),g={...l.edge,...i,id:i.id,points:w,start:i.start,end:i.end,x:y.x,y:y.y,width:n.width,height:n.height,labelStyle:l.edge.labelStyle,fromCluster:c.edge.fromCluster??l.edge.fromCluster??s.edge.fromCluster,toCluster:c.edge.toCluster??l.edge.toCluster??s.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),I=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:a,siteConfig:f})=>{const h=e.graph().rankdir;p.trace("Dir in recursive render - dir:",h);const{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o}=_(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));const n=Q(r);await Promise.all(e.nodes().map(async function(y){const g=e.node(y);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));p.trace(`Setting data for parent cluster XXX
Node.id = `,y,`
data=`,u.height,`
Parent cluster`,a.height),e.setNode(a.id,u),e.parent(y)||(p.trace("Setting parent",y,a.id),e.setParent(y,a.id,u))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){p.info("Cluster identified XBX",y,g.width,e.node(y));const{ranksep:u,nodesep:E}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:u+25,nodesep:E});const S=await oe({element:i,graph:g.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),N=S.elem;z(g,N),g.diff=S.diff||0,p.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),H(N,g)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),p.trace(D(g.id,e)),b.set(g.id,{id:D(g.id,e),node:g})):(p.trace("Node - the non recursive path XAX",y,i,e.node(y),h),await J(i,e.node(y),{config:f,dir:h}))})),await m(async()=>{const y=e.edges().map(async function(g){const u=e.edge(g.v,g.w,g.name);if(p.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),p.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),p.info("Fix",b,"ids:",g.v,g.w,"Translating: ",b.get(g.v),b.get(g.w)),n&&u.selfLoop){if(u.selfLoop.order!==1)return;const E={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:u.originalEdge?.startLabelLeft??u.startLabelLeft,startLabelRight:u.originalEdge?.startLabelRight??u.startLabelRight,endLabelLeft:u.originalEdge?.endLabelLeft??u.endLabelLeft,endLabelRight:u.originalEdge?.endLabelRight??u.endLabelRight};await X(s,E),u.width=E.width,u.height=E.height,u.labelStyle=E.labelStyle;return}await X(s,u)});await Promise.all(y)},"processEdges")();const{subGraphTitleTotalMargin:w}=T(f);return{elem:o,graph:e,groups:{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:n,subGraphTitleTotalMargin:w}},"measureDagreGraph"),M=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),j(t)},"runDagreGraphLayout"),$=m((t,e,r)=>{const d=t.node(e);if(!d)return;const a={...d};return d?.clusterNode?a.y=(d.y??0)+r:t.children(e).length>0?a.height=(d.height??0)+r:a.y=(d.y??0)+r/2,a},"normalizeDagreNode"),v=m((t,e)=>{U.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),ee=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+d:a.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{const{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:a=0}=e,f=new Map(t.nodes.map(c=>[c.id,c]));x(r).forEach(c=>{const l=$(r,c,a);if(!l)return;v(r.node(c),l);const s=f.get(c);s&&v(s,l)});const h=a/2;return t.edges=B(r,h,{mergeSelfLoops:d}).map(({edge:c,start:l,end:s})=>ee(c,l,s,h)),t},"applyDagreLayoutResult"),re=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:a,id:f,mergeSelfLoops:h,subGraphTitleTotalMargin:c})=>{let l=0;await Promise.all(x(e).map(async function(o){const n=e.node(o);if(p.info("Position XBX => "+o+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=c,p.info("A tainted cluster node XBX1",o,n.id,n.width,n.height,n.x,n.y,e.parent(o)),b.get(n.id).node=n,R(n);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,n.id,n.x,n.y,n.width,n.height,e.parent(o)),n.height+=c,e.node(n.parentId);const L=n?.padding/2||0,w=n?.labelBBox?.height||0,y=w-L||0;p.debug("OffsetY",y,"labelHeight",w,"halfPadding",L),await F(r,n),b.get(n.id).node=n}else{const L=e.node(n.parentId);n.y+=c/2,p.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",L,L?.offsetY,n),R(n)}}));const s=c/2;return B(e,s,{mergeSelfLoops:h}).forEach(function({edge:o,start:n,end:L}){p.info("Edge "+n+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(u=>u.y+=s);const w=e.node(n),y=e.node(L),g=q(d,o,b,a,w,y,f);W(o,g)}),e.nodes().forEach(function(o){const n=e.node(o);p.info(o,n.type,n.diff),n.isGroup&&(l=n.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),oe=m(async t=>{const e=await I(t);return M(e.graph),await re(e)},"renderDagreSubgraph"),G=m(t=>{const e=new O({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){const d=r.start,a=d+"---"+d+"---1",f=d+"---"+d+"---2",h=e.node(d);e.setNode(a,{domId:a,id:a,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(a,h.parentId),e.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,h.pa Line truncated
+1
View File
@@ -0,0 +1 @@
function J(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if(!isFinite(n)||n===0)return null;var e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"),i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function K(n){return n=j(Math.abs(n)),n?n[1]:NaN}function Q(n,t){return function(e,i){for(var o=e.length,a=[],c=0,h=n[0],M=0;o>0&&h>0&&(M+h+1>i&&(h=Math.max(1,i-M)),a.push(e.substring(o-=h,o+h)),!((M+=h+1)>i));)h=n[c=(c+1)%n.length];return a.reverse().join(t)}}function V(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var W=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $(n){if(!(t=W.exec(n)))throw new Error("invalid format: "+n);var t;return new L({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$.prototype=L.prototype;function L(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}L.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _(n){n:for(var t=n.length,e=1,i=-1,o;e<t;++e)switch(n[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+n[e])break n;i>0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var N;function v(n,t){var e=j(n,t);if(!e)return N=void 0,n.toPrecision(t);var i=e[0],o=e[1],a=o-(N=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+j(n,Math.max(0,t+a-1))[0]}function X(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}const O={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:J,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>X(n*100,t),r:X,s:v,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function R(n){return n}var U=Array.prototype.map,Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nn(n){var t=n.grouping===void 0||n.thousands===void 0?R:Q(U.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?R:V(U.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",h=n.minus===void 0?"−":n.minus+"",M=n.nan===void 0?"NaN":n.nan+"";function T(f,g){f=$(f);var b=f.fill,p=f.align,m=f.sign,w=f.symbol,S=f.zero,E=f.width,F=f.comma,y=f.precision,C=f.trim,d=f.type;d==="n"?(F=!0,d="g"):O[d]||(y===void 0&&(y=12),C=!0,d="g"),(S||b==="0"&&p==="=")&&(S=!0,b="0",p="=");var q=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?e:w==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():""),B=(w==="$"?i:/[%p]/.test(d)?c:"")+(g&&g.suffix!==void 0?g.suffix:""),D=O[d],H=/[defgprs%]/.test(d);y=y===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function G(r){var l=q,u=B,x,I,k;if(d==="c")u=D(r)+u,r="";else{r=+r;var P=r<0||1/r<0;if(r=isNaN(r)?M:D(Math.abs(r),y),C&&(r=_(r)),P&&+r==0&&m!=="+"&&(P=!1),l=(P?m==="("?m:h:m==="-"||m==="("?"":m)+l,u=(d==="s"&&!isNaN(r)&&N!==void 0?Y[8+N/3]:"")+u+(P&&m==="("?")":""),H){for(x=-1,I=r.length;++x<I;)if(k=r.charCodeAt(x),48>k||k>57){u=(k===46?o+r.slice(x+1):r.slice(x))+u,r=r.slice(0,x);break}}}F&&!S&&(r=t(r,1/0));var z=l.length+r.length+u.length,s=z<E?new Array(E-z+1).join(b):"";switch(F&&S&&(r=t(s+r,s.length?E-u.length:1/0),s=""),p){case"<":r=l+r+u+s;break;case"=":r=l+s+r+u;break;case"^":r=s.slice(0,z=s.length>>1)+l+r+u+s.slice(z);break;default:r=s+l+r+u;break}return a(r)}return G.toString=function(){return f+""},G}function Z(f,g){var b=Math.max(-8,Math.min(8,Math.floor(K(g)/3)))*3,p=Math.pow(10,-b),m=T((f=$(f),f.type="f",f),{suffix:Y[8+b/3]});return function(w){return m(p*w)}}return{format:T,formatPrefix:Z}}var A,tn,rn;en({thousands:",",grouping:[3],currency:["$",""]});function en(n){return A=nn(n),tn=A.format,rn=A.formatPrefix,A}export{rn as a,tn as b,K as e,$ as f};
+30
View File
@@ -0,0 +1,30 @@
import{I as X}from"./chunk-2Q5K7J3B.js";import{p as z}from"./chunk-JWPE2WC7.js";import{n as O,b as G,s as Y,o as P,g as F,a as Z,_ as g,A as N,l as A,D as q,d as U,y as E,p as j,i as J,ak as K,B as Q,al as ee}from"./mermaid.core.js";import{p as te}from"./cynefin-OW5HDTMX.js";import"./index.js";var D=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,k=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,V=/^\s*%%/,re=" ";function _(n){return n.some(t=>D.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=L.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(`
`),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p<t.length;p++){const c=t[p];c.trim()===""||V.test(c)||T.test(c)||k.test(c)||s.push(c.replace(/\t/g," "))}if(!_(s))return{text:n,lineMap:e};const i=M(s),o=[];let a=0;for(let p=0;p<=r;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=r+1;p<t.length;p++){const c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if(V.test(c)){o.push(c),a++,e.set(a,h);continue}if(T.test(c)){o.push(c),a++,e.set(a,h);continue}if(k.test(c))continue;const l=c.replace(/\t/g," "),w=L.exec(l);if(w?.index!==void 0){const f=w.index,m=Math.round(f/i)+1;let u=f+1;for(;u<l.length&&ne.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;const v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node — expected a filename or directory name after the box-drawing prefix`);const W=re.repeat(m);o.push(W+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(D.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
`),lineMap:e}}g(R,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),j()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:Z,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:O},I=de,he=g(n=>{z(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),$=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;$(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;$(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=q(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),U(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return`
.treeView-node-label {
font-size: ${t};
fill: ${e};
white-space: pre;
}
.treeView-node-dir {
font-weight: bold;
}
.treeView-node-line {
stroke: ${r};
}
.treeView-node-icon {
color: ${s};
}
.treeView-node-description {
font-size: ${t};
fill: ${i};
font-style: italic;
white-space: pre;
}
.treeView-highlight-bg {
fill: ${o};
stroke: ${a};
stroke-width: 1;
}
`},"styles"),ye=Ce,Ne={db:I,renderer:be,parser:pe,styles:ye};export{Ne as diagram};
+41
View File
@@ -0,0 +1,41 @@
import{p as I}from"./chunk-JWPE2WC7.js";import{s as _,g as E,o as D,n as F,a as P,b as z,_ as c,D as G,p as B,A as w,y as C,B as W,l as b,E as V,d as H}from"./mermaid.core.js";import{p as j}from"./cynefin-OW5HDTMX.js";import"./index.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),U=W.radar,X=c(()=>w({...U,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Y=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),Q=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:X,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await j("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
.radarCurve-${r} {
color: ${s};
fill: ${s};
fill-opacity: ${t.curveOpacity};
stroke: ${s};
stroke-width: ${t.curveStrokeWidth};
}
.radarLegendBox-${r} {
fill: ${s};
fill-opacity: ${t.curveOpacity};
stroke: ${s};
}
`}return e},"genIndexStyles"),lt=c(a=>{const t=V(),e=C(),r=w(t,e.themeVariables),s=w(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),ct=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=lt(a);return`
.radarTitle {
font-size: ${t.fontSize};
color: ${t.titleColor};
dominant-baseline: hanging;
text-anchor: middle;
}
.radarAxisLine {
stroke: ${e.axisColor};
stroke-width: ${e.axisStrokeWidth};
}
.radarAxisLabel {
font-size: ${e.axisLabelFontSize}px;
color: ${e.axisColor};
}
.radarGraticule {
fill: ${e.graticuleColor};
fill-opacity: ${e.graticuleOpacity};
stroke: ${e.graticuleColor};
stroke-width: ${e.graticuleStrokeWidth};
}
.radarLegendText {
text-anchor: start;
font-size: ${e.legendFontSize}px;
dominant-baseline: hanging;
}
${it(t,e)}
`},"styles"),mt={parser:et,db:$,renderer:ot,styles:ct};export{mt as diagram};
+3
View File
@@ -0,0 +1,3 @@
import{p as re}from"./chunk-JWPE2WC7.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,j as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,am as pe}from"./mermaid.core.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX.js";import"./index.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${P(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;"),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const w=f[p],R=f[p-1];w.y=R.y+R.height+s.swimlaneGap}return h}o(Y,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimeLine truncated
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,He={parser:Ee,db:F,renderer:$e,styles:Ne};export{He as diagram};
+24
View File
@@ -0,0 +1,24 @@
import{p as ge}from"./chunk-JWPE2WC7.js";import{_ as w,E as ye,y as ae,A as ee,D as Se,d as ve,l as te,bd as B,j as U,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,be as Ae,p as Fe}from"./mermaid.core.js";import{s as Ne}from"./chunk-POPQ4Y6H.js";import{p as Me}from"./cynefin-OW5HDTMX.js";import{b as O}from"./defaultLocale.js";import{o as Q}from"./ordinal.js";import"./index.js";import"./init.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,i,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function De(t,a){for(var l=this,n=[l],r=[],i,h,d,g=-1;l=n.pop();)if(r.push(l),i=l.children)for(h=0,d=i.length;h<d;++h)n.push(i[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ye)):a===void 0&&(a=je);for(var l=new Z(t),n,r=[l],i,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(i=h[d]=new Z(h[d])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function je(t){return t.children}function Ye(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qe(t,a,l,n,r){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(n-a)/t.value;++d<g;)h=i[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(r-l)/t.value;++d<g;)h=i[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,i){for(var h=[],d=a.children,g,c,p=0,b=0,s=d.length,x,S,v=a.value,u,y,N,$,V,W,M;p<s;){x=r-l,S=i-n;do u=d[b++].value;while(!u&&b<s);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,V=Math.max(N/M,M/y);b<s;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Qe(g,l,n,r,v?n+=S*u/v:i):et(g,l,n,v?l+=x*u/v:r,i),v-=u,p=b}return h}const nt=(function t(a){function l(n,r,i,h,d){at(a,n,r,i,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],i=G,h=G,d=G,g=G,c=G;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(b),r=[0],a&&s.eachBefore(Ke),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),s.x0=S,s.y0=v,s.x1=u,s.y1=y,s.children&&(x=r[s.depth+1]=i(s)/2,S+=c(s)-x,v+=h(s)-x,u-=d(s)-x,y-=g(s)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(s,S,v,u,y))}return p.round=function(s){return arguments.length?(a=!!s,p):a},p.size=function(s){return arguments.length?(l=+s[0],n=+s[1],p):[l,n]},p.tile=function(s){return arguments.length?(t=Je(s),p):t},p.padding=function(s){return arguments.length?p.paddingInner(s).paddingOuter(s):p.paddingInner()},p.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:q(+s),p):i},p.paddingOuter=function(s){return arguments.length?p.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):p.paddingTop()},p.paddingTop=function(s){return arguments.length?(h=typeof s=="function"?s:q(+s),p):h},p.paddingRight=function(s){return arguments.length?(d=typeof s=="function"?s:q(+s),p)Line truncated
.treemapNode.section {
stroke: ${r.sectionStrokeColor};
stroke-width: ${r.sectionStrokeWidth};
fill: ${r.sectionFillColor};
}
.treemapNode.leaf {
stroke: ${r.leafStrokeColor};
stroke-width: ${r.leafStrokeWidth};
fill: ${r.leafFillColor};
}
.treemapLabel {
fill: ${h};
font-size: ${r.labelFontSize};
}
.treemapValue {
fill: ${d};
font-size: ${r.valueFontSize};
}
.treemapTitle {
fill: ${i};
font-size: ${r.titleFontSize};
}
`},"getStyles"),ut=pt,Ct={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{Ct as diagram};
+24
View File
@@ -0,0 +1,24 @@
import{p as $}from"./chunk-JWPE2WC7.js";import{_ as b,A as m,D as C,d as S,l as w,b as D,a as T,n as P,o as z,g as A,s as E,y as F,B as W,p as _}from"./mermaid.core.js";import{p as N}from"./cynefin-OW5HDTMX.js";import"./index.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=D,this.getAccTitle=T,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=A,this.setAccDescription=E}getConfig(){const t=m({...L,...F().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{$(e,t);let r=-1,s=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,w.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&t.getPacket().length<M;){const[p,o]=I({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(t.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}t.pushWord(s)},"populate"),I=b((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,n=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},O=b((e,t,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,B]of p.entries())j(f,B,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=b((e,t,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(s+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),G={draw:O},H={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},K=b(({packet:e}={})=>{const t=m(H,e);return`
.packetByte {
font-size: ${t.byteFontSize};
}
.packetByte.start {
fill: ${t.startByteColor};
}
.packetByte.end {
fill: ${t.endByteColor};
}
.packetLabel {
fill: ${t.labelColor};
font-size: ${t.labelFontSize};
}
.packetTitle {
fill: ${t.titleColor};
font-size: ${t.titleFontSize};
}
.packetBlock {
stroke: ${t.blockStrokeColor};
stroke-width: ${t.blockStrokeWidth};
fill: ${t.blockFillColor};
}
`},"styles"),J={parser:x,get db(){return new v},renderer:G,styles:K};export{J as diagram};
+1
View File
@@ -0,0 +1 @@
import{g as l,r as m,d as n}from"./chunk-SVP7TREG.js";import{p}from"./chunk-JWPE2WC7.js";import{_ as t,l as o}from"./mermaid.core.js";import{M as u,a as f}from"./cynefin-OW5HDTMX.js";import"./index.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},R={parser:g,db:n,renderer:m,styles:l};export{R as diagram};
+99
View File
@@ -0,0 +1,99 @@
import{g as Ut}from"./chunk-XXDRQBXY.js";import{s as Kt}from"./chunk-POPQ4Y6H.js";import{_ as f,b as Zt,a as jt,s as qt,g as Wt,n as Ht,o as Qt,c as tt,l as F,k as Xt,p as Jt,q as $t,r as te,t as ee,u as se,v as ie,j as re,x as ne}from"./mermaid.core.js";import{c as ae}from"./channel.js";import"./index.js";var Ot=(function(){var s=f(function(G,a,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=a);return l},"o"),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],h=[1,10],y=[1,11],b=[1,12],k=[1,30],R=[1,23],p=[1,24],g=[1,25],C=[1,26],v=[1,27],O=[1,19],x=[1,28],A=[1,29],N=[1,20],D=[1,18],L=[1,21],w=[1,22],xt=[2,6],u=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],pt=[1,36],ft=[1,37],bt=[1,38],gt=[1,39],yt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],Ct=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],nt=[1,101],at=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],_t=[18,61,64,66],kt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(a,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttribuLine truncated
`+m.showPosition()+`
Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Tt="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Tt,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:Et,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,Et=m.yylloc;break;case 2:if(I=this.productions_[T[1]][1],U.$=_[_.length-I],U._$={first_line:t[t.length-(I||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(I||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(I||1)].range[0],t[t.length-1].range[1]]),St=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof St<"u")return St;I&&(d=d.slice(0,-1*I*2),_=_.slice(0,-1*I),t=t.slice(0,-1*I)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(a,l){return this.yy=l||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var l=a.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var l=a.length,d=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),l=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
`+l+"^"},"showPosition"),test_match:f(function(a,l){var d,i,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),i=a[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],d=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var t in _)this[t]=_[t];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,l,d,i;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),t=0;t<_.length;t++)if(d=this._input.match(this.rules[_[t]]),d&&(!l||d[0].length>l[0].length)){if(l=d,i=t,this.options.backtrack_lexer){if(a=this.test_match(d,_[t]),a!==!1)return a;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(a=this.test_match(l,_[i]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var l=this.next();return l||this.lex()},"lex"),begin:f(function(l){this.conditionStack.push(l)},"begin"),popState:f(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:f(function(l){this.begin(l)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(l,d,i,_){switch(i){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return d.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return d.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return G})();kt.lexer=Gt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=kt,kt.Parser=ct,new ct})();Ot.parser=Ot;var oe=Ot,K,ce=(K=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0Line truncated
[data-look="${o}"][data-color-id="color-${b}"].node path {
stroke: ${r[b]};
${h?`fill: ${c[b]};`:""}
}
[data-look="${o}"][data-color-id="color-${b}"].node rect {
stroke: ${r[b]};
${h?`fill: ${c[b]};`:""}
}
`;return y},"genColor"),ue=f(s=>{const{look:n,theme:o,erEdgeLabelBackground:c,strokeWidth:r}=s;return`
${he(s)}
.entityBox {
fill: ${s.mainBkg};
stroke: ${s.nodeBorder};
}
.relationshipLabelBox {
fill: ${s.tertiaryColor};
opacity: 0.7;
background-color: ${s.tertiaryColor};
rect {
opacity: 0.5;
}
}
.labelBkg {
background-color: ${dt.has(o)&&c?c:Mt(s.tertiaryColor,.5)};
}
.edgeLabel {
background-color: ${dt.has(o)&&c?c:s.edgeLabelBackground};
}
.edgeLabel .label rect {
fill: ${dt.has(o)&&c?c:s.edgeLabelBackground};
}
.edgeLabel .label text {
fill: ${s.textColor};
}
.edgeLabel .label {
fill: ${s.nodeBorder};
font-size: 14px;
}
.label {
font-family: ${s.fontFamily};
color: ${s.nodeTextColor||s.textColor};
}
.edge-pattern-dashed {
stroke-dasharray: 8,8;
}
.node rect,
.node circle,
.node ellipse,
.node polygon
{
fill: ${s.mainBkg};
stroke: ${s.nodeBorder};
stroke-width: ${n==="neo"?r:"1px"};
}
.relationshipLine {
stroke: ${s.lineColor};
stroke-width: ${n==="neo"?r:"1px"};
fill: none;
}
.marker {
fill: none !important;
stroke: ${s.lineColor} !important;
stroke-width: 1;
}
[data-look=neo].labelBkg {
background-color: ${Mt(s.tertiaryColor,.5)};
}
.cluster rect {
fill: ${s.clusterBkg??s.mainBkg};
stroke: ${s.clusterBorder??s.nodeBorder};
stroke-width: 1px;
}
.cluster text {
fill: ${s.titleColor??s.textColor};
}
.cluster-label text {
fill: ${s.titleColor??s.textColor};
}
`},"getStyles"),de=ue,_e={parser:oe,get db(){return new ce},renderer:Bt,styles:de};export{_e as diagram};
+168
View File
@@ -0,0 +1,168 @@
import{g as Xt}from"./chunk-5VM5RSS4.js";import{g as Qt}from"./chunk-XXDRQBXY.js";import{s as Jt}from"./chunk-POPQ4Y6H.js";import{_ as k,b4 as Zt,F as Mt,l as $,c as ke,u as $t,v as e1,x as rt,b as t1,s as s1,n as i1,a as r1,g as a1,o as n1,k as u1,H as o1,J as l1,ca as c1,q as st,j as it,O as h1,p as d1,b7 as p1,r as f1}from"./mermaid.core.js";import{f as g1}from"./chunk-F27PBJKO.js";import{c as b1}from"./channel.js";var A1="flowchart-",Pe,k1=(Pe=class{constructor(){this.vertexCounter=0,this.config=ke(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=t1,this.setAccDescription=s1,this.setDiagramTitle=i1,this.getAccTitle=r1,this.getAccDescription=a1,this.getDiagramTitle=n1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return u1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const r of this.vertices.values())if(r.id===i)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,r,a,n,c,g,l={},m){if(!i||i.trim().length===0)return;let p;if(m!==void 0){let u;m.includes(`
`)?u=m+`
`:u=`{
`+m+`
}`,p=o1(u,{schema:l1})}const F=this.subGraphLookup.get(i);if(F&&p){F.metadata={...F.metadata,...p};return}const _=this.edges.find(u=>u.id===i);if(_){const u=p;u?.animate!==void 0&&(_.animate=u.animate),u?.animation!==void 0&&(_.animation=u.animation),u?.curve!==void 0&&(_.interpolate=u.curve);return}let L,A=this.vertices.get(i);if(A===void 0&&(r===void 0&&a===void 0&&n!==void 0&&n!==null&&$.warn(`Style applied to unknown node "${i}". This may indicate a typo. The node will be created automatically.`),A={id:i,labelType:"text",domId:A1+i+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(i,A)),this.vertexCounter++,r!==void 0?(this.config=ke(),L=this.sanitizeText(r.text.trim()),A.labelType=r.type,L.startsWith('"')&&L.endsWith('"')&&(L=L.substring(1,L.length-1)),A.text=L):A.text===void 0&&(A.text=i),a!==void 0&&(A.type=a),n?.forEach(u=>{A.styles.push(u)}),c?.forEach(u=>{A.classes.push(u)}),g!==void 0&&(A.dir=g),A.props===void 0?A.props=l:l!==void 0&&Object.assign(A.props,l),p!==void 0){if(p.shape){if(p.shape!==p.shape.toLowerCase()||p.shape.includes("_"))throw new Error(`No such shape: ${p.shape}. Shape names should be lowercase.`);if(!c1(p.shape))throw new Error(`No such shape: ${p.shape}.`);A.type=p?.shape}p?.label&&(A.text=p?.label,A.labelType=this.sanitizeNodeLabelType(p?.labelType)),p?.icon&&(A.icon=p?.icon,!p.label?.trim()&&A.text===i&&(A.text="")),p?.form&&(A.form=p?.form),p?.pos&&(A.pos=p?.pos),p?.img&&(A.img=p?.img,!p.label?.trim()&&A.text===i&&(A.text="")),p?.constraint&&(A.constraint=p.constraint),p.w&&(A.assetWidth=Number(p.w)),p.h&&(A.assetHeight=Number(p.h))}}addSingleLink(i,r,a,n){const l={start:i,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};$.info("abc78 Got edge...",l);const m=a.text;if(m!==void 0&&(l.text=this.sanitizeText(m.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(m.type)),a!==void 0&&(l.type=a.type,l.stroke=a.stroke,l.length=a.length>10?10:a.length),n&&!this.edges.some(p=>p.id===n))l.id=n,l.isUserDefinedId=!0;else{const p=this.edges.filter(F=>F.start===l.start&&F.end===l.end);p.length===0?l.id=st(l.start,l.end,{counter:0,prefix:"L"}):l.id=st(l.start,l.end,{counter:p.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))$.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)}isLinkData(i){return i!==null&&typeof i=="object"&&"id"in i&&typeof i.id=="string"}addLink(i,r,a){const n=this.isLinkData(a)?a.id.replace("@",""):void 0;$.info("addLink",i,r,n);for(const c of i)for(const g of r){const l=c===i[i.length-1],m=g===r[0];l&&m?this.addSingleLink(c,g,a,n):this.addSingleLink(c,g,a,void 0)}}updateLinkInterpolate(i,r){i.forEach(a=>{a==="default"?this.edges.defaultInterpolate=r:this.edges[a].interpolate=r})}updateLink(i,r){i.forEach(a=>{if(typeof a=="number"&&a>=this.edges.length)throw new Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);a==="default"?this.edges.defaultStyle=r:(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[a]?.style?.push("fill:none"))})}addClass(i,r){const a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i.split(",").forEach(n=>{let c=this.classes.get(n);c===void 0&&(c={id:n,styles:[],textStyles:[]},this.classes.set(n,c)),a?.forEach(g=>{if(/color/.exec(g)){const l=g.replace("fill","bgFill");c.textStyles.push(l)}c.styles.push(g)})})}setDirection(i){this.direction=i.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(i,r){for(const a of i.split(",")){const n=this.vertices.get(a);n&&n.classes.push(r);const c=this.edges.find(l=>l.id===a);c&&c.classes.push(r);const g=this.subGraphLookup.get(a);g&&g.classes.push(r)}}setTooltip(i,r){if(r!==void 0){r=this.sanitizeText(r);for(const a of i.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}}setClickFun(i,r,a){if(ke().securityLevel!=="loose"||r===void 0)return;let n=[];if(typeof a=="string"){n=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let g=0;g<n.length;g++){let l=n[g].trim();l.startsWith('"')&&l.endsWith('"')&&(l=l.substr(1,l.length-2)),n[g]=l}}n.length===0&&n.push(i);const c=this.vertices.get(i);c&&(c.haveCallback=!0,this.funs.push(()=>{const g=this.lookUpDomId(i),l=document.querySelector(`[id="${g}"]`);l!==null&&l.addEventListener("click",()=>{rt.runFunc(r,...n)},!1)}))}setLink(i,r,a){i.split(",").forEach(n=>{const c=this.vertices.get(n);c!==void 0&&(c.link=rt.formatUrl(r,this.config),c.linkTarget=a)}),this.setClass(i,"clickable")}getTooltip(i){return this.tooltips.get(i)}setClickEvent(i,r,a){i.split(",").forEach(n=>{this.setClickFun(n,r,a)}),this.setClass(i,"clickable")}bindFunctions(i){this.funs.forEach(r=>{r(i)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(i){const r=g1();it(i).select("svg").selectAll("g.node").on("mouseover",c=>{const g=it(c.currentTarget),l=g.attr("title");if(l===null)return;const m=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(g.attr("title")).style("left",window.scrollX+m.left+(m.right-m.left)/2+"px").style("top",window.scrollY+m.bottom+"px"),r.html(h1.sanitize(l)),g.classed("hover",!0)}).on("mouseout",c=>{r.transition().duration(500).style("opacity",0),it(c.currentTarget).classed("hover",!1)})}clear(i="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=i,this.config=ke(),d1()}setGen(i){this.version=i||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(i,r,a){let n=i.text.trim(),c=a.text;i===a&&/\s/.exec(a.text)&&(n=void 0);const l=k(L=>{const A={boolean:{},number:{},string:{}},u=[];let h;return{nodeList:L.filter(function(B){const J=typeof B;return B.stmt&&B.stmt==="dir"?(h=B.value,!1):B.trim()===""?!1:J in A?A[J].hasOwnProperty(B)?!1:A[J][B]=!0:u.includes(B)?!1:u.push(B)}),dir:h}},"uniq")(r.flat()),m=l.nodeList;let p=l.dir;const F=ke().flowchart??{};if(p=p??(F.inheritDir?this.getDirection()??ke().direction??void 0:void 0),this.version==="gen-1")for(let L=0;L<m.length;L++)m[L]=this.lookUpDomId(m[L]);n=n??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;const _={id:n,nodes:m,title:c.trim(),classes:[],dir:p,labelType:this.sanitizeNodeLabelType(a?.type)};return $.info("Adding",_.id,_.nodes,_.dir),_.nodes=this.makeUniq(_,this.subGraphs).nodes,this.subGraphs.push(_),this.subGraphLookup.set(n,_),n}getPosForId(i){for(const[r,a]of this.subGraphs.entries())if(a.id===i)return r;return-1}indexNodes2(i,r){const a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0}; Line truncated
`+z.showPosition()+`
Expecting `+Xe.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":tt="Parse error on line "+(I+1)+": Unexpected "+(Y==Gt?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(tt,{text:z.match,token:this.terminals_[Y]||Y,line:z.yylineno,loc:$e,expected:Xe})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+De+", token: "+Y);switch(Z[0]){case 1:b.push(Y),x.push(z.yytext),e.push(z.yylloc),b.push(Z[1]),Y=null,Nt=z.yyleng,t=z.yytext,I=z.yylineno,$e=z.yylloc;break;case 2:if(de=this.productions_[Z[1]][1],Ge.$=x[x.length-de],Ge._$={first_line:e[e.length-(de||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(de||1)].first_column,last_column:e[e.length-1].last_column},Yt&&(Ge._$.range=[e[e.length-(de||1)].range[0],e[e.length-1].range[1]]),et=this.performAction.apply(Ge,[t,Nt,I,Ce.yy,Z[1],x,e].concat(Ht)),typeof et<"u")return et;de&&(b=b.slice(0,-1*de*2),x=x.slice(0,-1*de),e=e.slice(0,-1*de)),b.push(this.productions_[Z[1]][0]),x.push(Ge.$),e.push(Ge._$),Ot=Oe[b[b.length-2]][b[b.length-1]],b.push(Ot);break;case 3:return!0}}return!0},"parse")},jt=(function(){var Ae={EOF:1,parseError:k(function(f,b){if(this.yy.parser)this.yy.parser.parseError(f,b);else throw new Error(f)},"parseError"),setInput:k(function(d,f){return this.yy=f||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var f=d.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:k(function(d){var f=d.length,b=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===o.length?this.yylloc.first_column:0)+o[o.length-b.length].length-b[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(d){this.unput(this.match.slice(d))},"less"),pastInput:k(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var d=this.pastInput(),f=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
`+f+"^"},"showPosition"),test_match:k(function(d,f){var b,o,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),o=d[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],b=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var e in x)this[e]=x[e];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,f,b,o;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),e=0;e<x.length;e++)if(b=this._input.match(this.rules[x[e]]),b&&(!f||b[0].length>f[0].length)){if(f=b,o=e,this.options.backtrack_lexer){if(d=this.test_match(b,x[e]),d!==!1)return d;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(d=this.test_match(f,x[o]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var f=this.next();return f||this.lex()},"lex"),begin:k(function(f){this.conditionStack.push(f)},"begin"),popState:k(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:k(function(f){this.begin(f)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(f,b,o,x){switch(o){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),b.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const e=/\n\s*/g;return b.yytext=b.yytext.replace(e,"<br/>"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return f.lex.firstGraph()&&this.begin("dir"),12;case 36:return f.lex.firstGraph()&&this.begin("dir"),12;case 37:return f.lex.firstGraph()&&this.begin("dir"),12;case 38:return f.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStylLine truncated
`);return Ut.parse(i)};var T1=zt,S1=k((s,i)=>{const r=b1,a=r(s,"r"),n=r(s,"g"),c=r(s,"b");return f1(a,n,c,i)},"fade"),E1=k(s=>`.label {
font-family: ${s.fontFamily};
color: ${s.nodeTextColor||s.textColor};
}
.cluster-label text {
fill: ${s.titleColor};
}
.cluster-label span {
color: ${s.titleColor};
}
.cluster-label span p {
background-color: transparent;
}
.label text,span {
fill: ${s.nodeTextColor||s.textColor};
color: ${s.nodeTextColor||s.textColor};
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${s.mainBkg};
stroke: ${s.nodeBorder};
stroke-width: ${s.strokeWidth??1}px;
}
.rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
text-anchor: middle;
}
.node .katex path {
fill: #000;
stroke: #000;
stroke-width: 1px;
}
.rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.root .anchor path {
fill: ${s.lineColor} !important;
stroke-width: 0;
stroke: ${s.lineColor};
}
.arrowheadPath {
fill: ${s.arrowheadColor};
}
.edgePaths .path {
stroke: ${s.lineColor};
stroke-width: ${s.strokeWidth??2}px;
}
.flowchart-link {
stroke: ${s.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${s.edgeLabelBackground};
p {
background-color: ${s.edgeLabelBackground};
}
rect {
opacity: 0.5;
background-color: ${s.edgeLabelBackground};
fill: ${s.edgeLabelBackground};
}
text-align: center;
}
/* For html labels only */
.labelBkg {
background-color: ${S1(s.edgeLabelBackground,.5)};
// background-color:
}
.cluster rect {
fill: ${s.clusterBkg};
stroke: ${s.clusterBorder};
stroke-width: 1px;
}
.cluster text {
fill: ${s.titleColor};
}
.cluster span {
color: ${s.titleColor};
}
/* .cluster div {
color: ${s.titleColor};
} */
/* Collapsed subgraph node (@{ view: collapsed }) */
.node .collapsed-indicator {
fill: ${s.clusterBorder};
stroke: none;
opacity: 0.6;
}
.node .collapsed-separator {
stroke: ${s.clusterBorder};
stroke-width: 0.75px;
}
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${s.fontFamily};
font-size: 12px;
background: ${s.tertiaryColor};
border: 1px solid ${s.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.flowchartTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${s.textColor};
}
rect.text {
fill: none;
stroke-width: 0;
}
.icon-shape, .image-shape {
background-color: ${s.edgeLabelBackground};
p {
background-color: ${s.edgeLabelBackground};
padding: 2px;
}
.label rect {
opacity: 0.5;
background-color: ${s.edgeLabelBackground};
fill: ${s.edgeLabelBackground};
}
text-align: center;
}
${Xt()}
`,"getStyles"),y1=E1,Wt=k(({defaultLayout:s,styles:i=y1}={})=>({parser:T1,get db(){return new k1},renderer:D1,styles:i,init:k(r=>{r.flowchart||(r.flowchart={});const a=Zt().layout??s??r.layout;a&&Mt({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Mt({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),x1=Wt();const I1=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:Wt,diagram:x1},Symbol.toStringTag,{value:"Module"}));export{Wt as c,I1 as f,y1 as s};
+292
View File
@@ -0,0 +1,292 @@
import{bf as on,bg as On,bh as cn,bi as un,bj as ln,bk as ue,bl as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bm as it,l as Tt,k as Zn,G as Xn,p as Gn,x as jn}from"./mermaid.core.js";import{g as oe}from"./index.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear.js";import{i as er}from"./init.js";import"./defaultLocale.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*hr;return new ht(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}fuLine truncated
`+H.showPosition()+`
Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
`+g+"^"},"showPosition"),test_match:d(function(c,g){var b,m,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),m=c[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],b=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var o in I)this[o]=I[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,g,b,m;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),o=0;o<I.length;o++)if(b=this._input.match(this.rules[I[o]]),b&&(!g||b[0].length>g[0].length)){if(g=b,m=o,this.options.backtrack_lexer){if(c=this.test_match(b,I[o]),c!==!1)return c;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(c=this.test_match(g,I[m]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(g,b,m,I){switch(m){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();x.lexer=C;function M(){this.yy={}}return d(M,"Parser"),M.prototype=x,x.Parser=M,new M})();we.parser=we;var Qi=we;it.extend(Oi);it.extend(Vi);it.extend(Bi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Lt=[],At=[],Ee=new Map,Ie=[],se=[],Wt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Ji=d(function(){Ie=[],se=[],Wt="",Ae=[],te=0,Ce=void 0,ee=void 0,et=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Lt=[],At=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Gn(),$e="sunday",ae="saturday"},"clear"),Ki=d(function(t){_t=t},"setDiagramId"),ts=d(function(t){Ye=t},"setAxisFormat"),es=d(function(){return Ye},"getAxisFormat"),ns=d(function(t){Fe=t},"setTickInterval"),rs=d(function(){return Fe},"getTickInterval"),is=d(function(t){Ue=t},"setTodayMarker"),ss=d(function(){return Ue},"getTodayMarker"),as=d(function(t){lt=t},"setDateFormat"),os=d(function(){qt=!0},"enableInclusiveEndDates"),cs=d(function(){return qt},"endDatesAreInclusive"),us=d(function(){We=!0},"enableTopAxis"),ls=d(function(){return We},"topAxisEnabled"),fs=d(function(t){Le=t},"setDisplayMode"),ds=d(function(){return Le},"getDisplayMode"),hs=d(function(){return lt},"getDateFormat"),Fn=d((t,e)= Line truncated
.mermaid-main-font {
font-family: ${t.fontFamily};
}
.exclude-range {
fill: ${t.excludeBkgColor};
}
.section {
stroke: none;
opacity: 0.2;
}
.section0 {
fill: ${t.sectionBkgColor};
}
.section2 {
fill: ${t.sectionBkgColor2};
}
.section1,
.section3 {
fill: ${t.altSectionBkgColor};
opacity: 0.2;
}
.sectionTitle0 {
fill: ${t.titleColor};
}
.sectionTitle1 {
fill: ${t.titleColor};
}
.sectionTitle2 {
fill: ${t.titleColor};
}
.sectionTitle3 {
fill: ${t.titleColor};
}
.sectionTitle {
text-anchor: start;
font-family: ${t.fontFamily};
}
/* Grid and axis */
.grid .tick {
stroke: ${t.gridColor};
opacity: 0.8;
shape-rendering: crispEdges;
}
.grid .tick text {
font-family: ${t.fontFamily};
fill: ${t.textColor};
}
.grid path {
stroke-width: 0;
}
/* Today line */
.today {
fill: none;
stroke: ${t.todayLineColor};
stroke-width: 2px;
}
/* Task styling */
/* Default task */
.task {
stroke-width: 2;
}
.taskText {
text-anchor: middle;
font-family: ${t.fontFamily};
}
.taskTextOutsideRight {
fill: ${t.taskTextDarkColor};
text-anchor: start;
font-family: ${t.fontFamily};
}
.taskTextOutsideLeft {
fill: ${t.taskTextDarkColor};
text-anchor: end;
}
/* Special case clickable */
.task.clickable {
cursor: pointer;
}
.taskText.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideLeft.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideRight.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
/* Specific task settings for the sections*/
.taskText0,
.taskText1,
.taskText2,
.taskText3 {
fill: ${t.taskTextColor};
}
.task0,
.task1,
.task2,
.task3 {
fill: ${t.taskBkgColor};
stroke: ${t.taskBorderColor};
}
.taskTextOutside0,
.taskTextOutside2
{
fill: ${t.taskTextOutsideColor};
}
.taskTextOutside1,
.taskTextOutside3 {
fill: ${t.taskTextOutsideColor};
}
/* Active task */
.active0,
.active1,
.active2,
.active3 {
fill: ${t.activeTaskBkgColor};
stroke: ${t.activeTaskBorderColor};
}
.activeText0,
.activeText1,
.activeText2,
.activeText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Completed task */
.done0,
.done1,
.done2,
.done3 {
stroke: ${t.doneTaskBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
}
.doneText0,
.doneText1,
.doneText2,
.doneText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Done task text displayed outside the bar sits against the diagram background,
not against the done-task bar, so it must use the outside/contrast color. */
.doneText0.taskTextOutsideLeft,
.doneText0.taskTextOutsideRight,
.doneText1.taskTextOutsideLeft,
.doneText1.taskTextOutsideRight,
.doneText2.taskTextOutsideLeft,
.doneText2.taskTextOutsideRight,
.doneText3.taskTextOutsideLeft,
.doneText3.taskTextOutsideRight {
fill: ${t.taskTextOutsideColor} !important;
}
/* Tasks on the critical line */
.crit0,
.crit1,
.crit2,
.crit3 {
stroke: ${t.critBorderColor};
fill: ${t.critBkgColor};
stroke-width: 2;
}
.activeCrit0,
.activeCrit1,
.activeCrit2,
.activeCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.activeTaskBkgColor};
stroke-width: 2;
}
.doneCrit0,
.doneCrit1,
.doneCrit2,
.doneCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
cursor: pointer;
shape-rendering: crispEdges;
}
.milestone {
transform: rotate(45deg) scale(0.8,0.8);
}
.milestoneText {
font-style: italic;
}
.doneCritText0,
.doneCritText1,
.doneCritText2,
.doneCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Done-crit task text outside the bar — same reasoning as doneText above. */
.doneCritText0.taskTextOutsideLeft,
.doneCritText0.taskTextOutsideRight,
.doneCritText1.taskTextOutsideLeft,
.doneCritText1.taskTextOutsideRight,
.doneCritText2.taskTextOutsideLeft,
.doneCritText2.taskTextOutsideRight,
.doneCritText3.taskTextOutsideLeft,
.doneCritText3.taskTextOutsideRight {
fill: ${t.taskTextOutsideColor} !important;
}
.vert {
stroke: ${t.vertLineColor};
}
.vertText {
font-size: 15px;
text-anchor: middle;
fill: ${t.vertLineColor} !important;
}
.activeCritText0,
.activeCritText1,
.activeCritText2,
.activeCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
.titleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.titleColor||t.textColor};
font-family: ${t.fontFamily};
}
`,"getStyles"),Ns=Hs,Bs={parser:Qi,db:Ls,renderer:Os,styles:Ns};export{Bs as diagram};
+106
View File
@@ -0,0 +1,106 @@
import{I as le}from"./chunk-2Q5K7J3B.js";import{p as he}from"./chunk-JWPE2WC7.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,j as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core.js";import{p as Ee}from"./cynefin-OW5HDTMX.js";import"./index.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.braLine truncated
${s-i/2-L/2},${x+R}
${s-i/2-L/2},${x-R}
${t.posWithOffset-i/2-L},${x-c-R}
${t.posWithOffset+i/2+L},${x-c-R}
${t.posWithOffset+i/2+L},${x+c+R}
${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",`
${t.x},${u+2}
${t.x},${u-2}
${t.x+O},${u-c-2}
${t.x+O+i+4},${u-c-2}
${t.x+O+i+4},${u+c+2}
${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(q().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.x<s.x:t.y<s.y)?r.branch:e.branch,a=h(f=>f.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seq<r.seq,"isBetweenCommits");return[...o.values()].some(f=>l(f)&&a(f))},"shouldRerouteArrow"),W=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return W(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=q(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.y<a.y?W(n.y,a.y):W(a.y,n.y),b=n.x<a.x?W(n.x,a.x):W(a.x,n.x);y==="TB"?n.x<a.x?u=`M ${n.x} ${n.y} L ${b-$} ${n.y} ${g} ${b} ${n.y+c} L ${b} ${a.y-$} ${f} ${b+c} ${a.y} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${b+$} ${n.y} ${f} ${b} ${n.y+c} L ${b} ${a.y-$} ${g} ${b-c} ${a.y} L ${a.x} ${a.y}`):y==="BT"?n.x<a.x?u=`M ${n.x} ${n.y} L ${b-$} ${n.y} ${f} ${b} ${n.y-c} L ${b} ${a.y+$} ${g} ${b+c} ${a.y} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${b+$} ${n.y} ${g} ${b} ${n.y-c} L ${b} ${a.y+$} ${f} ${b-c} ${a.y} L ${a.x} ${a.y}`):n.y<a.y?u=`M ${n.x} ${n.y} L ${n.x} ${p-$} ${f} ${n.x+c} ${p} L ${a.x-$} ${p} ${g} ${a.x} ${p+c} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${n.x} ${p+$} ${g} ${n.x+c} ${p} L ${a.x-$} ${p} ${f} ${a.x} ${p-c} L ${a.x} ${a.y}`)}else f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,y==="TB"?(n.x<a.x&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${f} ${n.x+c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${g} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x>a.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.x<a.x&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x>a.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.y<a.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${g} ${a.x} ${n.y+c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${f} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y>a.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y= Line truncated
`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;P=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=q(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,P,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,P),re(l,P,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s<e.THEME_COLOR_LIMIT;s++)t+=`
.label${s} { fill: ${e.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${e.strokeWidth};}
`;return t},"genGitGraphGradient"),kr=h(e=>{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
.branch-label${a} { fill: ${e.nodeBorder};}
.commit${a} { stroke: ${e.nodeBorder}; }
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
.arrow${a} { stroke: ${e.nodeBorder}; }
.commit-bullets { fill: ${e.nodeBorder}; }
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
${wr(e)}`;else{const l=a%ie;n+=`
.branch-label${a} { fill: ${e["gitBranchLabel"+l]}; }
.commit${a} { stroke: ${e["git"+l]}; fill: ${e["git"+l]}; }
.commit-highlight${a} { stroke: ${e["gitInv"+l]}; fill: ${e["gitInv"+l]}; }
.arrow${a} { stroke: ${e["git"+l]}; }
`}return n}else if(xr.has(t)){let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
.commit${a} { stroke: ${e.nodeBorder}; }
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:""} }
.arrow${a} { stroke: ${e.nodeBorder}; }
.commit-bullets { fill: ${e.nodeBorder}; }
`;else{const l=a%o.length;n+=`
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
.commit${a} { stroke: ${o[l]}; fill: ${o[l]}; }
.commit-highlight${a} { stroke: ${o[l]}; fill: ${o[l]}; }
.label${a} { fill: ${pr.has(t)?e.mainBkg:o[l]}; stroke: ${o[l]}; stroke-width: ${e.strokeWidth}; }
.arrow${a} { stroke: ${o[l]}; }
`}return n}else{let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)n+=`
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
.commit${a} { stroke: ${e.nodeBorder}; }
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:""}}
.arrow${a} { stroke: ${e.nodeBorder}; }
.commit-bullets { fill: ${e.nodeBorder}; }
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
`;return n}},"genColor"),vr=h(e=>`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return`
.branch-label${r} { fill: ${e["gitBranchLabel"+t]}; }
.commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; }
.commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; }
.label${r} { fill: ${e["git"+t]}; }
.arrow${r} { stroke: ${e["git"+t]}; }
`}).join(`
`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return`
.commit-id,
.commit-msg,
.branch-label {
fill: lightgrey;
color: lightgrey;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
${s?kr(e):vr(e)}
.branch {
stroke-width: ${e.strokeWidth};
stroke: ${e.commitLineColor??e.lineColor};
stroke-dasharray: ${s?"4 2":"2"};
}
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}}
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; }
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
.tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} }
.tag-hole { fill: ${e.textColor}; }
.commit-merge {
stroke: ${s?e.mainBkg:e.primaryColor};
fill: ${s?e.mainBkg:e.primaryColor};
}
.commit-reverse {
stroke: ${s?e.mainBkg:e.primaryColor};
fill: ${s?e.mainBkg:e.primaryColor};
stroke-width: ${s?e.strokeWidth:3};
}
.commit-highlight-outer {
}
.commit-highlight-inner {
stroke: ${s?e.mainBkg:e.primaryColor};
fill: ${s?e.mainBkg:e.primaryColor};
}
.arrow {
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
stroke-width: ${de.has(t)?e.strokeWidth:8};
stroke-linecap: round;
fill: none
}
.gitTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${e.textColor};
}
`},"getStyles"),Er=Cr,Ir={parser:Ve,db:se,renderer:yr,styles:Er};export{Ir as diagram};
+1
View File
@@ -0,0 +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-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-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-duration:initial;--tw-ease: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{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-400:oklch(75% .183 55.934);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-800:oklch(47% .157 37.304);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-50:oklch(98.2% .018 155.826);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-400:oklch(76.5% .177 163.223);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-2xl:96rem;--contLine truncated
+110
View File
@@ -0,0 +1,110 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index3.js","assets/common-types.js","assets/index2.js"])))=>i.map(i=>d[i]);
function jL(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function wc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jf={exports:{}},bs={};var AA;function UL(){if(AA)return bs;AA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,s){var u=null;if(s!==void 0&&(u=""+s),o.key!==void 0&&(u=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:s}}return bs.Fragment=t,bs.jsx=n,bs.jsxs=n,bs}var kA;function FL(){return kA||(kA=1,jf.exports=UL()),jf.exports}var p=FL(),Uf={exports:{}},Re={};var _A;function BL(){if(_A)return Re;_A=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),E=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=E&&M[E]||M["@@iterator"],typeof M=="function"?M:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function A(M,j,C){this.props=M,this.context=j,this.refs=T,this.updater=C||x}A.prototype.isReactComponent={},A.prototype.setState=function(M,j){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,j,"setState")},A.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function _(){}_.prototype=A.prototype;function N(M,j,C){this.props=M,this.context=j,this.refs=T,this.updater=C||x}var L=N.prototype=new _;L.constructor=N,w(L,A.prototype),L.isPureReactComponent=!0;var U=Array.isArray;function D(){}var P={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function Y(M,j,C){var J=C.ref;return{$$typeof:e,type:M,key:j,ref:J!==void 0?J:null,props:C}}function B(M,j){return Y(M.type,j,M.props)}function V(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function X(M){var j={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(C){return j[C]})}var ne=/\/+/g;function ie(M,j){return typeof M=="object"&&M!==null&&M.key!=null?X(""+M.key):j.toString(36)}function ee(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(D,D):(M.status="pending",M.then(function(j){M.status==="pending"&&(M.status="fulfilled",M.value=j)},function(j){M.status==="pending"&&(M.status="rejected",M.reason=j)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function F(M,j,C,J,Q){var re=typeof M;(re==="undefined"||re==="boolean")&&(M=null);var oe=!1;if(M===null)oe=!0;else switch(re){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(M.$$typeof){case e:case t:oe=!0;break;case h:return oe=M._init,F(oe(M._payload),j,C,J,Q)}}if(oe)return Q=Q(M),oe=J===""?"."+ie(M,0):J,U(Q)?(C="",oe!=null&&(C=oe.replace(ne,"$&/")+"/"),F(Q,j,C,"",function(ve){return ve})):Q!=null&&(V(Q)&&(Q=B(Q,C+(Q.key==null||M&&M.key===Q.key?"":(""+Q.key).replace(ne,"$&/")+"/")+oe)),j.push(Q)),1;oe=0;var he=J===""?".":J+":";if(U(M))for(var pe=0;pe<M.length;pe++)J=M[pe],re=he+ie(J,pe),oe+=F(J,j,C,re,Q);else if(pe=S(M),typeof pe=="function")for(M=pe.call(M),pe=0;!(J=M.next()).done;)J=J.value,re=he+ie(J,pe++),oe+=F(J,j,C,re,Q);else if(re==="object"){if(typeof M.then=="function")return F(ee(M),j,C,J,Q);throw j=String(M),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return oe}functLine truncated
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+je+r+qe}var Ie=!1;function kt(r,i){if(!r||Ie)return"";Ie=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var Z=ae}Reflect.construct(r,[],de)}else{try{de.call()}catch(ae){Z=ae}r.call(de.prototype)}}else{try{throw Error()}catch(ae){Z=ae}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&Z&&typeof ae.stack=="string")return[ae.stack,Z.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),k=y[0],R=y[1];if(k&&R){var z=k.split(`
`),K=R.split(`
`);for(b=d=0;d<z.length&&!z[d].includes("DetermineComponentFrameRoot");)d++;for(;b<K.length&&!K[b].includes("DetermineComponentFrameRoot");)b++;if(d===z.length||b===K.length)for(d=z.length-1,b=K.length-1;1<=d&&0<=b&&z[d]!==K[b];)b--;for(;1<=d&&0<=b;d--,b--)if(z[d]!==K[b]){if(d!==1||b!==1)do if(d--,b--,0>b||z[d]!==K[b]){var le=`
`+z[d].replace(" at new "," at ");return r.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",r.displayName)),le}while(1<=d&&0<=b);break}}}finally{Ie=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?Qe(l):""}function cn(r,i){switch(r.tag){case 26:case 27:case 5:return Qe(r.type);case 16:return Qe("Lazy");case 13:return r.child!==i&&i!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return kt(r.type,!1);case 11:return kt(r.type.render,!1);case 1:return kt(r.type,!0);case 31:return Qe("Activity");default:return""}}function ml(r){try{var i="",l=null;do i+=cn(r,l),l=r,r=r.return;while(r);return i}catch(d){return`
Error generating stack: `+d.message+`
`+d.stack}}var ai=Object.prototype.hasOwnProperty,ii=e.unstable_scheduleCallback,Ao=e.unstable_cancelCallback,Ed=e.unstable_shouldYield,Sd=e.unstable_requestPaint,Vt=e.unstable_now,xd=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,dn=e.log,dr=e.unstable_setDisableYieldValue,qt=null,wt=null;function Jt(r){if(typeof dn=="function"&&dr(r),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(qt,r)}catch{}}var at=Math.clz32?Math.clz32:x1,Mr=Math.log,Bn=Math.LN2;function x1(r){return r>>>=0,r===0?32:31-(Mr(r)/Bn|0)|0}var hl=256,bl=262144,yl=4194304;function Ta(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function vl(r,i,l){var d=r.pendingLanes;if(d===0)return 0;var b=0,y=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var R=d&134217727;return R!==0?(d=R&~y,d!==0?b=Ta(d):(k&=R,k!==0?b=Ta(k):l||(l=R&~r,l!==0&&(b=Ta(l))))):(R=d&~y,R!==0?b=Ta(R):k!==0?b=Ta(k):l||(l=d&~r,l!==0&&(b=Ta(l)))),b===0?0:i!==0&&i!==b&&(i&y)===0&&(y=b&-b,l=i&-i,y>=l||y===32&&(l&4194048)!==0)?i:b}function ko(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function w1(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 CS(){var r=yl;return yl<<=1,(yl&62914560)===0&&(yl=4194304),r}function wd(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function _o(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function T1(r,i,l,d,b,y){var k=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var R=r.entanglements,z=r.expirationTimes,K=r.hiddenUpdates;for(l=k&~l;0<l;){var le=31-at(l),de=1<<le;R[le]=0,z[le]=-1;var Z=K[le];if(Z!==null)for(K[le]=null,le=0;le<Z.length;le++){var ae=Z[le];ae!==null&&(ae.lane&=-536870913)}l&=~de}d!==0&&RS(r,d,0),y!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=y&~(k&~i))}function RS(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-at(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|l&261930}function IS(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var d=31-at(l),b=1<<d;b&i|r[d]&i&&(r[d]|=i),l&=~b}}function OS(r,i){var l=i&-i;return l=(l&42)!==0?1:Td(l),(l&(r.suspendedLanes|i))!==0?0:l}function Td(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ad(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function DS(){var r=q.p;return r!==0?r:(r=window.event,r===void 0?32:yA(r.type))}function LS(r,i){var l=q.p;try{return q.p=r,i()}finally{q.p=l}}var jr=Math.random().toString(36).slice(2),Ot="__reactFiber$"+jr,en="__reactProps$"+jr,oi="__reactContainer$"+jr,kd="__reactEvents$"+jr,A1="__reactListeners$"+jr,k1="__reactHandles$"+jr,MS="__reactResources$"+jr,No="__reactMarker$"+jr;function _d(r){delete r[Ot],delete r[en],delete r[kd],delete r[A1],delete r[k1]}function si(r){var i=r[Ot];if(i)return i;for(var l=r.parentNode;l;){if(i=l[oi]||l[Ot]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=nA(r);r!==null;){if(l=r[Ot])return l;r=nA(r)}return i}r=l,l=r.parentNode}return null}function li(r){if(r=r[Ot]||r[oi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Co(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function ui(r){var i=r[MS];return i||(i=r[MS]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function _t(r){r[No]=!0}var jS=new Set,US={};function Aa(r,i){ci(r,i),ci(r+"Capture",i)}function ci(r,i){for(US[r]=i,r=0;r<i.length;r++)jS.add(i[r])}var _1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u20 Line truncated
`).replace(aL,"")}function qT(r,i){return i=VT(i),VT(r)===i}function nt(r,i,l,d,b,y){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||pi(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&pi(r,""+d);break;case"className":Sl(r,"class",d);break;case"tabIndex":Sl(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Sl(r,l,d);break;case"style":qS(r,d,y);break;case"data":if(i!=="object"){Sl(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=wl(""+d),r.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(i!=="input"&&nt(r,i,"name",b.name,b,null),nt(r,i,"formEncType",b.formEncType,b,null),nt(r,i,"formMethod",b.formMethod,b,null),nt(r,i,"formTarget",b.formTarget,b,null)):(nt(r,i,"encType",b.encType,b,null),nt(r,i,"method",b.method,b,null),nt(r,i,"target",b.target,b,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=wl(""+d),r.setAttribute(l,d);break;case"onClick":d!=null&&(r.onclick=fr);break;case"onScroll":d!=null&&Be("scroll",r);break;case"onScrollEnd":d!=null&&Be("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}l=wl(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""+d):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":d===!0?r.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,d):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(l,d):r.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(l):r.setAttribute(l,d);break;case"popover":Be("beforetoggle",r),Be("toggle",r),El(r,"popover",d);break;case"xlinkActuate":pr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":pr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":pr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":pr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":pr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":pr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":pr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":pr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":pr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":El(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=O1.get(l)||l,El(r,l,d))}}function yf(r,i,l,d,b,y){switch(l){case"style":qS(r,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof d=="string"?pi(r,d):(typeof d=="number"||typeof d=="bigint")&&pi(r,""+d);break;case"onScroll":d!=null&&Be("scroll",r);break;case"onScrollEnd":d!=null&&Be("scrollend",r);break;case"onClick":d!=null&&(r.onclick=fr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
.`.concat(HU,` {
overflow: hidden `).concat(a,`;
padding-right: `).concat(c,"px ").concat(a,`;
}
body[`).concat(to,`] {
overflow: hidden `).concat(a,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(u,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(c,"px ").concat(a,`;
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(a,";")].filter(Boolean).join(""),`
}
.`).concat(Qu,` {
right: `).concat(c,"px ").concat(a,`;
}
.`).concat(Ju,` {
margin-right: `).concat(c,"px ").concat(a,`;
}
.`).concat(Qu," .").concat(Qu,` {
right: 0 `).concat(a,`;
}
.`).concat(Ju," .").concat(Ju,` {
margin-right: 0 `).concat(a,`;
}
body[`).concat(to,`] {
`).concat(VU,": ").concat(c,`px;
}
`)},fk=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},cF=function(){v.useEffect(function(){return document.body.setAttribute(to,(fk()+1).toString()),function(){var e=fk()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,e.toString())}},[])},dF=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;cF();var s=v.useMemo(function(){return sF(o)},[o]);return v.createElement(lF,{styles:uF(s,!t,o,n?"":"!important")})},Dg=!1;if(typeof window<"u")try{var Fu=Object.defineProperty({},"passive",{get:function(){return Dg=!0,!0}});window.addEventListener("test",Fu,Fu),window.removeEventListener("test",Fu,Fu)}catch{Dg=!1}var Vi=Dg?{passive:!1}:!1,pF=function(e){return e.tagName==="TEXTAREA"},eC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pF(e)&&n[t]==="visible")},fF=function(e){return eC(e,"overflowY")},gF=function(e){return eC(e,"overflowX")},gk=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=tC(e,a);if(o){var s=nC(e,a),u=s[1],c=s[2];if(u>c)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},mF=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},hF=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},tC=function(e,t){return e==="v"?fF(t):gF(t)},nC=function(e,t){return e==="v"?mF(t):hF(t)},bF=function(e,t){return e==="h"&&t==="rtl"?-1:1},yF=function(e,t,n,a,o){var s=bF(e,window.getComputedStyle(t).direction),u=s*a,c=n.target,f=t.contains(c),g=!1,h=u>0,m=0,E=0;do{if(!c)break;var S=nC(e,c),x=S[0],w=S[1],T=S[2],A=w-T-s*x;(x||A)&&tC(e,c)&&(m+=A,E+=x);var _=c.parentNode;c=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(h&&Math.abs(m)<1||!h&&Math.abs(E)<1)&&(g=!0),g},Bu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mk=function(e){return[e.deltaX,e.deltaY]},hk=function(e){return e&&"current"in e?e.current:e},vF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EF=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},SF=0,qi=[];function xF(e){var t=v.useRef([]),n=v.useRef([0,0]),a=v.useRef(),o=v.useState(SF++)[0],s=v.useState(JN)[0],u=v.useRef(e);v.useEffect(function(){u.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=GU([e.lockRef.current],(e.shards||[]).map(hk),!0).filter(Boolean);return w.forEach(function(T){return T.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(w,T){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!u.current.allowPinchZoom;var A=Bu(w),_=n.current,N="deltaX"in w?w.deltaX:_[0]-A[0],L="deltaY"in w?w.deltaY:_[1]-A[1],U,D=w.target,P=Math.abs(N)>Math.abs(L)?"h":"v";if("touches"in w&&P==="h"&&D.type==="range")return!1;var $=window.getSelection(),Y=$&&$.anchorNode,B=Y?Y===D||Y.contains(D):!1;if(B)return!1;var V=gk(P,D);if(!V)return!0;if(V?U=P:(U=P==="v"?"h":"v",V=gk(P,D)),!V)return!1;if(!a.current&&"changedTouches"in w&&(N||L)&&(a.current=U),!U)return!0;var X=a.current||U;return yF(X,T,w,X==="h"?N:L)},[]),f=v.useCallback(function(w){var T=w;if(!(!qi.length||qi[qi.length-1]!==s)){var A="deltaY"in T?mk(T):Bu(T),_=t.current.filter(function(U){return U.name===T.type&&(U.target===T.target||T.target===U.shadowParent)&&vF(U.delta,A)})[0];if(_&&_.should){T.cancelable&&T.preventDefault();return}if(!_){var N=(u.current.shards||[]).map(hk).filter(Boolean).filter(function(U){return U.contains(T.target)}),L=N.length>0?c(T,N[0]):!u.current.noIsolation;L&&T.cancelable&&T.preventDefault()}}},[]),g=v.useCallback(function(w,T,A,_){var N={name:w,delta:T,target:A,should:_,shadowParent:wF(A)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(L){return L!==N})},1)},[]),h=v.useCallback(function(w){n.current=Bu(w),a.current=void 0},[]),m=v.useCallback(function(w){g(w.type,mk(w),w.target,c(w,e.lockRef.current))},[]),E=v.useCallback(function(w){g(w.type,Bu(w),w.target,c(w,e.lockRef.current))},[]);v.useEffect(function(){return qi.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:E}),document.addEventListener("wheel",f,Vi),document.addEventListener("touchmove",f,Vi),document.addEventListener("touchstart",h,Vi),function(){qi=qi.filter(function(w){return w!==s}),document.removeEventListener("wheel",f,Vi),document.removeEventListener("touchmove",f,Vi),document.removeEventListener("touchstart",h,Vi)}},[]);var S=e.removeScrollBar,x=e.inert;return v.createElement(v.Fragment,null,x?v.createElement(s,{styles:EF(o)}):null,S?v.createElement(dF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const TF=QU(QN,xF);var Js=v.forwardRef(function(e,t){return v.createElement(jc,ar({},e,{ref:t,sideCar:TF}))});Js.classNames=jc.classNames;var Lg=["Enter"," "],AF=["ArrowDown","PageUp","Home"],rC=["ArrowUp","PageDown","End"],kF=[...AF,...rC],_F={ltr:[...Lg,"ArrowRight"],rtl:[...Lg,"ArrowLeft"]},NF={ltr:["ArrowLeft"],rtl:["ArrowRight"]},el="Menu",[js,CF,RF]=Ys(el),[ei,aC]=It(el,[RF,va,fo]),Uc=va(),iC=fo(),[IF,ti]=ei(el),[OF,tl]=ei(el),oC=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:o,onOpenChange:s,modal:u=!0}=e,c=Uc(t),[f,g]=v.useState(null),h=v.useRef(!1),m=Rt(s),E=ya(o);return v.useEffect(()=>{const S=()=>{h.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>h.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),p.jsx(Oc,{...c,children:p.jsx(IF,{scope:t,open:n,onOpenChange:m,content:f,onContentChange:g,children:p.jsx(OF,{scope:t,onClose:v.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:E,modal:u,children:a})})})};oC.displayName=el;var DF="MenuAnchor",_m=v.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,o=Uc(n);return p.jsx(Zs,{...o,...a,ref:t})});_m.displayName=DF;var Nm="MenuPortal",[LF,sC]=ei(Nm,{forceMount:void 0}),lC=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:o}=e,s=ti(Nm,t);return p.jsx(LF,{scope:t,forceMount:n,children:p.jsx(xt,{present:n||s.open,children:p.jsx(po,{asChild:!0,container:o,children:a})})})};lC.displayName=Nm;var Un="MenuContent",[MF,Cm]=ei(Un),uC=v.forwardRef((e,t)=>{const n=sC(Un,e.__scopeMenu),{forceMount:a=n.forceMount,...o}=e,s=ti(Un,e.__scopeMenu),u=tl(Un,e.__scopeMenu);return p.jsx(js.Provider,{scope:e.__scopeMenu,children:p.jsx(xt,{present:a||s.open,children:p.jsx(js.Slot,{scope:e.__scopeMenu,children:u.modal?p.jsx(jF,{...o,ref:t}):p.jsx(UF,{...o,ref:t})})})})}),jF=v.forwardRef((e,t)=>{const n=ti(Un,e.__scopeMenu),a=v.useRef(n Line truncated
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},xP="DialogDescriptionWarning",wP=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uR(xP).contentName}}.`;return v.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Pm=KC,TP=ZC,zm=JC,$m=eR,Gm=tR,cR=rR,AP=iR,dR=sR;function kP({...e}){return p.jsx(Pm,{"data-slot":"sheet",...e})}function _P({...e}){return p.jsx(zm,{"data-slot":"sheet-portal",...e})}function NP({className:e,...t}){return p.jsx($m,{"data-slot":"sheet-overlay",className:be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function CP({className:e,children:t,side:n="right",showCloseButton:a=!0,...o}){return p.jsxs(_P,{children:[p.jsx(NP,{}),p.jsxs(Gm,{"data-slot":"sheet-content",className:be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[t,a&&p.jsxs(dR,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[p.jsx(J_,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function RP({className:e,...t}){return p.jsx("div",{"data-slot":"sheet-header",className:be("flex flex-col gap-1.5 p-4",e),...t})}function IP({className:e,...t}){return p.jsx(cR,{"data-slot":"sheet-title",className:be("text-foreground font-semibold",e),...t})}function Pt(e){return(e||"/").replace(/\/+$/,"")||"/"}function OP(e){if(!e||e.startsWith("#"))return e;try{const t=new URL(e,window.location.origin);return t.origin!==window.location.origin?e:Pt(t.pathname)+t.search+t.hash}catch{return e}}function DP(e){if(!e||e.startsWith("#"))return!1;if(e.startsWith("/docs"))return!0;try{const t=new URL(e,window.location.origin);return t.origin===window.location.origin&&t.pathname.startsWith("/docs")}catch{return!1}}function LP(e){const t=Pt(e);return t==="/"?"/docs/index.md":`${t}.md`}function pR({nav:e,activeItem:t,onItemClick:n}){const a=(o,s=0)=>{const u=(o.path||o.title)===t;if(o.children&&o.children.length>0)return p.jsxs("div",{className:"mb-4",children:[p.jsx("div",{className:"flex items-center gap-1 px-3 py-1.5 text-[11px] font-semibold text-muted-foreground/80 uppercase tracking-wider",children:o.title}),p.jsx("div",{className:"space-y-0.5 mt-1",children:o.children.map(g=>a(g,s+1))})]},o.title+(o.path||""));const f=Pt(o.path||"/");return p.jsxs("a",{href:f,"data-nav-path":o.path||"",onClick:g=>{g.preventDefault(),n(o)},className:`group flex items-center gap-1.5 w-full text-left px-3 py-1.5 text-[13px] rounded-md transition-colors ${u?"text-primary font-medium bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted/40"}`,style:{paddingLeft:`${12+s*10}px`},children:[s>0&&p.jsx(kc,{className:`h-3 w-3 shrink-0 opacity-0 group-hover:opacity-40 ${u?"opacity-60 text-primary":""}`}),p.jsx("span",{className:"truncate",children:o.title})]},o.title+(o.path||""))};return p.jsx("nav",{className:"space-y-0.5 pb-6",children:e.items?.map(o=>a(o))})}function Pu({nav:e,activeItem:t,onItemClick:n}){return p.jsx("aside",{className:"docs-sidebar w-[17rem] min-w-[17rem] shrink-0 hidden md:block border-r border-border/40",children:p.jsx(YC,{className:"h-[calc(100vh-3.5rem)] sticky top-14",children:p.jsx("div",{className:"py-5 px-2",children:p.jsx(pR,{nav:e,activeItem:t,onItemClick:n})})})})}function MP({open:e,onOpenChange:t,nav:n,activeItem:a,onItemClick:o,title:s="Navigation"}){return p.jsx(kP,{open:e,onOpenChange:t,children:p.jsxs(CP,{side:"left",className:"w-72 p-0",children:[p.jsx(RP,{className:"border-b px-4 py-3",children:p.jsx(IP,{children:s})}),p.jsx(YC,{className:"h-[calc(100vh-4rem)] px-2 py-4",children:p.jsx(pR,{nav:n,activeItem:a,onItemClick:u=>{o(u),t(!1)}})})]})})}function vk(e){const t=[],n=String(e||"");let a=n.indexOf(","),o=0,s=!1;for(;!s;){a===-1&&(a=n.length,s=!0);const u=n.slice(o,a).trim();(u||!s)&&t.pus Line truncated
`,g="/",h="*",m="",E="comment",S="declaration";function x(T,A){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];A=A||{};var _=1,N=1;function L(ie){var ee=ie.match(t);ee&&(_+=ee.length);var F=ie.lastIndexOf(f);N=~F?ie.length-F:N+ie.length}function U(){var ie={line:_,column:N};return function(ee){return ee.position=new D(ie),Y(),ee}}function D(ie){this.start=ie,this.end={line:_,column:N},this.source=A.source}D.prototype.content=T;function P(ie){var ee=new Error(A.source+":"+_+":"+N+": "+ie);if(ee.reason=ie,ee.filename=A.source,ee.line=_,ee.column=N,ee.source=T,!A.silent)throw ee}function $(ie){var ee=ie.exec(T);if(ee){var F=ee[0];return L(F),T=T.slice(F.length),ee}}function Y(){$(n)}function B(ie){var ee;for(ie=ie||[];ee=V();)ee!==!1&&ie.push(ee);return ie}function V(){var ie=U();if(!(g!=T.charAt(0)||h!=T.charAt(1))){for(var ee=2;m!=T.charAt(ee)&&(h!=T.charAt(ee)||g!=T.charAt(ee+1));)++ee;if(ee+=2,m===T.charAt(ee-1))return P("End of comment missing");var F=T.slice(2,ee-2);return N+=2,L(F),T=T.slice(ee),N+=2,ie({type:E,comment:F})}}function X(){var ie=U(),ee=$(a);if(ee){if(V(),!$(o))return P("property missing ':'");var F=$(s),q=ie({type:S,property:w(ee[0].replace(e,m)),value:F?w(F[0].replace(e,m)):m});return $(u),q}}function ne(){var ie=[];B(ie);for(var ee;ee=X();)ee!==!1&&(ie.push(ee),B(ie));return ie}return Y(),ne()}function w(T){return T?T.replace(c,m):m}return ng=x,ng}var kk;function QP(){if(kk)return Yi;kk=1;var e=Yi&&Yi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=n;const t=e(ZP());function n(a,o){let s=null;if(!a||typeof a!="string")return s;const u=(0,t.default)(a),c=typeof o=="function";return u.forEach(f=>{if(f.type!=="declaration")return;const{property:g,value:h}=f;c?o(g,h,f):h&&(s=s||{},s[g]=h)}),s}return Yi}var Es={},_k;function JP(){if(_k)return Es;_k=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(g){return!g||n.test(g)||e.test(g)},u=function(g,h){return h.toUpperCase()},c=function(g,h){return"".concat(h,"-")},f=function(g,h){return h===void 0&&(h={}),s(g)?g:(g=g.toLowerCase(),h.reactCompat?g=g.replace(o,c):g=g.replace(a,c),g.replace(t,u))};return Es.camelCase=f,Es}var Ss,Nk;function ez(){if(Nk)return Ss;Nk=1;var e=Ss&&Ss.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(QP()),n=JP();function a(o,s){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(c,f){c&&f&&(u[(0,n.camelCase)(c,s)]=f)}),u}return a.default=a,Ss=a,Ss}var tz=ez();const nz=wc(tz),xR=wR("end"),Vm=wR("start");function wR(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function rz(e){const t=Vm(e),n=xR(e);if(t&&n)return{start:t,end:n}}function Rs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ck(e.position):"start"in e||"end"in e?Ck(e):"line"in e||"column"in e?Ug(e):""}function Ug(e){return Rk(e&&e.line)+":"+Rk(e&&e.column)}function Ck(e){return Ug(e&&e.start)+"-"+Ug(e&&e.end)}function Rk(e){return e&&typeof e=="number"?e:1}class $t extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let o="",s={},u=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(u=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof a=="string"){const f=a.indexOf(":");f===-1?s.ruleId=a:(s.source=a.slice(0,f),s.ruleId=a.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){const f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Rs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const qm={}.hasOwnProperty,az=new Map,iz=/[A-Z]/g,oz=new Set(["table","tbody","thead","tfoot","tr"]),sz=new Set(["td","th"]),TR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options Line truncated
`;break}case-3:{u=`\r
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(s)}o=s===-2,a.push(u)}return a.join("")}function h3(e){const a={constructs:CR([p3,...(e||{}).extensions||[]]),content:o(Iz),defined:[],document:o(Dz),flow:o(Z$),lazy:{},string:o(e3),text:o(t3)};return a;function o(s){return u;function u(c){return f3(a,s,c)}}}function b3(e){for(;!LR(e););return e}const Pk=/[\0\t\n\r]/g;function y3(){let e=1,t="",n=!0,a;return o;function o(s,u,c){const f=[];let g,h,m,E,S;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),m=0,t="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(Pk.lastIndex=m,g=Pk.exec(s),E=g&&g.index!==void 0?g.index:s.length,S=s.charCodeAt(E),!g){t=s.slice(m);break}if(S===10&&m===E&&a)f.push(-3),a=void 0;else switch(a&&(f.push(-5),a=void 0),m<E&&(f.push(s.slice(m,E)),e+=E-m),S){case 0:{f.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,f.push(-2);e++<h;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:a=!0,e=1}m=E+1}return c&&(a&&f.push(-5),t&&f.push(t),f.push(null)),f}}const v3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function E3(e){return e.replace(v3,S3)}function S3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return RR(n.slice(s?2:1),s?16:10)}return zs(n)||e}const PR={}.hasOwnProperty;function x3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),w3(n)(b3(h3(n).document().write(y3()(e,t,!0))))}function w3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ai),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:s(Ie),blockQuote:s(ve),characterEscape:Y,characterReference:Y,codeFenced:s(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ce,u),codeText:s(je,u),codeTextData:Y,data:Y,codeFlowValue:Y,definition:s(qe),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(Qe),hardBreakEscape:s(kt),hardBreakTrailing:s(kt),htmlFlow:s(cn,u),htmlFlowData:Y,htmlText:s(cn,u),htmlTextData:Y,image:s(ml),label:u,link:s(ai),listItem:s(Ao),listItemValue:E,listOrdered:s(ii,m),listUnordered:s(ii),paragraph:s(Ed),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(Ie),strong:s(Sd),thematicBreak:s(xd)},exit:{atxHeading:f(),atxHeadingSequence:U,autolink:f(),autolinkEmail:pe,autolinkProtocol:he,blockQuote:f(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:re,characterReference:oe,codeFenced:f(T),codeFencedFence:w,codeFencedFenceInfo:S,codeFencedFenceMeta:x,codeFlowValue:B,codeIndented:f(A),codeText:f(ee),codeTextData:B,data:B,definition:f(),definitionDestinationString:L,definitionLabelString:_,definitionTitleString:N,emphasis:f(),hardBreakEscape:f(X),hardBreakTrailing:f(X),htmlFlow:f(ne),htmlFlowData:B,htmlText:f(ie),htmlTextData:B,image:f(q),label:se,labelText:te,lineEnding:V,link:f(F),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:J,resourceDestinationString:I,resourceTitleString:M,resource:j,setextHeading:f($),setextHeadingLineSequence:P,setextHeadingText:D,strong:f(),thematicBreak:f()}};zR(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ue){let me={type:"root",children:[]};const Ne={stack:[me],tokenStack:[],config:t,enter:c,exit:g,buffer:u,resume:h,data:n},Ue=[];let Xe=-1;for(;++Xe<ue.length;)if(ue[Xe][1].type==="listOrdered"||ue[Xe][1].type==="listUnordered")if(ue[Xe][0]==="enter")Ue.push(Xe);else{const dn=Ue.pop();Xe=o(ue,dn,Xe)}for(Xe=-1;++Xe<ue.length;){const dn=t[ue[Xe][0]];PR.call(dn,ue[Xe][1].type)&&dn[ue[Xe][1].type].call(Object.assign({sliceSerialize:ue[Xe][2].sliceSerialize},Ne),ue[Xe][1])}if(Ne.tokenStack.length>0){const dn=Ne.tokenStack[Ne.tokenStack.length-1];(dn[1]||zk).call(Ne,void 0,dn[0])}for(me.position={start:la(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:la(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)me=t.transforms[Xe](me)||me;return me}function o(ue,me,Ne){let Ue=me-1,Xe=-1,dn=!1,dr,qt,wt,Jt;for(;++Ue<=Ne;){const at=ue[Ue];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?Xe++:Xe--,Jt=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(dr&&!Jt&&!Xe&&!wt&&(wt=Ue),Jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jt=void 0}if(!Xe&&at[0]==="enter"&&at[1].type==="listItemPrefix"||Xe===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(dr){let Mr=Ue;for(qt=void 0;Mr--;){const Bn=ue[Mr];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;qt&&(ue[qt][1].type="lineEndingBlank",dn=!0),Bn[1].type="lineEnding",qt=Mr}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespaLine truncated
`}]}function N3(e,t){const n=t.value?t.value+`
`:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function C3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=mo(a.toLowerCase()),s=e.footnoteOrder.indexOf(a);let u,c=e.footnoteCounts.get(a);c===void 0?(c=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=s+1,c+=1,e.footnoteCounts.set(a,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,f);const g={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,g),e.applyData(t,g)}function O3(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $R(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=a:o.push({type:"text",value:a}),o}function L3(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return $R(e,t);const o={src:mo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function M3(e,t){const n={src:mo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function j3(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function U3(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return $R(e,t);const o={href:mo(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function F3(e,t){const n={href:mo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function B3(e,t,n){const a=e.all(t),o=n?P3(n):GR(t),s={},u=[];if(typeof t.checked=="boolean"){const h=a[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},a.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<a.length;){const h=a[c];(o||c!==0||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
`}),h.type==="element"&&h.tagName==="p"&&!o?u.push(...h.children):u.push(h)}const f=a[a.length-1];f&&(o||f.type!=="element"||f.tagName!=="p")&&u.push({type:"text",value:`
`});const g={type:"element",tagName:"li",properties:s,children:u};return e.patch(t,g),e.applyData(t,g)}function P3(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=GR(n[a])}return t}function GR(e){const t=e.spread;return t??e.children.length>1}function z3(e,t){const n={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<a.length;){const u=a[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,s),e.applyData(t,s)}function $3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function H3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V3(e,t){const n=e.all(t),a=n.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),o.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Vm(t.children[1]),f=xR(t.children[t.children.length-1]);c&&f&&(u.position={start:c,end:f}),o.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function q3(e,t,n){const a=n?n.children:void 0,s=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,c=u?u.length:t.children.length;let f=-1;const g=[];for(;++f<c;){const m=t.children[f],E={},S=u?u[f]:void 0;S&&(E.align=S);let x={type:"element",tagName:s,properties:E,children:[]};m&&(x.children=e.all(m),e.patch(m,x),x=e.applyData(m,x)),g.push(x)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(g,!0)};return e.patch(t,h),e.applyData(t,h)}function Y3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const $k=9,Gk=32;function W3(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),o=0;const s=[];for(;a;)s.push(Hk(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=n.exec(t);return s.push(Hk(t.slice(o),o>0,!1)),s.join("")}function Hk(e,t,n){let a=0,o=e.length;if(t){let s=e.codePointAt(a);for(;s===$k||s===Gk;)a++,s=e.codePointAt(a)}if(n){let s=e.codePointAt(o-1);for(;s===$k||s===Gk;)o--,s=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function K3(e,t){const n={type:"text",value:W3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function X3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Z3={blockquote:k3,break:_3,code:N3,delete:C3,emphasis:R3,footnoteReference:I3,heading:O3,html:D3,imageReference:L3,image:M3,inlineCode:j3,linkReference:U3,link:F3,listItem:B3,list:z3,paragraph:$3,root:G3,strong:H3,table:V3,tableCell:Y3,tableRow:q3,text:K3,thematicBreak:X3,toml:zu,yaml:zu,definition:zu,footnoteDefinition:zu};function zu(){}const HR=-1,qc=0,Os=1,hc=2,Zm=3,Qm=4,Jm=5,eh=6,VR=7,qR=8,Vk=typeof self=="object"?self:globalThis,Q3=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),a=o=>{if(e.has(o))return e.get(o);const[s,u]=t[o];switch(s){case qc:case HR:return n(u,o);case Os:{const c=n([],o);for(const f of u)c.push(a(f));return c}case hc:{const c=n({},o);for(const[f,g]of u)c[a(f)]=a(g);return c}case Zm:return n(new Date(u),o);case Qm:{const{source:c,flags:f}=u;return n(new RegExp(c,f),o)}case Jm:{const c=n(new Map,o);for(const[f,g]of u)c.set(a(f),a(g));return c}case eh:{const c=n(new Set,o);for(const f of u)c.add(a(f));return c}case VR:{const{name:c,message:f}=u;return n(new Vk[c](f),o)}case qR:return n(BigInt(u),o);case"BigInt":return n(Object(BigInt(u)),o);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:c}=new Uint8Array(u);return n(new DataView(c),u)}}return n(new Vk[s](u),o)};return a},qk=e=>Q3(new Map,e)(0),Wi="",{toString:J3}={},{keys:e4}=Object,ws=e=>{const t=typeof e;if(t!=="object"||!e)return[qc,t];const n=J3.call(e).slice(8,-1);switch(n){case"Array":return[Os,Wi];case"Object":return[hc,Wi];case"Date":return[Zm,Wi];case"RegExp":return[Qm,Wi];case"Map":return[Jm,Wi];case"Set":return[eh,Wi];case"DataView":return[Os,n]}return n.includes("Array")?[Os,n]:n.includes("Error")?[VR,n]:[hc,n]},$u=([e,t])=>e===qc&&(t==="function"||t==="symbol"),t4=(e,t,n,a)=>{const o=(u,c)=>{const f=a.push(u)-1;return n.set(c,f),f},s=u=>{if(n.has(u))return n.get(u);let[c,f]=ws(u);switch(c){case qc:{let h=u;switch(f){case"bigint":c=qR,h=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);h=null;break;case"undefined":return o([HR],u)}return o([c,h],u)}case Os:{if(f){let E=u;return f==="DataView"?E=new Uint8Array(u.buffer):f==="ArrayBuffer"&&(E=new Uint8Array( Line truncated
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
`}]}}const Yc=(function(e){if(e==null)return l4;if(typeof e=="function")return Wc(e);if(typeof e=="object")return Array.isArray(e)?i4(e):o4(e);if(typeof e=="string")return s4(e);throw new Error("Expected function, string, or object as test")});function i4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Yc(e[n]);return Wc(a);function a(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function o4(e){const t=e;return Wc(n);function n(a){const o=a;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function s4(e){return Wc(t);function t(n){return n&&n.type===e}}function Wc(e){return t;function t(n,a,o){return!!(u4(n)&&e.call(this,n,typeof a=="number"?a:void 0,o||void 0))}}function l4(){return!0}function u4(e){return e!==null&&typeof e=="object"&&"type"in e}const YR=[],c4=!0,Pg=!1,d4="skip";function WR(e,t,n,a){let o;typeof t=="function"&&typeof n!="function"?(a=n,n=t):o=t;const s=Yc(o),u=a?-1:1;c(e,void 0,[])();function c(f,g,h){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const S=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(E,"name",{value:"node ("+(f.type+(S?"<"+S+">":""))+")"})}return E;function E(){let S=YR,x,w,T;if((!t||s(f,g,h[h.length-1]||void 0))&&(S=p4(n(f,h)),S[0]===Pg))return S;if("children"in f&&f.children){const A=f;if(A.children&&S[0]!==d4)for(w=(a?A.children.length:-1)+u,T=h.concat(A);w>-1&&w<A.children.length;){const _=A.children[w];if(x=c(_,w,T)(),x[0]===Pg)return x;w=typeof x[1]=="number"?x[1]:w+u}}return S}}}function p4(e){return Array.isArray(e)?e:typeof e=="number"?[c4,e]:e==null?YR:[e]}function th(e,t,n,a){let o,s,u;typeof t=="function"&&typeof n!="function"?(s=void 0,u=t,o=n):(s=t,u=n,o=a),WR(e,s,c,o);function c(f,g){const h=g[g.length-1],m=h?h.children.indexOf(f):void 0;return u(f,m,h)}}const zg={}.hasOwnProperty,f4={};function g4(e,t){const n=t||f4,a=new Map,o=new Map,s=new Map,u={...Z3,...n.handlers},c={all:g,applyData:h4,definitionById:a,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:f,options:n,patch:m4,wrap:y4};return th(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const m=h.type==="definition"?a:o,E=String(h.identifier).toUpperCase();m.has(E)||m.set(E,h)}}),c;function f(h,m){const E=h.type,S=c.handlers[E];if(zg.call(c.handlers,E)&&S)return S(c,h,m);if(c.options.passThrough&&c.options.passThrough.includes(E)){if("children"in h){const{children:w,...T}=h,A=bc(T);return A.children=c.all(h),A}return bc(h)}return(c.options.unknownHandler||b4)(c,h,m)}function g(h){const m=[];if("children"in h){const E=h.children;let S=-1;for(;++S<E.length;){const x=c.one(E[S],h);if(x){if(S&&E[S-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Wk(x.value)),!Array.isArray(x)&&x.type==="element")){const w=x.children[0];w&&w.type==="text"&&(w.value=Wk(w.value))}Array.isArray(x)?m.push(...x):m.push(x)}}}return m}}function m4(e,t){e.position&&(t.position=rz(e))}function h4(e,t){let n=t;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&s&&Object.assign(n.properties,bc(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function b4(e,t){const n=t.data||{},a="value"in t&&!(zg.call(n,"hProperties")||zg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function y4(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
`});++a<e.length;)a&&n.push({type:"text",value:`
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function Wk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Kk(e,t){const n=g4(e,t),a=n.one(e,void 0),o=a4(n),s=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
`},o),s}function v4(e,t){return e&&"run"in e?async function(n,a){const o=Kk(n,{file:a,...t});await e.run(o,a)}:function(n,a){return Kk(n,{file:a,...e||t})}}function Xk(e){if(e)throw e}var og,Zk;function E4(){if(Zk)return og;Zk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(g){return typeof Array.isArray=="function"?Array.isArray(g):t.call(g)==="[object Array]"},s=function(g){if(!g||t.call(g)!=="[object Object]")return!1;var h=e.call(g,"constructor"),m=g.constructor&&g.constructor.prototype&&e.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!h&&!m)return!1;var E;for(E in g);return typeof E>"u"||e.call(g,E)},u=function(g,h){n&&h.name==="__proto__"?n(g,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):g[h.name]=h.newValue},c=function(g,h){if(h==="__proto__")if(e.call(g,h)){if(a)return a(g,h).value}else return;return g[h]};return og=function f(){var g,h,m,E,S,x,w=arguments[0],T=1,A=arguments.length,_=!1;for(typeof w=="boolean"&&(_=w,w=arguments[1]||{},T=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});T<A;++T)if(g=arguments[T],g!=null)for(h in g)m=c(w,h),E=c(g,h),w!==E&&(_&&E&&(s(E)||(S=o(E)))?(S?(S=!1,x=m&&o(m)?m:[]):x=m&&s(m)?m:{},u(w,{name:h,newValue:f(_,x,E)})):typeof E<"u"&&u(w,{name:h,newValue:E}));return w},og}var S4=E4();const sg=wc(S4);function $g(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function x4(){const e=[],t={run:n,use:a};return t;function n(...o){let s=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...o);function c(f,...g){const h=e[++s];let m=-1;if(f){u(f);return}for(;++m<o.length;)(g[m]===null||g[m]===void 0)&&(g[m]=o[m]);o=g,h?w4(h,c)(...g):u(null,...g)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function w4(e,t){let n;return a;function a(...u){const c=e.length>u.length;let f;c&&u.push(o);try{f=e.apply(this,u)}catch(g){const h=g;if(c&&n)throw h;return o(h)}c||(f&&f.then&&typeof f.then=="function"?f.then(s,o):f instanceof Error?o(f):s(f))}function o(u,...c){n||(n=!0,t(u,...c))}function s(u){o(null,u)}}const rr={basename:T4,dirname:A4,extname:k4,join:_4,sep:"/"};function T4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');al(e);let n=0,a=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else a<0&&(s=!0,a=o+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let u=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else u<0&&(s=!0,u=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(a=o):(c=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function A4(e){if(al(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function k4(e){al(e);let t=e.length,n=-1,a=0,o=-1,s=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){a=t+1;break}continue}n<0&&(u=!0,n=t+1),c===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===a+1?"":e.slice(o,n)}function _4(...e){let t=-1,n;for(;++t<e.length;)al(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":N4(n)}function N4(e){al(e);const t=e.codePointAt(0)===47;let n=C4(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function C4(e,t){let n="",a=0,o=-1,s=0,u=-1,c,f;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(o===u-1||s===1))if(o!==u-1&&s===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",a=0):(n=n.slice(0,f),a=n.length-1-n.lastIndexOf("/")),o=u,s=0;continue}}else if(n.length>0){n="",a=0,o=u,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(o+1,u):n=e.slice(o+1,u),a=u-o-1;o=u,s=0}else c===46&&s>-1?s++:s=-1}return n}function al(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const R4={cwd:I4};function I4(){return"/"}function Gg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function O4(e){if(typeof e=="string")e=new URL(e);else if(!Gg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return D4(e)}function D4(e){if(e.hostname!==""){consLine truncated
`:" ")+s.indentLines(s.containerFlow(a,c.current()),t?JR:xG))),g(),f}}function xG(e,t,n){return t===0?e:JR(e,t,n)}function JR(e,t,n){return(n?"":" ")+e}const wG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];e0.peek=NG;function TG(){return{canContainEols:["delete"],enter:{strikethrough:kG},exit:{strikethrough:_G}}}function AG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wG}],handlers:{delete:e0}}}function kG(e){this.enter({type:"delete",children:[]},e)}function _G(e){this.exit(e)}function e0(e,t,n,a){const o=n.createTracker(a),s=n.enter("strikethrough");let u=o.move("~~");return u+=n.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),s(),u}function NG(){return"~"}function CG(e){return e.length}function RG(e,t){const n=t||{},a=(n.align||[]).concat(),o=n.stringLength||CG,s=[],u=[],c=[],f=[];let g=0,h=-1;for(;++h<e.length;){const w=[],T=[];let A=-1;for(e[h].length>g&&(g=e[h].length);++A<e[h].length;){const _=IG(e[h][A]);if(n.alignDelimiters!==!1){const N=o(_);T[A]=N,(f[A]===void 0||N>f[A])&&(f[A]=N)}w.push(_)}u[h]=w,c[h]=T}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<g;)s[m]=a_(a[m]);else{const w=a_(a);for(;++m<g;)s[m]=w}m=-1;const E=[],S=[];for(;++m<g;){const w=s[m];let T="",A="";w===99?(T=":",A=":"):w===108?T=":":w===114&&(A=":");let _=n.alignDelimiters===!1?1:Math.max(1,f[m]-T.length-A.length);const N=T+"-".repeat(_)+A;n.alignDelimiters!==!1&&(_=T.length+_+A.length,_>f[m]&&(f[m]=_),S[m]=_),E[m]=N}u.splice(1,0,E),c.splice(1,0,S),h=-1;const x=[];for(;++h<u.length;){const w=u[h],T=c[h];m=-1;const A=[];for(;++m<g;){const _=w[m]||"";let N="",L="";if(n.alignDelimiters!==!1){const U=f[m]-(T[m]||0),D=s[m];D===114?N=" ".repeat(U):D===99?U%2?(N=" ".repeat(U/2+.5),L=" ".repeat(U/2-.5)):(N=" ".repeat(U/2),L=N):L=" ".repeat(U)}n.delimiterStart!==!1&&!m&&A.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||m)&&A.push(" "),n.alignDelimiters!==!1&&A.push(N),A.push(_),n.alignDelimiters!==!1&&A.push(L),n.padding!==!1&&A.push(" "),(n.delimiterEnd!==!1||m!==g-1)&&A.push("|")}x.push(n.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return x.join(`
`)}function IG(e){return e==null?"":String(e)}function a_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function OG(e,t,n,a){const o=n.enter("blockquote"),s=n.createTracker(a);s.move("> "),s.shift(2);const u=n.indentLines(n.containerFlow(e,s.current()),DG);return o(),u}function DG(e,t,n){return">"+(n?"":" ")+e}function LG(e,t){return i_(e,t.inConstruct,!0)&&!i_(e,t.notInConstruct,!1)}function i_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function o_(e,t,n,a){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
`&&LG(n.stack,n.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
`}function MG(e,t){const n=String(e);let a=n.indexOf(t),o=a,s=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++s>u&&(u=s):s=1,o=a+t.length,a=n.indexOf(t,o);return u}function jG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function UG(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function FG(e,t,n,a){const o=UG(n),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(jG(e,n)){const m=n.enter("codeIndented"),E=n.indentLines(s,BG);return m(),E}const c=n.createTracker(a),f=o.repeat(Math.max(MG(s,o)+1,3)),g=n.enter("codeFenced");let h=c.move(f);if(e.lang){const m=n.enter(`codeFencedLang${u}`);h+=c.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${u}`);h+=c.move(" "),h+=c.move(n.safe(e.meta,{before:h,after:`
`,encode:["`"],...c.current()})),m()}return h+=c.move(`
`),s&&(h+=c.move(s+`
`)),h+=c.move(f),g(),h}function BG(e,t,n){return(n?"":" ")+e}function rh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function PG(e,t,n,a){const o=rh(n),s=o==='"'?"Quote":"Apostrophe",u=n.enter("definition");let c=n.enter("label");const f=n.createTracker(a);let g=f.move("[");return g+=f.move(n.safe(n.associationId(e),{before:g,after:"]",...f.current()})),g+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),g+=f.move("<"),g+=f.move(n.safe(e.url,{before:g,after:">",...f.current()})),g+=f.move(">")):(c=n.enter("destinationRaw"),g+=f.move(n.safe(e.url,{before:g,after:e.title?" ":`
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),g+=f.move(" "+o),g+=f.move(n.safe(e.title,{before:g,after:o,...f.current()})),g+=f.move(o),c()),u(),g}function zG(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $s(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yc(e,t,n){const a=io(e),o=io(t);return a===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}t0.peek=$G;function t0(e,t,n,a){const o=zG(n),s=n.enter("emphasis"),u=n.createTracker(a),c=u.move(o);let f=u.move(n.containerPhrasing(e,{after:o,before:c,...u.current()}));const g=f.charCodeAt(0),h=yc(a.before.charCodeAt(a.before.length-1),g,o);h.inside&&(f=$s(g)+f.slice(1));const m=f.charCodeAt(f.length-1),E=yc(a.after.charCodeAt(0),m,o);E.inside&&(f=f.slice(0,-1)+$s(m));const S=u.move(o);return s(),n.attentionEncodeSurroundingInfo={after:E.outside,before:h.outside},c+f+S}function $G(e,t,n){return n.options.emphasis||"*"}function GG(e,t){let n=!1;return th(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Pg}),!!((!e.depth||e.depth<3)&&Km(e)&&(t.options.setext||n))}function HG(e,t,n,a){const o=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(a);if(GG(e,n)){const h=n.enter("headingSetext"),m=n.enter("phrasing"),E=n.containerPhrasing(e,{...s.current(),before:`
`,after:`
`});return m(),h(),E+`
`+(o===1?"=":"-").repeat(E.length-(Math.max(E.lastIndexOf("\r"),E.lastIndexOf(`
`))+1))}const u="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");s.move(u+" ");let g=n.containerPhrasing(e,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(g)&&(g=$s(g.charCodeAt(0))+g.slice(1)),g=g?u+" "+g:u,n.options.closeAtx&&(g+=" "+u),f(),c(),g}n0.peek=VG;function n0(e){return e.value||""}function VG(){return"<"}r0.peek=qG;function r0(e,t,n,a){const o=rh(n),s=o==='"'?"Quote":"Apostrophe",u=n.enter("image");let c=n.enter("label");const f=n.createTracker(a);let g=f.move("![");return g+=f.move(n.safe(e.alt,{before:g,after:"]",...f.current()})),g+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),g+=f.move("<"),g+=f.move(n.safe(e.url,{before:g,after:">",...f.current()})),g+=f.move(">")):(c=n.enter("destinationRaw"),g+=f.move(n.safe(e.url,{before:g,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),g+=f.move(" "+o),g+=f.move(n.safe(e.title,{before:g,after:o,...f.current()})),g+=f.move(o),c()),g+=f.move(")"),u(),g}function qG(){return"!"}a0.peek=YG;function a0(e,t,n,a){const o=e.referenceType,s=n.enter("imageReference");let u=n.enter("label");const c=n.createTracker(a);let f=c.move("![");const g=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(g+"]["),u();const h=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return u(),n.stack=h,s(),o==="full"||!g||g!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function YG(){return"!"}i0.peek=WG;function i0(e,t,n){let a=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++s<n.unsafe.length;){const u=n.unsafe[s],c=n.compilePattern(u);let f;if(u.atBreak)for(;f=c.exec(a);){let g=f.index;a.charCodeAt(g)===10&&a.charCodeAt(g-1)===13&&g--,a=a.slice(0,g)+" "+a.slice(f.index+1)}}return o+a+o}function WG(){return"`"}function o0(e,t){const n=Km(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}s0.peek=KG;function s0(e,t,n,a){const o=rh(n),s=o==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let c,f;if(o0(e,n)){const h=n.stack;n.stack=[],c=n.enter("autolink");let m=u.move("<");return m+=u.move(n.containerPhrasing(e,{before:m,after:">",...u.current()})),m+=u.move(">"),c(),n.stack=h,m}c=n.enter("link"),f=n.enter("label");let g=u.move("[");return g+=u.move(n.containerPhrasing(e,{before:g,after:"](",...u.current()})),g+=u.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),g+=u.move("<"),g+=u.move(n.safe(e.url,{before:g,after:">",...u.current()})),g+=u.move(">")):(f=n.enter("destinationRaw"),g+=u.move(n.safe(e.url,{before:g,after:e.title?" ":")",...u.current()}))),f(),e.title&&(f=n.enter(`title${s}`),g+=u.move(" "+o),g+=u.move(n.safe(e.title,{before:g,after:o,...u.current()})),g+=u.move(o),f()),g+=u.move(")"),c(),g}function KG(e,t,n){return o0(e,n)?"<":"["}l0.peek=XG;function l0(e,t,n,a){const o=e.referenceType,s=n.enter("linkReference");let u=n.enter("label");const c=n.createTracker(a);let f=c.move("[");const g=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(g+"]["),u();const h=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return u(),n.stack=h,s(),o==="full"||!g||g!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function XG(){return"["}function ah(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ZG(e){const t=ah(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function QG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function u0(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function JG(e,t,n,a){const o=n.enter("list"),s=n.bulletCurrent;let u=e.ordered?QG(n):ah(n);const c=e.ordered?u==="."?")":".":ZG(n);let f=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),u0(n)===u&&h){let m=-1;for(;++m<e.chilLine truncated
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:E,table:u,tableCell:f,tableRow:c}};function u(S,x,w,T){return g(h(S,w,T),S.align)}function c(S,x,w,T){const A=m(S,w,T),_=g([A]);return _.slice(0,_.indexOf(`
`))}function f(S,x,w,T){const A=w.enter("tableCell"),_=w.enter("phrasing"),N=w.containerPhrasing(S,{...T,before:s,after:s});return _(),A(),N}function g(S,x){return RG(S,{align:x,alignDelimiters:a,padding:n,stringLength:o})}function h(S,x,w){const T=S.children;let A=-1;const _=[],N=x.enter("table");for(;++A<T.length;)_[A]=m(T[A],x,w);return N(),_}function m(S,x,w){const T=S.children;let A=-1;const _=[],N=x.enter("tableRow");for(;++A<T.length;)_[A]=f(T[A],S,x,w);return N(),_}function E(S,x,w){let T=d0.inlineCode(S,x,w);return w.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function bH(){return{exit:{taskListCheckValueChecked:l_,taskListCheckValueUnchecked:l_,paragraph:vH}}}function yH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:EH}}}function l_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vH(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const o=t.children;let s=-1,u;for(;++s<o.length;){const c=o[s];if(c.type==="paragraph"){u=c;break}}u===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function EH(e,t,n,a){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",c=n.createTracker(a);s&&c.move(u);let f=d0.listItem(e,t,n,{...a,...c.current()});return s&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),f;function g(h){return h+u}}function SH(){return[J4(),EG(),TG(),cH(),bH()]}function xH(e){return{extensions:[eG(),SG(e),AG(),hH(e),yH()]}}const wH={tokenize:CH,partial:!0},p0={tokenize:RH,partial:!0},f0={tokenize:IH,partial:!0},g0={tokenize:OH,partial:!0},TH={tokenize:DH,partial:!0},m0={name:"wwwAutolink",tokenize:_H,previous:b0},h0={name:"protocolAutolink",tokenize:NH,previous:y0},Lr={name:"emailAutolink",tokenize:kH,previous:v0},ur={};function AH(){return{text:ur}}let Ha=48;for(;Ha<123;)ur[Ha]=Lr,Ha++,Ha===58?Ha=65:Ha===91&&(Ha=97);ur[43]=Lr;ur[45]=Lr;ur[46]=Lr;ur[95]=Lr;ur[72]=[Lr,h0];ur[104]=[Lr,h0];ur[87]=[Lr,m0];ur[119]=[Lr,m0];function kH(e,t,n){const a=this;let o,s;return u;function u(m){return!Hg(m)||!v0.call(a,a.previous)||ih(a.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Hg(m)?(e.consume(m),c):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(TH,h,g)(m):m===45||m===95||zt(m)?(s=!0,e.consume(m),f):h(m)}function g(m){return e.consume(m),o=!0,f}function h(m){return s&&o&&Kt(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function _H(e,t,n){const a=this;return o;function o(u){return u!==87&&u!==119||!b0.call(a,a.previous)||ih(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(wH,e.attempt(p0,e.attempt(f0,s),n),n)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function NH(e,t,n){const a=this;let o="",s=!1;return u;function u(m){return(m===72||m===104)&&y0.call(a,a.previous)&&!ih(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(Kt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const E=o.toLowerCase();if(E==="http"||E==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),s?g:(s=!0,f)):n(m)}function g(m){return m===null||mc(m)||ot(m)||Ka(m)||Hc(m)?n(m):e.attempt(p0,e.attempt(f0,h),n)(m)}function h(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function CH(e,t,n){let a=0;return o;function o(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),o):u===46&&a===3?(e.consume(u),s):n(u)}function s(u){return u===null?n(u):t(u)}}function RH(e,t,n){let a,o,s;return u;function u(g){return g===46||g===95?e.check(g0,f,c)(g):g===null||ot(g)||Ka(g)||g!==45&&Hc(g)?f(g):(s=!0,e.consume(g),u)}function c(g){return g===95?a=!0:(o=a,a=void 0),e.consume(g),u}function f(g){return o||a||!s?n(g):t(g)}}function IH(e,t){let n=0,a=0;return o;function o(u){return u===40?(n++,e.consume(u),o):u===41&&a<n?s(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(g0,t,s)(u):u===null||ot(u)||Ka(u)?t(u):(e.consume(u),o)}function s(u){return u===41&&a++,e.consume(u),o}}function OH(e,t,n){return a;function a(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),a):c===38?(e.consume(c),s):c===93?(e.consume(c),o):c===60||c===null||ot(c)||Ka(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||ot(c)||Ka(c)?t(c):a(c)}function s(c){return Kt(c)?u(c):n(c)}function u(c){re Line truncated
`),n=[];let a=0;for(;a<t.length;){const o=t[a].match(/^===\s+"([^"]+)"\s*$/);if(!o){n.push(t[a]),a++;continue}const s=o[1];for(a++;a<t.length&&t[a].trim()==="";)a++;const u=[];for(;a<t.length&&!(/^===\s+"[^"]+"\s*$/.test(t[a])||t[a].trim()===""&&a+1<t.length&&/^===\s+"[^"]+"\s*$/.test(t[a+1]));){if(t[a].startsWith(" ")||t[a].trimStart().startsWith("```")){u.push(t[a].replace(/^ /,"")),a++;continue}if(u.length>0&&t[a].trim()===""){u.push(""),a++;continue}break}n.push(`### ${p5}${s}`),n.push(""),n.push(...u),n.push("")}return n.join(`
`)}function h5(e){let t=g5(e);return t=f5(t),t=m5(t),t}const b5="modulepreload",y5=function(e){return"/"+e},d_={},Vg=function(t,n,a){let o=Promise.resolve();if(n&&n.length>0){let f=function(g){return Promise.all(g.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=u?.nonce||u?.getAttribute("nonce");o=f(n.map(g=>{if(g=y5(g),g in d_)return;d_[g]=!0;const h=g.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${m}`))return;const E=document.createElement("link");if(E.rel=h?"stylesheet":b5,h||(E.as="script"),E.crossOrigin="",E.href=g,c&&E.setAttribute("nonce",c),document.head.appendChild(E),h)return new Promise((S,x)=>{E.addEventListener("load",S),E.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${g}`)))})}))}function s(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return o.then(u=>{for(const c of u||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})},v5={theme:"base",themeVariables:{background:"transparent",mainBkg:"#0d9488",primaryColor:"#0d9488",primaryBorderColor:"#14b8a6",primaryTextColor:"#ffffff",secondaryColor:"#6366f1",secondaryBorderColor:"#818cf8",secondaryTextColor:"#ffffff",tertiaryColor:"#e11d48",tertiaryBorderColor:"#fb7185",tertiaryTextColor:"#ffffff",textColor:"#f1f5f9",labelTextColor:"#f1f5f9",lineColor:"#94a3b8",arrowheadColor:"#cbd5e1",nodeBorder:"#14b8a6",clusterBkg:"rgba(13, 148, 136, 0.08)",clusterBorder:"rgba(20, 184, 166, 0.4)",defaultLinkColor:"#94a3b8",edgeLabelBackground:"rgba(15, 23, 42, 0.85)",nodeTextColor:"#ffffff",actorBkg:"#0d9488",actorBorder:"#14b8a6",actorTextColor:"#ffffff",actorLineColor:"#64748b",signalColor:"#cbd5e1",signalTextColor:"#f1f5f9",activationBorderColor:"#14b8a6",activationBkgColor:"rgba(13, 148, 136, 0.2)",sequenceNumberColor:"#ffffff",noteBkgColor:"rgba(99, 102, 241, 0.2)",noteBorderColor:"#818cf8",noteTextColor:"#f1f5f9",titleColor:"#f8fafc",fontFamily:'"Inter", system-ui, -apple-system, sans-serif',fontSize:"16px"}},E5={theme:"base",themeVariables:{background:"transparent",mainBkg:"#0d9488",primaryColor:"#0d9488",primaryBorderColor:"#0f766e",primaryTextColor:"#ffffff",secondaryColor:"#6366f1",secondaryBorderColor:"#4f46e5",secondaryTextColor:"#ffffff",tertiaryColor:"#e11d48",tertiaryBorderColor:"#be123c",tertiaryTextColor:"#ffffff",textColor:"#1e293b",labelTextColor:"#334155",lineColor:"#94a3b8",arrowheadColor:"#64748b",nodeBorder:"#0f766e",clusterBkg:"rgba(13, 148, 136, 0.06)",clusterBorder:"rgba(15, 118, 110, 0.3)",defaultLinkColor:"#94a3b8",edgeLabelBackground:"rgba(255, 255, 255, 0.9)",nodeTextColor:"#ffffff",actorBkg:"#0d9488",actorBorder:"#0f766e",actorTextColor:"#ffffff",actorLineColor:"#cbd5e1",signalColor:"#64748b",signalTextColor:"#1e293b",noteBkgColor:"rgba(99, 102, 241, 0.1)",noteBorderColor:"#6366f1",noteTextColor:"#1e293b",titleColor:"#0f172a",fontFamily:'"Inter", system-ui, -apple-system, sans-serif',fontSize:"16px"}};function S5(){return document.documentElement.classList.contains("dark")}function x5(e){return{startOnLoad:!1,securityLevel:"strict",...e?v5:E5,flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis"},sequence:{useMaxWidth:!0,wrap:!0},er:{useMaxWidth:!0},gantt:{useMaxWidth:!0}}}function w5(e,t){const n=Math.max(Math.floor(t),320);return e.replace(/<svg([^>]*)>/,(a,o)=>`<svg${o.replace(/\swidth="[^"]*"/g,"").replace(/\sheight="[^"]*"/g,"").replace(/\sstyle="[^"]*"/g,"")} width="${n}" style="width:100%;max-width:100%;height:auto;display:block;">`)}let p_=0;function T5(e){return p_+=1,`mermaid-${e.replace(/:/g,"")}-${p_}`}function yg({chart:e}){const t=v.useId(),n=v.useRef(null),a=v.useRef(null),o=v.useRef(void 0),[s,u]=v.useState("loading"),[c,f]=v.useState(""),[g,h]=v.useState("");return v.useEffect(()=>{const m=n.current;if(!m)return;let E=!1;const S=async()=>{u("loading"),f(""),h("");const T=(await Vg(async()=>{const{default:L}=await import("./mermaid.core.js").then(U=>U.cb);return{default:L}},[])).default;T.initialize(x5(S5()));const A=getComputedStyle(m),_=parseFloat(A.paddingLeft)+parseFloat(A.paddingRight),N=m.clientWidth-_;try{const{svg:L,bindFunctions:U}=await T.render(T5(t),e);if(E)return;o.current=U,h(w5(L,N)),u("ready")}catch(L){if(E)return;u("error"),f(L instanceof Error?L.message:"Failed to render diagram")}};S();const x=new ResizeObserver(()=>{S()});x.observe(m);const w=new MutationObserver(()=>{S()});return w.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{E=!0,x.disconnect(),w.disconnect()}},[e,t]),v.useEffect(()=>{s!=="ready"||!a.current||o.current?.(a.current)},[s,g]),s==="error"?p.jsx("pre",{className:"mermaid-diagram mermaid-error text-destructive text-sm my-4 p-4 rounded-lg border border-destructive/30 bg-destructive/5 overflow-x-auto",children:c}):p.jsxs("div",{ref:n,className:`mermaiLine truncated
`)===-1?p.jsx("code",{className:"bg-primary/10 text-primary px-1.5 py-0.5 rounded text-sm font-mono",children:A}):p.jsx("code",{className:`block font-mono text-foreground ${T??""}`,children:A}),pre:({children:T})=>{if(v.isValidElement(T)&&T.type===yg)return T;const A=S(T);return A?p.jsx(yg,{chart:A}):p.jsx("pre",{className:"bg-muted text-foreground border border-border p-4 rounded-lg text-sm overflow-auto my-4 font-mono whitespace-pre",children:T})},table:({children:T})=>p.jsx("div",{className:"overflow-auto my-4",children:p.jsx("table",{className:"w-full border-collapse text-sm",children:T})}),thead:({children:T})=>p.jsx("thead",{className:"bg-muted/50",children:T}),tr:({children:T})=>p.jsx("tr",{className:"border-b",children:T}),th:({children:T})=>p.jsx("th",{className:"px-4 py-2 text-left font-medium",children:T}),td:({children:T})=>p.jsx("td",{className:"px-4 py-2 text-foreground",children:T}),hr:()=>p.jsx("hr",{className:"my-6 border-border"}),strong:({children:T})=>p.jsx("strong",{className:"font-semibold text-foreground",children:T}),em:({children:T})=>p.jsx("em",{children:T})},w=u===Pt(a)&&o.length>0;return n?p.jsx("main",{id:"main-content",className:"docs-main flex-1 min-w-0",children:p.jsxs("div",{className:"docs-main-inner mx-auto w-full max-w-[720px] px-6 py-8 lg:px-8",children:[p.jsx(B5,{selectedItem:n}),f&&p.jsx("div",{className:"text-muted-foreground animate-pulse",children:"Loading content..."}),w&&p.jsx("article",{ref:h,className:"prose prose-neutral dark:prose-invert max-w-none prose-pre:bg-muted prose-pre:text-foreground prose-code:text-foreground",children:p.jsx(XR,{remarkPlugins:[E0],components:x,children:o})},a),!f&&!w&&u===Pt(a)&&p.jsx("div",{className:"bg-muted/50 border rounded-lg p-6",children:p.jsxs("p",{className:"text-muted-foreground",children:["Content for ",p.jsx("strong",{className:"text-primary",children:n.title})," would be displayed here."]})})]})}):p.jsx("main",{id:"main-content",className:"docs-main flex-1 min-w-0",children:p.jsxs("div",{className:"docs-main-inner mx-auto w-full max-w-[720px] px-6 py-8 lg:px-8",children:[p.jsx("h1",{className:"text-4xl font-bold tracking-tight mb-4",children:e.site?.title||"Documentation"}),p.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:e.site?.description||"Welcome to the documentation."}),p.jsx(Ns,{className:"my-8"}),p.jsx("h2",{className:"text-2xl font-semibold mb-4 text-primary",children:"Theme Configuration"}),p.jsxs("div",{className:"bg-muted/50 border rounded-lg p-4 mb-6",children:[p.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:p.jsx("strong",{children:"Current theme from YAML:"})}),p.jsx("pre",{className:"bg-muted text-foreground border border-border p-3 rounded-lg text-sm overflow-auto",children:`site:
theme:
preset: "${m?.preset||"zinc"}"
radius: "${m?.radius||"md"}"
darkMode: ${m?.darkMode!==!1}`})]}),p.jsx("h3",{className:"text-lg font-medium mb-3",children:"Available Presets"}),p.jsx("div",{className:"flex flex-wrap gap-2 mb-6",children:Object.keys(KL).map(T=>p.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${T===(m?.preset||"zinc")?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:T},T))}),p.jsxs("p",{className:"text-muted-foreground mb-4",children:[p.jsx("strong",{children:"Click any item in the sidebar"})," to navigate."]}),p.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"Routes"}),p.jsxs("p",{className:"text-muted-foreground mb-4",children:[p.jsx("span",{className:"font-medium text-primary",children:t.routes?.length||0})," routes configured."]}),p.jsx("pre",{className:"bg-muted text-foreground border border-border p-4 rounded-lg text-sm overflow-auto",children:JSON.stringify(t.routes?.slice(0,3),null,2)})]})})}function Vu({config:e,templateKey:t="docs"}){const n=e.templates?.[t]?.slots?.footer,a=n?.ref,s=(a?e.components?.[a]:e.components?.footer)?.props||n?.props;return p.jsx("footer",{className:"border-t border-border/50 py-8 px-6 bg-muted/20",children:p.jsxs("div",{className:"max-w-screen-2xl mx-auto flex flex-col sm:flex-row justify-between items-center gap-4 text-sm text-muted-foreground",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-5 h-5 rounded bg-gradient-to-br from-primary/60 to-primary flex items-center justify-center",children:p.jsx("span",{className:"text-primary-foreground text-[8px] font-bold",children:"AI"})}),p.jsx("span",{children:s?.text||`© ${new Date().getFullYear()} PraisonAIUI`})]}),p.jsx("nav",{className:"flex items-center gap-6",children:s?.links?.map(u=>p.jsx("a",{href:u.href,className:"hover:text-foreground transition-colors",children:u.label},u.href))})]})})}const P5=()=>({taskLists:[],collapsed:!1}),Vn=new Map,qg=100,z5=1440*60*1e3;function $5(){const e=Date.now(),t=Array.from(Vn.entries());for(const[n,a]of t)e-a.lastAccessed>z5&&Vn.delete(n);if(Vn.size>qg){const n=Array.from(Vn.entries()).sort(([,o],[,s])=>o.lastAccessed-s.lastAccessed),a=Vn.size-qg;for(let o=0;o<a;o++)Vn.delete(n[o][0])}}function Yg(e){if(!Vn.has(e))Vn.size>=qg&&$5(),Vn.set(e,{state:P5(),listeners:new Set,lastAccessed:Date.now()});else{const t=Vn.get(e);t.lastAccessed=Date.now()}return Vn.get(e)}function sh(e,t){const n=Yg(e),a=t(n.state);n.state=a,n.listeners.forEach(o=>o())}function G5(e,t){sh(e,n=>{const a=n.taskLists.filter(s=>s.id!==t.task_list_id),o={id:t.task_list_id,name:t.name,tasks:t.tasks,stats:T0(t.tasks),sequence:t.sequence,created_at:t.timestamp,updated_at:t.timestamp};return{...n,taskLists:[...a,o],collapsed:n.taskLists.length===0?t.tasks.length<=1:n.collapsed}})}function H5(e,t){sh(e,n=>{const a=n.taskLists.map(o=>o.id===t.task_list_id?{...o,tasks:t.tasks,stats:T0(t.tasks),sequence:t.sequence,updated_at:t.timestamp}:o);return{...n,taskLists:a}})}function T0(e){return e.reduce((t,n)=>(t.total+=1,t[n.status.toLowerCase()]+=1,t),{total:0,ready:0,running:0,done:0,failed:0})}function V5(e,t){sh(e,n=>({...n,collapsed:t}))}function q5(e){const[,t]=v.useState({});return v.useEffect(()=>{const n=Yg(e),a=()=>t({});return n.listeners.add(a),()=>{n.listeners.delete(a)}},[e]),Yg(e).state}function Y5(e,t){return t.type==="task_list.init"?(G5(e,t),!0):t.type==="task_list.update"?(H5(e,t),!0):!1}const A0=()=>({isStreaming:!1,currentResponse:"",toolCalls:[],thinkingSteps:[],pendingElements:[]}),qa=new Map;function Kc(e){return qa.has(e)||qa.set(e,{state:A0(),listeners:new Set,abortController:null,toolCallMap:new Map}),qa.get(e)}function qu(e){return e?Kc(e).state:A0()}function W5(e,t){const n=Kc(e);return n.listeners.add(t),()=>n.listeners.delete(t)}function Dn(e,t){const n=Kc(e);n.state={...n.state,...t},n.listeners.forEach(a=>a())}async function K5(e){const t=qa.get(e);if(t){t.abortController?.abort(),t.abortController=null,Dn(e,{isStreaming:!1});try{await fetch("/cancel",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e})})}catch{}}}function X5(e,t,n,a){const o=Kc(e);if(o.state.isStreaming)return;Dn(e,{isStreaming:!0,currentResponse:"",toolCalls:[],thinkingSteps:[],pendingElements:[]}),o.toolCallMap=new Map;const s=new AbortController;o.abortController=s,Z5(e,t,n,s,a)}async function Z5(e,t,n,a,o){try{const s=await fetch("/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,session_id:e,agent:n}),signal:a.signal});if(!s.ok)throw new Error(`HTTP ${s.status}`);const u=s.body?.getReader();if(!u)throw new Error("No response body");const c=new TextDecoder;let f="";for(;;){const{done:g,value:h}=await u.read();if(g)break;f+=c.decode(h,{stream:!0});const m=f.split(`
`);f=m.pop()||"";for(const E of m)if(E.startsWith("data: "))try{const S=JSON.parse(E.slice(6));Q5(e,S,o)}catch{}}}catch(s){if(s.name!=="AbortError"){const u=qa.get(e);u&&Dn(e,{thinkingSteps:[...u.state.thinkingSteps,`Error: ${s.message}`]})}}finally{const s=qa.get(e);s&&(s.abortController=null),Dn(e,{isStreaming:!1}),o?.onEnd?.()}}function Q5(e,t,n){const a=qa.get(e);if(!a)return;const o=a.toolCallMap;switch(t.type){case"session":t.session_id&&typeof t.session_id=="string"&&n?.onSessionId?.(t.session_id);break;case"token":case"run_content":case"team_run_content":{const u=t.token??t.content??"";u&&Dn(e,{currentResponse:a.state.currentResponse+u});break}case"message":case"run_completed":case"team_run_completed":{const u=t.content;u&&Dn(e,{currentResponse:u});break}case"thinking":case"reasoning_step":case"team_reasoning_step":{const u=t.step;u&&Dn(e,{thinkingSteps:[...a.state.thinkingSteps,u]});break}case"reasoning_started":case"team_reasoning_started":Dn(e,{thinkingSteps:[...a.state.thinkingSteps,"Starting reasoning..."]});break;case"tool_call":case"tool_call_started":case"team_tool_call_started":{const u={name:t.name,description:t.description,icon:t.icon,step_number:t.step_number,status:"running",tool_call_id:t.tool_call_id,args:t.args};u.tool_call_id&&o.set(u.tool_call_id,u);const c=g_(a.state.toolCalls,u);Dn(e,{toolCalls:c});break}case"tool_call_completed":case"team_tool_call_completed":{const u=t.extra_data,c=t.a2ui??u?.a2ui,f=t.elements??u?.elements,g={name:t.name,description:t.description,icon:t.icon,step_number:t.step_number,status:"done",tool_call_id:t.tool_call_id,args:t.args,formatted_result:t.formatted_result,result:t.result,surface_id:t.surface_id??u?.surface_id,a2ui:c?.length?{messages:c,surface_id:t.surface_id??u?.surface_id}:void 0,elements:f};g.tool_call_id&&o.set(g.tool_call_id,g);const h=g_(a.state.toolCalls,g),m=f?.length?[...a.state.pendingElements,...f]:a.state.pendingElements;Dn(e,{toolCalls:h,pendingElements:m});break}case"message_element":{const u=t.extra_data,c=t.element??u?.element;c&&Dn(e,{pendingElements:[...a.state.pendingElements,c]});break}case"error":case"run_error":case"team_run_error":{const u=t.error;u&&Dn(e,{thinkingSteps:[...a.state.thinkingSteps,`Error: ${u}`]});break}case"approval_required":case"approval_pending":case"run_paused":{const u=t.extra_data;if(u?.type==="approval_required"){const c=u;window.dispatchEvent(new CustomEvent("aiui:approval-required",{detail:c}))}break}case"end":case"done":case"run_cancelled":case"team_run_cancelled":break;default:Y5(e,t);break}}function g_(e,t){if(t.tool_call_id){const n=e.findIndex(a=>a.tool_call_id===t.tool_call_id);if(n>=0){const a=[...e];return a[n]={...a[n],...t},a}}return[...e,t]}function k0(e={}){const{externalSessionId:t}=e,[n,a]=v.useState(()=>qu(t));v.useEffect(()=>{if(!t){a(qu(null));return}return a(qu(t)),W5(t,()=>{a(qu(t))})},[t]);const o=v.useCallback((u,c)=>{const f=t??`new-${Date.now()}`;X5(f,u,c,{onSessionId:g=>{e.onSessionId?.(g)},onEnd:e.onEnd})},[t,e.onSessionId,e.onEnd]),s=v.useCallback(()=>{t&&K5(t)},[t]);return{isStreaming:n.isStreaming,currentResponse:n.currentResponse,toolCalls:n.toolCalls,thinkingSteps:n.thinkingSteps,pendingElements:n.pendingElements,sendMessage:o,cancel:s}}function J5(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function e6(e,t){if(e==null)return{};var n,a,o=J5(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)n=s[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Wg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function t6(e){if(Array.isArray(e))return Wg(e)}function n6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r6(e,t){if(e){if(typeof e=="string")return Wg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wg(e,t):void 0}}function a6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kg(e){return t6(e)||n6(e)||r6(e)||a6()}function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function i6(e,t){if(Gs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(Gs(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o6(e){var t=i6(e,"string");return Gs(t)=="symbol"?t:t+""}function _0(e,t,n){return(t=o6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xg(){return Xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Xg.apply(null,arguments)}function m_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function Ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(a){_0(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function s6(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[ Line truncated
`))})}function h6(e){var t=e.codeString,n=e.codeStyle,a=e.containerStyle,o=a===void 0?{float:"left",paddingRight:"10px"}:a,s=e.numberStyle,u=s===void 0?{}:s,c=e.startingLineNumber;return Ze.createElement("code",{style:Object.assign({},n,o)},m6({lines:t.replace(/\n$/,"").split(`
`),style:u,startingLineNumber:c}))}function b6(e){return"".concat(e.toString().length,".25em")}function C0(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function R0(e,t,n){var a={display:"inline-block",minWidth:b6(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},o=typeof e=="function"?e(t):e,s=pa(pa({},a),o);return s}function tc(e){var t=e.children,n=e.lineNumber,a=e.lineNumberStyle,o=e.largestLineNumber,s=e.showInlineLineNumbers,u=e.lineProps,c=u===void 0?{}:u,f=e.className,g=f===void 0?[]:f,h=e.showLineNumbers,m=e.wrapLongLines,E=e.wrapLines,S=E===void 0?!1:E,x=S?pa({},typeof c=="function"?c(n):c):{};if(x.className=x.className?[].concat(Kg(x.className.trim().split(/\s+/)),Kg(g)):g,n&&s){var w=R0(a,n,o);t.unshift(C0(n,w))}return m&h&&(x.style=pa({display:"flex"},x.style)),{type:"element",tagName:"span",properties:x,children:t}}function I0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var a=0;a<e.length;a++){var o=e[a];if(o.type==="text")n.push(tc({children:[o],className:Kg(new Set(t))}));else if(o.children){var s,u=t.concat(((s=o.properties)===null||s===void 0?void 0:s.className)||[]);I0(o.children,u).forEach(function(c){return n.push(c)})}}return n}function y6(e,t,n,a,o,s,u,c,f){var g,h=I0(e.value),m=[],E=-1,S=0;function x(U,D){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return tc({children:U,lineNumber:D,lineNumberStyle:c,largestLineNumber:u,showInlineLineNumbers:o,lineProps:n,className:P,showLineNumbers:a,wrapLongLines:f,wrapLines:t})}function w(U,D){if(a&&D&&o){var P=R0(c,D,u);U.unshift(C0(D,P))}return U}function T(U,D){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||P.length>0?x(U,D,P):w(U,D)}for(var A=function(){var D=h[S],P=D.children[0].value,$=g6(P);if($){var Y=P.split(`
`);Y.forEach(function(B,V){var X=a&&m.length+s,ne={type:"text",value:"".concat(B,`
`)};if(V===0){var ie=h.slice(E+1,S).concat(tc({children:[ne],className:D.properties.className})),ee=T(ie,X);m.push(ee)}else if(V===Y.length-1){var F=h[S+1]&&h[S+1].children&&h[S+1].children[0],q={type:"text",value:"".concat(B)};if(F){var te=tc({children:[q],className:D.properties.className});h.splice(S+1,0,te)}else{var se=[q],I=T(se,X,D.properties.className);m.push(I)}}else{var M=[ne],j=T(M,X,D.properties.className);m.push(j)}}),E=S}S++};S<h.length;)A();if(E!==h.length-1){var _=h.slice(E+1,h.length);if(_&&_.length){var N=a&&m.length+s,L=T(_,N);m.push(L)}}return t?m:(g=[]).concat.apply(g,m)}function v6(e){var t=e.rows,n=e.stylesheet,a=e.useInlineStyles;return t.map(function(o,s){return N0({node:o,stylesheet:n,useInlineStyles:a,key:"code-segment-".concat(s)})})}function O0(e){return e&&typeof e.highlightAuto<"u"}function E6(e){var t=e.astGenerator,n=e.language,a=e.code,o=e.defaultCodeValue;if(O0(t)){var s=d6(t,n);return n==="text"?{value:o,language:"text"}:s?t.highlight(n,a):t.highlightAuto(a)}try{return n&&n!=="text"?{value:t.highlight(a,n)}:{value:o}}catch{return{value:o}}}function S6(e,t){return function(a){var o,s,u=a.language,c=a.children,f=a.style,g=f===void 0?t:f,h=a.customStyle,m=h===void 0?{}:h,E=a.codeTagProps,S=E===void 0?{className:u?"language-".concat(u):void 0,style:pa(pa({},g['code[class*="language-"]']),g['code[class*="language-'.concat(u,'"]')])}:E,x=a.useInlineStyles,w=x===void 0?!0:x,T=a.showLineNumbers,A=T===void 0?!1:T,_=a.showInlineLineNumbers,N=_===void 0?!0:_,L=a.startingLineNumber,U=L===void 0?1:L,D=a.lineNumberContainerStyle,P=a.lineNumberStyle,$=P===void 0?{}:P,Y=a.wrapLines,B=a.wrapLongLines,V=B===void 0?!1:B,X=a.lineProps,ne=X===void 0?{}:X,ie=a.renderer,ee=a.PreTag,F=ee===void 0?"pre":ee,q=a.CodeTag,te=q===void 0?"code":q,se=a.code,I=se===void 0?(Array.isArray(c)?c[0]:c)||"":se,M=a.astGenerator,j=e6(a,p6);M=M||e;var C=A?Ze.createElement(h6,{containerStyle:D,codeStyle:S.style||{},numberStyle:$,startingLineNumber:U,codeString:I}):null,J=g.hljs||g['pre[class*="language-"]']||{backgroundColor:"#fff"},Q=O0(M)?"hljs":"prismjs",re=w?Object.assign({},j,{style:Object.assign({},J,m)}):Object.assign({},j,{className:j.className?"".concat(Q," ").concat(j.className):Q,style:Object.assign({},m)});if(V?S.style=pa({whiteSpace:"pre-wrap"},S.style):S.style=pa({whiteSpace:"pre"},S.style),!M)return Ze.createElement(F,re,C,Ze.createElement(te,S,I));(Y===void 0&&ie||V)&&(Y=!0),ie=ie||v6;var oe=[{type:"text",value:I}],he=E6({astGenerator:M,language:u,code:I,defaultCodeValue:oe});he.language===null&&(he.value=oe);var pe=(o=(s=I.match(/\n/g))===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0,ve=U+pe,Ce=y6(he,Y,ne,A,N,U,ve,$,V);return Ze.createElement(F,re,Ze.createElement(te,S,!N&&C,ie({rows:Ce,stylesheet:g,useInlineStyles:w})))}}const x6=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","armasm","arturo","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","awk","bash","basic","batch","bbcode","bbj","bicep","birb","bison","bnf","bqn","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","cilkc","cilkcpp","clike","clojure","cmake","cobol","coffeescript","concurnas","cooklang","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cue","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gettext","gherkin","git","glsl","gml","gn","go-module","go","gradle","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","linker-script","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","mata","matlab","maxscript","mel","mermaid","metafont","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","odin","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plant-uml","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rescript","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml Line truncated
?|
|(?![\\s\\S])))+`,"m"),alias:s,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(a)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}Ht.displayName="markup-templating";Ht.aliases=[];function Ht(e){e.register(Ft),(function(t){function n(a,o){return"___"+a.toUpperCase()+o+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,o,s,u){if(a.language===o){var c=a.tokenStack=[];a.code=a.code.replace(s,function(f){if(typeof u=="function"&&!u(f))return f;for(var g=c.length,h;a.code.indexOf(h=n(o,g))!==-1;)++g;return c[g]=f,h}),a.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(a,o){if(a.language!==o||!a.tokenStack)return;a.grammar=t.languages[o];var s=0,u=Object.keys(a.tokenStack);function c(f){for(var g=0;g<f.length&&!(s>=u.length);g++){var h=f[g];if(typeof h=="string"||h.content&&typeof h.content=="string"){var m=u[s],E=a.tokenStack[m],S=typeof h=="string"?h:h.content,x=n(o,m),w=S.indexOf(x);if(w>-1){++s;var T=S.substring(0,w),A=new t.Token(o,t.tokenize(E,a.grammar),"language-"+o,E),_=S.substring(w+x.length),N=[];T&&N.push.apply(N,c([T])),N.push(A),_&&N.push.apply(N,c([_])),typeof h=="string"?f.splice.apply(f,[g,1].concat(N)):h.content=N}}else h.content&&c(h.content)}return f}c(a.tokens)}}})})(e)}bb.displayName="django";bb.aliases=["jinja2"];function bb(e){e.register(Ht),(function(t){t.languages.django={comment:/^\{#[\s\S]*?#\}$/,tag:{pattern:/(^\{%[+-]?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%][+-]?|[+-]?[}%]\}$/,alias:"punctuation"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},filter:{pattern:/(\|)\w+/,lookbehind:!0,alias:"function"},test:{pattern:/(\bis\s+(?:not\s+)?)(?!not\b)\w+/,lookbehind:!0,alias:"function"},function:/\b[a-z_]\w+(?=\s*\()/i,keyword:/\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,number:/\b\d+(?:\.\d+)?\b/,boolean:/[Ff]alse|[Nn]one|[Tt]rue/,variable:/\b\w+\b/,punctuation:/[{}[\](),.:;]/};var n=/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g,a=t.languages["markup-templating"];t.hooks.add("before-tokenize",function(o){a.buildPlaceholders(o,"django",n)}),t.hooks.add("after-tokenize",function(o){a.tokenizePlaceholders(o,"django")}),t.languages.jinja2=t.languages.django,t.hooks.add("before-tokenize",function(o){a.buildPlaceholders(o,"jinja2",n)}),t.hooks.add("after-tokenize",function(o){a.tokenizePlaceholders(o,"jinja2")})})(e)}yb.displayName="dns-zone-file";yb.aliases=["dns-zone"];function yb(e){e.languages["dns-zone-file"]={comment:/;.*/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},variable:[{pattern:/(^\$ORIGIN[ \t]+)\S+/m,lookbehind:!0},{pattern:/(^|\s)@(?=\s|$)/,lookbehind:!0}],keyword:/^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,class:{pattern:/(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,lookbehind:!0,alias:"keyword"},punctuation:/[()]/},e.languages["dns-zone"]=e.languages["dns-zone-file"]}vb.displayName="docker";vb.aliases=["dockerfile"];function vb(e){(function(t){var n=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,a=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return n}),o=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,s=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return o}),u={pattern:RegExp(o),greedy:!0},c={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function f(g,h){return g=g.replace(/<OPT>/g,function(){return s}).replace(/<SP>/g,function(){return a}),RegExp(g,h)}t.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:f(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[u,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:f(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:f(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:f(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:c,string:u,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,oper Line truncated
]))(?:`+(/[^\s\\]/.source+'|[ ]+(?:(?![ "])|'+a+")|"+/\\[\r\n]+(?:[#;].*[\r\n]+)*(?![#;])/.source)+")*"),lookbehind:!0,greedy:!0,alias:"attr-value",inside:{comment:n,quoted:{pattern:RegExp(/(^|\s)/.source+a),lookbehind:!0,greedy:!0},punctuation:/\\$/m,boolean:{pattern:/^(?:false|no|off|on|true|yes)$/,greedy:!0}}},punctuation:/=/}})(e)}cl.displayName="t4-templating";cl.aliases=[];function cl(e){(function(t){function n(o,s,u){return{pattern:RegExp("<#"+o+"[\\s\\S]*?#>"),alias:"block",inside:{delimiter:{pattern:RegExp("^<#"+o+"|#>$"),alias:"important"},content:{pattern:/[\s\S]+/,inside:s,alias:u}}}}function a(o){var s=t.languages[o],u="language-"+o;return{block:{pattern:/<#[\s\S]+?#>/,inside:{directive:n("@",{"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/,inside:{punctuation:/^=|^["']|["']$/}},keyword:/\b\w+(?=\s)/,"attr-name":/\b\w+/}),expression:n("=",s,u),"class-feature":n("\\+",s,u),standard:n("",s,u)}}}}t.languages["t4-templating"]=Object.defineProperty({},"createT4",{value:a})})(e)}OE.displayName="t4-cs";OE.aliases=["t4"];function OE(e){e.register(bo),e.register(cl),e.languages.t4=e.languages["t4-cs"]=e.languages["t4-templating"].createT4("csharp")}ad.displayName="vbnet";ad.aliases=[];function ad(e){e.register(Qc),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}DE.displayName="t4-vb";DE.aliases=[];function DE(e){e.register(cl),e.register(ad),e.languages["t4-vb"]=e.languages["t4-templating"].createT4("vbnet")}LE.displayName="tap";LE.aliases=[];function LE(e){e.register(Zc),e.languages.tap={fail:/not ok[^#{\n\r]*/,pass:/ok[^#{\n\r]*/,pragma:/pragma [+-][a-z]+/,bailout:/bail out!.*/i,version:/TAP version \d+/i,plan:/\b\d+\.\.\d+(?: +#.*)?/,subtest:{pattern:/# Subtest(?:: .*)?/,greedy:!0},punctuation:/[{}]/,directive:/#.*/,yamlish:{pattern:/(^[ \t]*)---[\s\S]*?[\r\n][ \t]*\.\.\.$/m,lookbehind:!0,inside:e.languages.yaml,alias:"language-yaml"}}}ME.displayName="tcl";ME.aliases=[];function ME(e){e.languages.tcl={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,greedy:!0},variable:[{pattern:/(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,lookbehind:!0},{pattern:/(\$)\{[^}]+\}/,lookbehind:!0},{pattern:/(^[\t ]*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,lookbehind:!0}],function:{pattern:/(^[\t ]*proc[ \t]+)\S+/m,lookbehind:!0},builtin:[{pattern:/(^[\t ]*)(?:break|class|continue|error|eval|exit|for|foreach|if|proc|return|switch|while)\b/m,lookbehind:!0},/\b(?:else|elseif)\b/],scope:{pattern:/(^[\t ]*)(?:global|upvar|variable)\b/m,lookbehind:!0,alias:"constant"},keyword:{pattern:/(^[\t ]*|\[)(?:Safe_Base|Tcl|after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|scan|seek|set|socket|source|split|string|subst|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|test|vars|wordBreak(?:After|Before))|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait Line truncated
- a positive number
- less than the value passed to \`max\` (or ${yS} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var iq=vI,oq=SI;function sq({className:e,value:t,...n}){return p.jsx(iq,{"data-slot":"progress",className:be("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:p.jsx(oq,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function dl(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ud="Switch",[lq]=It(ud),[uq,cq]=lq(ud),wI=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:o,defaultChecked:s,required:u,disabled:c,value:f="on",onCheckedChange:g,form:h,...m}=e,[E,S]=v.useState(null),x=ke(t,N=>S(N)),w=v.useRef(!1),T=E?h||!!E.closest("form"):!0,[A,_]=Zt({prop:o,defaultProp:s??!1,onChange:g,caller:ud});return p.jsxs(uq,{scope:n,checked:A,disabled:c,children:[p.jsx(ye.button,{type:"button",role:"switch","aria-checked":A,"aria-required":u,"data-state":_I(A),"data-disabled":c?"":void 0,disabled:c,value:f,...m,ref:x,onClick:ge(e.onClick,N=>{_(L=>!L),T&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),T&&p.jsx(kI,{control:E,bubbles:!w.current,name:a,value:f,checked:A,required:u,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});wI.displayName=ud;var TI="SwitchThumb",AI=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,o=cq(TI,n);return p.jsx(ye.span,{"data-state":_I(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t})});AI.displayName=TI;var dq="SwitchBubbleInput",kI=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...o},s)=>{const u=v.useRef(null),c=ke(u,s),f=dl(n),g=Xs(t);return v.useEffect(()=>{const h=u.current;if(!h)return;const m=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(m,"checked").set;if(f!==n&&S){const x=new Event("click",{bubbles:a});S.call(h,n),h.dispatchEvent(x)}},[f,n,a]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:c,style:{...o.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});kI.displayName=dq;function _I(e){return e?"checked":"unchecked"}var pq=wI,fq=AI;function gq({className:e,size:t="default",...n}){return p.jsx(pq,{"data-slot":"switch","data-size":t,className:be("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...n,children:p.jsx(fq,{"data-slot":"switch-thumb",className:be("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var cd="Checkbox",[mq]=It(cd),[hq,vS]=mq(cd);function bq(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:o,disabled:s,form:u,name:c,onCheckedChange:f,required:g,value:h="on",internal_do_not_use_render:m}=e,[E,S]=Zt({prop:n,defaultProp:o??!1,onChange:f,caller:cd}),[x,w]=v.useState(null),[T,A]=v.useState(null),_=v.useRef(!1),N=x?!!u||!!x.closest("form"):!0,L={checked:E,disabled:s,setChecked:S,control:x,setControl:w,name:c,form:u,value:h,hasConsumerStoppedPropagationRef:_,required:g,defaultChecked:fa(o)?!1:o,isFormControl:N,bubbleInput:T,setBubbleInput:A};return p.jsx(hq,{scope:t,...L,children:yq(m)?m(L):a})}var NI="CheckboxTrigger",CI=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},o)=>{const{control:s,value:u,disabled:c,checked:f,required:g,setControl:h,setChecked:m,hasConsumerStoppedPropagationRef:E,isFormControl:S,bubbleInput:x}=vS(NI,e),w=ke(o,h),T=v.useRef(f);return v.useEffect(()=>{const A=s?.form;if(A){const _=()=>m(T.current);return A.addEventListener("reset",_),()=>A.removeEventListener("reset",_)}},[s,m]),p.jsx(ye.button,{type:"button",role:"checkbox","aria-checked":fa(f)?"mixed":f,"aria-required":g,"data-state":MI(f),"data-disabled":c?"":void 0,disabled:c,value:u,...a,ref:w,onKeyDown:ge(t,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:ge(n,A=>{m(_=>fa(_)?!0:!_),x&&S&&(E.current=A.isPropagationStopped(),E.current||A.stopPropagation())})})});CI.displayName=NI;var RI=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:o,defaultChecked:s,required:u,disabled:c,value:f,onCheckedChange:g,form:h,...m}=e;return p.jsx(bq,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:c,required:u,onCheckedChange:g,name:a,form:h,value:f,internal_do_not_use_render:({isFormControl:E})=>p.jsxs(p.Fragment,{children:[p.jsx(CI,{...m,ref:t,__scopeChecLine truncated
`);for(;t.length&&!t[0].trim();)t.shift();for(;t.length&&!t[t.length-1].trim();)t.pop();if(!t.length)return"";const n=Math.min(...t.filter(a=>a.trim().length>0).map(a=>a.match(/^ */)?.[0].length??0));return n===0?t.join(`
`):t.map(a=>a.slice(n)).join(`
`)}function TY({language:e,children:t}){const[n,a]=v.useState(!1),o=v.useCallback(async()=>{await navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),2e3)},[t]);return p.jsxs("div",{className:"relative group/code my-3 rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-[#1e1e2e] text-xs text-gray-400",children:[p.jsx("span",{children:e||"code"}),p.jsx("button",{onClick:o,className:"flex items-center gap-1 hover:text-white transition-colors",children:n?"✓ Copied":"Copy"})]}),p.jsx(F0,{style:K6,language:e||"text",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"13px"},children:t})]})}function AY(e){const t=e.split(`
`);let n=!1,a=!1,o="",s=0;for(let u=0;u<t.length;u++){const c=t[u];if(/^[ \t]*```/.test(c)){n=!n;continue}if(n)continue;const f=c.match(/^([ \t]*)(\d+)\.[ \t]/);if(f){const g=f[1];!a||g!==o?(a=!0,o=g,s=1):s++,t[u]=c.replace(/^([ \t]*)\d+\./,`${g}${s}.`)}else c.trim()===""&&a||a&&/^[ \t]+\S/.test(c)||a&&(a=!1,s=0)}return t.join(`
`)}function u1({content:e}){const t=AY(e);return p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none prose-p:leading-relaxed prose-pre:p-0 prose-pre:bg-transparent",children:p.jsx(XR,{remarkPlugins:[E0],components:{ul({children:n,ordered:a,start:o}){if(a){const s=o!=null?Number(o):1;return p.jsx("ol",{start:s,style:{listStyleType:"decimal",paddingLeft:"1.5rem",margin:"0.5rem 0"},children:n})}return p.jsx("ul",{style:{listStyleType:"disc",paddingLeft:"1.5rem",margin:"0.5rem 0"},children:n})},li({children:n}){return p.jsx("li",{style:{display:"list-item",marginBottom:"0.25rem"},children:n})},code({className:n,children:a,...o}){const s=/language-(\w+)/.exec(n||""),u=wY(String(a));return!s&&!u.includes(`
`)?p.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-sm font-mono",...o,children:a}):p.jsx(TY,{language:s?.[1],children:u})},a({href:n,children:a}){return p.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:a})},table({children:n}){return p.jsx("div",{className:"overflow-x-auto my-3",children:p.jsx("table",{className:"min-w-full text-sm",children:n})})}},children:t})})}function kY({message:e,sessionId:t}){return e.role==="user"?p.jsx("div",{className:"flex justify-end",children:p.jsxs("div",{className:"flex gap-3 max-w-[80%]",children:[p.jsx("div",{className:"rounded-2xl px-4 py-2.5 bg-primary text-primary-foreground",children:p.jsx("p",{className:"text-sm whitespace-pre-wrap",children:e.content})}),p.jsx(xc,{role:"user"})]})}):p.jsxs("div",{className:"flex gap-3 group",children:[p.jsx(xc,{role:"assistant"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[e.toolCalls&&e.toolCalls.length>0&&p.jsx("div",{className:"mb-2 space-y-1",children:e.toolCalls.map((a,o)=>p.jsx(l1,{toolCall:a},o))}),p.jsx(u1,{content:e.content}),e.elements&&e.elements.length>0&&p.jsx("div",{className:"mt-3 space-y-3",children:e.elements.map((a,o)=>p.jsx(_S,{element:a,className:"w-full"},o))}),e.images&&e.images.length>0&&p.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.images.map((a,o)=>p.jsx("img",{src:a,alt:"",className:"max-w-full rounded-md max-h-64 object-contain"},o))}),e.actions&&e.actions.length>0&&p.jsx(hY,{actions:e.actions,messageId:e.id,sessionId:t}),p.jsxs("div",{className:"mt-1 flex items-center gap-1 relative",children:[p.jsx(SY,{text:e.content}),p.jsx(xY,{messageId:e.id})]})]})]})}function _Y({onSend:e,onCancel:t,isStreaming:n=!1,placeholder:a="Type a message...",enableFileUpload:o=!1}){const[s,u]=v.useState(""),[c,f]=v.useState([]),g=v.useRef(null),h=v.useRef(null),m=v.useCallback(()=>{const A=s.trim();(A||c.length>0)&&!n&&(e(A,c.length>0?c:void 0),u(""),f([]),g.current&&(g.current.style.height="auto"))},[s,c,n,e]),E=v.useCallback(A=>{const _=Array.from(A.target.files||[]);f(N=>[...N,..._]),h.current&&(h.current.value="")},[]),S=v.useCallback(()=>{h.current?.click()},[]),x=v.useCallback(A=>{f(_=>_.filter((N,L)=>L!==A))},[]),w=v.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),m())},[m]),T=v.useCallback(()=>{const A=g.current;A&&(A.style.height="auto",A.style.height=`${Math.min(A.scrollHeight,200)}px`)},[]);return p.jsx("div",{className:"p-4 pb-6",children:p.jsxs("div",{className:"max-w-3xl mx-auto",children:[p.jsxs("div",{className:"rounded-2xl border bg-background/80 backdrop-blur-sm shadow-lg",children:[c.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1 px-4 pt-3",children:c.map((A,_)=>p.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-muted rounded-lg text-xs",children:[p.jsx("span",{className:"truncate max-w-[100px]",children:A.name}),p.jsx("button",{type:"button",onClick:()=>x(_),className:"hover:text-destructive",children:"×"})]},`${A.name}-${_}`))}),p.jsxs("div",{className:"flex items-end gap-2 p-2",children:[o&&p.jsxs(p.Fragment,{children:[p.jsx("input",{ref:h,type:"file",multiple:!0,onChange:E,className:"hidden",accept:"image/*,audio/*,video/*,.pdf,.doc,.docx,.txt,.csv,.json"}),p.jsx("button",{type:"button",onClick:S,className:"p-2 rounded-xl hover:bg-accent text-muted-foreground transition-colors",title:"Attach file",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]}),p.jsx("textarea",{ref:g,value:s,onChange:A=>u(A.target.value),onKeyDown:w,onInput:T,placeholder:a,disabled:n,rows:1,className:"flex-1 resize-none bg-transparent px-3 py-2.5 text-sm focus:outline-none disabled:opacity-50 placeholder:text-muted-foreground/60",style:{maxHeight:"200px"}}),n?p.jsx("button",{type:"button",onClick:t,className:"p-2 rounded-xl bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors",title:"Stop",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:p.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}):p.jsx("button",{type:"button",onClick:m,disabled:!s.trim(),className:"p-2 rounded-xl bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"Send",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})})})]})]}),p.jsx("p",{className:"text-[10px] text-center text-muted-foreground/50 mt-2",children:"Press Enter to send, Shift+Enter for new line" Line truncated
`),m=v.useCallback(async()=>{!n.trim()||s||f(n)},[n,s,f]),E=v.useCallback(()=>{a("")},[]);return p.jsxs("div",{className:"min-h-screen bg-background text-foreground flex flex-col",children:[p.jsxs("header",{className:"border-b px-6 py-4 flex items-center justify-between",children:[p.jsx("h1",{className:"text-xl font-semibold",children:t||"Playground"}),p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("button",{onClick:E,className:"px-3 py-1.5 text-sm rounded-md border hover:bg-accent",children:"Clear"})})]}),p.jsxs("div",{className:"flex-1 flex",children:[p.jsxs("div",{className:"flex-1 flex flex-col border-r",children:[p.jsx("div",{className:"px-4 py-2 border-b bg-muted/30",children:p.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),p.jsx("div",{className:"flex-1 p-4",children:p.jsx("textarea",{value:n,onChange:S=>a(S.target.value),placeholder:"Enter your prompt here...",className:"w-full h-full resize-none bg-transparent border rounded-md p-3 focus:outline-none focus:ring-2 focus:ring-primary"})}),p.jsx("div",{className:"px-4 py-3 border-t flex justify-end gap-2",children:s?p.jsx("button",{onClick:g,className:"px-4 py-2 bg-destructive text-destructive-foreground rounded-md hover:bg-destructive/90",children:"Stop"}):p.jsx("button",{onClick:m,disabled:!n.trim(),className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed",children:"Submit"})})]}),p.jsxs("div",{className:"flex-1 flex flex-col",children:[p.jsxs("div",{className:"px-4 py-2 border-b bg-muted/30 flex items-center justify-between",children:[p.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Output"}),s&&p.jsx("span",{className:"text-xs text-muted-foreground animate-pulse",children:"Processing..."})]}),p.jsx("div",{className:"flex-1 p-4 overflow-auto",children:h?p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap",children:h}):p.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground text-sm",children:"Output will appear here"})})]})]}),e?.features&&p.jsxs("div",{className:"border-t px-6 py-3 bg-muted/20 flex items-center gap-4 text-sm text-muted-foreground",children:[e.features.streaming&&p.jsx("span",{children:"✓ Streaming"}),e.features.reasoning&&p.jsx("span",{children:"✓ Reasoning"}),e.features.tools&&p.jsx("span",{children:"✓ Tools"})]})]})}function fW(e,t){const n=e.replace(/^\/+|\/+$/g,""),o=t.replace(/^\/+|\/+$/g,"").replace(/\*\*/g,"{{GLOB}}").replace(/\*/g,"[^/]+").replace(/\{\{GLOB\}\}/g,".*");return new RegExp(`^${o}$`).test(n)}function gW(e,t,n){const o=[...t.routes??[]].sort((s,u)=>(u.priority??0)-(s.priority??0));for(const s of o){if(!fW(e,s.pattern))continue;const u=n[s.template];return u?{template:s.template,layout:u.layout??"ThreeColumnLayout",slots:u.slots??{},slotOverrides:s.slotOverrides}:(console.warn(`Template "${s.template}" not found`),null)}return null}function mW(e,t){if(t)return t.slotOverrides&&e in t.slotOverrides?t.slotOverrides[e]:t.slots[e]}function hW(e){return mW("right",e)!==null}function bW(e){return e.title.trim().toLowerCase()}function S1(e){const t=[];e.path&&t.push(e.path.toLowerCase());for(const n of e.children??[])t.push(...S1(n));return t}function yW(e,t){const n=t.replace(/^\/+/,"").toLowerCase(),a=e.replace(/\/+$/,"").toLowerCase();if(n==="index")return a.endsWith("/index")||a==="/docs";const o=`/${n}`;return a.endsWith(o)||a.endsWith(`${o}/index`)}function vW(e,t){if(!t.groups?.length)return!1;const n=bW(e),a=S1(e);for(const o of t.groups){const s=o.group.toLowerCase();if(n===s)return!0;if(o.prefix){const u=o.prefix.toLowerCase();if(n===u||n===u.replace(/-/g," "))return!0;const c=`/docs/${u}`;if(a.some(f=>f===c||f.startsWith(`${c}/`)))return!0}if(o.pages?.some(u=>a.some(c=>yW(c,u)))||!e.children?.length&&o.pages?.some(u=>{const c=u.split("/").pop()?.replace(/-/g," ")??"";return n===c||n===u.toLowerCase()}))return!0}return!1}function EW(e,t){const n=t.toLowerCase();let a=-1,o=0;for(let s=0;s<e.length;s++){const u=e[s];for(const c of u.groups??[]){if(!c.prefix)continue;const f=`/${c.prefix.toLowerCase()}/`;n.includes(f)&&f.length>o&&(a=s,o=f.length)}}return a>=0?a:0}function SW(e,t){return t?e.filter(n=>vW(n,t)):e}function Xu({enabled:e}){return e?p.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 z-50 bg-primary text-primary-foreground px-4 py-2 rounded-md text-sm font-medium",children:"Skip to main content"}):null}function xW(){const[e,t]=v.useState({}),[n,a]=v.useState({}),[o,s]=v.useState({}),[u,c]=v.useState(!0),[f,g]=v.useState(null),[h,m]=v.useState(null),[E,S]=v.useState(""),[x,w]=v.useState(()=>Pt(window.location.pathname)),[T,A]=v.useState(!1),[_,N]=v.useState(0),L=e.navigation?.tabs??[],U=v.useMemo(()=>L.length?{items:SW(n.items??[],L[_])}:n,[n,L,_]);v.useEffect(()=>{L.length&&N(EW(L,x))},[x,L]);const D=(M,j)=>{con Line truncated
+67
View File
@@ -0,0 +1,67 @@
import{j as s,r as y,R as W}from"./index.js";import{A as E,o as u,p as g,c as m,a as D,b as G,s as v,d as q,e as b,g as ke,i as Se,n as V,f as Te,h as T,D as S,u as Z,C as te,j as $,k as F,l as Ce,m as De,q as Me,r as Oe,t as Ae,v as Pe,G as ie}from"./common-types.js";const U=class U{parse(t,n=0){if(n>U.MAX_DEPTH)throw new E("Max recursion depth reached in parse");if(!t||!t.includes("${"))return[t];const a=[],r=new oe(t);for(;!r.isAtEnd();)if(r.matches("${")){r.advance(2);const i=this.extractInterpolationContent(r),o=this.parseExpression(i,n+1);o!==null&&a.push(o)}else if(r.peek()==="\\"&&r.peek(1)==="$"&&r.peek(2)==="{")r.advance(),a.push("${"),r.advance(2);else{const i=r.pos;for(;!r.isAtEnd()&&!(r.matches("${")||r.peek()==="\\"&&r.peek(1)==="$"&&r.peek(2)==="{");)r.advance();a.push(r.input.substring(i,r.pos))}return a.filter(i=>i!==null&&i!=="")}extractInterpolationContent(t){const n=t.pos;let a=1;for(;!t.isAtEnd()&&a>0;){const r=t.advance();if(r==="{")a++;else if(r==="}")a--;else if(r==="'"||r==='"'){const i=r;for(;!t.isAtEnd();){const o=t.advance();if(o==="\\")t.advance();else if(o===i)break}}}if(a>0)throw new E("Unclosed interpolation: missing '}'");return t.input.substring(n,t.pos-1)}parseExpression(t,n=0){if(t=t.trim(),!t)return"";const a=new oe(t),r=this.parseExpressionInternal(a,n);if(!a.isAtEnd())throw new E(`Unexpected characters at end of expression: '${a.input.substring(a.pos)}'`);return r}parseExpressionInternal(t,n){if(t.skipWhitespace(),t.isAtEnd())return"";if(t.matches("${")){t.advance(2);const r=this.extractInterpolationContent(t);return this.parseExpression(r,n+1)}if(t.matchesString("'")||t.matchesString('"'))return this.parseStringLiteral(t);if(this.isDigit(t.peek()))return this.parseNumberLiteral(t);if(t.matchesKeyword("true"))return!0;if(t.matchesKeyword("false"))return!1;if(t.matchesKeyword("null"))return"";const a=this.scanPathOrIdentifier(t);return t.skipWhitespace(),t.peek()==="("?this.parseFunctionCall(a,t,n):a?{path:a}:""}scanPathOrIdentifier(t){const n=t.pos;for(;!t.isAtEnd();){const a=t.peek();if(this.isAlnum(a)||a==="/"||a==="."||a==="_"||a==="-")t.advance();else break}return t.input.substring(n,t.pos)}parseFunctionCall(t,n,a){n.match("("),n.skipWhitespace();const r={};for(;!n.isAtEnd()&&n.peek()!==")";){const i=this.scanIdentifier(n);if(n.skipWhitespace(),!n.match(":"))throw new E(`Expected ':' after argument name '${i}' in function '${t}'`);n.skipWhitespace(),r[i]=this.parseExpressionInternal(n,a),n.skipWhitespace(),n.peek()===","&&(n.advance(),n.skipWhitespace())}if(!n.match(")"))throw new E(`Expected ')' after function arguments for '${t}'`);return{call:t,args:r,returnType:"any"}}scanIdentifier(t){const n=t.pos;for(;!t.isAtEnd()&&(this.isAlnum(t.peek())||t.peek()==="_");)t.advance();return t.input.substring(n,t.pos)}parseStringLiteral(t){const n=t.advance();let a="";for(;!t.isAtEnd();){const r=t.advance();if(r==="\\"){const i=t.advance();i==="n"?a+=`
`:i==="t"?a+=" ":i==="r"?a+="\r":a+=i}else{if(r===n)break;a+=r}}return a}parseNumberLiteral(t){const n=t.pos;for(;!t.isAtEnd()&&(this.isDigit(t.peek())||t.peek()===".");)t.advance();return Number(t.input.substring(n,t.pos))}isAlnum(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"}isDigit(t){return t>="0"&&t<="9"}};U.MAX_DEPTH=10;let ee=U;class oe{constructor(t){this.input=t,this.pos=0}isAtEnd(){return this.pos>=this.input.length}peek(t=0){return this.pos+t>=this.input.length?"\0":this.input[this.pos+t]}advance(t=1){const n=this.input.substring(this.pos,this.pos+t);return this.pos+=t,n}match(t){return this.peek()===t?(this.advance(),!0):!1}matches(t){return!!this.input.startsWith(t,this.pos)}matchesString(t){return this.peek()===t}matchesKeyword(t){if(this.input.startsWith(t,this.pos)){const n=this.peek(t.length);if(!/[a-zA-Z0-9_]/.test(n))return this.advance(t.length),!0}return!1}skipWhitespace(){for(;!this.isAtEnd()&&/\s/.test(this.peek());)this.advance()}}const be=6048e5,je=864e5,se=Symbol.for("constructDateFrom");function P(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&se in e?e[se](t):e instanceof Date?new e.constructor(t):new Date(t)}function C(e,t){return P(t||e,e)}let Ie={};function X(){return Ie}function L(e,t){const n=X(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=C(e,t?.in),i=r.getDay(),o=(i<a?7:0)+i-a;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function H(e,t){return L(e,{...t,weekStartsOn:1})}function ge(e,t){const n=C(e,t?.in),a=n.getFullYear(),r=P(n,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const i=H(r),o=P(n,0);o.setFullYear(a,0,4),o.setHours(0,0,0,0);const c=H(o);return n.getTime()>=i.getTime()?a+1:n.getTime()>=c.getTime()?a:a-1}function ce(e){const t=C(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ne(e,...t){const n=P.bind(null,t.find(a=>typeof a=="object"));return t.map(n)}function ue(e,t){const n=C(e,t?.in);return n.setHours(0,0,0,0),n}function Ee(e,t,n){const[a,r]=Ne(n?.in,e,t),i=ue(a),o=ue(r),c=+i-ce(i),h=+o-ce(o);return Math.round((c-h)/je)}function We(e,t){const n=ge(e,t),a=P(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),H(a)}function Fe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ze(e){return!(!Fe(e)&&typeof e!="number"||isNaN(+C(e)))}function Re(e,t){const n=C(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Ye={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qe=(e,t,n)=>{let a;const r=Ye[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function J(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const $e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Le={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Be={date:J({formats:$e,defaultWidth:"full"}),time:J({formats:Le,defaultWidth:"full"}),dateTime:J({formats:_e,defaultWidth:"full"})},Ve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},He=(e,t,n,a)=>Ve[e];function z(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):o;r=e.formattingValues[c]||e.formattingValues[o]}else{const o=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const Ue={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ge={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter" Line truncated
:where(:root) {
color-scheme: light dark;
}
:where(.a2ui-dark) {
color-scheme: dark;
}
:where(.a2ui-light) {
color-scheme: light;
}
:where(:root), :where(.a2ui-dark), :where(.a2ui-light) {
--a2ui-color-background: light-dark(#eee, #111);
--a2ui-color-on-background: light-dark(#333, #eee);
--a2ui-color-surface: light-dark(
color-mix(in oklab, var(--a2ui-color-background) 85%, white),
color-mix(in oklab, var(--a2ui-color-background) 95%, white)
);
--a2ui-color-on-surface: light-dark(#333, #eee);
--a2ui-color-primary: #17e;
--a2ui-color-primary-light: ${N("light",{colorVar:"--a2ui-color-primary"})};
--a2ui-color-primary-dark: ${N("dark",{colorVar:"--a2ui-color-primary"})};
--a2ui-color-primary-hover: ${N("hover",{darkVar:"--a2ui-color-primary-dark",lightVar:"--a2ui-color-primary-light"})};
--a2ui-color-on-primary: #fff;
--a2ui-color-secondary: light-dark(#ddd, #333);
--a2ui-color-secondary-light: ${N("light",{colorVar:"--a2ui-color-secondary"})};
--a2ui-color-secondary-dark: ${N("dark",{colorVar:"--a2ui-color-secondary",percentage:95})};
--a2ui-color-secondary-hover: ${N("hover",{darkVar:"--a2ui-color-secondary-dark",lightVar:"--a2ui-color-secondary-light"})};
--a2ui-color-on-secondary: light-dark(#333, #eee);
--a2ui-border-radius: 0.25rem;
--a2ui-color-border: light-dark(#ccc, #444);
--a2ui-border-width: 1px;
--a2ui-border: 1px solid var(--a2ui-color-border, #ccc);
--a2ui-font-family-title: inherit;
--a2ui-font-family-monospace: monospace;
--a2ui-color-input: light-dark(#fff, #2a2a2a);
--a2ui-color-on-input: light-dark(#333, #eee);
--a2ui-grid-base: 0.5rem;
--a2ui-spacing-xs: calc(var(--a2ui-spacing-s) / 2);
--a2ui-spacing-s: calc(var(--a2ui-spacing-m) / 2);
--a2ui-spacing-m: var(--a2ui-grid-base);
--a2ui-spacing-l: calc(var(--a2ui-spacing-m) * 2);
--a2ui-spacing-xl: calc(var(--a2ui-spacing-l) * 2);
--a2ui-font-size: 1rem;
--a2ui-font-scale: 1.2;
--a2ui-font-size-xs: calc(var(--a2ui-font-size-s) / var(--a2ui-font-scale));
--a2ui-font-size-s: calc(var(--a2ui-font-size-m) / var(--a2ui-font-scale));
--a2ui-font-size-m: var(--a2ui-font-size);
--a2ui-font-size-l: calc(var(--a2ui-font-size-m) * var(--a2ui-font-scale));
--a2ui-font-size-xl: calc(var(--a2ui-font-size-l) * var(--a2ui-font-scale));
--a2ui-font-size-2xl: calc(var(--a2ui-font-size-xl) * var(--a2ui-font-scale));
--a2ui-line-height-headings: 1.2;
--a2ui-line-height-body: 1.5;
}
`;let B;function na(){return B||(B=new CSSStyleSheet,B.replaceSync(ta)),B}function aa(){if(typeof document>"u")return;const e=na();document.adoptedStyleSheets.includes(e)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,e])}function N(e,t){switch(e){case"light":{const n=t;return`color-mix(in oklab, var(${n.colorVar}) ${n.percentage??85}%, ${n.mixColor??"white"})`}case"dark":{const n=t;return`color-mix(in oklab, var(${n.colorVar}) ${n.percentage??85}%, ${n.mixColor??"black"})`}case"hover":{const n=t;return`light-dark(var(${n.darkVar}), var(${n.lightVar}))`}}}var xe=y.memo(({surface:e,id:t,basePath:n,compImpl:a,componentModel:r})=>{const i=a.render,o=y.useMemo(()=>new Pe(e,t,n),[e,t,n,r]),c=y.useCallback((h,l)=>{const d=l||o.dataContext.path;return s.jsx(ne,{surface:e,id:h,basePath:d},`${h}-${d}`)},[e,o.dataContext.path]);return s.jsx(i,{context:o,buildChild:c})});xe.displayName="ResolvedChild";var ne=y.memo(({surface:e,id:t,basePath:n})=>{const a=y.useMemo(()=>{let o=0;return{subscribe:c=>{const h=e.componentsModel.onCreated.subscribe(d=>{d.id===t&&(o++,c())}),l=e.componentsModel.onDeleted.subscribe(d=>{d===t&&(o++,c())});return()=>{h.unsubscribe(),l.unsubscribe()}},getSnapshot:()=>{const c=e.componentsModel.get(t);return c?`${c.type}-${o}`:`missing-${o}`}}},[e,t]);y.useSyncExternalStore(a.subscribe,a.getSnapshot);const r=e.componentsModel.get(t);if(!r)return s.jsxs("div",{style:{color:"gray",padding:"4px"},children:["[Loading ",t,"...]"]});const i=e.catalog.components.get(r.type);return i?s.jsx(xe,{surface:e,id:t,basePath:n,componentModel:r,compImpl:i}):s.jsxs("div",{style:{color:"red"},children:["Unknown component: ",r.type]})});ne.displayName="DeferredChild";var Ia=({surface:e})=>s.jsx(ne,{surface:e,id:"root",basePath:"/"});function w(e,t){const n=y.memo(t,(r,i)=>!(r.props!==i.props||r.context.componentModel.id!==i.context.componentModel.id||r.context.dataContext.path!==i.context.dataContext.path)),a=({context:r,buildChild:i})=>{const o=y.useRef(null);o.current?o.current.context!==r&&(o.current.dispose(),o.current=new ie(r,e.schema)):o.current=new ie(r,e.schema);const c=o.current,h=y.useCallback(f=>{const M=c.subscribe(f);return()=>M.unsubscribe()},[c]),l=y.useCallback(()=>c.snapshot,[c]),d=y.useSyncExternalStore(h,l);return y.useEffect(()=>()=>c.dispose(),[c]),s.jsx(n,{props:d||{},buildChild:i,context:r})};return{name:e.name,schema:e.schema,render:a}}function Na(e,t){return{name:e.name,schema:e.schema,render:t}}var k=()=>{y.useEffect(()=>{typeof document<"u"&&document.adoptedStyleSheets&&aa()},[])},we=e=>{switch(e){case"center":return"center";case"end":return"flex-end";case"spaceAround":return"space-around";case"spaceBetween":return"space-between";case"spaceEvenly":return"space-evenly";case"start":return"flex-start";case"stretch":return"stretch";default:return"flex-start"}},ae=e=>{switch(e){case"start":return"flex-start";case"center":return"center";case"end":return"flex-end";case"stretch":return"stretch";default:return"stretch"}},Q=()=>({boxSizing:"border-box"}),ra=()=>({boxSizing:"border-box"}),_=e=>typeof e!="number"?{}:{flex:`${e}`,minWidth:0,minHeight:0},ia=y.createContext(void 0),oa=()=>y.useContext(ia),fe=!1;function sa(e,t){const n=oa(),[a,r]=y.useState(null),i=JSON.stringify(t);return y.useEffect(()=>{if(!n){fe||(console.warn("[useMarkdown]",`can't render markdown because no markdown renderer is configured.
`,"Use `@a2ui/markdown-it`, or your own markdown renderer."),fe=!0),r(null);return}let o=!0;const c=i?JSON.parse(i):void 0;return n(e,c).then(h=>{o&&r(h)}).catch(h=>{console.error("[useMarkdown] Render failed:",h)}),()=>{o=!1}},[e,n,i]),a}var pe={},ca=(e,t)=>{switch(t){case"h1":return`# ${e}`;case"h2":return`## ${e}`;case"h3":return`### ${e}`;case"h4":return`#### ${e}`;case"h5":return`##### ${e}`;case"caption":return`*${e}*`;default:return e}},ua=w(Fn,({props:e})=>{k();const t=typeof e.text=="string"?e.text:String(e.text??""),n=ca(t,e.variant),a=sa(n),r={...Q(),..._(e.weight)},i=e.variant==="caption",o=[pe.a2uiText,i?pe.a2uiCaption:e.variant||"body"];a===null&&o.push("no-markdown-renderer");const c=a!==null?{dangerouslySetInnerHTML:{__html:a}}:{children:n};return i?s.jsx("span",{className:o.join(" "),style:r,...c}):s.jsx("div",{className:o.join(" "),style:r,...c})}),la=w(zn,({props:e})=>{k();const t=a=>a==="scaleDown"?"scale-down":a||"fill",n={...Q(),..._(e.weight),objectFit:t(e.fit),display:"block",borderRadius:"var(--a2ui-image-border-radius, 0)"};return e.variant==="icon"?(n.width="var(--a2ui-image-icon-size, 24px)",n.height="var(--a2ui-image-icon-size, 24px)"):e.variant==="avatar"?(n.width="var(--a2ui-image-avatar-size, 40px)",n.height="var(--a2ui-image-avatar-size, 40px)",n.borderRadius="50%"):e.variant==="smallFeature"?n.maxWidth="var(--a2ui-image-small-feature-size, 100px)":e.variant==="largeFeature"?n.maxHeight="var(--a2ui-image-large-feature-size, 400px)":e.variant==="header"&&(n.height="var(--a2ui-image-header-size, 200px)",n.objectFit="cover"),s.jsx("img",{src:e.url,alt:e.description||"",style:n})}),da={play:"play_arrow",rewind:"fast_rewind",favoriteOff:"favorite_border",starOff:"star_border"};function ha(e){return da[e]??e.replace(/[A-Z]/g,t=>"_"+t.toLowerCase())}var ma=w(Yn,({props:e})=>{k();const t=typeof e.name=="object"&&e.name!==null&&"svgPath"in e.name,n={...Q(),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"var(--a2ui-icon-size, var(--a2ui-font-size-xl, 24px))",color:"var(--a2ui-icon-color, inherit)",lineHeight:1};if(t){const i=e.name.svgPath;return s.jsx("svg",{className:"a2ui-icon svg",viewBox:"0 0 24 24",style:{...n,fill:"currentColor",width:"var(--a2ui-icon-size, 24px)",height:"var(--a2ui-icon-size, 24px)"},children:s.jsx("path",{d:i})})}const a=typeof e.name=="string"?ha(e.name):"",r={...n,fontFamily:'var(--a2ui-icon-font-family, "Material Symbols Outlined", sans-serif)',fontVariationSettings:'var(--a2ui-icon-font-variation-settings, "FILL" 1)',fontWeight:"normal",fontStyle:"normal",letterSpacing:"normal",textTransform:"none"};return s.jsx("span",{className:"material-symbols-outlined",style:r,children:a})}),fa=w(qn,({props:e})=>{k();const t={...Q(),width:"100%",height:"auto",borderRadius:"var(--a2ui-video-border-radius, 0)"};return s.jsx("video",{src:e.url,controls:!0,style:t})}),pa=w($n,({props:e})=>{k();const t={display:"flex",flexDirection:"column",gap:"var(--a2ui-spacing-xs, 0.25rem)",background:"var(--a2ui-audioplayer-background, transparent)",borderRadius:"var(--a2ui-audioplayer-border-radius, 0)",padding:"var(--a2ui-audioplayer-padding, 0)"};return s.jsxs("div",{style:t,children:[e.description&&s.jsx("span",{style:{fontSize:"var(--a2ui-font-size-xs, 0.75rem)",color:"var(--a2ui-text-caption-color, light-dark(#666, #aaa))"},children:e.description}),s.jsx("audio",{src:e.url,controls:!0})]})}),re=({childList:e,buildChild:t})=>Array.isArray(e)?s.jsx(s.Fragment,{children:e.map((n,a)=>{if(n&&typeof n=="object"&&"id"in n){const r=n;return s.jsx(W.Fragment,{children:t(r.id,r.basePath)},`${r.id}-${a}`)}return typeof n=="string"?s.jsx(W.Fragment,{children:t(n)},`${n}-${a}`):null})}):null,ba=w(Ln,({props:e,buildChild:t,context:n})=>(k(),s.jsx("div",{style:{..._(e.weight),display:"flex",flexDirection:"row",justifyContent:we(e.justify),alignItems:ae(e.align),gap:"var(--a2ui-row-gap, var(--a2ui-spacing-m))"},children:s.jsx(re,{childList:e.children,buildChild:t,context:n})}))),ga=w(_n,({props:e,buildChild:t,context:n})=>(k(),s.jsx("div",{style:{..._(e.weight),display:"flex",flexDirection:"column",justifyContent:we(e.justify),alignItems:ae(e.align),gap:"var(--a2ui-column-gap, var(--a2ui-spacing-m))"},children:s.jsx(re,{childList:e.children,buildChild:t,context:n})}))),ya=w(Bn,({props:e,buildChild:t,context:n})=>{k();const a=e.direction==="horizontal",r={display:"flex",flexDirection:a?"row":"column",alignItems:ae(e.align),overflowX:a?"auto":"hidden",overflowY:a?"hidden":"auto",gap:"var(--a2ui-list-gap, var(--a2ui-spacing-s))",padding:"var(--a2ui-list-padding, 0)"};return s.jsx("div",{style:r,children:s.jsx(re,{childList:e.children,buildChild:t,context:n})})}),va=w(Vn,({props:e,buildChild:t})=>{k();const n={...ra(),..._(e.weight),display:"block",border:"var(--a2ui-card-border, var(--a2ui-border))",borderRadius:"var(--a2ui-card-border-radius, var(--a2ui-border-radius, 8px))",padding:"var(--a2ui-card-padding, var(--a2ui-spacing-m, 16px))",background:"var(--a2ui-card-b Line truncated
+5
View File
@@ -0,0 +1,5 @@
import{y as Q,w as _,x as X,z as E,B as w,o as f,E as q,a as O,s as m,F as S,u as $,b as N,H as k,d as Y,I as K}from"./common-types.js";import{J as mt,A as ht,f as gt,l as yt,t as bt,K as vt,k as St,C as At,L as _t,v as wt,j as Mt,M as It,N as Zt,m as kt,r as Dt,q as Pt,D as jt,O as Ct,P as Ot,G as $t,Q as Nt,g as Et,e as Tt,i as xt,R as Ut}from"./common-types.js";class v{constructor(){this.listeners=new Set}subscribe(e){return this.listeners.add(e),{unsubscribe:()=>this.listeners.delete(e)}}async emit(e){for(const t of this.listeners)try{await t(e)}catch(a){console.error("EventEmitter error:",a)}}dispose(){this.listeners.clear()}}function D(n){return/^\d+$/.test(n)}class ee{constructor(e={}){this.data={},this.signals=new Map,this.subscriptions=new Set,this.data=e}getSignal(e){const t=this.normalizePath(e);return this.signals.has(t)||this.signals.set(t,Q(this.get(t))),this.signals.get(t)}set(e,t){if(e==null)throw new _("Path cannot be null or undefined.");if(e==="/"||e==="")return this.data=t,this.notifyAllSignals(),this;const a=this.parsePath(e),s=a.pop();this.data||(this.data={});let r=this.data;for(let i=0;i<a.length;i++){const o=a[i];if(Array.isArray(r)&&!D(o))throw new _(`Cannot use non-numeric segment '${o}' on an array in path '${e}'.`,e);if(r[o]!==void 0&&r[o]!==null&&typeof r[o]!="object")throw new _(`Cannot set path '${e}': segment '${o}' is a primitive value.`,e);if(r[o]===void 0||r[o]===null){const c=i<a.length-1?a[i+1]:s;r[o]=D(c)?[]:{}}r=r[o]}if(Array.isArray(r)&&!D(s))throw new _(`Cannot use non-numeric segment '${s}' on an array in path '${e}'.`,e);return t===void 0?Array.isArray(r)?r[parseInt(s,10)]=void 0:delete r[s]:r[s]=t,this.notifySignals(e),this}get(e){if(e==null)throw new _("Path cannot be null or undefined.");if(e==="/"||e==="")return this.data;const t=this.parsePath(e);let a=this.data;for(const s of t){if(a==null)return;a=a[s]}return a}subscribe(e,t){const a=this.getSignal(e);let s=!0,r=a.peek();const i=X(()=>{const o=a.value;r=o,s||t(o)});return s=!1,this.subscriptions.add(i),{get value(){return r},unsubscribe:()=>{i(),this.subscriptions.delete(i)}}}dispose(){for(const e of this.subscriptions)e();this.subscriptions.clear(),this.signals.clear()}normalizePath(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e||"/"}parsePath(e){return e.split("/").filter(t=>t.length>0)}notifySignals(e){const t=this.normalizePath(e);E(()=>{this.updateSignal(t);let a=t;for(;a!=="/"&&a!=="";)a=a.substring(0,a.lastIndexOf("/"))||"/",this.updateSignal(a);for(const s of this.signals.keys())this.isDescendant(s,t)&&this.updateSignal(s)})}updateSignal(e){const t=this.signals.get(e);if(t){const a=this.get(e);Array.isArray(a)?t.value=[...a]:typeof a=="object"&&a!==null?t.value={...a}:t.value=a}}notifyAllSignals(){E(()=>{for(const e of this.signals.keys())this.updateSignal(e)})}isDescendant(e,t){return t==="/"||t===""?e!=="/":e.startsWith(t+"/")}}class te{constructor(){this.components=new Map,this._onCreated=new v,this._onDeleted=new v,this.onCreated=this._onCreated,this.onDeleted=this._onDeleted}get(e){return this.components.get(e)}get entries(){return this.components.entries()}addComponent(e){if(this.components.has(e.id))throw new w(`Component with id '${e.id}' already exists.`);this.components.set(e.id,e),this._onCreated.emit(e)}removeComponent(e){const t=this.components.get(e);t&&(this.components.delete(e),t.dispose(),this._onDeleted.emit(e))}dispose(){for(const e of this.components.values())e.dispose();this.components.clear(),this._onCreated.dispose(),this._onDeleted.dispose()}}const V=f({name:m().describe("The name of the action, taken from the component's action.event.name property."),surfaceId:m().describe("The id of the surface where the event originated."),sourceComponentId:m().describe("The id of the component that triggered the event."),timestamp:m().datetime().describe("An ISO 8601 timestamp of when the event occurred."),context:q(O()).describe("A JSON object containing the key-value pairs from the component's action.event.context, after resolving all data bindings.")}).strict(),ne=f({code:S("VALIDATION_FAILED"),surfaceId:m().describe("The id of the surface where the error occurred."),path:m().describe("The JSON pointer to the field that failed validation (e.g. '/components/0/text')."),message:m().describe("A short one or two sentence description of why validation failed.")}).strict(),ae=f({code:m().refine(n=>n!=="VALIDATION_FAILED"),message:m().describe("A short one or two sentence description of why the error occurred."),surfaceId:m().describe("The id of the surface where the error occurred.")}).passthrough(),se=$([ne,ae]),re=f({version:S("v0.9")}).and($([f({action:V}),f({error:se})])),ot=f({version:S("v0.9"),surfaces:q(f({}).passthrough()).describe("A map of surface IDs to their current data models.")}).strict(),ie=N(re).describe("A list of client messages."),ct=f({messages:ie}).strict().describe("An object wrapping a list of client messages.");class oe{constructor(e,t,a={},s=!1){this.id=e,thLine truncated
]))`;continue}else if(a[c]==="$"){s+=`($|(?=[\r
]))`;continue}}if(t.s&&a[c]==="."){s+=i?`${a[c]}\r
`:`[${a[c]}\r
]`;continue}s+=a[c],a[c]==="\\"?r=!0:i&&a[c]==="]"?i=!1:!i&&a[c]==="["&&(i=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),n.source}return s}function H(n,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&n.keyType?._def.typeName===u.ZodEnum)return{type:"object",required:n.keyType._def.values,properties:n.keyType._def.values.reduce((a,s)=>({...a,[s]:l(n.valueType._def,{...e,currentPath:[...e.currentPath,"properties",s]})??g(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};const t={type:"object",additionalProperties:l(n.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(n.keyType?._def.typeName===u.ZodString&&n.keyType._def.checks?.length){const{type:a,...s}=G(n.keyType._def,e);return{...t,propertyNames:s}}else{if(n.keyType?._def.typeName===u.ZodEnum)return{...t,propertyNames:{enum:n.keyType._def.values}};if(n.keyType?._def.typeName===u.ZodBranded&&n.keyType._def.type._def.typeName===u.ZodString&&n.keyType._def.type._def.checks?.length){const{type:a,...s}=J(n.keyType._def,e);return{...t,propertyNames:s}}}return t}function Ie(n,e){if(e.mapStrategy==="record")return H(n,e);const t=l(n.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||g(e),a=l(n.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||g(e);return{type:"array",maxItems:125,items:{type:"array",items:[t,a],minItems:2,maxItems:2}}}function Ze(n){const e=n.values,a=Object.keys(n.values).filter(r=>typeof e[e[r]]!="number").map(r=>e[r]),s=Array.from(new Set(a.map(r=>typeof r)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:a}}function ke(n){return n.target==="openAi"?void 0:{not:g({...n,currentPath:[...n.currentPath,"not"]})}}function De(n){return n.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const Z={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Pe(n,e){if(e.target==="openApi3")return R(n,e);const t=n.options instanceof Map?Array.from(n.options.values()):n.options;if(t.every(a=>a._def.typeName in Z&&(!a._def.checks||!a._def.checks.length))){const a=t.reduce((s,r)=>{const i=Z[r._def.typeName];return i&&!s.includes(i)?[...s,i]:s},[]);return{type:a.length>1?a:a[0]}}else if(t.every(a=>a._def.typeName==="ZodLiteral"&&!a.description)){const a=t.reduce((s,r)=>{const i=typeof r._def.value;switch(i){case"string":case"number":case"boolean":return[...s,i];case"bigint":return[...s,"integer"];case"object":if(r._def.value===null)return[...s,"null"];default:return s}},[]);if(a.length===t.length){const s=a.filter((r,i,o)=>o.indexOf(r)===i);return{type:s.length>1?s:s[0],enum:t.reduce((r,i)=>r.includes(i._def.value)?r:[...r,i._def.value],[])}}}else if(t.every(a=>a._def.typeName==="ZodEnum"))return{type:"string",enum:t.reduce((a,s)=>[...a,...s._def.values.filter(r=>!a.includes(r))],[])};return R(n,e)}const R=(n,e)=>{const t=(n.options instanceof Map?Array.from(n.options.values()):n.options).map((a,s)=>l(a._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return t.length?{anyOf:t}:void 0};function je(n,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(n.innerType._def.typeName)&&(!n.innerType._def.checks||!n.innerType._def.checks.length))return e.target==="openApi3"?{type:Z[n.innerType._def.typeName],nullable:!0}:{type:[Z[n.innerType._def.typeName],"null"]};if(e.target==="openApi3"){const a=l(n.innerType._def,{...e,currentPath:[...e.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}const t=l(n.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}function Ce(n,e){const t={type:"number"};if(!n.checks)return t;for(const a of n.checks)switch(a.kind){case"int":t.type="integer",B(t,"type",a.message,e);break;case"min":e.target==="jsonSchema7"?a.inclusive?d(t,"minimum",a.value,a.message,e):d(t,"exclusiveMinimum",a.value,a.message,e):(a.inclusive||(t.exclusiveMinimum=!0),d(t,"minimum",a.value,a.message,e));break;case"max":e.target==="jsonSchema7"?a.inclusive?d(t,"maximum",a.value,a.message,e):d(t,"exclusiveMaximum",a.value,a.message,e):(a.inclusive||(t.exclusiveMaximum=!0),d(t,"maximum",a.value,a.message,e));break;case"multipleOf":d(t,"multipleOf",a.value,a.message,e);break}return t}function Oe(n,e){const t=e.target==="openAi",a={type:"object",properties:{}},s=[],r=n.shape();for(const o in r){let c=r[o];if(c===void 0||c._def===void 0)continue;let p=Ne(c);p&&t&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),p=!1);const A=l(c._def,{...e,currentPath:[.. Line truncated
+2
View File
@@ -0,0 +1,2 @@
import{_ as e,l as s,D as o,d as i}from"./mermaid.core.js";import{p as g}from"./cynefin-OW5HDTMX.js";import"./index.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},d={version:"11.17.2"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,n)=>{s.debug(`rendering info diagram
`+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
+1
View File
@@ -0,0 +1 @@
function t(e,a){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(a).domain(e);break}return this}export{t as i};
+70
View File
@@ -0,0 +1,70 @@
import{_ as o,c as ot,L as ut,D as dt,an as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,d as bt}from"./mermaid.core.js";import"./index.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Y(B){i.length=i.length-2*B,p.length=p.length-B,n.length=n.length-B}o(Y,"popStack");function tt(){var B;return B=c.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=s.symbols_[B]||B),B}o(tt,"lex");for(var M,W,N,K,F={},U,V,et,Z;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";Z=[];for(U in v[W])this.terminals_[U]&&U>L&&Z.push("'"+this.terminals_[U]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
`+b.showPosition()+`
Expecting `+Z.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:Z})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],F.$=p[p.length-V],F._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},G&&(F._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(F,[w,$,I,S.yy,N[1],p,n].concat(C)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),p.push(F.$),n.push(F._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===c.length?this.yylloc.first_column:0)+c[c.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
`+s+"^"},"showPosition"),test_match:o(function(t,s){var i,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=t[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var n in p)this[n]=p[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,s,i,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),n=0;n<p.length;n++)if(i=this._input.match(this.rules[p[n]]),i&&(!s||i[0].length>s[0].length)){if(s=i,c=n,this.options.backtrack_lexer){if(t=this.test_match(i,p[n]),t!==!1)return t;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(t=this.test_match(s,p[c]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var s=this.next();return s||this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:o(function(s){this.begin(s)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(s,i,c,p){switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return T})();D.lexer=O;function E(){this.yy={}}return o(E,"Parser"),E.prototype=D,D.Parser=E,new E})();J.parser=J;var xt=J,H,vt=(H=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,ft()}getRoot(){return this.root}addNode(h,r){const a=pt.sanitizeText(r,ot());if(!this.root){this.root={text:a,children:[]},this.stack=[{level:0,node:this.root}],it(a);return}this.baseLevel??=h;let l=h-this.baseLevel+1;for(l<=0&&(l=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=l;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:a,children:[]};y.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return gt()}setAccTitle(h){kt(h)}getAccDescription(){return mt()}setAccDescription(h){wt(h)}getDiagramTitle(){return _t()}setDiagramTitle(h){it(h)}},o(H,"IshikawaDB"),H),St=14,j=250,$t=30,Et=60,At=5,ht=82*Math.PI/180,st=Math.cos(ht),nt=Math.sin(ht),at=o((e,h,r)=>{const a=e.node().getBBox(),l=a.width+h*2,y=a.height+h*2;bt(e,y,l,r),e.attr("viewBox",`${a.x-h} ${a.y-h} ${l} ${y}`)},"applyPaddedViewBox"),It=o((e,h,r,a)=>{const y=a.db.getRoot();if(!y)return;const f=ot(),{look:d,handDrawnSeed:m,themeVariables:u}=f,k=ut(f.fontSize)[0]??St,g=d==="handDrawn",_=y.children??[],x=f.ishikawa?.diagramPadding??20,D=f.ishikawa?.useMaxWidth??!1,O=dt(h),E=O.append("g").attr("class","ishikawa"),T=g?yt.svg(O.node()):void 0,t=T?{roughSvg:T,seed:m??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,s=`ishikawa-arrow-${h}`;g||E.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,c=j;const p=g?void 0:z(E,i,c,i,c,"ishikawa-spine");if(Lt(E,i,c,y.text,k,t),!_.length){g&&z(E,i,c,i,c,"ishikawa-spine",t),at(O,x,D);return}i-=20;const n=_.filter((S,P)=>P%2===0),v=_.filter((S,P)=>P%2===1),w=rt(n),I=rt(v),$=w.total+I.total;let L=j,A=j;if($>0){const S=j*2,P=j*.3;L=Math.max(P,S*(w.total/$)),A=Math.max(P,S*(I.total/$))}const C=k*2;L=Math.max(L,w.max*C),A=Math.max(A,I.max*C),c=Math.max(L,j),p&&p.attr("y1",c).attr("y2",c),E.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);const b=Math.ceil(_.length/2);for(let S=0;S<b;S++){const P=E.append("g").attr("class","ishikawa-pair");for(const[R,G,Y]of[[_[S*2],-1,L],[_[S*2+1],1,A]])R&&Pt(P,R,i,c,G,Y,k,t);i=P.selectAll("text").nodes().reduce((R,G)=>Math.min(R,G.getBBox().x),1/0)}if(g)z(E,i,c,0,c,"ishikawa-spine",t);else{p.attr("x1",i);const S=`url(#${s})`;E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",S)}at(O,x,D)},"draw"),rt=o(e=>{const h=o(r=>r.children.reduce((a,l)=>a+1+h(l),0),"countDescendants");return e.reduce((r,a)=>{const l=h(a);return r.total+=l,r.max=Math.max(r.max,l),r},{total:0,max:0})},"sideStats"),Lt=o((e,h,r,a,l,y)=>{const f=Math.max(6,Math.floor(110/(l*.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${h},${r})`),m=X(d,ct(a,f),0,0,"ishikawa-head-label","start",l),u=m.node().getBBox(),k=Math.max(60,u.width+6),g=Math.max(40,u.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});d.insert(()=>x,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Tt=o((e,h)=>{const r=[],a=[],l=o Line truncated
`)},"wrapText"),X=o((e,h,r,a,l,y,f)=>{const d=Bt(h),m=f*1.05,u=e.append("text").attr("class",l).attr("text-anchor",y).attr("x",r).attr("y",a-(d.length-1)*m/2);for(const[k,g]of d.entries())u.append("tspan").attr("x",r).attr("dy",k===0?0:m).text(g);return u},"drawMultilineText"),lt=o((e,h,r)=>e+(h-e)*r,"lerp"),z=o((e,h,r,a,l,y,f)=>{if(f){const d=f.roughSvg.line(h,r,a,l,{roughness:1.5,seed:f.seed,stroke:f.lineColor,strokeWidth:2});e.append(()=>d).attr("class",y);return}return e.append("line").attr("class",y).attr("x1",h).attr("y1",r).attr("x2",a).attr("y2",l)},"drawLine"),Nt={draw:It},Dt=o(e=>`
.ishikawa .ishikawa-spine,
.ishikawa .ishikawa-branch,
.ishikawa .ishikawa-sub-branch {
stroke: ${e.lineColor};
stroke-width: 2;
fill: none;
}
.ishikawa .ishikawa-sub-branch {
stroke-width: 1;
}
.ishikawa .ishikawa-arrow {
fill: ${e.lineColor};
}
.ishikawa .ishikawa-head {
fill: ${e.mainBkg};
stroke: ${e.lineColor};
stroke-width: 2;
}
.ishikawa .ishikawa-label-box {
fill: ${e.mainBkg};
stroke: ${e.lineColor};
stroke-width: 2;
}
.ishikawa text {
font-family: ${e.fontFamily};
font-size: ${e.fontSize};
fill: ${e.textColor};
}
.ishikawa .ishikawa-head-label {
font-weight: 600;
text-anchor: middle;
dominant-baseline: middle;
font-size: 14px;
}
.ishikawa .ishikawa-label {
text-anchor: end;
}
.ishikawa .ishikawa-label.cause {
text-anchor: middle;
dominant-baseline: middle;
}
.ishikawa .ishikawa-label.align {
text-anchor: end;
dominant-baseline: middle;
}
.ishikawa .ishikawa-label.up {
dominant-baseline: baseline;
}
.ishikawa .ishikawa-label.down {
dominant-baseline: hanging;
}
`,"getStyles"),Ot=Dt,Rt={parser:xt,get db(){return new vt},renderer:Nt,styles:Ot};export{Rt as diagram};
+139
View File
@@ -0,0 +1,139 @@
import{g as gt}from"./chunk-5VM5RSS4.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-F27PBJKO.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,j as X,d as $t,p as Mt}from"./mermaid.core.js";import{d as it}from"./arc.js";import"./index.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
`+_.showPosition()+`
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
`+n+"^"},"showPosition"),test_match:s(function(r,n){var l,y,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),y=r[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var c in d)this[c]=d[c];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,n,l,y;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),c=0;c<d.length;c++)if(l=this._input.match(this.rules[d[c]]),l&&(!n||l[0].length>n[0].length)){if(n=l,y=c,this.options.backtrack_lexer){if(r=this.test_match(l,d[c]),r!==!1)return r;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(r=this.test_match(n,d[y]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var n=this.next();return n||this.lex()},"lex"),begin:s(function(n){this.conditionStack.push(n)},"begin"),popState:s(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:s(function(n){this.begin(n)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(n,l,y,d){switch(y){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h})();g.lexer=m;function x(){this.yy={}}return s(x,"Parser"),x.prototype=g,g.Parser=x,new x})();U.parser=U;var Et=U,V="",J=[],L=[],B=[],Ct=s(function(){J.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=s(function(t){V=t,J.push(t)},"addSection"),It=s(function(){return J},"getSections"),At=s(function(){let t=rt();const e=100;let a=0;for(;!t&&a<e;)t=rt(),a++;return L.push(...B),L},"getTasks"),Ft=s(function(){const t=[];return L.forEach(a=>{a.people&&t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),Vt=s(function(t,e){const a=e.substr(1).split(":");let f=0,i=[];a.length===1?(f=Number(a[0]),i=[]):(f=Number(a[0]),i=a[1].split(","));const u=i.map(o=>o.trim()),p={section:V,type:V,people:u,task:t,score:f};B.push(p)},"addTask"),Rt=s(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),rt=s(function(){const t=s(function(a){return B[a].processed},"compileTask");let e=!0;for(const[a,f]of B.entries())t(a),e=e&&f.processed;return e},"compileTasks"),Lt=s(function(){return Ft()},"getActors"),nt={getConfig:s(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=s(t=>`.label {
font-family: ${t.fontFamily};
color: ${t.textColor};
}
.mouth {
stroke: #666;
}
line {
stroke: ${t.textColor}
}
.legend {
fill: ${t.textColor};
font-family: ${t.fontFamily};
}
.label text {
fill: #333;
}
.label {
color: ${t.textColor}
}
.face {
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
stroke: #999;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: 1px;
}
.node .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.arrowheadPath {
fill: ${t.arrowheadColor};
}
.edgePaths .path {
stroke: ${t.lineColor};
stroke-width: 1.5px;
}
.flowchart-link {
stroke: ${t.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
rect {
opacity: 0.5;
}
text-align: center;
}
.cluster rect {
}
.cluster text {
fill: ${t.titleColor};
}
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${t.fontFamily};
font-size: 12px;
background: ${t.tertiaryColor};
border: 1px solid ${t.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.task-type-0, .section-type-0 {
${t.fillType0?`fill: ${t.fillType0}`:""};
}
.task-type-1, .section-type-1 {
${t.fillType0?`fill: ${t.fillType1}`:""};
}
.task-type-2, .section-type-2 {
${t.fillType0?`fill: ${t.fillType2}`:""};
}
.task-type-3, .section-type-3 {
${t.fillType0?`fill: ${t.fillType3}`:""};
}
.task-type-4, .section-type-4 {
${t.fillType0?`fill: ${t.fillType4}`:""};
}
.task-type-5, .section-type-5 {
${t.fillType0?`fill: ${t.fillType5}`:""};
}
.task-type-6, .section-type-6 {
${t.fillType0?`fill: ${t.fillType6}`:""};
}
.task-type-7, .section-type-7 {
${t.fillType0?`fill: ${t.fillType7}`:""};
}
.actor-0 {
${t.actor0?`fill: ${t.actor0}`:""};
}
.actor-1 {
${t.actor1?`fill: ${t.actor1}`:""};
}
.actor-2 {
${t.actor2?`fill: ${t.actor2}`:""};
}
.actor-3 {
${t.actor3?`fill: ${t.actor3}`:""};
}
.actor-4 {
${t.actor4?`fill: ${t.actor4}`:""};
}
.actor-5 {
${t.actor5?`fill: ${t.actor5}`:""};
}
${gt()}
`,"getStyles"),jt=Bt,K=s(function(t,e){return kt(t,e)},"drawRect"),Nt=s(function(t,e){const f=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(g){const m=it().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}s(u,"smile");function p(g){const m=it().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}s(p,"sad");function o(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s(o,"ambivalent"),e.score>3?u(i):e.score<3?p(i):o(i),f},"drawFace"),ot=s(function(t,e){const a=t.append("circle");return a.attr("cx",e.cx),a.attr("cy",e.cy),a.attr("class","actor-"+e.pos),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("r",e.r),a.class!==void 0&&a.attr("class",a.class),e.title!==void 0&&a.append("title").text(e.title),a},"drawCircle"),ct=s(function(t,e){return xt(t,e)},"drawText"),zt=s(function(t,e){function a(i,u,p,o,g){return i+","+u+" "+(i+p)+","+u+" "+(i+p)+","+(u+o-g)+" "+(i+p-g*1.2)+","+(u+o)+" "+i+","+(u+o)}s(a,"genPoints");const f=t.append("polygon");f.attr("points",a(e.x,e.y,50,20,7)),f.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=s(function(t,e,a){const f=t.append("g"),i=lt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=a.width*e.taskCount+a.diagramMarginX*(e.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,K(f,i),ht(a)(e.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},a,e.colour)},"drawSection"),Z=-1,Ot=s(function(t,e,a,f){const i=e.x+a.width/2,u=t.append("g");Z++,u.append("line").attr("id",f+"-task"+Z).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nt(u,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=lt();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,K(u,o);let g=e.x+14;e.people.forEach(m=>{const x=e.actors[m].color,h={cx:g,cy:e.y,r:7,fill:x,stroke:"#000",title:m,pos:e.actors[m].position};ot(u,h),g+=10}),ht(a)(e.task,u,o.x,o.y,o.width,o.height,{class:"task"},a,e.colour)},"drawTask"),Yt=s(function(t,e){mt(t,e)},"drawBackgroundRect"),ht=(function(){function t(i,u,p,o,g,m,x,h){const r=u.append("text").attr("x",p+g/2).attr("y",o+m/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(r,x)}s(t,"byText");function e(i,u,p,o,g,m,x,h,r){const{taskFontSize:n,taskFontFamily:l}=h,y=i.split(/<br\s*\/?>/gi);for(let d=0;d<y.length;d++){const c=d*n-n*(y.length-1)/2,v=u.append("text").attr("x",p+g/2).attr("y",o).attr("fill",r).style("text-anchor","middle").style("font-size",n).style("font-family",l);v.append("tspan").attr("x",p+g/2).attr("dy",c).text(y[d]),v.attr("y",o+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),f(v,x)}}s(e,"byTspan");function a(i,u,p,o,g,m,x,h){const r=u.append("switch"),l=r.append("foreignObject").attr("x",p).attr("y",o).attr("width",g).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,r,p,o,g,m,x,h),f(l,x)}s(a,"byFo");function f(i,u){for(const p in u)p in u&&i.attr(p,u[p])}return s(f,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?t:e}})(),qt=s(function(t,e){Z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics"),j={drawRect:K,drawCircle:ot,drawSection:Wt,drawText:ct,drawLabel:zt,drawTask:Ot,drawBackgroundRect:Yt,initGraphics:qt},Ht=s(function(t){Object.keys(t).forEach(function(a){$[a]=t[a]})},"setConf"),E={},W=0;function ut(t){const e=R().journey,a=e.maxLabelWidth;W=0;let f=60;Object.keys(E).forEach(i=>{const u=E[i].color,p={cx:20,cy:f,r:7,fill:u,stroke:"#000",pos:E[i].position};j.drawCircle(t,p);let o=t.append("text").attr("visibility","hidden").text(i);const g=o.node().getBoundingClientRect().width;o.remov Line truncated
+89
View File
@@ -0,0 +1,89 @@
import{_ as o,l as te,c as U,D as fe,af as ye,ag as be,ah as me,Y as _e,B as Y,i as F,H as ke,J as Ee,V as Se,W as ce,X as le}from"./mermaid.core.js";import{g as Ne}from"./chunk-5VM5RSS4.js";import"./index.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],H=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,M){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:G}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:G}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:H}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:H}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],M=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;t.push(q);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=M[P]&&M[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in M[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`:
`+b.showPosition()+`
Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[E]||E,line:b.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),E=null,se=b.yyleng,c=b.yytext,W=b.yylineno,q=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],j.$=u[u.length-C],j._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(j._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(j,[c,se,W,R.yy,x[1],u,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(j.$),t.push(j._$),oe=M[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},K=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
`+n+"^"},"showPosition"),test_match:o(function(i,n){var r,a,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),a=i[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in u)this[t]=u[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,r,a;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),t=0;t<u.length;t++)if(r=this._input.match(this.rules[u[t]]),r&&(!n||r[0].length>n[0].length)){if(n=r,a=t,this.options.backtrack_lexer){if(i=this.test_match(r,u[t]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,u[a]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,r,a,u){switch(a){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const t=/\n\s*/g;return r.yytext=r.yytext.replace(t,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return O})();T.lexer=K;function B(){this.yy={}}return o(B,"Parser"),B.prototype=T,T.Parser=B,new B})();$.parser=$;var xe=$,v=[],ne=[],ee=0,ie={},ve=o(()=>{v=[],ne=[],ee=0,ie={}},"clear"),De=o(e=>{if(v.length===0)return null;const h=v[0].level;let p=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===h&&!p&&(p=v[s]),v[s].level<h)throw new Error('Items without section detected, found section ("'+v[s].label+'")');return e===p?.level?null:p},"getSection"),he=o(function(){return ne},"getSections"),Le=o(function(){const e=[],h=[],p=he(),s=U();for(const d of p){const _={id:d.id,label:F(d.label??"",s),labelType:"markdown",isGroup:!0,ticket:d.ticket,shape:"kanbanSection",level:d.level,look:s.look};h.push(_);const m=v.filter(l=>l.parentId===d.id);for(const l of m){const D={id:l.id,parentId:d.id,label:F(l.label??"",s),labelType:"markdown",isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assignedLine truncated
`)?I=d+`
`:I=`{
`+d+`
}`;const g=ke(I,{schema:Ee});if(g.shape&&(g.shape!==g.shape.toLowerCase()||g.shape.includes("_")))throw new Error(`No such shape: ${g.shape}. Shape names should be lowercase.`);g?.shape&&g.shape==="kanbanItem"&&(l.shape=g?.shape),g?.label&&(l.label=g?.label),g?.icon&&(l.icon=g?.icon.toString()),g?.assigned&&(l.assigned=g?.assigned.toString()),g?.ticket&&(l.ticket=g?.ticket.toString()),g?.priority&&(l.priority=g?.priority)}const D=De(e);D?l.parentId=D.id||"kbn"+ee++:ne.push(l),v.push(l)},"addNode"),y={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=o((e,h)=>{switch(te.debug("In get type",e,h),e){case"[":return y.RECT;case"(":return h===")"?y.ROUNDED_RECT:y.CLOUD;case"((":return y.CIRCLE;case")":return y.CLOUD;case"))":return y.BANG;case"{{":return y.HEXAGON;default:return y.DEFAULT}},"getType"),Ce=o((e,h)=>{ie[e]=h},"setElementForId"),we=o(e=>{if(!e)return;const h=U(),p=v[v.length-1];e.icon&&(p.icon=F(e.icon,h)),e.class&&(p.cssClasses=F(e.class,h))},"decorateNode"),Ae=o(e=>{switch(e){case y.DEFAULT:return"no-border";case y.RECT:return"rect";case y.ROUNDED_RECT:return"rounded-rect";case y.CIRCLE:return"circle";case y.CLOUD:return"cloud";case y.BANG:return"bang";case y.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=o(()=>te,"getLogger"),Re=o(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:y,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=o(async(e,h,p,s)=>{te.debug(`Rendering kanban diagram
`+e);const _=s.db.getData(),m=U();m.htmlLabels=!1;const l=fe(h);for(const f of _.nodes)f.domId=`${h}-${f.id}`;const D=l.append("g");D.attr("class","sections");const I=l.append("g");I.attr("class","items");const g=_.nodes.filter(f=>f.isGroup);let w=0;const k=10,G=[];let N=25;for(const f of g){const A=m?.kanban?.sectionWidth||200;w=w+1,f.x=A*w+(w-1)*k/2,f.width=A,f.y=0,f.height=A*3,f.rx=5,f.ry=5,f.cssClasses=f.cssClasses+" section-"+w;const L=await ye(D,f);N=Math.max(N,L?.labelBBox?.height),G.push(L)}let V=0;for(const f of g){const A=G[V];V=V+1;const L=m?.kanban?.sectionWidth||200,H=-L*3/2+N;let T=H;const K=_.nodes.filter(i=>i.parentId===f.id);for(const i of K){if(i.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");i.x=f.x,i.width=L-1.5*k;const r=(await be(I,i,{config:m})).node().getBBox();i.y=T+r.height/2,await me(i),T=i.y+r.height/2+k/2}const B=A.cluster.select("rect"),O=Math.max(T-H+3*k,50)+(N-25);B.attr("height",O)}_e(void 0,l,m.mindmap?.padding??Y.kanban.padding,m.mindmap?.useMaxWidth??Y.kanban.useMaxWidth)},"draw"),je={draw:Be},Fe=o(e=>{let h="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],Se(e["lineColor"+s])?e["lineColor"+s]=ce(e["lineColor"+s],20):e["lineColor"+s]=le(e["lineColor"+s],20);const p=o((s,d)=>e.darkMode?le(s,d):ce(s,d),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){const d=""+(17-3*s);h+=`
.section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
fill: ${p(e["cScale"+s],10)};
stroke: ${p(e["cScale"+s],10)};
}
.section-${s-1} text {
fill: ${e["cScaleLabel"+s]};
}
.node-icon-${s-1} {
font-size: 40px;
color: ${e["cScaleLabel"+s]};
}
.section-edge-${s-1}{
stroke: ${e["cScale"+s]};
}
.edge-depth-${s-1}{
stroke-width: ${d};
}
.section-${s-1} line {
stroke: ${e["cScaleInv"+s]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${e.background};
stroke: ${e.nodeBorder};
stroke-width: 1px;
}
.kanban-ticket-link {
fill: ${e.background};
stroke: ${e.nodeBorder};
text-decoration: underline;
}
`}return h},"genSections"),Ge=o(e=>`
.edge {
stroke-width: 3;
}
${Fe(e)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${e.git0};
}
.section-root text {
fill: ${e.gitBranchLabel0};
}
.icon-container {
height:100%;
display: flex;
justify-content: center;
align-items: center;
}
.edge {
fill: none;
}
.cluster-label, .label {
color: ${e.textColor};
fill: ${e.textColor};
}
.kanban-label {
dy: 1em;
alignment-baseline: middle;
text-anchor: middle;
dominant-baseline: middle;
text-align: center;
}
${Ne()}
`,"getStyles"),He=Ge,ze={db:Ve,renderer:je,parser:xe,styles:He};export{ze as diagram};
+257
View File
@@ -0,0 +1,257 @@
class S extends Error{constructor(e,t){var a="KaTeX parse error: "+e,i,s,u=t&&t.loc;if(u&&u.start<=u.end){var h=u.lexer.input;i=u.start,s=u.end,i===h.length?a+=" at end of input: ":a+=" at position "+(i+1)+": ";var c=h.slice(i,s).replace(/[^]/g,"$&̲"),v;i>15?v="…"+h.slice(i-15,i):v=h.slice(0,i);var p;s+15<h.length?p=h.slice(s,s+15)+"…":p=h.slice(s),a+=v+c+p}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,S.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var Y1=/([A-Z])/g,$1=r=>r.replace(Y1,"-$1").toLowerCase(),W1={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},j1=/[&><"']/g,i0=r=>String(r).replace(j1,e=>W1[e]),Ce=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?Ce(r.body[0]):r:r.type==="font"?Ce(r.body):r,Z1=new Set(["mathord","textord","atom"]),D0=r=>Z1.has(Ce(r).type),K1=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},dt={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function J1(r){if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Q1(r){if(r.default!==void 0)return r.default;var e=Array.isArray(r.type)?r.type[0]:r.type;return J1(e)}function _1(r,e,t,a){var i=t[e];r[e]=i!==void 0?a.processor?a.processor(i):i:Q1(a)}class Et{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t of Object.keys(dt)){var a=dt[t];a&&_1(this,t,e,a)}}reportNonstrict(e,t,a){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,a)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new S("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible iLine truncated
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+e/2.075+" -"+e+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},ua=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+e)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},oa=function(e,t){return"M983 "+(10+e+t)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},ha=function(e,t){return"M424,"+(2398+e+t)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
h400000v`+(40+e)+"h-400000z"},ma=function(e,t){return"M473,"+(2713+e+t)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},ca=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},da=function(e,t,a){var i=a-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},fa=function(e,t,a){t=1e3*t;var i="";switch(e){case"sqrtMain":i=la(t,Q0);break;case"sqrtSize1":i=ua(t,Q0);break;case"sqrtSize2":i=oa(t,Q0);break;case"sqrtSize3":i=ha(t,Q0);break;case"sqrtSize4":i=ma(t,Q0);break;case"sqrtTall":i=da(t,Q0,a)}return i},va=function(e,t){switch(e){case"⎜":return r0("M291 0 H417 V"+t+" H291z");case"∣":return r0("M145 0 H188 V"+t+" H145z");case"∥":return r0("M145 0 H188 V"+t+" H145z")+r0("M367 0 H410 V"+t+" H367z");case"⎟":return r0("M457 0 H583 V"+t+" H457z");case"⎢":return r0("M319 0 H403 V"+t+" H319z");case"⎥":return r0("M263 0 H347 V"+t+" H263z");case"⎪":return r0("M384 0 H504 V"+t+" H384z");case"⏐":return r0("M312 0 H355 V"+t+" H312z");case"‖":return r0("M257 0 H300 V"+t+" H257z")+r0("M478 0 H521 V"+t+" H478z");default:return""}},ar={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:r0("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:r0("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:r0("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:r0("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:r0("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:r0("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:r0("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:r0("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},pa=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function ga(r){return"toText"in r}class ae{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(ga(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var vt={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},ba={ex:!0,em:!0,mu:!0},Ur=function(e){return typeof e!="string"&&(e=e.unit),e in vt||e in ba||e==="ex"},K=function(e,t){var a;if(e.unit in vt)a=vt[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")a=i.fontMetrics().xHeight;else if(e.unit==="em")a=i.fontMetrics().quad;else throw new S("Invalid unit: '"+e.unit+"'");i!==t&&(a*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},A=function(e){return+e.toFixed(4)+"em"},L0=function(e){return e.filter(t=>t).join(" ")},It=function(e){var t="";for(var a of Object.keys(e)){var i=e[a];i!==void 0&&(t+=$1(a)+":"+i+";")}return t},Vr=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Xr=function(e){var t=document.createElement(e);t.className=L0(this.classes),Object.assign(t.style,this.style);for(var a of Object.keys(this.attributes))t.setAttribute(a,this.attributes[a]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},ya=/[\s"'>/=\x00-\x1f]/,Yr=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+i0(L0(this.classes))+'"');var a=It(this.style);a&&(t+=' style="'+i0(a)+'"');for(var i of Object.keys(this.attributes)){if(ya.test(i))throw new S("Invalid attribute name '"+i+"'");t+=" "+i+'="'+i0(this.attributes[i])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">",t};class ie{constructor(e,t,a,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,Vr.call(this,e,a,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Xr.call(this,"span")}toMarkup(){return Yr.call(this,"span")}}class Fe{constructor(e,t,a,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Vr.call(this,t,i),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Xr.call(this,"a")}toMarkup(){return Yr.call(this,"a")}}class xa{constructor(e,t,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+i0(this.src)+'"'+(' alt="'+i0(this.alt)+'"'),t=It(this.style);return t&&(e+=' style="'+i0(t)+'"'),e+="'/>",e}}var wa={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class d0{constructor(e,t,a,i,s,u,h,c){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=a||0,this.italic=i||0,this.skew=s||0,this.width=u||0,this.classes=h||[],this.style=c||{},this.maxFontSize=0;var v=sa(this.text.charCodeAt(0));v&&this.classes.push(v+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=wa[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement("span"),t.style.marginRight=A(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=L0(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=i0(L0( Line truncated
`+P+" children.");for(var U=0;U<P;U++){var o0=new P0(R[U]),m0=new C0([o0],{width:"400em",height:A(O),viewBox:"0 0 "+h+" "+L,preserveAspectRatio:Y[U]+" slice"}),Q=G0([G[U]],[m0],t);if(P===1)return{span:Q,minWidth:F,height:O};Q.style.height=A(O),q.push(Q)}return{span:k(["stretchy"],q,t),minWidth:F,height:O}}}var{span:i,minWidth:s,height:u}=a();return i.height=u,i.style.height=A(u),s>0&&(i.style.minWidth=A(s)),i},Za=function(e,t,a,i,s){var u,h=e.height+e.depth+a+i;if(/fbox|color|angl/.test(t)){if(u=k(["stretchy",t],[],s),t==="fbox"){var c=s.color&&s.getColor();c&&(u.style.borderColor=c)}}else{var v=[];/^[bx]cancel$/.test(t)&&v.push(new pt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&v.push(new pt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new C0(v,{width:"100%",height:A(h)});u=G0([],[p],s)}return u.height=h,u.style.height=A(h),u},Ka={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ja={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Qa(r){return r in Ka}function H(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Ge(r){var e=Ue(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Ue(r){return r&&(r.type==="atom"||Ja.hasOwnProperty(r.type))?r:null}var a1=r=>{if(r instanceof d0)return r;if(za(r)&&r.children.length===1)return a1(r.children[0])},Pt=(r,e)=>{var t,a,i;r&&r.type==="supsub"?(a=H(r.base,"accent"),t=a.base,r.base=t,i=Sa(X(r,e)),r.base=a):(a=H(r,"accent"),t=a.base);var s=X(t,e.havingCrampedStyle()),u=a.isShifty&&D0(t),h=0;if(u){var c,v;h=(c=(v=a1(s))==null?void 0:v.skew)!=null?c:0}var p=a.label==="\\c",b=p?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),x;if(a.isStretchy)x=Pe(a,e),x=V({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:h>0?{width:"calc(100% - "+A(2*h)+")",marginLeft:A(2*h)}:void 0}]});else{var y,T;a.label==="\\vec"?(y=Kr("vec",e),T=Zr.vec[1]):(y=Oe({mode:a.mode,text:a.label},e,"textord"),y=ka(y),y.italic=0,T=y.width,p&&(b+=y.depth)),x=k(["accent-body"],[y]);var M=a.label==="\\textcircled";M&&(x.classes.push("accent-full"),b=s.height);var q=h;M||(q-=T/2),x.style.left=A(q),a.label==="\\textcircled"&&(x.style.top=".2em"),x=V({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-b},{type:"elem",elem:x}]})}var C=k(["mord","accent"],[x],e);return i?(i.children[0]=C,i.height=Math.max(C.height,i.height),i.classes[0]="mord",i):C},i1=(r,e)=>{var t=r.isStretchy?Le(r.label):new z("mo",[g0(r.label,r.mode)]),a=new z("mover",[$(r.base,e),t]);return a.setAttribute("accent","true"),a},_a=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));B({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Ne(e[0]),a=!_a.test(r.funcName),i=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:i,base:t}},htmlBuilder:Pt,mathmlBuilder:i1});B({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Pt,mathmlBuilder:i1});B({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:i}},htmlBuilder:(r,e)=>{var t=X(r.base,e),a=Pe(r,e),i=r.label==="\\utilde"?.12:0,s=V({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]});return k(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=Le(r.label),a=new z("munder",[$(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var Me=r=>{var e=new z("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};B({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoLine truncated
]`,T4="\\\\[a-zA-Z@]+",B4="\\\\[^\uD800-\uDFFF]",C4="("+T4+")"+q1+"*",D4=`\\\\(
|[ \r ]+
?)[ \r ]*`,qt="[̀-ͯ]",q4=new RegExp(qt+"+$"),E4="("+q1+"+)|"+(D4+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(qt+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(qt+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+C4)+("|"+B4+")");class Fr{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(E4,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new c0("EOF",new h0(this,t,t));var a=this.tokenRegex.exec(e);if(a===null||a.index!==t)throw new S("Unexpected character: '"+e[t]+"'",new c0(e[t],new h0(this,t,t+1)));var i=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new c0(i,new h0(this,t,this.tokenRegex.lastIndex))}}class R4{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new S("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,a){if(a===void 0&&(a=!1),a){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var I4=x1;m("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});m("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});m("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});m("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});m("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});m("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");m("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Hr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};m("\\char",function(r){var e=r.popToken(),t,a=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new S("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=Hr[e.text],a==null||a>=t)throw new S("Invalid base-"+t+" digit "+e.text);for(var i;(i=Hr[r.future().text])!=null&&i<t;)a*=t,a+=i,r.popToken()}return"\\@char{"+a+"}"});var Xt=(r,e,t,a)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new S("\\newcommand's first argument must be a macro name");var s=i[0].text,u=r.isDefined(s);if(u&&!e)throw new S("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!u&&!t)throw new S("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var h=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var c="",v=r.expandNextToken();v.text!=="]"&&v.text!=="EOF";)c+=v.text,v=r.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new S("Invalid number of arguments: "+c);h=parseInt(c),i=r.consumeArg().tokens}return u&&a||r.macros.set(s,{tokens:i,numArgs:h}),""};m("\\newcommand",r=>Xt(r,!1,!0,!1));m("\\renewcommand",r=>Xt(r,!0,!1,!1));m("\\providecommand",r=>Xt(r,!0,!0,!0));m("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});m("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});m("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),O0[t],W.math[t],W.text[t]),""});m("\\bgroup","{");m("\\egroup","}");m("~","\\nobreakspace");m("\\lq","`");m("\\rq","'");m("\\aa","\\r a");m("\\AA","\\r A");m("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");m("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");m("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");m("ℬ","\\mathscr{B}");m("ℰ","\\mathscr{E}");m("ℱ","\\mathscr{F}");m("ℋ","\\mathscr{H}");m("ℐ","\\mathscr{I}");m("ℒ","\\mathscr{L}");m("ℳ","\\mathscr{M}");m("ℛ","\\mathscr{R}");m("ℭ","\\mathfrak{C}");m("ℌ","\\mathfrak{H}");m("ℨ","\\mathfrak{Z}");m("\\Bbbk","\\Bbb{k}");m("\\llap","\\mathllap{\\textrm{#1}}");m("\\rlap","\\mathrlap{\\textrm{#1}}");m("\\clap","\\mathclap{\\textrm{#1}}");m("\\mathstrut","\\vphantom{(}");m("\\underbar","\\underline{\\text{#1}}");m("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');m("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");m("\\ne","\\neq");m("≠","\\neq");m("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");m("∉","\\notin");m("≘","\\htmLine truncated
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:i}}Pr.hasOwnProperty(t[0])&&!W[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Pr[t[0]]+t.slice(1));var s=q4.exec(t);s&&(t=t.substring(0,s.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var u;if(W[this.mode][t]){this.settings.strict&&this.mode==="math"&&gt.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var h=W[this.mode][t].group,c=h0.range(e),v;Qa(h)?v={type:"atom",mode:this.mode,family:h,loc:c,text:t}:v={type:h,mode:this.mode,loc:c,text:t},u=v}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Gr(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),u={type:"textord",mode:"text",loc:h0.range(e),text:t};else return null;if(this.consume(),s)for(var p=0;p<s[0].length;p++){var b=s[0][p];if(!ct[b])throw new S("Unknown accent ' "+b+"'",e);var x=ct[b][this.mode]||ct[b].text;if(!x)throw new S("Accent "+b+" unsupported in "+this.mode+" mode",e);u={type:"accent",mode:this.mode,loc:h0.range(e),label:x,isStretchy:!1,isShifty:!0,base:u}}return u}}je.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var $t=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new je(e,t);delete a.gullet.macros.current["\\df@tag"];var i=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new S("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:a.subparse([new c0("\\df@tag")])}]}return i},N1=function(e,t,a){t.textContent="";var i=Wt(e,a).toNode();t.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),N1=function(){throw new S("KaTeX doesn't work in quirks mode.")});var H4=function(e,t){var a=Wt(e,t).toMarkup();return a},O4=function(e,t){var a=new Et(t);return $t(e,a)},F1=function(e,t,a){if(a.throwOnError||!(e instanceof S))throw e;var i=k(["katex-error"],[new d0(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+a.errorColor),i},Wt=function(e,t){var a=new Et(t);try{var i=$t(e,a);return Xa(i,e,a)}catch(s){return F1(s,e,a)}},L4=function(e,t){var a=new Et(t);try{var i=$t(e,a);return Ya(i,e,a)}catch(s){return F1(s,e,a)}},P4="0.16.47",G4={Span:ie,Anchor:Fe,SymbolNode:d0,SvgNode:C0,PathNode:P0,LineNode:pt},U4={version:P4,render:N1,renderToString:H4,ParseError:S,SETTINGS_SCHEMA:dt,__parse:O4,__renderToDomTree:Wt,__renderToHTMLTree:L4,__setFontMetrics:Aa,__defineSymbol:n,__defineFunction:B,__defineMacro:m,__domTree:G4};export{S as ParseError,dt as SETTINGS_SCHEMA,B as __defineFunction,m as __defineMacro,n as __defineSymbol,G4 as __domTree,O4 as __parse,Wt as __renderToDomTree,L4 as __renderToHTMLTree,Aa as __setFontMetrics,U4 as default,N1 as render,H4 as renderToString,P4 as version};
+1
View File
@@ -0,0 +1 @@
import{bn as B,bo as y,bp as ye,bq as V,br as U,bs as Ue,bt as oe,bu as We,bv as In,bw as qe,bx as _n,by as kn,bz as jn,bA as ue,bB as An,bC as Mn,bD as xe,bE as Oe,bF as fe,bG as de,bH as G,bI as Xe,bJ as He,bK as Rn,bL as T,bM as Sn,bN as $n,bO as Fn,bP as Ee,bQ as Bn,bR as Ke,bS as N,bT as Gn,bU as Dn,bV as Yn,bW as S,bX as ze,bY as Je,bZ as Vn,b_ as se,b$ as Qe,c0 as Un,c1 as Ze,c2 as Wn,c3 as qn,Q as x,c4 as c,c5 as Xn,c6 as m,c7 as M,c8 as P,c9 as W}from"./mermaid.core.js";var Hn=/\s/;function Kn(e){for(var n=e.length;n--&&Hn.test(e.charAt(n)););return n}var zn=/^\s+/;function Jn(e){return e&&e.slice(0,Kn(e)+1).replace(zn,"")}var Te=NaN,Qn=/^[-+]0x[0-9a-f]+$/i,Zn=/^0b[01]+$/i,er=/^0o[0-7]+$/i,nr=parseInt;function rr(e){if(typeof e=="number")return e;if(B(e))return Te;if(y(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=y(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Jn(e);var r=Zn.test(e);return r||er.test(e)?nr(e.slice(2),r?2:8):Qn.test(e)?Te:+e}var Pe=1/0,tr=17976931348623157e292;function $(e){if(!e)return e===0?e:0;if(e=rr(e),e===Pe||e===-Pe){var n=e<0?-1:1;return n*tr}return e===e?e:0}function ir(e){var n=$(e),r=n%1;return n===n?r?n-r:n:0}var Le=Object.create,ar=(function(){function e(){}return function(n){if(!y(n))return{};if(Le)return Le(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function or(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function q(e,n,r){n=="__proto__"&&ye?ye(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var ur=Object.prototype,fr=ur.hasOwnProperty;function X(e,n,r){var t=e[n];(!(fr.call(e,n)&&V(t,r))||r===void 0&&!(n in e))&&q(e,n,r)}function dr(e,n,r,t){var i=!r;r||(r={});for(var o=-1,a=n.length;++o<a;){var u=n[o],f=void 0;f===void 0&&(f=e[u]),i?q(r,u,f):X(r,u,f)}return r}function k(e,n,r){if(!y(r))return!1;var t=typeof n;return(t=="number"?U(r)&&Ue(n,r.length):t=="string"&&n in r)?V(r[n],e):!1}function sr(e){return oe(function(n,r){var t=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&k(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t<i;){var u=r[t];u&&e(n,u,t,o)}return n})}function cr(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var lr=Object.prototype,hr=lr.hasOwnProperty;function vr(e){if(!y(e))return cr(e);var n=We(e),r=[];for(var t in e)t=="constructor"&&(n||!hr.call(e,t))||r.push(t);return r}function H(e){return U(e)?In(e,!0):vr(e)}function C(e){var n=e==null?0:e.length;return n?qe(e):[]}function pr(e){return _n(kn(e,void 0,C),e+"")}var en=jn(Object.getPrototypeOf,Object),br="[object Object]",wr=Function.prototype,gr=Object.prototype,nn=wr.toString,mr=gr.hasOwnProperty,yr=nn.call(Object);function xr(e){if(!ue(e)||An(e)!=br)return!1;var n=en(e);if(n===null)return!0;var r=mr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&nn.call(r)==yr}var rn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ne=rn&&typeof module=="object"&&module&&!module.nodeType&&module,Or=Ne&&Ne.exports===rn,Ce=Or?Mn.Buffer:void 0,Ie=Ce?Ce.allocUnsafe:void 0;function tn(e,n){if(n)return e.slice();var r=e.length,t=Ie?Ie(r):new e.constructor(r);return e.copy(t),t}var Er=Object.prototype,Tr=Er.hasOwnProperty;function Pr(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Tr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function ce(e){var n=new e.constructor(e.byteLength);return new xe(n).set(new xe(e)),n}function Lr(e,n){var r=ce(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var Nr=/\w*$/;function Cr(e){var n=new e.constructor(e.source,Nr.exec(e));return n.lastIndex=e.lastIndex,n}var _e=Oe?Oe.prototype:void 0,ke=_e?_e.valueOf:void 0;function Ir(e){return ke?Object(ke.call(e)):{}}function an(e,n){var r=n?ce(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var _r="[object Boolean]",kr="[object Date]",jr="[object Map]",Ar="[object Number]",Mr="[object RegExp]",Rr="[object Set]",Sr="[object String]",$r="[object Symbol]",Fr="[object ArrayBuffer]",Br="[object DataView]",Gr="[object Float32Array]",Dr="[object Float64Array]",Yr="[object Int8Array]",Vr="[object Int16Array]",Ur="[object Int32Array]",Wr="[object Uint8Array]",qr="[object Uint8ClampedArray]",Xr="[object Uint16Array]",Hr="[object Uint32Array]";function Kr(e,n,r){var t=e.constructor;switch(n){case Fr:return ce(e);case _r:case kr:return new t(+e);case Br:return Lr(e);case Gr:case Dr:case Yr:case Vr:case Ur:case Wr:case qr:case Xr:case Hr:return an(e,r);case jr:return new t;case Ar:case Sr:return new t(e);case Mr:return Cr(e);case Rr:return new t;case $r:return Ir(e)}}function on(e){return typeof e.constructor=="function"&&!We(e)?ar(en(e)):{}}var zr="[object Map]";function Jr(e){return ue(e)&&fe(e)==zr}var je=G&&G.isMap,Qr=je?de(je):Jr,Zr="[object Set]";function et(e){return ue(e)&&fe(e)==Zr}var Ae=G&&G.isSet,nt=Ae?de(Ae):et,rt=1,un="[object Arguments]",tt="[object Array]",it="[object BoLine truncated
+1
View File
@@ -0,0 +1 @@
import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core.js";import{i as D}from"./init.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);breakLine truncated
+310
View File
@@ -0,0 +1,310 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-INFHLROL.js","assets/index.js","assets/index.css","assets/dagre-GXQ25YYZ.js","assets/layout.js","assets/swimlanes-42K2YHIH.js","assets/cose-bilkent-JH36ORCC.js","assets/cytoscape.esm.js","assets/c4Diagram-7LVT6UL2.js","assets/chunk-F27PBJKO.js","assets/flowDiagram-HODETNUW.js","assets/chunk-5VM5RSS4.js","assets/chunk-XXDRQBXY.js","assets/chunk-POPQ4Y6H.js","assets/channel.js","assets/swimlanesDiagram-VR7AAH4N.js","assets/erDiagram-RLTQ6QDP.js","assets/gitGraphDiagram-WWUBYQGX.js","assets/chunk-2Q5K7J3B.js","assets/chunk-JWPE2WC7.js","assets/cynefin-OW5HDTMX.js","assets/ganttDiagram-EL5Y4UJY.js","assets/linear.js","assets/init.js","assets/defaultLocale.js","assets/infoDiagram-27XIBGKW.js","assets/pieDiagram-E7YTZNPT.js","assets/arc.js","assets/ordinal.js","assets/quadrantDiagram-AXDQQJYC.js","assets/xychartDiagram-S5SC5T6Z.js","assets/requirementDiagram-BXWQKSXE.js","assets/sequenceDiagram-WJ2MYXX4.js","assets/classDiagram-ZZMXUADV.js","assets/chunk-TICWLB2K.js","assets/classDiagram-v2-VYDZK3BY.js","assets/stateDiagram-D77RDMKH.js","assets/chunk-IMKFNOWR.js","assets/stateDiagram-v2-MP3YSRHH.js","assets/journeyDiagram-3NMN7TZE.js","assets/timeline-definition-24CTP7MA.js","assets/mindmap-definition-YA3MSWOX.js","assets/kanban-definition-UXKFOSKX.js","assets/sankeyDiagram-P5KCCOFB.js","assets/diagram-Z3DM3KII.js","assets/diagram-UQ7AKVKN.js","assets/blockDiagram-I7D4REHJ.js","assets/diagram-S7CK7UJ4.js","assets/architectureDiagram-5GKGNRK7.js","assets/diagram-VSXAHHWV.js","assets/ishikawaDiagram-5VMMS53U.js","assets/vennDiagram-4TSXK5OY.js","assets/diagram-VX7I27RA.js","assets/wardleyDiagram-VM6X3IG4.js","assets/cynefinDiagram-5FMLGOSQ.js","assets/railroadDiagram-O6MQD6OU.js","assets/chunk-SVP7TREG.js","assets/ebnfDiagram-PWID7BFC.js","assets/abnfDiagram-VCTEODGH.js","assets/pegDiagram-XKGWAZYB.js"])))=>i.map(i=>d[i]);
import{g as gl,_ as At}from"./index.js";var Hd=Object.defineProperty,p=(e,t)=>Hd(e,"name",{value:t,configurable:!0}),I0=(e,t)=>{for(var r in t)Hd(e,r,{get:t[r],enumerable:!0})},po={exports:{}},P0=po.exports,ec;function R0(){return ec||(ec=1,(function(e,t){(function(r,i){e.exports=i()})(P0,(function(){var r=1e3,i=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",m="date",y="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var O=["th","st","nd","rd"],B=E%100;return"["+E+(O[(B-20)%10]||O[B]||O[0])+"]"}},T=function(E,O,B){var N=String(E);return!N||N.length>=O?E:""+Array(O+1-N.length).join(B)+E},S={s:T,z:function(E){var O=-E.utcOffset(),B=Math.abs(O),N=Math.floor(B/60),D=B%60;return(O<=0?"+":"-")+T(N,2,"0")+":"+T(D,2,"0")},m:function E(O,B){if(O.date()<B.date())return-E(B,O);var N=12*(B.year()-O.year())+(B.month()-O.month()),D=O.clone().add(N,u),rt=B-D<0,tt=O.clone().add(N+(rt?-1:1),u);return+(-(N+(B-D)/(rt?D-tt:tt-D))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:u,y:f,w:h,d:c,D:m,h:l,m:n,s:a,ms:o,Q:d}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},_="en",L={};L[_]=k;var A="$isDayjsObject",F=function(E){return E instanceof it||!(!E||!E[A])},V=function E(O,B,N){var D;if(!O)return _;if(typeof O=="string"){var rt=O.toLowerCase();L[rt]&&(D=rt),B&&(L[rt]=B,D=rt);var tt=O.split("-");if(!D&&tt.length>1)return E(tt[0])}else{var pt=O.name;L[pt]=O,D=pt}return!N&&D&&(_=D),D||!N&&_},Y=function(E,O){if(F(E))return E.clone();var B=typeof O=="object"?O:{};return B.date=E,B.args=arguments,new it(B)},R=S;R.l=V,R.i=F,R.w=function(E,O){return Y(E,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var it=(function(){function E(B){this.$L=V(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[A]=!0}var O=E.prototype;return O.parse=function(B){this.$d=(function(N){var D=N.date,rt=N.utc;if(D===null)return new Date(NaN);if(R.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var tt=D.match(x);if(tt){var pt=tt[2]-1||0,St=(tt[7]||"0").substring(0,3);return rt?new Date(Date.UTC(tt[1],pt,tt[3]||1,tt[4]||0,tt[5]||0,tt[6]||0,St)):new Date(tt[1],pt,tt[3]||1,tt[4]||0,tt[5]||0,tt[6]||0,St)}}return new Date(D)})(B),this.init()},O.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},O.$utils=function(){return R},O.isValid=function(){return this.$d.toString()!==y},O.isSame=function(B,N){var D=Y(B);return this.startOf(N)<=D&&D<=this.endOf(N)},O.isAfter=function(B,N){return Y(B)<this.startOf(N)},O.isBefore=function(B,N){return this.endOf(N)<Y(B)},O.$g=function(B,N,D){return R.u(B)?this[N]:this.set(D,B)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(B,N){var D=this,rt=!!R.u(N)||N,tt=R.p(B),pt=function(wt,It){var Mt=R.w(D.$u?Date.UTC(D.$y,It,wt):new Date(D.$y,It,wt),D);return rt?Mt:Mt.endOf(c)},St=function(wt,It){return R.w(D.toDate()[wt].apply(D.toDate("s"),(rt?[0,0,0,0]:[23,59,59,999]).slice(It)),D)},Tt=this.$W,ft=this.$M,Bt=this.$D,st="set"+(this.$u?"UTC":"");switch(tt){case f:return rt?pt(1,0):pt(31,11);case u:return rt?pt(1,ft):pt(0,ft+1);case h:var kt=this.$locale().weekStart||0,xt=(Tt<kt?Tt+7:Tt)-kt;return pt(rt?Bt-xt:Bt+(6-xt),ft);case c:case m:return St(st+"Hours",0);case l:return St(st+"Minutes",1);case n:return St(st+"Seconds",2);case a:return St(st+"Milliseconds",3);default:return this.clone()}},O.endOf=function(B){return this.startOf(B,!1)},O.$set=function(B,N){var D,rt=R.p(B),tt="set"+(this.$u?"UTC":""),pt=(D={},D[c]=tt+"Date",D[m]=tt+"Date",D[u]=tt+"Month",D[f]=tt+"FullYear",D[l]=tt+"Hours",D[n]=tt+"Minutes",D[a]=tt+"Seconds",D[o]=tt+"Milliseconds",D)[rt],St=rt===c?this.$D+(N-this.$W):N;if(rt===u||rt===f){var Tt=this.clone().set(m,1);Tt.$d[pt](St),Tt.init(),this.$d=Tt.set(m,Math.min(this.$D,Tt.daysInMonth())).$d}else pt&&this.$d[pt](St);return this.init(),this},O.set=function(B,N){return this.clone().$set(B,N)},O.get=function(B){return this[R.p(B)]()},O.add=function(B,N){var D,rt=this;B=Number(B);var tt=R.p(N),pt=function(ft){var Bt=Y(rt);return R.w(Bt.date(Bt.date()+Math.round(ft*B)),rt)};if(tt===u)return this.set(u,this.$M+B);if(tt===f)return this.set(f,this.$y+B);if(tt===c)return pt(1);if(tt===h)return pt(7);var St=(D={},D[n]=i,D[l]=s,D[a]=r,D)[tt]||1,Tt=this.$d.getTime()+B*St;return R.w(Tt,this)},O.subtract=function(B,N){return this.add(-1*B,N)},O.format=fLine truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K0(e,t){return X0(e)||V0(e,t)||Q0(e,t)||Z0()}function Q0(e,t){if(e){if(typeof e=="string")return rc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rc(e,t):void 0}}const jd=Object.entries,ic=Object.setPrototypeOf,J0=Object.isFrozen,tx=Object.getPrototypeOf,ex=Object.getOwnPropertyDescriptor;let xe=Object.freeze,Me=Object.seal,xi=Object.create,Gd=typeof Reflect<"u"&&Reflect,_n=Gd.apply,vn=Gd.construct;xe||(xe=function(t){return t});Me||(Me=function(t){return t});_n||(_n=function(t,r){for(var i=arguments.length,s=new Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];return t.apply(r,s)});vn||(vn=function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return new t(...i)});const ci=Jt(Array.prototype.forEach),rx=Jt(Array.prototype.lastIndexOf),sc=Jt(Array.prototype.pop),ui=Jt(Array.prototype.push),ix=Jt(Array.prototype.splice),me=Array.isArray,us=Jt(String.prototype.toLowerCase),Fa=Jt(String.prototype.toString),oc=Jt(String.prototype.match),di=Jt(String.prototype.replace),ac=Jt(String.prototype.indexOf),sx=Jt(String.prototype.trim),ox=Jt(Number.prototype.toString),ax=Jt(Boolean.prototype.toString),nc=typeof BigInt>"u"?null:Jt(BigInt.prototype.toString),lc=typeof Symbol>"u"?null:Jt(Symbol.prototype.toString),Gt=Jt(Object.prototype.hasOwnProperty),es=Jt(Object.prototype.toString),oe=Jt(RegExp.prototype.test),Ks=nx(TypeError);function Jt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return _n(e,t,i)}}function nx(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return vn(e,r)}}function Et(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:us;if(ic&&ic(e,null),!me(t))return e;let i=t.length;for(;i--;){let s=t[i];if(typeof s=="string"){const o=r(s);o!==s&&(J0(t)||(t[i]=o),s=o)}e[s]=!0}return e}function lx(e){for(let t=0;t<e.length;t++)Gt(e,t)||(e[t]=null);return e}function Te(e){const t=xi(null);for(const i of jd(e)){var r=K0(i,2);const s=r[0],o=r[1];Gt(e,s)&&(me(o)?t[s]=lx(o):o&&typeof o=="object"&&o.constructor===Object?t[s]=Te(o):t[s]=o)}return t}function hx(e){switch(typeof e){case"string":return e;case"number":return ox(e);case"boolean":return ax(e);case"bigint":return nc?nc(e):"0";case"symbol":return lc?lc(e):"Symbol()";case"undefined":return es(e);case"function":case"object":{if(e===null)return es(e);const t=e,r=Hr(t,"toString");if(typeof r=="function"){const i=r(t);return typeof i=="string"?i:es(i)}return es(e)}default:return es(e)}}function Hr(e,t){for(;e!==null;){const i=ex(e,t);if(i){if(i.get)return Jt(i.get);if(typeof i.value=="function")return Jt(i.value)}e=tx(e)}function r(){return null}return r}function cx(e){try{return oe(e,""),!0}catch{return!1}}const hc=xe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Aa=xe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ea=xe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ux=xe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","s Line truncated
`+ke),Ce&&ci([O,B,N],Br=>{ke=di(ke,Br," ")}),L&&le?L.createHTML(ke):ke},t.setConfig=function(){let bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_a(bt),ar=!0},t.clearConfig=function(){hi=null,ar=!1},t.isValidAttribute=function(bt,v,Z){hi||_a({});const ct=zt(bt),Dt=zt(v);return Zh(ct,Dt,Z)},t.addHook=function(bt,v){typeof v=="function"&&ui(E[bt],v)},t.removeHook=function(bt,v){if(v!==void 0){const Z=rx(E[bt],v);return Z===-1?void 0:ix(E[bt],Z,1)[0]}return sc(E[bt])},t.removeHooks=function(bt){E[bt]=[]},t.removeAllHooks=function(){E=pc()},t}var zi=Xd(),Bn=p((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>Bn(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([o,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,o)||Object.defineProperty(e,o,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[o]===void 0&&(s[o]=Array.isArray(a)?[]:{}),typeof s[o]=="object"&&(s[o]=Bn(s[o],a,{depth:r-1}))}else typeof s[o]!="object"&&(Object.hasOwn(e,o)?s[o]=a:Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),ie=Bn,er="#ffffff",rr="#f2f2f2",vt=p((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),Bi,Sx=(Bi=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||vt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||vt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||vt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||vt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this. Line truncated
`);for(const[r,{detector:i}]of Object.entries(Qr))if(i(e,t))return r;throw new of(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Ln=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)af(t,r,i)},"registerLazyLoadedDiagrams"),af=p((e,t,r)=>{Qr[e]&&P.warn(`Detector with key ${e} already exists. Overwriting.`),Qr[e]={detector:t,loader:r},P.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),rC=p(e=>Qr[e].loader,"getDiagramLoader"),qs=/<br\s*\/?>/gi,iC=p(e=>e?hf(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),sC=(()=>{let e=!1;return()=>{e||(nf(),e=!0)}})();function nf(){const e="data-temp-href-target";zi.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),zi.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(nf,"setupDompurifyHooks");var lf=p(e=>(sC(),zi.sanitize(e)),"removeScript"),mc=p((e,t)=>{if(fe(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=lf(e):r!=="loose"&&(e=hf(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=lC(e))}return e},"sanitizeMore"),$e=p((e,t)=>e&&(t.dompurifyConfig?e=zi.sanitize(mc(e,t),t.dompurifyConfig).toString():e=zi.sanitize(mc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),oC=p((e,t)=>typeof e=="string"?$e(e,t):e.flat().map(r=>$e(r,t)),"sanitizeTextOrArray"),aC=p(e=>qs.test(e),"hasBreaks"),nC=p(e=>e.split(qs),"splitBreaks"),lC=p(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),hf=p(e=>e.replace(qs,"#br#"),"breakToPlaceholder"),hC=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),cC=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),uC=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),yc=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let s=t[i];if(s===","&&i>0&&i+1<t.length){const o=t[i-1],a=t[i+1];dC(o,a)&&(s=o+","+a,i++,r.pop())}r.push(fC(s))}return r.join("")},"parseGenericTypes"),Fn=p((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),dC=p((e,t)=>{const r=Fn(e,"~"),i=Fn(t,"~");return r===1&&i===1},"shouldCombineSets"),fC=p(e=>{const t=Fn(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let s=i.indexOf("~"),o=i.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)i[s]="<",i[o]=">",s=i.indexOf("~"),o=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),xc=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),An=/\$\$(.*?)\$\$/g,Ls=p(e=>(e.match(An)?.length??0)>0,"hasKatex"),XM=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await cf(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),pC=p(async(e,t)=>{if(!Ls(e))return e;if(!(xc()||t.legacyMathML||t.forceLegacyMathML))return e.replace(An,"MathML is unsupported in this environment.");{const{default:r}=await At(async()=>{const{default:s}=await import("./katex.js");return{default:s}},[]),i=t.forceLegacyMathML||!xc()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(qs).map(s=>Ls(s)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${s}</div>`:`<div>${s}</div>`).join("").replace(An,(s,o)=>r.renderToString(o,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),cf=p(async(e,t)=>$e(await pC(e,t),t),"renderKatexSanitized"),Ws={getRows:iC,sanitizeText:$e,sanitizeTextOrArray:oC,hasBreaks:aC,splitBreaks:nC,lineBreakRegex:qs,removeScript:lf,getUrl:hC,evaluate:ir,getMax:cC,getMin:uC},gC=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),mC=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),uf=p(function(e,t,r,i){const s=mC(t,r,i);gC(e,s)},"configureSvgSize"),yC=p(function(e,t,r,i){const s=t.node().getBBox(),o=s.width,a=s.height;P.info(`SVG bounds: ${o}x${a}`,s);let n=0,l=0;P.info(`Graph bounds: ${n}x${l}`,e),n=o+r*2,l=a+r*2,P.info(`Calculated bounds: ${n}x${l}`),uf(t,l,n,i);const c=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),mo={};function En(e){return[...e.cssRules].map(t=>t.cssText).join(`
`)}p(En,"cssStyleSheetToString");var xC=p((e,t,r,i)=>{let s="";return e in mo&&mo[e]?s=mo[e]({...r,svgId:i}):P.warn(`No theme found for ${e}`),`& {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
fill: ${r.textColor}
}
@keyframes edge-animation-frame {
from {
stroke-dashoffset: 0;
}
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
& .edge-animation-slow {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 50s linear infinite;
stroke-linecap: round;
}
& .edge-animation-fast {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 20s linear infinite;
stroke-linecap: round;
}
/* Classes common for multiple diagrams */
& .error-icon {
fill: ${r.errorBkgColor};
}
& .error-text {
fill: ${r.errorTextColor};
stroke: ${r.errorTextColor};
}
& .edge-thickness-normal {
stroke-width: ${r.strokeWidth??1}px;
}
& .edge-thickness-thick {
stroke-width: 3.5px
}
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-thickness-invisible {
stroke-width: 0;
fill: none;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
& .marker {
fill: ${r.lineColor};
stroke: ${r.lineColor};
}
& .marker.cross {
stroke: ${r.lineColor};
}
& svg {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
}
& p {
margin: 0
}
${s}
.node .neo-node {
stroke: ${r.nodeBorder};
}
[data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].swimlane.cluster rect {
filter: none;
}
[data-look="neo"].node path {
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
stroke-width: ${r.strokeWidth??1}px;
}
[data-look="neo"].node .outer-path {
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].node .neo-line path {
stroke: ${r.nodeBorder};
filter: none;
}
[data-look="neo"].node circle{
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].node circle .state-start{
fill: #000000;
}
[data-look="neo"].icon-shape .icon {
fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].icon-shape .icon-neo path {
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
${t}
`},"getStyles"),CC=p((e,t)=>{t!==void 0&&(mo[e]=t)},"addStylesForDiagram"),bC=xC,df={};I0(df,{clear:()=>kC,getAccDescription:()=>_C,getAccTitle:()=>TC,getDiagramTitle:()=>BC,setAccDescription:()=>SC,setAccTitle:()=>wC,setDiagramTitle:()=>vC});var xl="",Cl="",bl="",kl=p(e=>$e(e,Ut()),"sanitizeText"),kC=p(()=>{xl="",bl="",Cl=""},"clear"),wC=p(e=>{xl=kl(e).replace(/^\s+/g,"")},"setAccTitle"),TC=p(()=>xl,"getAccTitle"),SC=p(e=>{bl=kl(e).replace(/\n\s+/g,`
`)},"setAccDescription"),_C=p(()=>bl,"getAccDescription"),vC=p(e=>{Cl=kl(e)},"setDiagramTitle"),BC=p(()=>Cl,"getDiagramTitle"),Cc=P,LC=ml,$t=Ut,VM=tf,ZM=Hi,wl=p(e=>$e(e,$t()),"sanitizeText"),FC=yC,AC=p(()=>df,"getCommonDb"),Ao={},Eo=p((e,t,r)=>{Ao[e]&&Cc.warn(`Diagram with id ${e} already registered. Overwriting.`),Ao[e]=t,r&&af(e,r),CC(e,t.styles),t.injectUtils?.(Cc,LC,$t,wl,FC,AC(),()=>{})},"registerDiagram"),Mn=p(e=>{if(e in Ao)return Ao[e];throw new EC(e)},"getDiagram"),Ni,EC=(Ni=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(Ni,"DiagramNotFoundError"),Ni),MC={value:()=>{}};function ff(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new yo(r)}function yo(e){this._=e}function $C(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");if(s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}yo.prototype=ff.prototype={constructor:yo,on:function(e,t){var r=this._,i=$C(e+"",r),s,o=-1,a=i.length;if(arguments.length<2){for(;++o<a;)if((s=(e=i[o]).type)&&(s=OC(r[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=i[o]).type)r[s]=bc(r[s],e.name,t);else if(t==null)for(s in r)r[s]=bc(r[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new yo(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var r=new Array(s),i=0,s,o;i<s;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,s=o.length;i<s;++i)o[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],s=0,o=i.length;s<o;++s)i[s].value.apply(t,r)}};function OC(e,t){for(var r=0,i=e.length,s;r<i;++r)if((s=e[r]).name===t)return s.value}function bc(e,t,r){for(var i=0,s=e.length;i<s;++i)if(e[i].name===t){e[i]=MC,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var $n="http://www.w3.org/1999/xhtml";const kc={svg:"http://www.w3.org/2000/svg",xhtml:$n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ea(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),kc.hasOwnProperty(t)?{space:kc[t],local:e}:e}function DC(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===$n&&t.documentElement.namespaceURI===$n?t.createElement(e):t.createElementNS(r,e)}}function IC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pf(e){var t=ea(e);return(t.local?IC:DC)(t)}function PC(){}function Tl(e){return e==null?PC:function(){return this.querySelector(e)}}function RC(e){typeof e!="function"&&(e=Tl(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=new Array(a),l,c,h=0;h<a;++h)(l=o[h])&&(c=e.call(l,l.__data__,h,o))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Ae(i,this._parents)}function NC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qC(){return[]}function gf(e){return e==null?qC:function(){return this.querySelectorAll(e)}}function WC(e){return function(){return NC(e.apply(this,arguments))}}function zC(e){typeof e=="function"?e=WC(e):e=gf(e);for(var t=this._groups,r=t.length,i=[],s=[],o=0;o<r;++o)for(var a=t[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),s.push(l));return new Ae(i,s)}function mf(e){return function(){return this.matches(e)}}function yf(e){return function(t){return t.matches(e)}}var HC=Array.prototype.find;function YC(e){return function(){return HC.call(this.children,e)}}function UC(){return this.firstElementChild}function jC(e){return this.select(e==null?UC:YC(typeof e=="function"?e:yf(e)))}var GC=Array.prototype.filter;function XC(){return Array.from(this.children)}function VC(e){return function(){return GC.call(this.children,e)}}function ZC(e){return this.selectAll(e==null?XC:VC(typeof e=="function"?e:yf(e)))}function KC(e){typeof e!="function"&&(e=mf(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Ae(i,this._parents)}function xf(e){return new Array(e.length)}function QC(){return new Ae(this._enter||this._groups.map(xf),this._parents)}function Mo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Mo.prototype={constructor:Mo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function JC(e){retur Line truncated
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),P.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const s=[];for(;(i=Ts.exec(e))!==null;)if(i.index===Ts.lastIndex&&Ts.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const o=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;s.push({type:o,args:a})}return s.length===0?{type:e,args:null}:s.length===1?s[0]:s}catch(r){return P.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),yw=p(function(e){return e.replace(Ts,"")},"removeDirectives"),xw=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Nl(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return pw[r]??t}p(Nl,"interpolateToCurve");function Cp(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?P2.sanitizeUrl(r):r}p(Cp,"formatUrl");var Cw=p((e,...t)=>{const r=e.split("."),i=r.length-1,s=r[i];let o=window;for(let a=0;a<i;a++)if(o=o[r[a]],!o){P.error(`Function name: ${e} not found in window`);return}o[s](...t)},"runFunc");function ql(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}p(ql,"distance");function bp(e){let t,r=0;e.forEach(s=>{r+=ql(s,t),t=s});const i=r/2;return Wl(e,i)}p(bp,"traverseEdge");function kp(e){return e.length===1?e[0]:bp(e)}p(kp,"calcLabelPosition");var Kc=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Wl=p((e,t)=>{let r,i=t;for(const s of e){if(r){const o=ql(s,r);if(o===0)return r;if(o<i)i-=o;else{const a=i/o;if(a<=0)return r;if(a>=1)return{x:s.x,y:s.y};if(a>0&&a<1)return{x:Kc((1-a)*r.x+a*s.x,5),y:Kc((1-a)*r.y+a*s.y,5)}}}r=s}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),bw=p((e,t,r)=>{P.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const s=Wl(t,25),o=e?10:5,a=Math.atan2(t[0].y-s.y,t[0].x-s.x),n={x:0,y:0};return n.x=Math.sin(a)*o+(t[0].x+s.x)/2,n.y=-Math.cos(a)*o+(t[0].y+s.y)/2,n},"calcCardinalityPosition");function wp(e,t,r){const i=structuredClone(r);P.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const s=25+e,o=Wl(i,s),a=10+e*.5,n=Math.atan2(i[0].y-o.y,i[0].x-o.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+o.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+o.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2),l}p(wp,"calcTerminalLabelPosition");function Tp(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(Tp,"getStylesFromArray");var Qc=0,kw=p(()=>(Qc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Qc),"generateId");function Sp(e){let t="";const r="0123456789abcdef",i=r.length;for(let s=0;s<e;s++)t+=r.charAt(Math.floor(Math.random()*i));return t}p(Sp,"makeRandomHex");var ww=p(e=>Sp(e.length),"random"),Tw=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Sw=p(function(e,t){const r=t.text.replace(Ws.lineBreakRegex," "),[,i]=aa(t.fontSize),s=e.append("text");s.attr("x",t.x),s.attr("y",t.y),s.style("text-anchor",t.anchor),s.style("font-family",t.fontFamily),s.style("font-size",i),s.style("font-weight",t.fontWeight),s.attr("fill",t.fill),t.class!==void 0&&s.attr("class",t.class);const o=s.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),s},"drawSimpleText"),_w=Us((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Ws.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),s=[];let o="";return i.forEach((a,n)=>{const l=br(`${a} `,r),c=br(o,r);if(l>t){const{hyphenatedStrings:d,remainingWord:f}=vw(a,t,"-",r);s.push(o,...d),o=f}else c+l>=t?(s.push(o),o=a):o=[o,a].filter(Boolean).join(" ");n+1===i.length&&s.push(o)}),s.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),vw=Us((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const s=[...e],o=[];let a="";return s.forEach((n,l)=>{const c=`${a}${n}`;if(br(c,i)>=t){const u=l+1,d=s.length===u,f=`${c}${r}`;o.push(d?c:f),a=""}else a=c}),{hyphenatedStrings:o,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function _p(e,t){return zl(e,t).height}p(_p,"calculateTextHeight");function br(e,t){return zl(e,t).width}p(br,"calculateTextWidth");var zl=Us((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:s=400}=t;if(!e)return{width:0,height:0};const[,o]=aa(r),a=["sans-serif",i],n=e.split(Ws. Line truncated
]`).replace("lheading",Fp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ep=/^( {2,}|\\)\n(?!\s*$)/,Qw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,la=/[\p{P}\p{S}]/u,Kl=/[\s\p{P}\p{S}]/u,Mp=/[^\s\p{P}\p{S}]/u,Jw=Nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kl).getRegex(),$p=/(?!~)[\p{P}\p{S}]/u,tT=/(?!~)[\s\p{P}\p{S}]/u,eT=/(?:[^\s\p{P}\p{S}]|~)/u,rT=Nt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pw?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Op=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,iT=Nt(Op,"u").replace(/punct/g,la).getRegex(),sT=Nt(Op,"u").replace(/punct/g,$p).getRegex(),Dp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oT=Nt(Dp,"gu").replace(/notPunctSpace/g,Mp).replace(/punctSpace/g,Kl).replace(/punct/g,la).getRegex(),aT=Nt(Dp,"gu").replace(/notPunctSpace/g,eT).replace(/punctSpace/g,tT).replace(/punct/g,$p).getRegex(),nT=Nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Mp).replace(/punctSpace/g,Kl).replace(/punct/g,la).getRegex(),lT=Nt(/\\(punct)/,"gu").replace(/punct/g,la).getRegex(),hT=Nt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),cT=Nt(Vl).replace("(?:-->|$)","-->").getRegex(),uT=Nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",cT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,dT=Nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ip=Nt(/^!?\[(label)\]\[(ref)\]/).replace("label",zo).replace("ref",Xl).getRegex(),Pp=Nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xl).getRegex(),fT=Nt("reflink|nolink(?!\\()","g").replace("reflink",Ip).replace("nolink",Pp).getRegex(),iu=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ql={_backpedal:_s,anyPunctuation:lT,autolink:hT,blockSkip:rT,br:Ep,code:Kw,del:_s,emStrongLDelim:iT,emStrongRDelimAst:oT,emStrongRDelimUnd:nT,escape:Zw,link:dT,nolink:Pp,punctuation:Jw,reflink:Ip,reflinkSearch:fT,tag:uT,text:Qw,url:_s},pT={...Ql,link:Nt(/^!?\[(label)\]\((.*?)\)/).replace("label",zo).getRegex(),reflink:Nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zo).getRegex()},jn={...Ql,emStrongRDelimAst:aT,emStrongLDelim:sT,url:Nt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",iu).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Nt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",iu).getRegex()},gT={...jn,br:Nt(Ep).replace("{2,}","*").getRegex(),text:Nt(jn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},so={normal:Zl,gfm:Xw,pedantic:Vw},is={normal:Ql,gfm:jn,breaks:gT,pedantic:pT},mT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},su=e=>mT[e];function Ge(e,t){if(t){if(ye.escapeTest.test(e))return e.replace(ye.escapeReplace,su)}else if(ye.escapeTestNoEncode.test(e))return e.replace(ye.escapeReplaceNoEncode,su);return e}function ou(e){try{e=encodeURI(e).replace(ye.percentDecode,"%")}catch{return null}return e}function au(e,t){let r=e.replace(ye.findPipe,(o,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ye.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(yeLine truncated
`).map(o=>{let a=o.match(r.other.beginningSpace);if(a===null)return o;let[n]=a;return n.length>=s.length?o.slice(s.length):o}).join(`
`)}var Ho=class{options;rules;lexer;constructor(t){this.options=t||oi}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:ss(i,`
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],s=xT(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:s}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let s=ss(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:ss(r[0],`
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=ss(r[0],`
`).split(`
`),s="",o="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
`),u=h.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
${h}`:h,o=o?`${o}
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,a,!0),this.lexer.state.top=d,i.length===0)break;let f=a.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let m=f,y=m.raw+`
`+i.join(`
`),x=this.blockquote(y);a[a.length-1]=x,s=s.substring(0,s.length-m.raw.length)+x.raw,o=o.substring(0,o.length-m.text.length)+x.text;break}else if(f?.type==="list"){let m=f,y=m.raw+`
`+i.join(`
`),x=this.list(y);a[a.length-1]=x,s=s.substring(0,s.length-f.raw.length)+x.raw,o=o.substring(0,o.length-m.raw.length)+x.raw,i=y.substring(a.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:o}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",u="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let d=r[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),f=t.split(`
`,1)[0],m=!d.trim(),y=0;if(this.options.pedantic?(y=2,u=d.trimStart()):m?y=r[1].length+1:(y=r[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,u=d.slice(y),y+=r[1].length),m&&this.rules.other.blankLine.test(f)&&(h+=f+`
`,t=t.substring(f.length+1),c=!0),!c){let k=this.rules.other.nextBulletRegex(y),T=this.rules.other.hrRegex(y),S=this.rules.other.fencesBeginRegex(y),_=this.rules.other.headingBeginRegex(y),L=this.rules.other.htmlBeginRegex(y);for(;t;){let A=t.split(`
`,1)[0],F;if(f=A,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),F=f):F=f.replace(this.rules.other.tabCharGlobal," "),S.test(f)||_.test(f)||L.test(f)||k.test(f)||T.test(f))break;if(F.search(this.rules.other.nonSpaceChar)>=y||!f.trim())u+=`
`+F.slice(y);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(d)||_.test(d)||T.test(d))break;u+=`
`+f}!m&&!f.trim()&&(m=!0),h+=A+`
`,t=t.substring(A.length+1),d=F.slice(y)}}o.loose||(n?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let x=null,C;this.options.gfm&&(x=this.rules.other.listIsTask.exec(u),x&&(C=x[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!x,checked:C,loose:!1,text:u,tokens:[]}),o.raw+=h}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let c=0;c<o.items.length;c++)if(this.lexer.state.top=!1,o.items[c].tokens=this.lexer.blockTokens(o.items[c].text,[]),!o.loose){let h=o.items[c].tokens.filter(d=>d.type==="space"),u=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));o.loose=u}if(o.loose)for(let c=0;c<o.items.length;c++)o.items[c].loose=!0;return o}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:s,title:o}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=au(r[1]),s=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===s.length){for(let n of s)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of o)a.rows.push(au(n,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=ss(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=yT(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let s=r[2],o="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],o=a[3])}else o=r[3]?r[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),nu(r,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=r[s.toLowerCase()];if(!o){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return nu(i,o,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!i||this.rules.inline.punctuation.exec(i))){let o=[...s[0]].length-1,a,n,l=o,c=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+o);(s=h.exec(r))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(n=[...a].length,s[3]||s[4]){l+=n;continue}else if((s[5]||s[6])&&o%3&&!((o+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let u=[...s[0]][0].length,d=t.slice(0,o+s.index+u+n);if(Math.min(o,n)%2){let m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,s;return r[2]==="@"?(i=r[1],s="mailto:"+i):(i=r[1],s=i),{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let o;do o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(o!==r[0]);i=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Re=class Gn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||oi,this.options.tokenizer=this.options.tokenizer||new Ho,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ye,block:so.normal,inline:is.normal};this.options.pedantic?(r.block=so.pedantic,r.inline=is.pedantic):this.options.gfm&&(r.block=so.gfm,this.options.breaks?r.inline=is.breaks:r.inline=is.gfm),this.tokenizer.rules=r}static get rules(){return{block:so,inline:is}}static lex(t,r){return new Gn(r).lex(t)}static lexInline(t,r){return new Gn(r).inlineTokens(t)}lex(t){t=t.replace(ye.carriageReturn,`
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(ye.tabCharGlobal," ").replace(ye.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let a=r.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
`:r.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+s.raw,a.text+=`
`+s.text,this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+s.raw,a.text+=`
`+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),r.push(s);continue}let o=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+s.raw,a.text+=`
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s),i=o.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+s.raw,a.text+=`
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)o=s[2]?s[2].length:0,i=i.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},u),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},Yo=class{options;parser;constructor(t){this.options=t||oi}space(t){return""}code({text:t,lang:r,escaped:i}){let s=(r||"").match(ye.notSpaceStart)?.[0],o=t.replace(ye.endingNewline,"")+`
`;return s?'<pre><code class="language-'+Ge(s)+'">'+(i?o:Ge(o,!0))+`</code></pre>
`:"<pre><code>"+(i?o:Ge(o,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
`}hr(t){return`<hr>
`}list(t){let r=t.ordered,i=t.start,s="";for(let n=0;n<t.items.length;n++){let l=t.items[n];s+=this.listitem(l)}let o=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+o+a+`>
`+s+"</"+o+`>
`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Ge(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let r="",i="";for(let o=0;o<t.header.length;o++)i+=this.tablecell(t.header[o]);r+=this.tablerow({text:i});let s="";for(let o=0;o<t.rows.length;o++){let a=t.rows[o];i="";for(let n=0;n<a.length;n++)i+=this.tablecell(a[n]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
<thead>
`+r+`</thead>
`+s+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ge(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let s=this.parser.parseInline(i),o=ou(t);if(o===null)return s;t=o;let a='<a href="'+t+'"';return r&&(a+=' title="'+Ge(r)+'"'),a+=">"+s+"</a>",a}image({href:t,title:r,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let o=ou(t);if(o===null)return Ge(i);t=o;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Ge(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ge(t.text)}},Jl=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ne=class Xn{options;renderer;textRenderer;constructor(t){this.options=t||oi,this.options.renderer=this.options.renderer||new Yo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Jl}static parse(t,r){return new Xn(r).parse(t)}static parseInline(t,r){return new Xn(r).parseInline(t)}parse(t,r=!0){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=o,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let a=o;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,l=this.renderer.text(n);for(;s+1<t.length&&t[s+1].type==="text";)n=t[++s],l+=`
`+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=this.options.extensions.renderers[o.type].call({parser:this},o);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=n||"";continue}}let a=o;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},gs=class{options;block;constructor(t){this.options=t||oi}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Re.lex:Re.lexInline}provideParser(){return this.block?Ne.parse:Ne.parseInline}},CT=class{defaults=Ul();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ne;Renderer=Yo;TextRenderer=Jl;Lexer=Re;Tokenizer=Ho;Hooks=gs;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let s of t)switch(i=i.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let a of o.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of o.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,r));break}default:{let o=s;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let n=o[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let a=r.renderers[o.name];a?r.renderers[o.name]=function(...n){let l=o.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[o.level];a?a.unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(r.childTokens[o.name]=o.childTokens)}),s.extensions=r),i.renderer){let o=this.defaults.renderer||new Yo(this.defaults);for(let a in i.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=o[n];o[n]=(...h)=>{let u=l.apply(o,h);return u===!1&&(u=c.apply(o,h)),u||""}}s.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Ho(this.defaults);for(let a in i.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=o[n];o[n]=(...h)=>{let u=l.apply(o,h);return u===!1&&(u=c.apply(o,h)),u}}s.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new gs;for(let a in i.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=o[n];gs.passThroughHooks.has(a)?o[n]=h=>{if(this.defaults.async&&gs.passThroughHooksRespectAsync.has(a))return(async()=>{let d=await l.call(o,h);return c.call(o,d)})();let u=l.call(o,h);return c.call(o,u)}:o[n]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(o,h);return d===!1&&(d=await c.apply(o,h)),d})();let u=l.apply(o,h);return u===!1&&(u=c.apply(o,h)),u}}s.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,a=i.walkTokens;s.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),o&&(l=l.concat(o.call(this,n))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Re.lex(t,r??this.defaults)}parser(t,r){return Ne.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let s={...i},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option Line truncated
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Ge(i.message+"",!0)+"</pre>";return r?Promise.resolve(s):s}if(r)return Promise.reject(i);throw i}}},ti=new CT;function Wt(e,t){return ti.parse(e,t)}Wt.options=Wt.setOptions=function(e){return ti.setOptions(e),Wt.defaults=ti.defaults,Bp(Wt.defaults),Wt};Wt.getDefaults=Ul;Wt.defaults=oi;Wt.use=function(...e){return ti.use(...e),Wt.defaults=ti.defaults,Bp(Wt.defaults),Wt};Wt.walkTokens=function(e,t){return ti.walkTokens(e,t)};Wt.parseInline=ti.parseInline;Wt.Parser=Ne;Wt.parser=Ne.parse;Wt.Renderer=Yo;Wt.TextRenderer=Jl;Wt.Lexer=Re;Wt.lexer=Re.lex;Wt.Tokenizer=Ho;Wt.Hooks=gs;Wt.parse=Wt;Wt.options;Wt.setOptions;Wt.use;Wt.walkTokens;Wt.parseInline;Ne.parse;Re.lex;function Rp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var s=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var u,d;return(d=(u=h.match(/[\t ]/g))===null||u===void 0?void 0:u.length)!==null&&d!==void 0?d:0})):n},[]);if(s.length){var o=new RegExp(`
[ ]{`.concat(Math.min.apply(Math,s),"}"),"g");i=i.map(function(n){return n.replace(o,`
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(n,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",u=n;typeof n=="string"&&n.includes(`
`)&&(u=String(n).split(`
`).map(function(d,f){return f===0?d:"".concat(h).concat(d)}).join(`
`)),a+=u+i[l+1]}),a}var Vn=typeof performance<"u"&&typeof performance.now=="function",gi=p(()=>Vn?performance.now():0,"now"),qa="🧜 ",bT="Mermaid render",kT="Mermaid",wT={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},Wi;Wi=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(t){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(t))}tickSync(t,r){if(!this.enabled)return r();const i=gi();try{return r()}finally{this.buckets[t]=(this.buckets[t]??0)+(gi()-i)}}async tick(t,r){if(!this.enabled)return r();const i=gi();try{return await r()}finally{this.buckets[t]=(this.buckets[t]??0)+(gi()-i)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();const t=this.roots.at(-1),r=this.runLabel??t?.name;return t&&(this.records.push({label:r??t.name,tree:t,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(t,r)),this.runLabel=void 0,t}begin(t){if(!this.enabled)return;const r={name:t,start:gi(),duration:-1,children:[]},i=this.stack.at(-1);if(i?i.children.push(r):this.roots.push(r),this.stack.push(r),Vn&&typeof performance.mark=="function")try{performance.mark(`${qa}${t} ▶`)}catch{}}end(){if(!this.enabled)return;const t=this.stack.pop();if(!t)return;const r=gi();if(t.duration=r-t.start,Vn&&typeof performance.measure=="function")try{performance.measure(`${qa}${t.name}`,{start:t.start,end:r,detail:{devtools:{dataType:"track-entry",track:bT,trackGroup:kT,color:wT[t.name]??"primary",tooltipText:`${t.name} — ${t.duration.toFixed(1)} ms`}}})}catch{}}async span(t,r){if(!this.enabled)return r();this.begin(t);try{return await r()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(t=this.report(),r){if(!t)return;const i=t.duration,s=r&&r!==t.name?`${t.name} [${r}]`:t.name,o=["ms % phase"],a=p((l,c)=>{const h=" ".repeat(c),u=l.duration.toFixed(1).padStart(8),d=i>0?`${(l.duration/i*100).toFixed(0).padStart(3)}%`:" -";o.push(`${u} ${d} ${h}${l.name}`);for(const f of l.children)a(f,c+1);if(l.children.length>0){const f=l.children.reduce((y,x)=>y+x.duration,0),m=l.duration-f;if(m>.5){const y=m.toFixed(1).padStart(8);o.push(`${y} ${h} (self)`)}}},"walk");a(t,0);const n=Object.keys(this.buckets);if(n.length>0){o.push("—— buckets (summed) ——");for(const l of n)o.push(`${this.buckets[l].toFixed(1).padStart(8)} ${l}`)}console.log(`${qa}mermaid render profile · ${s}
${o.join(`
`)}`)}},p(Wi,"Profiler");globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};var TT=$w.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(Iw),ei=TT;function Np(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
`).replace(/\n{2,}/g,`
`);return Rp(i)}p(Np,"preprocessMarkdown");function qp(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(qp,"nonMarkdownToLines");function Wp(e,t={}){const r=Np(e,t),i=Wt.lexer(r),s=[[]];let o=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
`).forEach((h,u)=>{u!==0&&(o++,s.push([])),h.split(" ").forEach(d=>{d=d.replace(/&#39;/g,"'"),d&&s[o].push({content:d,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&s[o].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?s[o].push({content:n.text,type:"normal"}):s[o].push({content:n.raw,type:"normal"})}),s}p(Wp,"markdownToLines");function zp(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}p(zp,"nonMarkdownToHTML");function Hp(e,{markdownAutoWrap:t}={}){const r=Wt.lexer(e);function i(s){return s.type==="text"?t===!1?s.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):s.text.replace(/\n */g,"<br/>"):s.type==="strong"?`<strong>${s.tokens?.map(i).join("")}</strong>`:s.type==="em"?`<em>${s.tokens?.map(i).join("")}</em>`:s.type==="paragraph"?`<p>${s.tokens?.map(i).join("")}</p>`:s.type==="space"?"":s.type==="html"?`${s.text}`:s.type==="escape"?s.text:(P.warn(`Unsupported markdown: ${s.type}`),s.raw)}return p(i,"output"),r.map(i).join("")}p(Hp,"markdownToHTML");function Yp(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(Yp,"splitTextToChars");function Up(e,t){const r=Yp(t.content);return th(e,[],r,t.type)}p(Up,"splitWordToFitWidth");function th(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[s,...o]=r,a=[...t,s];return e([{content:a.join(""),type:i}])?th(e,a,o,i):(t.length===0&&s&&(t.push(s),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(th,"splitWordToFitWidthRecursion");function jp(e,t){if(e.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Uo(e,t)}p(jp,"splitLineToFitWidth");function Uo(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let s="";e[0].content===" "&&(s=" ",e.shift());const o=e.shift()??{content:" ",type:"normal"},a=[...i];if(s!==""&&a.push({content:s,type:"normal"}),a.push(o),t(a))return Uo(e,t,r,a);if(i.length>0)r.push(i),e.unshift(o);else if(o.content){const[n,l]=Up(t,o);r.push([n]),l.content&&e.unshift(l)}return Uo(e,t,r)}p(Uo,"splitLineToFitWidthRecursion");function Zn(e,t){t&&e.attr("style",t)}p(Zn,"applyStyle");var lu=16384;async function Gp(e,t,r,i,s=!1,o=Ut()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,lu)}px`),a.attr("height",`${Math.min(10*r,lu)}px`);const n=a.append("xhtml:div"),l=Ls(t.label)?await cf(t.label.replace(Ws.lineBreakRegex,`
`),o):$e(t.label,o),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");return h.html(l),Zn(h,t.labelStyle),h.attr("class",`${c} ${i}`),Zn(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&n.attr("class","labelBkg"),(await ei.measure(()=>n.node().getBoundingClientRect())).width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px")),a.node()}p(Gp,"addHtmlSpan");function ha(e,t,r,i=!1){const s=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&s.attr("text-anchor","middle"),s}p(ha,"createTspan");function Xp(e,t,r){const i=e.append("text"),s=ha(i,1,t);ca(s,r);const o=s.node().getComputedTextLength();return i.remove(),o}p(Xp,"computeWidthOfText");function ST(e,t,r){const i=e.append("text"),s=ha(i,1,t);ca(s,[{content:r,type:"normal"}]);const o=s.node()?.getBoundingClientRect();return o&&i.remove(),o}p(ST,"computeDimensionOfText");function Vp(e,t,r,i=!1,s=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");s&&l.attr("text-anchor","middle");let c=0;for(const h of r){const u=p(f=>Xp(a,1.1,f)<=e,"checkWidth"),d=u(h)?[h]:jp(h,u);for(const f of d){const m=ha(l,c,1.1,s);ca(m,f),c++}}if(i){const h=l.node().getBBox(),u=2;return n.attr("x",h.x-u).attr("y",h.y-u).attr("width",h.width+2*u).attr("height",h.height+2*u),a.node()}else return l.node()}p(Vp,"createFormattedText");function Kn(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(Kn,"decodeHTMLEntities");function ca(e,t){e.text(""),t.forEach((r,i)=>{const s=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?s.text(Kn(r.content)):s.text(" "+Kn(r.content))})}p(ca,"updateTextContentAndStyles");async function Zp(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(s,o,a)=>(r.push((async()=>{const n=`${o}:${a}`;return await O2(n)?await Ys(n,void 0,{class:"label-icon"}):`<i class='${$e(s,t).replace(":"," ")}'></i>`})()),s));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(Zp,"replaceIconSubstring");var Ye=p(async(e,t="",{style:r="",isTitle:i=!1,classes:s="",useHtmlLabels:o=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(P.debug("XYZ createText",t,r,i,s,o,n,"addSvgBackground: ",c),o){const u=a?Hp(t,h):zp(t),d=await Zp(Dr(u),h),f=t.replace(/\\\\/g,"\\"),m={isNode:n,label:Ls(t)?f:d,labelStyle:r.replace("fill:","color:")};return await Gp(e,m,l,s,c,h)}else{const u=Dr(t.replace(/<br\s*\/?>/g,"<br/>")),d=a?Wp(u.replace("<br>","<br/>"),h):qp(u),f=Vp(l,e,d,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ft(f).attr("style",m)}else{const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ft(f).select("rect").attr("style",m.replace(/background:/g,"fill:"));const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ft(f).select("text").attr("style",y)}return i?Ft(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Ft(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function Wa(e,t,r){if(e&&e.length){const[i,s]=t,o=Math.PI/180*r,a=Math.cos(o),n=Math.sin(o);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-s)*n+i,l[1]=(c-i)*n+(h-s)*a+s}}}function _T(e,t){return e[0]===t[0]&&e[1]===t[1]}function vT(e,t,r,i=1){const s=r,o=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(s)for(const c of a)Wa(c,n,s);const l=(function(c,h,u){const d=[];for(const k of c){const T=[...k];_T(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&d.push(T)}const f=[];h=Math.max(h,.1);const m=[];for(const k of d)for(let T=0;T<k.length-1;T++){const S=k[T],_=k[T+1];if(S[1]!==_[1]){const L=Math.min(S[1],_[1]);m.push({ymin:L,ymax:Math.max(S[1],_[1]),x:L===S[1]?S[0]:_[0],islope:(_[0]-S[0])/(_[1]-S[1])})}}if(m.sort(((k,T)=>k.ymin<T.ymin?-1:k.ymin>T.ymin?1:k.x<T.x?-1:k.x>T.x?1:k.ymax===T.ymax?0:(k.ymax-T.ymax)/Math.abs(k.ymax-T.ymax))),!m.length)return f;let y=[],x=m[0].ymin,C=0;for(;y.length||m.length;){if(m.length){let k=-1;for(let T=0;T<m.length&&!(m[T].ymin>x);T++)k=T;m.splice(0,k+1).forEach((T=>{y.push({s:x,edge:T})}))}if(y=y.filter((k=>!(k.edge.ymax<=x))),y.sort(((k,T)=>k.edge.x===T.edge.x?0:(k.edge.x-T.edge.x)/Math.abs(k.edge.x-T.edge.x))),(u!==1||C%h==0)&&y.length>1)for(let k=0;k<y.lengthLine truncated
M ${s.x},${s.y} L ${a.x},${a.y}`}p(bg,"createLine");function kg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r,t.label="";const s=e.insert("g").attr("class",yt(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:a}=t,n=lt.svg(s),l=nt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,o*2,l),h=bg(o),u=n.path(h,l),d=s.insert(()=>c,":first-child");return d.insert(()=>u),d.attr("class","outer-path"),a&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),ut(t,d),t.intersect=function(f){return P.info("crossedCircle intersect",t,{radius:o,point:f}),ot.circle(t,o,f)},s}p(kg,"crossedCircle");function pr(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const d=n+u*h,f=e+r*Math.cos(d),m=t+r*Math.sin(d);a.push({x:-f,y:-m})}return a}p(pr,"generateCirclePoints");async function wg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await mt(e,t,yt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+n,h=o.height+l,u=Math.max(5,h*.1),{cssStyles:d}=t,f=[...pr(c/2,-h/2,u,30,-90,0),{x:-c/2-u,y:u},...pr(c/2+u*2,-u,u,20,-180,-270),...pr(c/2+u*2,u,u,20,-90,-180),{x:-c/2-u,y:-h/2},...pr(c/2,h/2,u,20,0,90)],m=[{x:c/2,y:-h/2-u},{x:-c/2,y:-h/2-u},...pr(c/2,-h/2,u,20,-90,0),{x:-c/2-u,y:-u},...pr(c/2+c*.1,-u,u,20,-180,-270),...pr(c/2+c*.1,u,u,20,-90,-180),{x:-c/2-u,y:h/2},...pr(c/2,h/2,u,20,0,90),{x:-c/2,y:h/2+u},{x:c/2,y:h/2+u}],y=lt.svg(s),x=nt(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=Rt(f).replace("Z",""),T=y.path(k,x),S=Rt(m),_=y.path(S,{...x}),L=s.insert("g",":first-child");return L.insert(()=>_,":first-child").attr("stroke-opacity",0),L.insert(()=>T,":first-child"),L.attr("class","text"),d&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${u}, 0)`),a.attr("transform",`translate(${-c/2+u-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ut(t,L),t.intersect=function(A){return ot.polygon(t,m,A)},s}p(wg,"curlyBraceLeft");function gr(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const d=n+u*h,f=e+r*Math.cos(d),m=t+r*Math.sin(d);a.push({x:f,y:m})}return a}p(gr,"generateCirclePoints");async function Tg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await mt(e,t,yt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),u=Math.max(5,h*.1),{cssStyles:d}=t,f=[...gr(c/2,-h/2,u,20,-90,0),{x:c/2+u,y:-u},...gr(c/2+u*2,-u,u,20,-180,-270),...gr(c/2+u*2,u,u,20,-90,-180),{x:c/2+u,y:h/2},...gr(c/2,h/2,u,20,0,90)],m=[{x:-c/2,y:-h/2-u},{x:c/2,y:-h/2-u},...gr(c/2,-h/2,u,20,-90,0),{x:c/2+u,y:-u},...gr(c/2+u*2,-u,u,20,-180,-270),...gr(c/2+u*2,u,u,20,-90,-180),{x:c/2+u,y:h/2},...gr(c/2,h/2,u,20,0,90),{x:c/2,y:h/2+u},{x:-c/2,y:h/2+u}],y=lt.svg(s),x=nt(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=Rt(f).replace("Z",""),T=y.path(k,x),S=Rt(m),_=y.path(S,{...x}),L=s.insert("g",":first-child");return L.insert(()=>_,":first-child").attr("stroke-opacity",0),L.insert(()=>T,":first-child"),L.attr("class","text"),d&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${-u}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ut(t,L),t.intersect=function(A){return ot.polygon(t,m,A)},s}p(Tg,"curlyBraceRight");function ae(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const d=n+u*h,f=e+r*Math.cos(d),m=t+r*Math.sin(d);a.push({x:-f,y:-m})}return a}p(ae,"generateCirclePoints");async function Sg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await mt(e,t,yt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),u=Math.max(5,h*.1),{cssStyles:d}=t,f=[...ae(c/2,-h/2,u,30,-90,0),{x:-c/2-u,y:u},...ae(c/2+u*2,-u,u,20,-180,-270),...ae(c/2+u*2,u,u,20,-90,-180),{x:-c/2-u,y:-h/2},...ae(c/2,h/2,u,20,0,90)],m=[...ae(-c/2+u+u/2,-h/2,u,20,-90,-180),{x:c/2-u/2,y:u},...ae(-c/2-u/2,-u,u,20,0,90),...ae(-c/2-u/2,u,u,20,-90,0),{x:c/2-u/2,y:-u},...ae(-c/2+u+u/2,h/2,u,30,-180,-270)],y=[{x:c/2,y:-h/2-u},{x:-c/2,y:-h/2-u},...ae(c/2,-h/2,u,20,-90,0),{x:-c/2-u,y:-u},...ae(c/2+u*2,-u,u,20,-180,-270),...ae(c/2+u*2,u,u,20,-90,-180),{x:-c/2-u,y:h/2},...ae(c/2,h/2,u,20,0,90),{x:-c/2,y:h/2+u},{x:c/2-u-u/2,y:h/2+u},...ae(-c/2+u+u/2,-h/2,u,20,-90,-180),{x:c/2-u/2,y:u},...ae(-c/2-u/2,-u,u,20,0,90),...ae(-c/2-u/2,u,u,20,-90,0),{x:c/2-u/2,y:-u Line truncated
a${s},${o} 0,0,1 0,${-i}
l${r},0
a${s},${o} 0,0,1 0,${i}
M${r},${-i}
a${s},${o} 0,0,0 0,${i}
l${-r},0`,"createCylinderPathD"),uS=p((e,t,r,i,s,o)=>[`M${e},${t}`,`M${e+r},${t}`,`a${s},${o} 0,0,0 0,${-i}`,`l${-r},0`,`a${s},${o} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),dS=p((e,t,r,i,s,o)=>[`M${e+r/2},${-i/2}`,`a${s},${o} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Bu=5,Lu=10;async function pm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?12:s/2,a=t.height??0;if(t.height&&(t.height=t.height-o,t.height<Bu&&(t.height=Bu)),t.width){const C=a/2/(2.5+a/50);t.width=t.width-o-C*3,t.width<Lu&&(t.width=Lu)}const{shapeSvg:n,bbox:l,label:c}=await mt(e,t,yt(t)),h=Math.max(t.height??0,l.height)+o,u=h/2,d=u/(2.5+h/50),f=Math.max(t.width??0,l.width)+d+o,{cssStyles:m}=t;let y;if(t.look==="handDrawn"){const x=lt.svg(n),C=uS(0,0,f,h,d,u),k=dS(0,0,f,h,d,u),T=x.path(C,nt(t,{})),S=x.path(k,nt(t,{fill:"none"}));y=n.insert(()=>S,":first-child"),y=n.insert(()=>T,":first-child"),y.attr("class","basic label-container"),m&&y.attr("style",m)}else{const x=cS(0,0,f,h,d,u);y=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",Qt(m)).attr("style",i),y.attr("class","basic label-container outer-path"),m&&y.selectAll("path").attr("style",m),i&&y.selectAll("path").attr("style",i)}return y.attr("label-offset-x",d),y.attr("transform",`translate(${-f/2}, ${h/2} )`),c.attr("transform",`translate(${-(l.width/2)-d-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ut(t,y),t.intersect=function(x){const C=ot.rect(t,x),k=C.y-(t.y??0);if(u!=0&&(Math.abs(k)<(t.height??0)/2||Math.abs(k)==(t.height??0)/2&&Math.abs(C.x-(t.x??0))>(t.width??0)/2-d)){let T=d*d*(1-k*k/(u*u));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,x.x-(t.x??0)>0&&(T=-T),C.x+=T}return C},n}p(pm,"tiltedCylinder");async function gm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=(t.look==="neo",s),a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await mt(e,t,yt(t)),c=Math.max(l.height+o,t.height??0),h=Math.max(l.width+a,(t.width??0)-c),u=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=lt.svg(n),y=nt(t,{}),x=Rt(u),C=m.path(x,y);d=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&d.attr("style",f)}else d=or(n,h,c,u);return i&&d.attr("style",i),t.width=h,t.height=c,ut(t,d),t.intersect=function(m){return ot.polygon(t,u,m)},n}p(gm,"trapezoid");async function mm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-o*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await mt(e,t,yt(t)),u=(t?.width?t?.width:h.width)+o*2,d=(t?.height?t?.height:h.height)+a*2,{cssStyles:f}=t,m=lt.svg(c),y=nt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-u/2*.8,y:-d/2},{x:u/2*.8,y:-d/2},{x:u/2,y:-d/2*.6},{x:u/2,y:d/2},{x:-u/2,y:d/2},{x:-u/2,y:-d/2*.6}],C=Rt(x),k=m.path(C,y),T=c.insert(()=>k,":first-child");return T.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ut(t,T),t.intersect=function(S){return ot.polygon(t,x,S)},c}p(mm,"trapezoidalPentagon");var Fu=10,Au=10;async function ym(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?s*2:s;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<Au&&(t.width=Au),t.height=t?.height??0,t.height<Fu&&(t.height=Fu));const{shapeSvg:a,bbox:n,label:l}=await mt(e,t,yt(t)),c=ir($t().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+o,u=t?.height?t?.height:h+n.height,d=u,f=[{x:0,y:0},{x:d,y:0},{x:d/2,y:-u}],{cssStyles:m}=t,y=lt.svg(a),x=nt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Rt(f),k=y.path(C,x),T=a.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),t.width=h,t.height=u,ut(t,T),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${u/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(S){return P.info("Triangle intersect",t,f,S),ot.polygon(t,f,S)},a}p(ym,"triangle");async function xm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await mt(e,t,yt(t)),u=(t?.width?t?.width:c.width)+(o??0)*2,d=(t?.height?t?.height:c.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,m=d+(n?f:-f),{cssStyles:y}=t,C=14-u,k=C>0?C/2:0,T=lt.svg(l),S=nt(t,{});t.look!=="ha Line truncated
M${f-jt},${m} L${f+u},${m}
M${f},${m-jt} L${f},${m+d}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=x.path(T,C),_=a.insert(()=>S,":first-child");return _.attr("transform",`translate(${jt/2}, ${jt/2})`),_.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+jt/2-(n.x-(n.left??0))}, ${-(n.height/2)+jt/2-(n.y-(n.top??0))})`),ut(t,_),t.intersect=function(L){return ot.polygon(t,k,L)},a}p(bm,"windowPane");var Eu=new Set(["redux-color","redux-dark-color"]),fS=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function nh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:s}=Ut(),{rowEven:o,rowOdd:a,nodeBorder:n,borderColorArray:l}=s;if(t.look==="handDrawn"){const{themeVariables:st}=Ut(),{background:kt}=st,xt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${kt}`]};await nh(e,xt)}const c=Ut();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,u=c.er?.entityPadding??6;const{cssStyles:d}=t,{labelStyles:f,nodeStyles:m}=dt(t);if(r.attributes.length===0&&t.label){const st={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};br(t.label,c)+st.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const kt=await Zi(e,t,st);if(i!=null&&Eu.has(i)){const xt=r.colorIndex??0;kt.attr("data-color-id",`color-${xt%l.length}`)}if(!ir(c.htmlLabels)){const xt=kt.select("text"),wt=xt.node()?.getBBox();xt.attr("transform",`translate(${-wt.width/2}, 0)`)}return kt}c.htmlLabels||(h*=1.25,u*=1.25);let y=yt(t);y||(y="node default");const x=e.insert("g").attr("class",y).attr("id",t.domId||t.id),C=await Ci(x,t.label??"",c,0,0,["name"],f);C.height+=u;let k=0;const T=[],S=[];let _=0,L=0,A=0,F=0,V=!0,Y=!0;for(const st of r.attributes){const kt=await Ci(x,st.type,c,0,k,["attribute-type"],f);_=Math.max(_,kt.width+h);const xt=await Ci(x,st.name,c,0,k,["attribute-name"],f);L=Math.max(L,xt.width+h);const wt=await Ci(x,st.keys.join(),c,0,k,["attribute-keys"],f);A=Math.max(A,wt.width+h);const It=await Ci(x,st.comment,c,0,k,["attribute-comment"],f);F=Math.max(F,It.width+h);const Mt=Math.max(kt.height,xt.height,wt.height,It.height)+u;S.push({yOffset:k,rowHeight:Mt}),k+=Mt}let R=4;A<=h&&(V=!1,A=0,R--),F<=h&&(Y=!1,F=0,R--);const it=x.node().getBBox();if(C.width+h*2-(_+L+A+F)>0){const st=C.width+h*2-(_+L+A+F);_+=st/R,L+=st/R,A>0&&(A+=st/R),F>0&&(F+=st/R)}const U=_+L+A+F,E=lt.svg(x),O=nt(t,{});t.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");let B=0;S.length>0&&(B=S.reduce((st,kt)=>st+(kt?.rowHeight??0),0));const N=Math.max(it.width+h*2,t?.width||0,U),D=Math.max((B??0)+C.height,t?.height||0),rt=-N/2,tt=-D/2;if(x.selectAll("g:not(:first-child)").each((st,kt,xt)=>{const wt=Ft(xt[kt]),It=wt.attr("transform");let Mt=0,ee=0;if(It){const Be=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(It);Be&&(Mt=parseFloat(Be[1]),ee=parseFloat(Be[2]),wt.attr("class").includes("attribute-name")?Mt+=_:wt.attr("class").includes("attribute-keys")?Mt+=_+L:wt.attr("class").includes("attribute-comment")&&(Mt+=_+L+A))}wt.attr("transform",`translate(${rt+h/2+Mt}, ${ee+tt+C.height+u/2})`)}),x.select(".name").attr("transform","translate("+-C.width/2+", "+(tt+u/2)+")"),i!=null&&Eu.has(i)){const st=r.colorIndex??0;x.attr("data-color-id",`color-${st%l.length}`)}const pt=E.rectangle(rt,tt,N,D,O),St=x.insert(()=>pt,":first-child").attr("class","outer-path").attr("style",d.join(""));T.push(0);for(const[st,kt]of S.entries()){const wt=(st+1)%2===0&&kt.yOffset!==0,It=E.rectangle(rt,C.height+tt+kt?.yOffset,N,kt?.rowHeight,{...O,fill:wt?o:a,stroke:n});x.insert(()=>It,"g.label").attr("style",d.join("")).attr("class",`row-rect-${wt?"even":"odd"}`)}const Tt=1e-4;let ft=bi(rt,C.height+tt,N+rt,C.height+tt,Tt),Bt=E.polygon(ft.map(st=>[st.x,st.y]),O);if(x.insert(()=>Bt).attr("class","divider"),ft=bi(_+rt,C.height+tt,_+rt,D+tt,Tt),Bt=E.polygon(ft.map(st=>[st.x,st.y]),O),x.insert(()=>Bt).attr("class","divider"),V){const st=_+L+rt;ft=bi(st,C.height+tt,st,D+tt,Tt),Bt=E.polygon(ft.map(kt=>[kt.x,kt.y]),O),x.insert(()=>Bt).attr("class","divider")}if(Y){const st=_+L+A+rt;ft=bi(st,C.height+tt,st,D+tt,Tt),Bt=E.polygon(ft.map(kt=>[kt.x,kt.y]),O),x.insert(()=>Bt).attr("class","divider")}for(const st of T){const kt=C.height+tt+st;ft=bi(rt,kt,N+rt,kt,Tt),Bt=E.polygon(ft.map(xt=>[xt.x,xt.y]),O),x.insert(()=>Bt).attr("class","divider")}if(ut(t,St),m&&t.look!=="handDrawn")if(i!=null&&fS.has(i))x.selectAll("path").attr("style",m);else{const kt=m.split(";")?.filter(xt=>xt.includes("stroke"))?.map(xt=>`${xt}`).join("; ");x.selectAll("path").attr("style",kt??""),x.selectAll(".row-rect-even path").attr("style",m)}return t.intersect=function(st){return ot.rect(t,st)},x}p(nh,"erBox");async function Ci(e,t,r,i=0,s=0,o=[],a=""){const n=e.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${i}, ${s})`).attr("styl Line truncated
a${h},${h} 1 0,0 ${m*.25},${-1*y*.1}
a${h},${h} 1 0,0 ${m*.25},0
a${h},${h} 1 0,0 ${m*.25},0
a${h},${h} 1 0,0 ${m*.25},${y*.1}
a${h},${h} 1 0,0 ${m*.15},${y*.33}
a${h*.8},${h*.8} 1 0,0 0,${y*.34}
a${h},${h} 1 0,0 ${-1*m*.15},${y*.33}
a${h},${h} 1 0,0 ${-1*m*.25},${y*.15}
a${h},${h} 1 0,0 ${-1*m*.25},0
a${h},${h} 1 0,0 ${-1*m*.25},0
a${h},${h} 1 0,0 ${-1*m*.25},${-1*y*.15}
a${h},${h} 1 0,0 ${-1*m*.1},${-1*y*.33}
a${h*.8},${h*.8} 1 0,0 0,${-1*y*.34}
a${h},${h} 1 0,0 ${m*.1},${-1*y*.33}
H0 V0 Z`;if(t.look==="handDrawn"){const k=lt.svg(s),T=nt(t,{}),S=k.path(C,T);x=s.insert(()=>S,":first-child"),x.attr("class","basic label-container").attr("style",Qt(u))}else x=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return x.attr("transform",`translate(${-m/2}, ${-y/2})`),ut(t,x),t.calcIntersect=function(k,T){return ot.rect(k,T)},t.intersect=function(k){return P.info("Bang intersect",t,k),ot.rect(t,k)},s}p(_m,"bang");async function vm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await mt(e,t,yt(t)),l=o.width+2*a,c=o.height+2*a,h=.15*l,u=.25*l,d=.35*l,f=.2*l,{cssStyles:m}=t;let y;const x=`M0 0
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
a${d},${d} 1 0,1 ${l*.4},${-1*l*.1}
a${u},${u} 1 0,1 ${l*.35},${l*.2}
a${h},${h} 1 0,1 ${l*.15},${c*.35}
a${f},${f} 1 0,1 ${-1*l*.15},${c*.65}
a${u},${h} 1 0,1 ${-1*l*.25},${l*.15}
a${d},${d} 1 0,1 ${-1*l*.5},0
a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
H0 V0 Z`;if(t.look==="handDrawn"){const C=lt.svg(s),k=nt(t,{}),T=C.path(x,k);y=s.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Qt(m))}else y=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),y.attr("transform",`translate(${-l/2}, ${-c/2})`),ut(t,y),t.calcIntersect=function(C,k){return ot.rect(C,k)},t.intersect=function(C){return P.info("Cloud intersect",t,C),ot.rect(t,C)},s}p(vm,"cloud");async function Bm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await mt(e,t,yt(t)),l=o.width+8*a,c=o.height+2*a,h=5,u=t.look==="neo"?`
M${-l/2} ${c/2-h}
v${-c+2*h}
q0,-${h} ${h},-${h}
h${l-2*h}
q${h},0 ${h},${h}
v${c-h}
H${-l/2}
Z
`:`
M${-l/2} ${c/2-h}
v${-c+2*h}
q0,-${h} ${h},-${h}
h${l-2*h}
q${h},0 ${h},${h}
v${c-2*h}
q0,${h} ${-h},${h}
h${-(l-2*h)}
q${-h},0 ${-h},${-h}
Z
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const d=s.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",u);return s.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),s.append(()=>n.node()),ut(t,d),t.calcIntersect=function(f,m){return ot.rect(f,m)},t.intersect=function(f){return ot.rect(t,f)},s}p(Bm,"defaultMindmapNode");async function Lm(e,t){const r={padding:t.padding??0};return ah(e,t,r)}p(Lm,"mindmapCircle");var gS=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:om},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:rm},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:am},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:cm},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Bg},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Lg},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:$g},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:dg},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Cg},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:gg},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:vg},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:ah},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:_m},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:vm},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Jg},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ig},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:jg},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Ug},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:gm},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Hg},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ag},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:fm},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:mg},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:im},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:hm},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:lm},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Og},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Pg},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:wg},{semanticName:"Comment Right",nam Line truncated
outsidePoint: ${JSON.stringify(t)}
insidePoint : ${JSON.stringify(r)}
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,o=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-o:a+o;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(s-t.y)*a>Math.abs(i-t.x)*l){let u=r.y<t.y?t.y-l-s:s-l-t.y;n=h*u/c;const d={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-u:r.y-c+u};return n===0&&(d.x=t.x,d.y=t.y),h===0&&(d.x=t.x),c===0&&(d.y=t.y),P.debug(`abc89 top/bottom calc, Q ${c}, q ${u}, R ${h}, r ${n}`,d),d}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let u=c*n/h,d=r.x<t.x?r.x+h-n:r.x-h+n,f=r.y<t.y?r.y+u:r.y-u;return P.debug(`sides calc abc89, Q ${c}, q ${u}, R ${h}, r ${n}`,{_x:d,_y:f}),n===0&&(d=t.x,f=t.y),h===0&&(d=t.x),c===0&&(f=t.y),{x:d,y:f}}},"intersection"),Du=p((e,t)=>{P.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],s=!1;return e.forEach(o=>{if(P.info("abc88 checking point",o,t),!DS(t,o)&&!s){const a=IS(t,i,o);P.debug("abc88 inside",o,i,a),P.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?P.warn("abc88 no intersect",a,r):r.push(a),s=!0}else P.warn("abc88 outside",o,i),i=o,s||r.push(o)}),P.debug("returning points",r),r},"cutPathAtIntersect");function Om(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],o=e[i],a=e[i+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(t.push(o),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(Om,"extractCornerPoints");var Iu=p(function(e,t,r){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=r/o;return{x:t.x-a*i,y:t.y-a*s}},"findAdjacentPoint"),PS=p(function(e){const{cornerPointPositions:t}=Om(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const s=e[i-1],o=e[i+1],a=e[i],n=Iu(s,a,5),l=Iu(o,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const u=Math.sqrt(2)*2;let d={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){P.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const f=5;a.x===n.x?d={x:c<0?n.x-f+u:n.x+f-u,y:h<0?n.y-u:n.y+u}:d={x:c<0?n.x-u:n.x+u,y:h<0?n.y-f+u:n.y+f-u}}else P.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));r.push(d,l)}else r.push(e[i]);return r},"fixCorners"),RS=p((e,t,r)=>{const i=e-t-r,s=2,o=2,a=s+o,n=Math.floor(i/a),l=Number.isFinite(n)?Math.max(0,n):0,c=Array(l).fill(`${s} ${o}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),Dm=p(function(e,t,r,i,s,o,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=$t();let h=t.points,u=!1;const d=s;var f=o;const m=[];for(const D in t.cssCompiledStyles)lp(D)||m.push(t.cssCompiledStyles[D]);if(c==="swimlane"){if(f.intersect&&d.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[d.intersect(h[0]),f.intersect(h[1])];else{const D=h.slice(1,-1),rt=D[0],tt=D[D.length-1],pt=.5,St=Math.abs(h[h.length-1].x-tt.x)<pt&&Math.abs(h[h.length-1].y-tt.y)<pt,Tt=d.intersect(rt),ft=St?tt:f.intersect(tt),Bt=Math.abs(ft.x-tt.x)<pt&&Math.abs(ft.y-tt.y)<pt,kt=Math.abs(Tt.x-rt.x)<pt&&Math.abs(Tt.y-rt.y)<pt?[]:[Tt],xt=Bt?[]:[ft];h=[...kt,...D,...xt]}h=OS(t,h)}else f.intersect&&d.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(d.intersect(h[0])),h.push(f.intersect(h[h.length-1])));const y=btoa(JSON.stringify(h));t.toCluster&&(P.info("to cluster abc88",r.get(t.toCluster)),h=Du(t.points,r.get(t.toCluster).node),u=!0),t.fromCluster&&(P.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=Du(h.reverse(),r.get(t.fromCluster).node).reverse(),u=!0);let x=h.filter(D=>!Number.isNaN(D.y));const C=ES(t.curve);C!=="rounded"&&(x=PS(x));let k=Ss;switch(C){case"linear":k=Ss;break;case"basis":k=zn;break;case"cardinal":k=Gf;break;case"bumpX":k=zf;break;case"bumpY":k=Hf;break;case"catmullRom":k=Vf;break;case"monotoneX":k=ep;break;case"monotoneY":k=rp;break;case"natural":k=sp;break;case"step":k=op;break;case"stepAfter":k=np;break;case"stepBefore":k=ap;break;case"rounded":k=Ss;break;default:k=zn}const{x:T,y:S}=BS(t),_=Jk().x(T).y(S).curve(k);let L;switch(t.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-invisible";break;default:L="edge-thickness-normal"}switch(t.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break;default:L+=" edge-pattern-solid"}let A,F=C==="rounded"?Im(Pm(x,t),5):_(x);const V=Array.isArray(t.style)?t.style:[t.style];let Y=V.find(D=>D?.startsWith("stroke:")),R="";t.animate&&(R="edge-animation-fast"),t.animation&&(R="edge-animation-"+t.animation);let it=!1;if(t.look==="handDrawn"){const D=lt.svg(e);Object.assign([],x);const rt=D.path(F,{roughness:.3,seed:l});L+=" transition",A=Ft(rt).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+L+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",V?V.reduce((pt,St)=>pt+";"+St,""):"");let tt=A Line truncated
L20,10
M20,10
L0,20`)},"requirement_arrow"),o_=p((e,t,r)=>{const i=Ut(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
L20,10
M20,10
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),a_=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),n_=p((e,t,r)=>{const i=Ut(),{themeVariables:s}=i,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),l_={extension:qS,composition:WS,aggregation:zS,dependency:HS,lollipop:YS,point:US,circle:jS,cross:GS,barb:XS,barbNeo:VS,only_one:ZS,zero_or_one:KS,one_or_more:QS,zero_or_more:JS,only_one_neo:t_,zero_or_one_neo:e_,one_or_more_neo:r_,zero_or_more_neo:i_,requirement_arrow:s_,requirement_contains:a_,requirement_arrow_neo:o_,requirement_contains_neo:n_},Rm=NS,Nm=typeof global=="object"&&global&&global.Object===Object&&global,h_=typeof self=="object"&&self&&self.Object===Object&&self,wr=Nm||h_||Function("return this")(),tr=wr.Symbol,qm=Object.prototype,c_=qm.hasOwnProperty,u_=qm.toString,hs=tr?tr.toStringTag:void 0;function d_(e){var t=c_.call(e,hs),r=e[hs];try{e[hs]=void 0;var i=!0}catch{}var s=u_.call(e);return i&&(t?e[hs]=r:delete e[hs]),s}var f_=Object.prototype,p_=f_.toString;function g_(e){return p_.call(e)}var m_="[object Null]",y_="[object Undefined]",Pu=tr?tr.toStringTag:void 0;function Ki(e){return e==null?e===void 0?y_:m_:Pu&&Pu in Object(e)?d_(e):g_(e)}function ri(e){return e!=null&&typeof e=="object"}var x_="[object Symbol]";function ch(e){return typeof e=="symbol"||ri(e)&&Ki(e)==x_}function Wm(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}var ve=Array.isArray,Ru=tr?tr.prototype:void 0,Nu=Ru?Ru.toString:void 0;function zm(e){if(typeof e=="string")return e;if(ve(e))return Wm(e,zm)+"";if(ch(e))return Nu?Nu.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function uh(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function pa(e){return e}var C_="[object AsyncFunction]",b_="[object Function]",k_="[object GeneratorFunction]",w_="[object Proxy]";function Zo(e){if(!uh(e))return!1;var t=Ki(e);return t==b_||t==k_||t==C_||t==w_}var Va=wr["__core-js_shared__"],qu=(function(){var e=/[^.]+$/.exec(Va&&Va.keys&&Va.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function T_(e){return!!qu&&qu in e}var S_=Function.prototype,__=S_.toString;function ni(e){if(e!=null){try{return __.call(e)}catch{}try{return e+""}catch{}}return""}var v_=/[\\^$.*+?()[\]{}|]/g,B_=/^\[object .+?Constructor\]$/,L_=Function.prototype,F_=Object.prototype,A_=L_.toString,E_=F_.hasOwnProperty,M_=RegExp("^"+A_.call(E_).replace(v_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $_(e){if(!uh(e)||T_(e))return!1;var t=Zo(e)?M_:B_;return t.test(ni(e))}function O_(e,t){return e?.[t]}function li(e,t){var r=O_(e,t);return $_(r)?r:void 0}var ol=li(wr,"WeakMap");function D_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function I_(){}var P_=800,R_=16,N_=Date.now;function q_(e){var t=0,r=0;return function(){var i=N_(),s=R_-(i-r);if(r=i,s>0){if(++t>=P_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Cs(e){return function(){return e}}var Wu=(function(){try{var e=li(Object,"defineProperty");return e({},"",{}),e}catch{}})(),W_=Wu?function(e,t){return Wu(e,"toString",{configurable:!0,enumerable:!1,value:Cs(t),writable:!0})}:pa,z_=q_(W_);function H_(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}function Y_(e,t,r,i){for(var s=e.length,o=r+-1;++o<s;)if(t(e[o],o,e))return o;return-1}function U_(e){return e!==e}function j_(e,t,r){for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}function G_(e,t,r){return t===t?j_(e,t,r):Y_(e,U_,r)}function X_(e,t){var r=e==null?0:e.length;return!!r&&G_(e,t,0)>-1}var V_=9007199254740991,Z_=/^(?:0|[1-9]\d*)$/;function Hm(e,t){var r=typeof e;return t=t??V_,!!t&&(r=="number"||r!="symbol"&&Z_.test(e))&&e>-1&&e%1==0&&e<t}function Ym(e,t){return e===t||e!==e&&t!==t}var zu=Math.max;function K_(e,t,r){return t=zu(t===void 0?e.length-1:t,0),function(){for(var i=arguments,s=-1,o=zu(i.length-t,0),a=Array(o);++s<o;)a[s]=i[t+s];s=-1;for(var n= Line truncated
`+r.mark.snippet),o+" "+s):o}p(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return p(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=p(function(i){return this.name+": "+e(this,i)},"toString"),tn=t,tn}p(Ji,"requireException");var en,pd;function Sy(){if(pd)return en;pd=1;const e=Qi();function t(s,o,a,n,l){let c="",h="";const u=Math.floor(l/2)-1;return n-o>u&&(c=" ... ",o=n-u+c.length),a-n>u&&(h=" ...",a=n+u-h.length),{str:c+s.slice(o,a).replace(/\t/g,"→")+h,pos:n-o+c.length}}p(t,"getLine");function r(s,o){return e.repeat(" ",o-s.length)+s}p(r,"padStart");function i(s,o){if(o=Object.create(o||null),!s.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);const a=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=a.exec(s.buffer);)l.push(c.index),n.push(c.index+c[0].length),s.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let u="";const d=Math.min(s.line+o.linesAfter,l.length).toString().length,f=o.maxLength-(o.indent+d+3);for(let y=1;y<=o.linesBefore&&!(h-y<0);y++){const x=t(s.buffer,n[h-y],l[h-y],s.position-(n[h]-n[h-y]),f);u=e.repeat(" ",o.indent)+r((s.line-y+1).toString(),d)+" | "+x.str+`
`+u}const m=t(s.buffer,n[h],l[h],s.position,f);u+=e.repeat(" ",o.indent)+r((s.line+1).toString(),d)+" | "+m.str+`
`,u+=e.repeat("-",o.indent+d+3+m.pos)+`^
`;for(let y=1;y<=o.linesAfter&&!(h+y>=l.length);y++){const x=t(s.buffer,n[h+y],l[h+y],s.position-(n[h]-n[h+y]),f);u+=e.repeat(" ",o.indent)+r((s.line+y+1).toString(),d)+" | "+x.str+`
`}return u.replace(/\n$/,"")}return p(i,"makeSnippet"),en=i,en}p(Sy,"requireSnippet");var rn,gd;function pe(){if(gd)return rn;gd=1;const e=Ji(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function i(o){const a={};return o!==null&&Object.keys(o).forEach(function(n){o[n].forEach(function(l){a[String(l)]=n})}),a}p(i,"compileStyleAliases");function s(o,a){if(a=a||{},Object.keys(a).forEach(function(n){if(t.indexOf(n)===-1)throw new e('Unknown option "'+n+'" is met in definition of "'+o+'" YAML type.')}),this.options=a,this.tag=o,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(n){return n},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=i(a.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+o+'" YAML type.')}return p(s,"Type2"),rn=s,rn}p(pe,"requireType");var sn,md;function wh(){if(md)return sn;md=1;const e=Ji(),t=pe();function r(o,a){const n=[];return o[a].forEach(function(l){let c=n.length;n.forEach(function(h,u){h.tag===l.tag&&h.kind===l.kind&&h.multi===l.multi&&(c=u)}),n[c]=l}),n}p(r,"compileList");function i(){const o={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(n){n.multi?(o.multi[n.kind].push(n),o.multi.fallback.push(n)):o[n.kind][n.tag]=o.fallback[n.tag]=n}p(a,"collectType");for(let n=0,l=arguments.length;n<l;n+=1)arguments[n].forEach(a);return o}p(i,"compileMap");function s(o){return this.extend(o)}return p(s,"Schema2"),s.prototype.extend=p(function(a){let n=[],l=[];if(a instanceof t)l.push(a);else if(Array.isArray(a))l=l.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(n=n.concat(a.implicit)),a.explicit&&(l=l.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(h.loadKind&&h.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(h.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const c=Object.create(s.prototype);return c.implicit=(this.implicit||[]).concat(n),c.explicit=(this.explicit||[]).concat(l),c.compiledImplicit=r(c,"implicit"),c.compiledExplicit=r(c,"explicit"),c.compiledTypeMap=i(c.compiledImplicit,c.compiledExplicit),c},"extend"),sn=s,sn}p(wh,"requireSchema");var on,yd;function Th(){if(yd)return on;yd=1;const e=pe();return on=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:p(function(t){return t!==null?t:""},"construct")}),on}p(Th,"requireStr");var an,xd;function Sh(){if(xd)return an;xd=1;const e=pe();return an=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:p(function(t){return t!==null?t:[]},"construct")}),an}p(Sh,"requireSeq");var nn,Cd;function _h(){if(Cd)return nn;Cd=1;const e=pe();return nn=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:p(function(t){return t!==null?t:{}},"construct")}),nn}p(_h,"requireMap");var ln,bd;function vh(){if(bd)return ln;bd=1;const e=wh();return ln=new e({explicit:[Th(),Sh(),_h()]}),ln}p(vh,"requireFailsafe");var hn,kd;function Bh(){if(kd)return hn;kd=1;const e=pe();function t(s){if(s===null)return!0;const o=s.length;return o===1&&s==="~"||o===4&&(s==="null"||s==="Null"||s==="NULL")}p(t,"resolveYamlNull");function r(){return null}p(r,"constructYamlNull");function i(s){return s===null}return p(i,"isNull"),hn=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{canonical:p(function(){return"~"},"canonical"),lowercase:p(function(){return"null"},"lowercase"),uppercase:p(function(){return"NULL"},"uppercase"),camelcase:p(function(){return"Null"},"camelcase"),empty:p(function(){return""},"empty")},defaultStyle:"lowercase"}),hn}p(Bh,"require_null");var cn,wd;function Lh(){if(wd)return cn;wd=1;const e=pe();function t(s){if(s===null)return!1;const o=s.length;return o===4&&(s==="true"||s==="True"||s==="TRUE")||o===5&&(s==="false"||s==="False"||s==="FALSE")}p(t,"resolveYamlBoolean");function r(s){return s==="true"||s==="True"||s==="TRUE"}p(r,"constructYamlBoolean");function i(s){return Object.prototype.toString.call(s)==="[object Boolean]"}return p(i,"isBoolean"),cn=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{lowercase:p( Line truncated
\r`;function r(a){if(a===null)return!1;let n=0;const l=a.length,c=t;for(let h=0;h<l;h++){const u=c.indexOf(a.charAt(h));if(!(u>64)){if(u<0)return!1;n+=6}}return n%8===0}p(r,"resolveYamlBinary");function i(a){const n=a.replace(/[\r\n=]/g,""),l=n.length,c=t;let h=0;const u=[];for(let f=0;f<l;f++)f%4===0&&f&&(u.push(h>>16&255),u.push(h>>8&255),u.push(h&255)),h=h<<6|c.indexOf(n.charAt(f));const d=l%4*6;return d===0?(u.push(h>>16&255),u.push(h>>8&255),u.push(h&255)):d===18?(u.push(h>>10&255),u.push(h>>2&255)):d===12&&u.push(h>>4&255),new Uint8Array(u)}p(i,"constructYamlBinary");function s(a){let n="",l=0;const c=a.length,h=t;for(let d=0;d<c;d++)d%3===0&&d&&(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]),l=(l<<8)+a[d];const u=c%3;return u===0?(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]):u===2?(n+=h[l>>10&63],n+=h[l>>4&63],n+=h[l<<2&63],n+=h[64]):u===1&&(n+=h[l>>2&63],n+=h[l<<4&63],n+=h[64],n+=h[64]),n}p(s,"representYamlBinary");function o(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return p(o,"isBinary"),yn=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:s}),yn}p(Dh,"requireBinary");var xn,Ad;function Ih(){if(Ad)return xn;Ad=1;const e=pe(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function i(o){if(o===null)return!0;const a=[],n=o;for(let l=0,c=n.length;l<c;l+=1){const h=n[l];let u=!1;if(r.call(h)!=="[object Object]")return!1;let d;for(d in h)if(t.call(h,d))if(!u)u=!0;else return!1;if(!u)return!1;if(a.indexOf(d)===-1)a.push(d);else return!1}return!0}p(i,"resolveYamlOmap");function s(o){return o!==null?o:[]}return p(s,"constructYamlOmap"),xn=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:s}),xn}p(Ih,"requireOmap");var Cn,Ed;function Ph(){if(Ed)return Cn;Ed=1;const e=pe(),t=Object.prototype.toString;function r(s){if(s===null)return!0;const o=s,a=new Array(o.length);for(let n=0,l=o.length;n<l;n+=1){const c=o[n];if(t.call(c)!=="[object Object]")return!1;const h=Object.keys(c);if(h.length!==1)return!1;a[n]=[h[0],c[h[0]]]}return!0}p(r,"resolveYamlPairs");function i(s){if(s===null)return[];const o=s,a=new Array(o.length);for(let n=0,l=o.length;n<l;n+=1){const c=o[n],h=Object.keys(c);a[n]=[h[0],c[h[0]]]}return a}return p(i,"constructYamlPairs"),Cn=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i}),Cn}p(Ph,"requirePairs");var bn,Md;function Rh(){if(Md)return bn;Md=1;const e=pe(),t=Object.prototype.hasOwnProperty;function r(s){if(s===null)return!0;const o=s;for(const a in o)if(t.call(o,a)&&o[a]!==null)return!1;return!0}p(r,"resolveYamlSet");function i(s){return s!==null?s:{}}return p(i,"constructYamlSet"),bn=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i}),bn}p(Rh,"requireSet");var kn,$d;function ka(){return $d||($d=1,kn=Mh().extend({implicit:[$h(),Oh()],explicit:[Dh(),Ih(),Ph(),Rh()]})),kn}p(ka,"require_default");var Od;function _y(){if(Od)return uo;Od=1;const e=Qi(),t=Ji(),r=Sy(),i=ka(),s=Object.prototype.hasOwnProperty,o=1,a=2,n=3,l=4,c=1,h=2,u=3,d=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,m=/[,\[\]{}]/,y=/^(?:!|!!|![0-9A-Za-z-]+!)$/,x=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function C(g){return Object.prototype.toString.call(g)}p(C,"_class");function k(g){return g===10||g===13}p(k,"isEol");function T(g){return g===9||g===32}p(T,"isWhiteSpace");function S(g){return g===9||g===32||g===10||g===13}p(S,"isWsOrEol");function _(g){return g===44||g===91||g===93||g===123||g===125}p(_,"isFlowIndicator");function L(g){if(g>=48&&g<=57)return g-48;const $=g|32;return $>=97&&$<=102?$-97+10:-1}p(L,"fromHexCode");function A(g){return g===120?2:g===117?4:g===85?8:0}p(A,"escapedHexLen");function F(g){return g>=48&&g<=57?g-48:-1}p(F,"fromDecimalCode");function V(g){switch(g){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}p(V,"simpleEscapeSequence");function Y(g){return g<=65535?String.fromCharCode(g):String.fromCharCode((g-65536>>10)+55296,(g-65536&1023)+56320)}p(Y,"charFromCodepoint");function R(g,$,H){$==="__proto__"?Object.defineProperty(g,$,{configurable:!0,enumerable:!0,writable:!0,value:H}):g[$]=H}p(R,"setProperty");const it=new Array(256),U=new Array(256);for(let g=0;g<256;g++)it[g]=V(g)?1:0,U[g]=V(g);function E(g,$){this.input=g,this.filename=$.filename||null,this.schema=$.schema||i,this.onWarning=$.onWarning||null,this.legacy=$.legacy||!1,this.json=$.json||!1,this.listener=$.listener||null,this.maxDepth=typeof $.maxDepth=="number"?$.maxDepth:100,this.maxTotalMergeKeys=typeof $.maxTotalMergeKeys=="number"?$.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=g.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}p(E,"State");function O(g,$){const H={name:g.filename,buffer:g.input.slice(0,-1),position:g.position,line:g.line,column:g.position-g.lineStart};return H.snippet=r(H),new t($,H)}p(O,"generateError");function B(g,$){throw O(g,$)}p(B,"throwError");function N(g,$){g.onWarning&&g.onWarning.call(null,O(g,$))}p(N,"throwWarning");function D(g,$,H){const X=g.anchorMapTransactions;if(X.length!==0){const z=X[X.length-1];s.call(z,$)||(z[$]={existed:s.call(g.anchorMap,$),value:g.anchorMap[$]})}g.anchorMap[$]=H}p(D,"storeAnchor");function rt(g){g.anchorMapTransactions.push(Object.create(null))}p(rt,"beginAnchorTransaction");function tt(g){const $=g.anchorMapTransactions.pop(),H=g.anchorMapTransactions;if(H.length===0)return;const X=H[H.length-1],z=Object.keys($);for(let et=0,w=z.length;et<w;et+=1){const I=z[et];s.call(X,I)||(X[I]=$[I])}}p(tt,"commitAnchorTransaction");function pt(g){const $=g.anchorMapTransactions.pop(),H=Object.keys($);for(let X=H.length-1;X>=0;X-=1){const z=$[H[X]];z.existed?g.anchorMap[H[X]]=z.value:delete g.anchorMap[H[X]]}}p(pt,"rollbackAnchorTransaction");function St(g){return{position:g.position,line:g.line,lineStart:g.lineStart,lineIndent:g.lineIndent,firstTabInLine:g.firstTabInLine,tag:g.tag,anchor:g.anchor,kind:g.kind,result:g.result}}p(St,"snapshotState");function Tt(g,$){g.position=$.position,g.line=$.line,g.lineStart=$.lineStart,g.lineIndent=$.lineIndent,g.firstTabInLine=$.firstTabInLine,g.tag=$.tag,g.anchor=$.anchor,g.kind=$.kind,g.result=$.result}p(Tt,"restoreState");const ft={YAML:p(function($,H,X){$.version!==null&&B($,"duplication of %YAML directive"),X.length!==1&&B($,"YAML directive accepts exactly one argument");const z=/^([0-9]+)\.([0-9]+)$/.exec(X[0]);z===null&&B($,"ill-formed argument of the YAML directive");const et=parseInt(z[1],10),w=parseInt(z[2],10);et!==1&&B($,"unacceptable YAML version of the document"),$.version=X[0],$.checkLineBreaks=w<2,w!==1&&w!==2&&N($,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function($,H,X){let z;X.length!==2&&B($,"TAG directive accepts exactly two arguments");const et=X[0];z=X[1],y.test(et)||B($,"ill-formed tag handle (first argument) of the TAG directive"),s.call($.tagMap,et)&&B($,'there is a previously declared suffix for "'+et+'" tag handle'),x.test(z)||B($,"ill-formed tag prefix (second argument) of the TAG directive");try{z=decodeURIComponent(z)}catch{B($,"tag prefix is malformed: "+z)}$.tagMap[et]=z},"handleTagDirective")};function Bt(g,$,H,X){if($<H){const z=g.input.slice($,H);if(X)for(let et=0,w=z.length;et<w;et+=1){const I=z.charCodeAt(et);I===9||I>=32&&I<=1114111||B(g,"expected valid JSON character")}else d.test(z)&&B(g,"the stream contains non-printable characters");g.result+=z}}p(Bt,"captureSegment");function st(g,$,H,X){e.isObject(H)||B(g,"cannot merge mappings; the provided source object is unacceptable");const z=Object.keys(H);for(let et=0,w=z.length;et<w;et+=1){const I=z[et];g.maxTotalMergeKeys!==-1&&++g.totalMergeKeys>g.maxTotalMergeKeys&&B(g,"merge keys exceeded maxTotalMergeKeys ("+g.maxTotalMergeKeys+")"),s.call($,I)||(R($,I,H[I]),X[I]=!0)}}p(st,"mergeMappings");function kt(g,$,H,X,z,et,w,I,J){if(Array.isArray(z)){z=Array.prototype.slice.call(z);for(let G=0,j=z.length;G<j;G+=1)Array.isArray(z[G])&&B(g,"nested arrays are not supported inside keys"),typeof z=="object"&&C(z[G])==="[object Object]"&&(z[G]="[object Object]")}if(typeof z=="object"&&C(z)==="[object Object]"&&(z="[object Object]"),z=String(z),$===null&&($={}),X==="tag:yaml.org,2002:merge")if(Array.isArray(et))for(let G=0,j=et.length;G<j;G+=1)st(g,$,et[G],H);else st(g,$,et,H);else!g.json&&!s.call(H,z)&&s.call($,z)&&(g.line=w||g.line,g.lineStart=I||g.lineStart,g.position=J||g.position,B(g,"duplica Line truncated
`,$-1))}p(Mt,"writeFoldedLines");function ee(g,$,H){let X,z,et,w,I,J;const G=g.kind,j=g.result;let K=g.input.charCodeAt(g.position);if(S(K)||_(K)||K===35||K===38||K===42||K===33||K===124||K===62||K===39||K===34||K===37||K===64||K===96)return!1;if(K===63||K===45){const Q=g.input.charCodeAt(g.position+1);if(S(Q)||H&&_(Q))return!1}for(g.kind="scalar",g.result="",X=z=g.position,et=!1;K!==0;){if(K===58){const Q=g.input.charCodeAt(g.position+1);if(S(Q)||H&&_(Q))break}else if(K===35){const Q=g.input.charCodeAt(g.position-1);if(S(Q))break}else{if(g.position===g.lineStart&&It(g)||H&&_(K))break;if(k(K))if(w=g.line,I=g.lineStart,J=g.lineIndent,wt(g,!1,-1),g.lineIndent>=$){et=!0,K=g.input.charCodeAt(g.position);continue}else{g.position=z,g.line=w,g.lineStart=I,g.lineIndent=J;break}}et&&(Bt(g,X,z,!1),Mt(g,g.line-w),X=z=g.position,et=!1),T(K)||(z=g.position+1),K=g.input.charCodeAt(++g.position)}return Bt(g,X,z,!1),g.result?!0:(g.kind=G,g.result=j,!1)}p(ee,"readPlainScalar");function ge(g,$){let H,X,z=g.input.charCodeAt(g.position);if(z!==39)return!1;for(g.kind="scalar",g.result="",g.position++,H=X=g.position;(z=g.input.charCodeAt(g.position))!==0;)if(z===39)if(Bt(g,H,g.position,!0),z=g.input.charCodeAt(++g.position),z===39)H=g.position,g.position++,X=g.position;else return!0;else k(z)?(Bt(g,H,X,!0),Mt(g,wt(g,!1,$)),H=X=g.position):g.position===g.lineStart&&It(g)?B(g,"unexpected end of the document within a single quoted scalar"):(g.position++,T(z)||(X=g.position));B(g,"unexpected end of the stream within a single quoted scalar")}p(ge,"readSingleQuotedScalar");function Be(g,$){let H,X,z,et=g.input.charCodeAt(g.position);if(et!==34)return!1;for(g.kind="scalar",g.result="",g.position++,H=X=g.position;(et=g.input.charCodeAt(g.position))!==0;){if(et===34)return Bt(g,H,g.position,!0),g.position++,!0;if(et===92){if(Bt(g,H,g.position,!0),et=g.input.charCodeAt(++g.position),k(et))wt(g,!1,$);else if(et<256&&it[et])g.result+=U[et],g.position++;else if((z=A(et))>0){let w=z,I=0;for(;w>0;w--)et=g.input.charCodeAt(++g.position),(z=L(et))>=0?I=(I<<4)+z:B(g,"expected hexadecimal character");g.result+=Y(I),g.position++}else B(g,"unknown escape sequence");H=X=g.position}else k(et)?(Bt(g,H,X,!0),Mt(g,wt(g,!1,$)),H=X=g.position):g.position===g.lineStart&&It(g)?B(g,"unexpected end of the document within a double quoted scalar"):(g.position++,T(et)||(X=g.position))}B(g,"unexpected end of the stream within a double quoted scalar")}p(Be,"readDoubleQuotedScalar");function _r(g,$){let H=!0,X,z,et;const w=g.tag;let I;const J=g.anchor;let G,j,K,Q;const ht=Object.create(null);let at,gt,Ct,Ot=g.input.charCodeAt(g.position);if(Ot===91)G=93,Q=!1,I=[];else if(Ot===123)G=125,Q=!0,I={};else return!1;for(g.anchor!==null&&D(g,g.anchor,I),Ot=g.input.charCodeAt(++g.position);Ot!==0;){if(wt(g,!0,$),Ot=g.input.charCodeAt(g.position),Ot===G)return g.position++,g.tag=w,g.anchor=J,g.kind=Q?"mapping":"sequence",g.result=I,!0;if(H?Ot===44&&B(g,"expected the node content, but found ','"):B(g,"missed comma between flow collection entries"),gt=at=Ct=null,j=K=!1,Ot===63){const qt=g.input.charCodeAt(g.position+1);S(qt)&&(j=K=!0,g.position++,wt(g,!0,$))}X=g.line,z=g.lineStart,et=g.position,le(g,$,o,!1,!0),gt=g.tag,at=g.result,wt(g,!0,$),Ot=g.input.charCodeAt(g.position),(K||g.line===X)&&Ot===58&&(j=!0,Ot=g.input.charCodeAt(++g.position),wt(g,!0,$),le(g,$,o,!1,!0),Ct=g.result),Q?kt(g,I,ht,gt,at,Ct,X,z,et):j?I.push(kt(g,null,ht,gt,at,Ct,X,z,et)):I.push(at),wt(g,!0,$),Ot=g.input.charCodeAt(g.position),Ot===44?(H=!0,Ot=g.input.charCodeAt(++g.position)):H=!1}B(g,"unexpected end of the stream within a flow collection")}p(_r,"readFlowCollection");function Ce(g,$){let H,X=c,z=!1,et=!1,w=$,I=0,J=!1,G,j=g.input.charCodeAt(g.position);if(j===124)H=!1;else if(j===62)H=!0;else return!1;for(g.kind="scalar",g.result="";j!==0;)if(j=g.input.charCodeAt(++g.position),j===43||j===45)c===X?X=j===43?u:h:B(g,"repeat of a chomping mode identifier");else if((G=F(j))>=0)G===0?B(g,"bad explicit indentation width of a block scalar; it cannot be less than one"):et?B(g,"repeat of an indentation width identifier"):(w=$+G-1,et=!0);else break;if(T(j)){do j=g.input.charCodeAt(++g.position);while(T(j));if(j===35)do j=g.input.charCodeAt(++g.position);while(!k(j)&&j!==0)}for(;j!==0;){for(xt(g),g.lineIndent=0,j=g.input.charCodeAt(g.position);(!et||g.lineIndent<w)&&j===32;)g.lineIndent++,j=g.input.charCodeAt(++g.position);if(!et&&g.lineIndent>w&&(w=g.lineIndent),k(j)){I++;continue}if(!et&&w===0&&B(g,"missing indentation for block scalar"),g.lineIndent<w){X===u?g.result+=e.repeat(`
`,z?1+I:I):X===c&&z&&(g.result+=`
`);break}H?T(j)?(J=!0,g.result+=e.repeat(`
`,z?1+I:I)):J?(J=!1,g.result+=e.repeat(`
`,I+1)):I===0?z&&(g.result+=" "):g.result+=e.repeat(`
`,I):g.result+=e.repeat(`
`,z?1+I:I),z=!0,et=!0,I=0;const K=g.position;for(;!k(j)&&j!==0;)j=g.input.charCodeAt(++g.position);Bt(g,K,g.position,!1)}return!0}p(Ce,"readBlockScalar");function ne(g,$){const H=g.tag,X=g.anchor,z=[];let et=!1;if(g.firstTabInLine!==-1)return!1;g.anchor!==null&&D(g,g.anchor,z);let w=g.input.charCodeAt(g.position);for(;w!==0&&(g.firstTabInLine!==-1&&(g.position=g.firstTabInLine,B(g,"tab characters must not be used in indentation")),w===45);){const I=g.input.charCodeAt(g.position+1);if(!S(I))break;if(et=!0,g.position++,wt(g,!0,-1)&&g.lineIndent<=$){z.push(null),w=g.input.charCodeAt(g.position);continue}const J=g.line;if(le(g,$,n,!1,!0),z.push(g.result),wt(g,!0,-1),w=g.input.charCodeAt(g.position),(g.line===J||g.lineIndent>$)&&w!==0)B(g,"bad indentation of a sequence entry");else if(g.lineIndent<$)break}return et?(g.tag=H,g.anchor=X,g.kind="sequence",g.result=z,!0):!1}p(ne,"readBlockSequence");function be(g,$,H){let X,z,et,w;const I=g.tag,J=g.anchor,G={},j=Object.create(null);let K=null,Q=null,ht=null,at=!1,gt=!1;if(g.firstTabInLine!==-1)return!1;g.anchor!==null&&D(g,g.anchor,G);let Ct=g.input.charCodeAt(g.position);for(;Ct!==0;){!at&&g.firstTabInLine!==-1&&(g.position=g.firstTabInLine,B(g,"tab characters must not be used in indentation"));const Ot=g.input.charCodeAt(g.position+1),qt=g.line;if((Ct===63||Ct===58)&&S(Ot))Ct===63?(at&&(kt(g,G,j,K,Q,null,z,et,w),K=Q=ht=null),gt=!0,at=!0,X=!0):at?(at=!1,X=!0):B(g,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),g.position+=1,Ct=Ot;else{if(z=g.line,et=g.lineStart,w=g.position,!le(g,H,a,!1,!0))break;if(g.line===qt){for(Ct=g.input.charCodeAt(g.position);T(Ct);)Ct=g.input.charCodeAt(++g.position);if(Ct===58)Ct=g.input.charCodeAt(++g.position),S(Ct)||B(g,"a whitespace character is expected after the key-value separator within a block mapping"),at&&(kt(g,G,j,K,Q,null,z,et,w),K=Q=ht=null),gt=!0,at=!1,X=!1,K=g.tag,Q=g.result;else if(gt)B(g,"can not read an implicit mapping pair; a colon is missed");else return g.tag=I,g.anchor=J,!0}else if(gt)B(g,"can not read a block mapping entry; a multiline key may not be an implicit key");else return g.tag=I,g.anchor=J,!0}if((g.line===qt||g.lineIndent>$)&&(at&&(z=g.line,et=g.lineStart,w=g.position),le(g,$,l,!0,X)&&(at?Q=g.result:ht=g.result),at||(kt(g,G,j,K,Q,ht,z,et,w),K=Q=ht=null),wt(g,!0,-1),Ct=g.input.charCodeAt(g.position)),(g.line===qt||g.lineIndent>$)&&Ct!==0)B(g,"bad indentation of a mapping entry");else if(g.lineIndent<$)break}return at&&kt(g,G,j,K,Q,null,z,et,w),gt&&(g.tag=I,g.anchor=J,g.kind="mapping",g.result=G),gt}p(be,"readBlockMapping");function ar(g){let $=!1,H=!1,X,z,et=g.input.charCodeAt(g.position);if(et!==33)return!1;g.tag!==null&&B(g,"duplication of a tag property"),et=g.input.charCodeAt(++g.position),et===60?($=!0,et=g.input.charCodeAt(++g.position)):et===33?(H=!0,X="!!",et=g.input.charCodeAt(++g.position)):X="!";let w=g.position;if($){do et=g.input.charCodeAt(++g.position);while(et!==0&&et!==62);g.position<g.length?(z=g.input.slice(w,g.position),et=g.input.charCodeAt(++g.position)):B(g,"unexpected end of the stream within a verbatim tag")}else{for(;et!==0&&!S(et);)et===33&&(H?B(g,"tag suffix cannot contain exclamation marks"):(X=g.input.slice(w-1,g.position+1),y.test(X)||B(g,"named tag handle cannot contain such characters"),H=!0,w=g.position+1)),et=g.input.charCodeAt(++g.position);z=g.input.slice(w,g.position),m.test(z)&&B(g,"tag suffix cannot contain flow indicator characters")}z&&!x.test(z)&&B(g,"tag name cannot contain such characters: "+z);try{z=decodeURIComponent(z)}catch{B(g,"tag name is malformed: "+z)}return $?g.tag=z:s.call(g.tagMap,X)?g.tag=g.tagMap[X]+z:X==="!"?g.tag="!"+z:X==="!!"?g.tag="tag:yaml.org,2002:"+z:B(g,'undeclared tag handle "'+X+'"'),!0}p(ar,"readTagProperty");function Ue(g){let $=g.input.charCodeAt(g.position);if($!==38)return!1;g.anchor!==null&&B(g,"duplication of an anchor property"),$=g.input.charCodeAt(++g.position);const H=g.position;for(;$!==0&&!S($)&&!_($);)$=g.input.charCodeAt(++g.position);return g.position===H&&B(g,"name of an anchor node must contain at least one character"),g.anchor=g.input.slice(H,g.position),!0}p(Ue,"readAnchorProperty");function Le(g){let $=g.input.charCodeAt(g.position);if($!==42)return!1;$=g.input.charCodeAt(++g.position);const H=g.position;for(;$!==0&&!S($)&&!_($);)$=g.input.charCodeAt(++g.position);g.position===H&&B(g,"name of an alias node must contain at least one character");const X=g.input.slice(H,g.position);return s.call(g.anchorMap,X)||B(g,'unidentified alias "'+X+'"'),g.result=g.anchorMap[X],wt(g,!0,-1),!0}p(Le,"readAlias");function je(g,$,H,X){const z=St(g);return rt(g),Tt(g,$),g.tag=null,g.anchor=null,g.kind=null,g.result=null,be(g,H,X)&&g.kind==="mapping"?(tt(g),!0):(pt(g),Tt(g,z),!1)}p(je,"tryReadBlockMappingFromProperty");function le(g,$,H,X,z){let et,w,I=1,J=!1,G=!1,j=null,K,Q,ht;g.depth>=g.maxDepth&&B(g,"nesting exceeded maxDepth ("+g.maxDepth+")"),g.depth+=1,g.listener!==null&&g.list Line truncated
`),g.charCodeAt(0)===65279&&(g=g.slice(1)));const H=new E(g,$),X=g.indexOf("\0");for(X!==-1&&(H.position=X,B(H,"null byte is not allowed in input")),H.input+="\0";H.input.charCodeAt(H.position)===32;)H.lineIndent+=1,H.position+=1;for(;H.position<H.length-1;)vr(H);return H.documents}p(nr,"loadDocuments");function lr(g,$,H){$!==null&&typeof $=="object"&&typeof H>"u"&&(H=$,$=null);const X=nr(g,H);if(typeof $!="function")return X;for(let z=0,et=X.length;z<et;z+=1)$(X[z])}p(lr,"loadAll2");function hr(g,$){const H=nr(g,$);if(H.length!==0){if(H.length===1)return H[0];throw new t("expected a single document in the stream, but found more")}}return p(hr,"load2"),uo.loadAll=lr,uo.load=hr,uo}p(_y,"requireLoader");var wn={},Dd;function vy(){if(Dd)return wn;Dd=1;const e=Qi(),t=Ji(),r=ka(),i=Object.prototype.toString,s=Object.prototype.hasOwnProperty,o=65279,a=9,n=10,l=13,c=32,h=33,u=34,d=35,f=37,m=38,y=39,x=42,C=44,k=45,T=58,S=61,_=62,L=63,A=64,F=91,V=93,Y=96,R=123,it=124,U=125,E={};E[0]="\\0",E[7]="\\a",E[8]="\\b",E[9]="\\t",E[10]="\\n",E[11]="\\v",E[12]="\\f",E[13]="\\r",E[27]="\\e",E[34]='\\"',E[92]="\\\\",E[133]="\\N",E[160]="\\_",E[8232]="\\L",E[8233]="\\P";const O=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],B=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function N(w,I){if(I===null)return{};const J={},G=Object.keys(I);for(let j=0,K=G.length;j<K;j+=1){let Q=G[j],ht=String(I[Q]);Q.slice(0,2)==="!!"&&(Q="tag:yaml.org,2002:"+Q.slice(2));const at=w.compiledTypeMap.fallback[Q];at&&s.call(at.styleAliases,ht)&&(ht=at.styleAliases[ht]),J[Q]=ht}return J}p(N,"compileStyleMap");function D(w){let I,J;const G=w.toString(16).toUpperCase();if(w<=255)I="x",J=2;else if(w<=65535)I="u",J=4;else if(w<=4294967295)I="U",J=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+I+e.repeat("0",J-G.length)+G}p(D,"encodeHex");const rt=1,tt=2;function pt(w){this.schema=w.schema||r,this.indent=Math.max(1,w.indent||2),this.noArrayIndent=w.noArrayIndent||!1,this.skipInvalid=w.skipInvalid||!1,this.flowLevel=e.isNothing(w.flowLevel)?-1:w.flowLevel,this.styleMap=N(this.schema,w.styles||null),this.sortKeys=w.sortKeys||!1,this.lineWidth=w.lineWidth||80,this.noRefs=w.noRefs||!1,this.noCompatMode=w.noCompatMode||!1,this.condenseFlow=w.condenseFlow||!1,this.quotingType=w.quotingType==='"'?tt:rt,this.forceQuotes=w.forceQuotes||!1,this.replacer=typeof w.replacer=="function"?w.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}p(pt,"State");function St(w,I){const J=e.repeat(" ",I);let G=0,j="";const K=w.length;for(;G<K;){let Q;const ht=w.indexOf(`
`,G);ht===-1?(Q=w.slice(G),G=K):(Q=w.slice(G,ht+1),G=ht+1),Q.length&&Q!==`
`&&(j+=J),j+=Q}return j}p(St,"indentString");function Tt(w,I){return`
`+e.repeat(" ",w.indent*I)}p(Tt,"generateNextLine");function ft(w,I){for(let J=0,G=w.implicitTypes.length;J<G;J+=1)if(w.implicitTypes[J].resolve(I))return!0;return!1}p(ft,"testImplicitResolving");function Bt(w){return w===c||w===a}p(Bt,"isWhitespace");function st(w){return w>=32&&w<=126||w>=161&&w<=55295&&w!==8232&&w!==8233||w>=57344&&w<=65533&&w!==o||w>=65536&&w<=1114111}p(st,"isPrintable");function kt(w){return st(w)&&w!==o&&w!==l&&w!==n}p(kt,"isNsCharOrWhitespace");function xt(w,I,J){const G=kt(w),j=G&&!Bt(w);return(J?G:G&&w!==C&&w!==F&&w!==V&&w!==R&&w!==U)&&w!==d&&!(I===T&&!j)||kt(I)&&!Bt(I)&&w===d||I===T&&j}p(xt,"isPlainSafe");function wt(w){return st(w)&&w!==o&&!Bt(w)&&w!==k&&w!==L&&w!==T&&w!==C&&w!==F&&w!==V&&w!==R&&w!==U&&w!==d&&w!==m&&w!==x&&w!==h&&w!==it&&w!==S&&w!==_&&w!==y&&w!==u&&w!==f&&w!==A&&w!==Y}p(wt,"isPlainSafeFirst");function It(w){return!Bt(w)&&w!==T}p(It,"isPlainSafeLast");function Mt(w,I){const J=w.charCodeAt(I);let G;return J>=55296&&J<=56319&&I+1<w.length&&(G=w.charCodeAt(I+1),G>=56320&&G<=57343)?(J-55296)*1024+G-56320+65536:J}p(Mt,"codePointAt");function ee(w){return/^\n* /.test(w)}p(ee,"needIndentIndicator");const ge=1,Be=2,_r=3,Ce=4,ne=5;function be(w,I,J,G,j,K,Q,ht){let at,gt=0,Ct=null,Ot=!1,qt=!1;const Xs=G!==-1;let Rr=-1,zt=wt(Mt(w,0))&&It(Mt(w,w.length-1));if(I||Q)for(at=0;at<w.length;gt>=65536?at+=2:at++){if(gt=Mt(w,at),!st(gt))return ne;zt=zt&&xt(gt,Ct,ht),Ct=gt}else{for(at=0;at<w.length;gt>=65536?at+=2:at++){if(gt=Mt(w,at),gt===n)Ot=!0,Xs&&(qt=qt||at-Rr-1>G&&w[Rr+1]!==" ",Rr=at);else if(!st(gt))return ne;zt=zt&&xt(gt,Ct,ht),Ct=gt}qt=qt||Xs&&at-Rr-1>G&&w[Rr+1]!==" "}return!Ot&&!qt?zt&&!Q&&!j(w)?ge:K===tt?ne:Be:J>9&&ee(w)?ne:Q?K===tt?ne:Be:qt?Ce:_r}p(be,"chooseScalarStyle");function ar(w,I,J,G,j){w.dump=(function(){if(I.length===0)return w.quotingType===tt?'""':"''";if(!w.noCompatMode&&(O.indexOf(I)!==-1||B.test(I)))return w.quotingType===tt?'"'+I+'"':"'"+I+"'";const K=w.indent*Math.max(1,J),Q=w.lineWidth===-1?-1:Math.max(Math.min(w.lineWidth,40),w.lineWidth-K),ht=G||w.flowLevel>-1&&J>=w.flowLevel;function at(gt){return ft(w,gt)}switch(p(at,"testAmbiguity"),be(I,ht,w.indent,Q,at,w.quotingType,w.forceQuotes&&!G,j)){case ge:return I;case Be:return"'"+I.replace(/'/g,"''")+"'";case _r:return"|"+Ue(I,w.indent)+Le(St(I,K));case Ce:return">"+Ue(I,w.indent)+Le(St(je(I,Q),K));case ne:return'"'+vr(I)+'"';default:throw new t("impossible error: invalid scalar style")}})()}p(ar,"writeScalar");function Ue(w,I){const J=ee(w)?String(I):"",G=w[w.length-1]===`
`,K=G&&(w[w.length-2]===`
`||w===`
`)?"+":G?"":"-";return J+K+`
`}p(Ue,"blockHeader");function Le(w){return w[w.length-1]===`
`?w.slice(0,-1):w}p(Le,"dropEndingNewline");function je(w,I){const J=/(\n+)([^\n]*)/g;let G=(function(){let ht=w.indexOf(`
`);return ht=ht!==-1?ht:w.length,J.lastIndex=ht,le(w.slice(0,ht),I)})(),j=w[0]===`
`||w[0]===" ",K,Q;for(;Q=J.exec(w);){const ht=Q[1],at=Q[2];K=at[0]===" ",G+=ht+(!j&&!K&&at!==""?`
`:"")+le(at,I),j=K}return G}p(je,"foldString");function le(w,I){if(w===""||w[0]===" ")return w;const J=/ [^ ]/g;let G,j=0,K,Q=0,ht=0,at="";for(;G=J.exec(w);)ht=G.index,ht-j>I&&(K=Q>j?Q:ht,at+=`
`+w.slice(j,K),j=K+1),Q=ht;return at+=`
`,w.length-j>I&&Q>j?at+=w.slice(j,Q)+`
`+w.slice(Q+1):at+=w.slice(j),at.slice(1)}p(le,"foldLine");function vr(w){let I="",J=0;for(let G=0;G<w.length;J>=65536?G+=2:G++){J=Mt(w,G);const j=E[J];!j&&st(J)?(I+=w[G],J>=65536&&(I+=w[G+1])):I+=j||D(J)}return I}p(vr,"escapeString");function nr(w,I,J){let G="";const j=w.tag;for(let K=0,Q=J.length;K<Q;K+=1){let ht=J[K];w.replacer&&(ht=w.replacer.call(J,String(K),ht)),(H(w,I,ht,!1,!1)||typeof ht>"u"&&H(w,I,null,!1,!1))&&(G!==""&&(G+=","+(w.condenseFlow?"":" ")),G+=w.dump)}w.tag=j,w.dump="["+G+"]"}p(nr,"writeFlowSequence");function lr(w,I,J,G){let j="";const K=w.tag;for(let Q=0,ht=J.length;Q<ht;Q+=1){let at=J[Q];w.replacer&&(at=w.replacer.call(J,String(Q),at)),(H(w,I+1,at,!0,!0,!1,!0)||typeof at>"u"&&H(w,I+1,null,!0,!0,!1,!0))&&((!G||j!=="")&&(j+=Tt(w,I)),w.dump&&n===w.dump.charCodeAt(0)?j+="-":j+="- ",j+=w.dump)}w.tag=K,w.dump=j||"[]"}p(lr,"writeBlockSequence");function hr(w,I,J){let G="";const j=w.tag,K=Object.keys(J);for(let Q=0,ht=K.length;Q<ht;Q+=1){let at="";G!==""&&(at+=", "),w.condenseFlow&&(at+='"');const gt=K[Q];let Ct=J[gt];w.replacer&&(Ct=w.replacer.call(J,gt,Ct)),H(w,I,gt,!1,!1)&&(w.dump.length>1024&&(at+="? "),at+=w.dump+(w.condenseFlow?'"':"")+":"+(w.condenseFlow?"":" "),H(w,I,Ct,!1,!1)&&(at+=w.dump,G+=at))}w.tag=j,w.dump="{"+G+"}"}p(hr,"writeFlowMapping");function g(w,I,J,G){let j="";const K=w.tag,Q=Object.keys(J);if(w.sortKeys===!0)Q.sort();else if(typeof w.sortKeys=="function")Q.sort(w.sortKeys);else if(w.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let ht=0,at=Q.length;ht<at;ht+=1){let gt="";(!G||j!=="")&&(gt+=Tt(w,I));const Ct=Q[ht];let Ot=J[Ct];if(w.replacer&&(Ot=w.replacer.call(J,Ct,Ot)),!H(w,I+1,Ct,!0,!0,!0))continue;const qt=w.tag!==null&&w.tag!=="?"||w.dump&&w.dump.length>1024;qt&&(w.dump&&n===w.dump.charCodeAt(0)?gt+="?":gt+="? "),gt+=w.dump,qt&&(gt+=Tt(w,I)),H(w,I+1,Ot,!0,qt)&&(w.dump&&n===w.dump.charCodeAt(0)?gt+=":":gt+=": ",gt+=w.dump,j+=gt)}w.tag=K,w.dump=j||"{}"}p(g,"writeBlockMapping");function $(w,I,J){const G=J?w.explicitTypes:w.implicitTypes;for(let j=0,K=G.length;j<K;j+=1){const Q=G[j];if((Q.instanceOf||Q.predicate)&&(!Q.instanceOf||typeof I=="object"&&I instanceof Q.instanceOf)&&(!Q.predicate||Q.predicate(I))){if(J?Q.multi&&Q.representName?w.tag=Q.representName(I):w.tag=Q.tag:w.tag="?",Q.represent){const ht=w.styleMap[Q.tag]||Q.defaultStyle;let at;if(i.call(Q.represent)==="[object Function]")at=Q.represent(I,ht);else if(s.call(Q.represent,ht))at=Q.represent[ht](I,ht);else throw new t("!<"+Q.tag+'> tag resolver accepts not "'+ht+'" style');w.dump=at}return!0}}return!1}p($,"detectType");function H(w,I,J,G,j,K,Q){w.tag=null,w.dump=J,$(w,J,!1)||$(w,J,!0);const ht=i.call(w.dump),at=G;G&&(G=w.flowLevel<0||w.flowLevel>I);const gt=ht==="[object Object]"||ht==="[object Array]";let Ct,Ot;if(gt&&(Ct=w.duplicates.indexOf(J),Ot=Ct!==-1),(w.tag!==null&&w.tag!=="?"||Ot||w.indent!==2&&I>0)&&(j=!1),Ot&&w.usedDuplicates[Ct])w.dump="*ref_"+Ct;else{if(gt&&Ot&&!w.usedDuplicates[Ct]&&(w.usedDuplicates[Ct]=!0),ht==="[object Object]")G&&Object.keys(w.dump).length!==0?(g(w,I,w.dump,j),Ot&&(w.dump="&ref_"+Ct+w.dump)):(hr(w,I,w.dump),Ot&&(w.dump="&ref_"+Ct+" "+w.dump));else if(ht==="[object Array]")G&&w.dump.length!==0?(w.noArrayIndent&&!Q&&I>0?lr(w,I-1,w.dump,j):lr(w,I,w.dump,j),Ot&&(w.dump="&ref_"+Ct+w.dump)):(nr(w,I,w.dump),Ot&&(w.dump="&ref_"+Ct+" "+w.dump));else if(ht==="[object String]")w.tag!=="?"&&ar(w,w.dump,I,K,at);else{if(ht==="[object Undefined]")return!1;if(w.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+ht)}if(w.tag!==null&&w.tag!=="?"){let qt=encodeURI(w.tag[0]==="!"?w.tag.slice(1):w.tag).replace(/!/g,"%21");w.tag[0]==="!"?qt="!"+qt:qt.slice(0,18)==="tag:yaml.org,2002:"?qt="!!"+qt.slice(18):qt="!<"+qt+">",w.dump=qt+" "+w.dump}}return!0}p(H,"writeNode");function X(w,I){const J=[],G=[];z(w,J,G);const j=G.length;for(let K=0;K<j;K+=1)I.duplicates.push(J[G[K]]);I.usedDuplicates=new Array(j)}p(X,"getDuplicateReferences");function z(w,I,J){if(w!==null&&typeof w=="object"){const G=I.indexOf(w);if(G!==-1)J.indexOf(G)===-1&&J.push(G);else if(I.push(w),Array.isArray(w))for(let j=0,K=w.length;j<K;j+=1)z(w[j],I,J);else{const j=Object.keys(w);for(let K=0,Q=j.length;K<Q;K+=1)z(w[j[K]],I,J)}}}p(z,"inspectNode");function et(w,I){I=I||{};const J=new pt(I);J.noRefs||X(w,J);let G=w;return J.replacer&&(G=J.replacer.call({"":G},"",G)),H(J,0,G,!0,!0)?J.dump+`
`:""}return p(et,"dump2"),wn.dump=et,wn}p(vy,"requireDumper");var Id;function By(){if(Id)return he;Id=1;const e=_y(),t=vy();function r(i,s){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}return p(r,"renamed"),he.Type=pe(),he.Schema=wh(),he.FAILSAFE_SCHEMA=vh(),he.JSON_SCHEMA=Eh(),he.CORE_SCHEMA=Mh(),he.DEFAULT_SCHEMA=ka(),he.load=e.load,he.loadAll=e.loadAll,he.dump=t.dump,he.YAMLException=Ji(),he.types={binary:Dh(),float:Ah(),map:_h(),null:Bh(),pairs:Ph(),set:Rh(),timestamp:$h(),bool:Lh(),int:Fh(),merge:Oh(),omap:Ih(),seq:Sh(),str:Th()},he.safeLoad=r("safeLoad","load"),he.safeLoadAll=r("safeLoadAll","loadAll"),he.safeDump=r("safeDump","dump"),he}p(By,"requireJsYaml");var eF=By(),rF=Ty(eF),{Type:y5,Schema:x5,FAILSAFE_SCHEMA:C5,JSON_SCHEMA:iF,CORE_SCHEMA:b5,DEFAULT_SCHEMA:k5,load:sF,loadAll:w5,dump:T5,YAMLException:S5,types:_5,safeLoad:v5,safeLoadAll:B5,safeDump:L5}=rF,oF={common:Ws,getConfig:Ut,insertCluster:Mm,insertEdge:Dm,insertEdgeLabel:hh,insertMarkers:Rm,insertNode:lh,interpolateToCurve:Nl,labelHelper:mt,log:P,positionEdgeLabel:$S},Ps={},Ly=p(e=>{for(const t of e)Ps[t.name]=t},"registerLayoutLoaders"),aF=p(()=>{Ly([{name:"dagre",loader:p(async()=>await At(()=>import("./dagre-GXQ25YYZ.js"),__vite__mapDeps([3,4,1,2])),"loader")},{name:"swimlane",loader:p(async()=>await At(()=>import("./swimlanes-42K2YHIH.js"),__vite__mapDeps([5,1,2])),"loader")},{name:"cose-bilkent",loader:p(async()=>await At(()=>import("./cose-bilkent-JH36ORCC.js"),__vite__mapDeps([6,7,1,2])),"loader")}])},"registerDefaultLayoutLoaders");aF();var F5=p(async(e,t)=>{if(!(e.layoutAlgorithm in Ps))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const h of e.nodes){const u=h.domId||h.id;h.domId=`${e.diagramId}-${u}`}const r=Ps[e.layoutAlgorithm],i=await r.loader(),{theme:s,themeVariables:o}=e.config,{useGradient:a,gradientStart:n,gradientStop:l}=o,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),a){const h=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return i.render(e,t,oF,{algorithm:r.algorithm})},"render"),A5=p((e="",{fallback:t="dagre"}={})=>{if(e in Ps)return e;if(t in Ps)return P.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Nh="comm",Fy="rule",Ay="decl",nF="@media",lF="@import",hF="@supports",cF="@namespace",hl="@keyframes",Ey="@layer",uF="@scope",dF=Math.abs,Bs=String.fromCharCode;function My(e){return e.trim()}function cl(e,t,r){return e.replace(t,r)}function vi(e,t){return e.charCodeAt(t)|0}function Gi(e,t,r){return e.slice(t,r)}function Ve(e){return e.length}function $y(e){return e.length}function fo(e,t){return t.push(e),e}var wa=1,Xi=1,Oy=0,Oe=0,Kt=0,ts="";function qh(e,t,r,i,s,o,a,n){return{value:e,root:t,parent:r,type:i,props:s,children:o,line:wa,column:Xi,length:a,return:"",siblings:n}}function fF(){return Kt}function pF(){return Kt=Oe>0?vi(ts,--Oe):0,Xi--,Kt===10&&(Xi=1,wa--),Kt}function We(){return Kt=Oe<Oy?vi(ts,Oe++):0,Xi++,Kt===10&&(Xi=1,wa++),Kt}function Mr(){return vi(ts,Oe)}function _o(){return Oe}function Ta(e,t){return Gi(ts,e,t)}function Rs(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function gF(e){return wa=Xi=1,Oy=Ve(ts=e),Oe=0,[]}function mF(e){return ts="",e}function Tn(e){return My(Ta(Oe-1,ul(e===91?e+2:e===40?e+1:e)))}function yF(e){for(;(Kt=Mr())&&Kt<33;)We();return Rs(e)>2||Rs(Kt)>3?"":" "}function xF(e,t){for(;--t&&We()&&!(Kt<48||Kt>102||Kt>57&&Kt<65||Kt>70&&Kt<97););return Ta(e,_o()+(t<6&&Mr()==32&&We()==32))}function ul(e){for(;We();)switch(Kt){case e:return Oe;case 34:case 39:e!==34&&e!==39&&ul(Kt);break;case 40:e===41&&ul(e);break;case 92:We();break}return Oe}function CF(e,t){for(;We()&&e+Kt!==57;)if(e+Kt===84&&Mr()===47)break;return"/*"+Ta(t,Oe-1)+"*"+Bs(e===47?e:We())}function bF(e){for(;!Rs(Mr());)We();return Ta(e,Oe)}function kF(e) Line truncated
`);const i=l2(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),uf(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Jy={draw:WA},zA=Jy,HA={db:{},renderer:Jy,parser:{parse:p(()=>{},"parse")}},YA=HA,t0="flowchart-elk",UA=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),jA=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([10,11,12,13,9,14]));return{id:t0,diagram:e}},"loader"),GA={id:t0,detector:UA,loader:jA},XA=GA,e0="timeline",VA=p(e=>/^\s*timeline/.test(e),"detector"),ZA=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./timeline-definition-24CTP7MA.js");return{diagram:t}},__vite__mapDeps([40,27,1,2]));return{id:e0,diagram:e}},"loader"),KA={id:e0,detector:VA,loader:ZA},QA=KA,r0="mindmap",JA=p(e=>/^\s*mindmap/.test(e),"detector"),tE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./mindmap-definition-YA3MSWOX.js");return{diagram:t}},__vite__mapDeps([41,12,13,1,2]));return{id:r0,diagram:e}},"loader"),eE={id:r0,detector:JA,loader:tE},rE=eE,i0="kanban",iE=p(e=>/^\s*kanban/.test(e),"detector"),sE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./kanban-definition-UXKFOSKX.js");return{diagram:t}},__vite__mapDeps([42,11,1,2]));return{id:i0,diagram:e}},"loader"),oE={id:i0,detector:iE,loader:sE},aE=oE,s0="sankey",nE=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),lE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./sankeyDiagram-P5KCCOFB.js");return{diagram:t}},__vite__mapDeps([43,28,23,1,2]));return{id:s0,diagram:e}},"loader"),hE={id:s0,detector:nE,loader:lE},cE=hE,o0="packet",uE=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),dE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./diagram-Z3DM3KII.js");return{diagram:t}},__vite__mapDeps([44,19,20,1,2]));return{id:o0,diagram:e}},"loader"),fE={id:o0,detector:uE,loader:dE},a0="radar",pE=p(e=>/^\s*radar-beta/.test(e),"detector"),gE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./diagram-UQ7AKVKN.js");return{diagram:t}},__vite__mapDeps([45,19,20,1,2]));return{id:a0,diagram:e}},"loader"),mE={id:a0,detector:pE,loader:gE},n0="block",yE=p(e=>/^\s*block(-beta)?/.test(e),"detector"),xE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./blockDiagram-I7D4REHJ.js");return{diagram:t}},__vite__mapDeps([46,11,14,1,2]));return{id:n0,diagram:e}},"loader"),CE={id:n0,detector:yE,loader:xE},bE=CE,l0="treeView",kE=p(e=>/^\s*treeView-beta/.test(e),"detector"),wE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./diagram-S7CK7UJ4.js");return{diagram:t}},__vite__mapDeps([47,18,19,20,1,2]));return{id:l0,diagram:e}},"loader"),TE={id:l0,detector:kE,loader:wE},SE=TE,h0="architecture",_E=p(e=>/^ Line truncated
`;try{Mn(s)}catch{const c=rC(s);if(!c)throw new of(`Diagram ${s} not found.`);const{id:h,diagram:u}=await c();Eo(h,u)}const{db:o,parser:a,renderer:n,init:l}=Mn(s);return a.parser&&(a.parser.yy=o),o.clear?.(),l?.(i),r.title&&o.setDiagramTitle?.(r.title),await a.parse(t),new Zr(s,t,o,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(Zr,"Diagram"),Zr),qd=[],cM=p(()=>{qd.forEach(e=>{e()}),qd=[]},"attachFunctions"),uM=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function w0(e){const t=e.match(sf);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
`):t[2];let s=sF(i,{schema:iF})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const o={};return s.displayMode&&(o.displayMode=s.displayMode.toString()),s.title&&(o.title=s.title.toString()),s.config&&(o.config=s.config),{text:e.slice(t[0].length),metadata:o}}p(w0,"extractFrontMatter");var dM=p(e=>e.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),fM=p(e=>{const{text:t,metadata:r}=w0(e),{displayMode:i,title:s,config:o={}}=r;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:s,config:o,text:t}},"processFrontmatter"),pM=p(e=>{const t=de.detectInit(e)??{},r=de.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:yw(e),directive:t}},"processDirectives");function Wh(e){const t=dM(e),r=fM(t),i=pM(r.text),s=Yl(r.config,i.directive);return e=uM(i.text),{code:e,title:r.title,config:s}}p(Wh,"preprocessDiagram");function T0(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(T0,"toBase64");var gM=5e4,mM="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",yM="sandbox",xM="loose",CM="http://www.w3.org/2000/svg",bM="http://www.w3.org/1999/xlink",kM="http://www.w3.org/1999/xhtml",wM="100%",TM="100%",SM="border:0;margin:0;",_M="margin:0",vM="allow-top-navigation-by-user-activation allow-popups",BM='The "iframe" tag is not supported by your browser.',LM=["foreignobject"],FM=["dominant-baseline"];function zh(e){const t=Wh(e);return Fo(),Qx(t.config??{}),t}p(zh,"processAndSetConfigs");async function S0(e,t){Sa();try{const{code:r,config:i}=zh(e);return{diagramType:(await v0(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(S0,"parse");var Wd=p((e,t,r=[])=>{const i=Qd(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),AM=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=fe(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Zc(l.styles)||n.forEach(c=>{r.insertRule(Wd(l.id,c,l.styles),r.cssRules.length)}),Zc(l.textStyles)||r.insertRule(Wd(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const s=new CSSStyleSheet;s.replaceSync(e.themeCSS),i=En(s)+`
`}else i+=`${e.themeCSS}
`;return i+En(r)},"createCssStyles"),EM=p((e,t)=>dl(kF(`${e}{${t}}`),SF([p(function(i,s,o,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===hl)return;i.props=i.props.map(n=>n===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[nF,hF,Ey,uF,"@container","@starting-style"],hl].includes(i.type)||(P.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Nh))},"addNamespace"),TF])),"compileCSS"),MM=p((e,t,r,i)=>{const s=AM(e,r),o=bC(t,s,{...e.themeVariables,theme:e.theme,look:e.look},i);return EM(i,o)},"createUserStyles"),$M=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Dr(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),OM=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":TM,i=T0(`<body style="${_M}">${e}</body>`);return`<iframe style="width:${wM};height:${r};${SM}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${vM}">
${BM}
</iframe>`},"putIntoIFrame"),zd=p((e,t,r,i,s)=>{const o=e.append("div");o.attr("id",r),i&&o.attr("style",i);const a=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",CM);return s&&a.attr("xmlns:xlink",s),a.append("g"),e},"appendDivSvgG");function pl(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(pl,"sandboxedIframe");var DM=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),IM=p(async function(e,t,r){Sa();const i=zh(t);t=i.code;const s=Ut();P.debug(s),t.length>(s?.maxTextSize??gM)&&(t=mM);const o=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const E=Ft(d?n:c).node();E&&"remove"in E&&E.remove()},"removeTempElements");let u=Ft(document.body);const d=s.securityLevel===yM,f=s.securityLevel===xM,m=s.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),d){const U=pl(Ft(r),a);u=Ft(U.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=Ft(r);zd(u,e,l,`font-family: ${m}`,bM)}else{if(DM(document,e,l,a),d){const U=pl(Ft(document.body),a);u=Ft(U.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=Ft("body");zd(u,e,l)}let y,x;try{y=await fl.fromText(t,{title:i.title})}catch(U){if(s.suppressErrorRendering)throw h(),U;y=await fl.fromText("error"),x=U}const C=u.select(c).node(),k=y.type,T=C.firstChild,S=T.firstChild,_=y.renderer.getClasses?.(t,y),L=MM(s,k,_,o),A=document.createElement("style");A.innerHTML=L,T.insertBefore(A,S);try{await y.renderer.draw(t,e,"11.17.2",y)}catch(U){throw s.suppressErrorRendering?h():zA.draw(t,e,"11.17.2"),U}const F=u.select(`${c} svg`),V=y.db.getAccTitle?.(),Y=y.db.getAccDescription?.();B0(k,F,V,Y);const it=p(()=>{u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",kM);let U=u.select(c).node().innerHTML;if(P.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),U=$M(U,d,ir(s.arrowMarkerAbsolute)),d){const E=u.select(c+" svg").node();U=OM(U,E)}else f||(U=zi.sanitize(U,{ADD_TAGS:LM,ADD_ATTR:FM,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return cM(),U},"serializeSvg")();if(x)throw x;return h(),{diagramType:k,svg:it,bindFunctions:y.db.bindFunctions}},"render");function _0(e={}){const t=ie({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),Zx(t),t?.theme&&t.theme in yr?t.themeVariables=yr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=yr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?Vx(t):Jd();ml(r.logLevel),Sa()}p(_0,"initialize");var v0=p((e,t={})=>{const{code:r}=Wh(e);return fl.fromText(r,t)},"getDiagramFromText");function B0(e,t,r,i){b0(t,e),k0(t,r,i,t.attr("id"))}p(B0,"addA11yInfo");var si=Object.freeze({render:IM,parse:S0,getDiagramFromText:v0,initialize:_0,getConfig:Ut,setConfig:tf,getSiteConfig:Jd,updateSiteConfig:Kx,reset:p(()=>{Fo()},"reset"),globalReset:p(()=>{Fo(Hi)},"globalReset"),defaultConfig:Hi});ml(Ut().logLevel);Fo(Ut());var PM=p((e,t,r)=>{P.warn(e),Hl(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),L0=p(async function(e={querySelector:".mermaid"}){try{await RM(e)}catch(t){if(Hl(t)&&P.error(t.str),kr.parseError&&kr.parseError(t),!e.suppressErrors)throw P.error("Use the suppressErrors option to suppress these errors"),t}},"run"),RM=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=si.getConfig();P.debug(`${e?"":"No "}Callback function found`);let s;if(r)s=r;else if(t)s=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");P.debug(`Found ${s.length} diagrams`),i?.startOnLoad!==void 0&&(P.debug("Start On Load: "+i?.startOnLoad),si.updateSiteConfig({startOnLoad:i?.startOnLoad}));const o=new de.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(s)){if(P.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${o.next()}`;a=l.innerHTML,a=Rp(de.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=de.detectInit(a);h&&P.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:d}=await M0(c,a,l);l.innerHTML=u,e&&await e(c),d&&d(l)}catch(u){PM(u,n,kr.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),F0=p(function(e){si.initialize(e)},"initialize"),NM=p(async function(e,t,r){P.warn("mermaid.init is deprecated. Please use run instead."),e&&F0(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await L0(i)},"init"),qM=p(async(e,{lazyLoad:t=!0}={})=>{Sa(),Ln(...e),t===!1&&await lM()},"registerExternalDiagrams"),A0=p(function(){if(kr.startOnLoad){const{startOnLoad:e}=si.getConfig();e&&kr.run().catch(t=>P.error("MermaiLine truncated
+96
View File
@@ -0,0 +1,96 @@
import{g as ae}from"./chunk-XXDRQBXY.js";import{s as ce}from"./chunk-POPQ4Y6H.js";import{_ as h,l as I,u as le,v as he,y as de,B as j,c as P,i as G,b4 as ge,V as ue,W as pe,X as fe}from"./mermaid.core.js";import"./index.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,a){return crypto.randomUUID?crypto.randomUUID():be(t)}function be(t,e,a){t=t||{};const l=t.random??t.rng?.()??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var q=(function(){var t=h(function(L,s,i,o){for(i=i||{},o=L.length;o--;i[L[o]]=s);return i},"o"),e=[1,4],a=[1,13],l=[1,12],n=[1,15],d=[1,16],f=[1,20],y=[1,19],E=[6,7,8],b=[1,26],v=[1,24],R=[1,25],g=[6,7,11],A=[1,6,13,15,16,19,22],J=[1,33],K=[1,34],$=[1,6,7,11,13,15,16,19,22],H={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,o,c,p,r,B){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},{6:a,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},{6:b,7:v,10:23,11:R},t(g,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:y}),t(g,[2,18]),t(g,[2,19]),t(g,[2,20]),t(g,[2,21]),t(g,[2,23]),t(g,[2,24]),t(g,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:v,10:32,11:R},{1:[2,7],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},t(A,[2,14],{7:J,11:K}),t($,[2,8]),t($,[2,9]),t($,[2,10]),t(g,[2,15]),t(g,[2,16]),t(g,[2,17]),{20:[1,35]},{21:[1,36]},t(A,[2,13],{7:J,11:K}),t($,[2,11]),t($,[2,12]),{21:[1,37]},t(g,[2,25]),t(g,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:h(function(s){var i=this,o=[0],c=[],p=[null],r=[],B=this.table,u="",U=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(T.yy[W]=this.yy[W]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var X=m.yylloc;r.push(X);var re=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(S){o.length=o.length-2*S,p.length=p.length-S,r.length=r.length-S}h(oe,"popStack");function ee(){var S;return S=c.pop()||m.lex()||Z,typeof S!="number"&&(S instanceof Array&&(c=S,S=c.pop()),S=i.symbols_[S]||S),S}h(ee,"lex");for(var k,O,x,z,C={},V,N,te,F;;){if(O=o[o.length-1],this.defaultActions[O]?x=this.defaultActions[O]:((k===null||typeof k>"u")&&(k=ee()),x=B[O]&&B[O][k]),typeof x>"u"||!x.length||!x[0]){var Y="";F=[];for(V in B[O])this.terminals_[V]&&V>ie&&F.push("'"+this.terminals_[V]+"'");m.showPosition?Y="Parse error on line "+(U+1)+`:
`+m.showPosition()+`
Expecting `+F.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Y="Parse error on line "+(U+1)+": Unexpected "+(k==Z?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Y,{text:m.match,token:this.terminals_[k]||k,line:m.yylineno,loc:X,expected:F})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+k);switch(x[0]){case 1:o.push(k),p.push(m.yytext),r.push(m.yylloc),o.push(x[1]),k=null,Q=m.yyleng,u=m.yytext,U=m.yylineno,X=m.yylloc;break;case 2:if(N=this.productions_[x[1]][1],C.$=p[p.length-N],C._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},re&&(C._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(C,[u,Q,U,T.yy,x[1],p,r].concat(se)),typeof z<"u")return z;N&&(o=o.slice(0,-1*N*2),p=p.slice(0,-1*N),r=r.slice(0,-1*N)),o.push(this.productions_[x[1]][0]),p.push(C.$),r.push(C._$),te=B[o[o.length-2]][o[o.length-1]],o.push(te);break;case 3:return!0}}return!0},"parse")},ne=(function(){var L={EOF:1,parseError:h(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
`+i+"^"},"showPosition"),test_match:h(function(s,i){var o,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;r<p.length;r++)if(o=this._input.match(this.rules[p[r]]),o&&(!i||o[0].length>i[0].length)){if(i=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var i=this.next();return i||this.lex()},"lex"),begin:h(function(i){this.conditionStack.push(i)},"begin"),popState:h(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:h(function(i){this.begin(i)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(i,o,c,p){switch(c){case 0:return i.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",o.yytext),20;case 36:return i.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return L})();H.lexer=ne;function M(){this.yy={}}return h(M,"Parser"),M.prototype=H,H.Parser=M,new M})();q.parser=q;var ke=q,Se=12,D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},w,xe=(w=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=D,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let a=this.nodes.length-1;a>=0;a--)if(this.nodes[a].level<e)return this.nodes[a];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,a,l,n){I.info("addNode",e,a,l,n);let d=!1;this.nodes.length===0?(this.baseLevel=e,e=0,d=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,d=!1);const f=P();let y=f.mindmap?.padding??j.mindmap.padding;switch(n){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:y*=2;break}const E={id:this.count++,nodeId:G(a,f),level:e,descr:G(l,f),type:n,children:[],width:f.mindmap?.maxNodeWidth??j.mindmap.maxNodeWidth,padding:y,isRoot:d},b=this.getParent(e);if(b)b.children.push(E),this.nodes.pushLine truncated
`+t);const n=l.db,d=n.getData(),f=ae(e,d.config.securityLevel);if(d.type=l.type,d.layoutAlgorithm=le(d.config.layout,{fallback:"cose-bilkent"}),d.diagramId=e,!n.getMindmap())return;d.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await he(d,f);const{themeVariables:E}=de(),{useGradient:b,gradientStart:v,gradientStop:R}=E;if(b&&v&&R){const g=f.attr("id"),A=f.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",v).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",R).attr("stop-opacity",1)}ce(f,d.config.mindmap?.padding??j.mindmap.padding,"mindmapDiagram",d.config.mindmap?.useMaxWidth??j.mindmap.useMaxWidth)},"draw"),De={draw:Ne},Le=h(t=>{const{theme:e,look:a}=t;let l="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++)t["lineColor"+n]=t["lineColor"+n]||t["cScaleInv"+n],ue(t["lineColor"+n])?t["lineColor"+n]=pe(t["lineColor"+n],20):t["lineColor"+n]=fe(t["lineColor"+n],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const d=""+(a==="neo"?Math.max(10-(n-1)*2,2):17-3*n);l+=`
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
fill: ${t["cScale"+n]};
}
.section-${n-1} text {
fill: ${t["cScaleLabel"+n]};
}
.section-${n-1} span {
color: ${t["cScaleLabel"+n]};
}
.node-icon-${n-1} {
font-size: 40px;
color: ${t["cScaleLabel"+n]};
}
.section-edge-${n-1}{
stroke: ${t["cScale"+n]};
}
.edge-depth-${n-1}{
stroke-width: ${d};
}
.section-${n-1} line {
stroke: ${t["cScaleInv"+n]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
[data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
fill: ${e==="redux"||e==="redux-dark"||e==="neutral"?t.mainBkg:t["cScale"+n]};
stroke: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScale"+n]};
stroke-width: ${t.strokeWidth??2}px;
}
[data-look="neo"].section-edge-${n-1}{
stroke: ${e?.includes("redux")||e==="neo-dark"?t.nodeBorder:t["cScale"+n]};
}
[data-look="neo"].mindmap-node.section-${n-1} text {
fill: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:n)]};
}
`}return l},"genSections"),ve=h((t,e,a)=>{let l="";for(let n=0;n<t;n++)l+=`
[data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
stroke: url(${e}-gradient);
fill: ${a};
}
.section-${n-1} line {
stroke-width: 0;
}`;return l},"genGradient"),Te=h(t=>{const{theme:e}=t,a=t.svgId,l=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${a}-drop-shadow)`):"none";return`
.edge {
stroke-width: 3;
}
${Le(t)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${t.git0};
}
.section-root text {
fill: ${t.gitBranchLabel0};
}
.section-root span {
color: ${e?.includes("redux")?t.nodeBorder:t.gitBranchLabel0};
}
.icon-container {
height:100%;
display: flex;
justify-content: center;
align-items: center;
}
.edge {
fill: none;
}
.mindmap-node-label {
dy: 1em;
alignment-baseline: middle;
text-anchor: middle;
dominant-baseline: middle;
text-align: center;
}
[data-look="neo"].mindmap-node {
filter: ${l};
}
[data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
fill: ${e?.includes("redux")?t.mainBkg:t.git0};
}
[data-look="neo"].mindmap-node.section-root .text-inner-tspan {
fill: ${e?.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]};
}
${t.useGradient&&a&&t.mainBkg?ve(t.THEME_COLOR_LIMIT,a,t.mainBkg):""}
`},"getStyles"),Oe=Te,Ae={get db(){return new xe},renderer:De,parser:ke,styles:Oe};export{Ae as diagram};
+1
View File
@@ -0,0 +1 @@
import{i as a}from"./init.js";class o extends Map{constructor(n,t=g){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),n!=null)for(const[r,s]of n)this.set(r,s)}get(n){return super.get(c(this,n))}has(n){return super.has(c(this,n))}set(n,t){return super.set(l(this,n),t)}delete(n){return super.delete(p(this,n))}}function c({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):t}function l({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):(e.set(r,t),t)}function p({_intern:e,_key:n},t){const r=n(t);return e.has(r)&&(t=e.get(r),e.delete(r)),t}function g(e){return e!==null&&typeof e=="object"?e.valueOf():e}const f=Symbol("implicit");function h(){var e=new o,n=[],t=[],r=f;function s(u){let i=e.get(u);if(i===void 0){if(r!==f)return r;e.set(u,i=n.push(u)-1)}return t[i%t.length]}return s.domain=function(u){if(!arguments.length)return n.slice();n=[],e=new o;for(const i of u)e.has(i)||e.set(i,n.push(i)-1);return s},s.range=function(u){return arguments.length?(t=Array.from(u),s):t.slice()},s.unknown=function(u){return arguments.length?(r=u,s):r},s.copy=function(){return h(n,t).unknown(r)},a.apply(s,arguments),s}export{h as o};
+1
View File
@@ -0,0 +1 @@
import{g as l,r as m,d as a}from"./chunk-SVP7TREG.js";import{p}from"./chunk-JWPE2WC7.js";import{_ as t,l as o}from"./mermaid.core.js";import{M as u,d as c}from"./cynefin-OW5HDTMX.js";import"./index.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},G={parser:b,db:a,renderer:m,styles:l};export{G as diagram};
+39
View File
@@ -0,0 +1,39 @@
import{p as at}from"./chunk-JWPE2WC7.js";import{a4 as T,a7 as B,b3 as rt,g as nt,s as it,a as ot,b as st,o as lt,n as ct,_ as g,l as G,c as ut,A as dt,D as gt,L as pt,d as ht,p as ft,B as mt}from"./mermaid.core.js";import{p as vt}from"./cynefin-OW5HDTMX.js";import{d as q}from"./arc.js";import{o as xt}from"./ordinal.js";import"./index.js";import"./init.js";function St(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,R=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=R*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,D=k)h=f[r],A=o[h],k=D+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:R};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),J={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,J)},"parse")},Lt=g(t=>`
.pieCircle{
stroke: ${t.pieStrokeColor};
stroke-width : ${t.pieStrokeWidth};
opacity : ${t.pieOpacity};
}
.pieCircle.highlighted{
scale: 1.05;
opacity: 1;
}
.pieCircle.highlightedOnHover:hover{
transition-duration: 250ms;
scale: 1.05;
opacity: 1;
}
.pieOuterCircle{
stroke: ${t.pieOuterStrokeColor};
stroke-width: ${t.pieOuterStrokeWidth};
fill: none;
}
.pieTitleText {
text-anchor: middle;
font-size: ${t.pieTitleTextSize};
fill: ${t.pieTitleTextColor};
font-family: ${t.fontFamily};
}
.slice {
font-family: ${t.fontFamily};
fill: ${t.pieSectionTextColor};
font-size:${t.pieSectionTextSize};
// fill: white;
}
.legend text {
fill: ${t.pieLegendTextColor};
font-family: ${t.fontFamily};
font-size: ${t.pieLegendTextSize};
}
`,"getStyles"),Rt=Lt,Wt=g(t=>{const n=[...t.values()].reduce((l,p)=>l+p,0),y=[...t.entries()].map(([l,p])=>({label:l,value:p})).filter(l=>l.value/n*100>=1);return wt().value(l=>l.value).sort(null)(y)},"createPieArcs"),_t=g((t,n,y,b)=>{G.debug(`rendering pie chart
`+t);const l=b.db,p=ut(),i=dt(l.getConfig(),p.pie),e=40,r=18,s=4,h=450,w=h,$=gt(n),f=$.append("g");f.attr("transform","translate("+w/2+","+h/2+")");const{themeVariables:o}=p;let[D]=pt(o.pieOuterStrokeWidth);D??=2;const E=i.legendPosition,k=i.textPosition,R=i.donutHole>0&&i.donutHole<=.9?i.donutHole:0,u=Math.min(w,h)/2-e,A=q().innerRadius(R*u).outerRadius(u),M=q().innerRadius(u*k).outerRadius(u*k),m=f.append("g");m.append("circle").attr("cx",0).attr("cy",0).attr("r",u+D/2).attr("class","pieOuterCircle");const W=l.getSections(),K=Wt(W),Q=[o.pie1,o.pie2,o.pie3,o.pie4,o.pie5,o.pie6,o.pie7,o.pie8,o.pie9,o.pie10,o.pie11,o.pie12];let H=0;W.forEach(a=>{H+=a});const U=K.filter(a=>(a.data.value/H*100).toFixed(0)!=="0"),N=xt(Q).domain([...W.keys()]);m.selectAll("mySlices").data(U).enter().append("path").attr("d",A).attr("fill",a=>N(a.data.label)).attr("class",a=>{let c="pieCircle";return i.highlightSlice==="hover"?c+=" highlightedOnHover":i.highlightSlice===a.data.label&&(c+=" highlighted"),c}),m.selectAll("mySlices").data(U).enter().append("text").text(a=>(a.data.value/H*100).toFixed(0)+"%").attr("transform",a=>"translate("+M.centroid(a)+")").style("text-anchor","middle").attr("class","slice");const Y=f.append("text").text(l.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),L=[...W.entries()].map(([a,c])=>({label:a,value:c})),C=f.selectAll(".legend").data(L).enter().append("g").attr("class","legend");C.append("rect").attr("width",r).attr("height",r).style("fill",a=>N(a.label)).style("stroke",a=>N(a.label)),C.append("text").attr("x",r+s).attr("y",r-s).text(a=>l.getShowData()?`${a.label} [${a.value}]`:a.label);const z=Math.max(...C.selectAll("text").nodes().map(a=>a?.getBoundingClientRect().width??0));let _=h,O=w+e;const d=r+s,P=L.length*d;switch(E){case"center":C.attr("transform",(a,c)=>{const v=d*L.length/2,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"top":_+=P,C.attr("transform",(a,c)=>{const v=u,x=-z/2-(r+s),S=c*d-v;return`translate(${x}, ${S})`}),m.attr("transform",()=>`translate(0, ${P+d})`);break;case"bottom":_+=P,C.attr("transform",(a,c)=>{const v=-u-d,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"left":O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*L.length/2,x=-u-(r+s),S=c*d-v;return"translate("+x+","+S+")"}),m.attr("transform",()=>`translate(${z+r+s}, 0)`);break;default:O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*L.length/2,x=12*r,S=c*d-v;return"translate("+x+","+S+")"});break}const j=Y.node()?.getBoundingClientRect().width??0,tt=w/2-j/2,et=w/2+j/2,X=Math.min(0,tt),Z=Math.max(O,et)-X;$.attr("viewBox",`${X} 0 ${Z} ${_}`),ht($,_,Z,i.useMaxWidth)},"draw"),Ft={draw:_t},Ut={parser:Mt,db:J,renderer:Ft,styles:Rt};export{Ut as diagram};
+7
View File
@@ -0,0 +1,7 @@
import{s as Ae,g as ke,o as ae,n as Fe,a as Pe,b as ve,_ as o,c as zt,l as bt,j as Lt,d as Ce,p as Le,B as z,i as Ee,E as De}from"./mermaid.core.js";import{l as ie}from"./linear.js";import"./index.js";import"./init.js";import"./defaultLocale.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,Line truncated
`+D.showPosition()+`
Expecting `+qt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:qt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},qe=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
`+l+"^"},"showPosition"),test_match:o(function(r,l){var x,c,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),c=r[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],x=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,x,c;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;e<S.length;e++)if(x=this._input.match(this.rules[S[e]]),x&&(!l||x[0].length>l[0].length)){if(l=x,c=e,this.options.backtrack_lexer){if(r=this.test_match(x,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[c]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,x,c,S){switch(c){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();kt.lexer=qe;function pt(){this.yy={}}return o(pt,"Parser"),pt.prototype=kt,kt.Parser=pt,new pt})();Et.parser=Et;var ze=Et,I=De(),ot,Ve=(ot=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantCLine truncated
`+t);const a=_.securityLevel;let k;a==="sandbox"&&(k=Lt("#i"+n));const T=(a==="sandbox"?Lt(k.nodes()[0].contentDocument.body):Lt("body")).select(`[id="${n}"]`),q=T.append("g").attr("class","main"),m=_.quadrantChart?.chartWidth??500,b=_.quadrantChart?.chartHeight??500;Ce(T,b,m,_.quadrantChart?.useMaxWidth??!0),T.attr("viewBox","0 0 "+m+" "+b),d.db.setHeight(b),d.db.setWidth(m);const g=d.db.getQuadrantData(),A=q.append("g").attr("class","quadrants"),ht=q.append("g").attr("class","border"),xt=q.append("g").attr("class","data-points"),ft=q.append("g").attr("class","labels"),gt=q.append("g").attr("class","title");g.title&&gt.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",h(g.title.horizontalPos)).attr("text-anchor",p(g.title.verticalPos)).attr("transform",y(g.title)).text(g.title.text),g.borderLines&&ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ct=A.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ct.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ct.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const dt=xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Re={draw:Be},He={parser:ze,db:we,renderer:Re,styles:o(()=>"","styles")};export{He as diagram};
+1
View File
@@ -0,0 +1 @@
import{g as s,r as l,d as t}from"./chunk-SVP7TREG.js";import{p as m}from"./chunk-JWPE2WC7.js";import{_ as n,l as i}from"./mermaid.core.js";import{M as p,c as u}from"./cynefin-OW5HDTMX.js";import"./index.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},x={parser:y,db:t,renderer:l,styles:s};export{x as diagram};
+84
View File
@@ -0,0 +1,84 @@
import{g as ze}from"./chunk-XXDRQBXY.js";import{s as Xe}from"./chunk-POPQ4Y6H.js";import{_ as m,y as Be,b as Je,a as Ze,s as et,g as tt,n as st,o as it,c as Ne,l as qe,p as rt,t as nt,u as at,v as lt,x as ct}from"./mermaid.core.js";import"./index.js";var Ce=(function(){var e=m(function($,i,a,o){for(a=a||{},o=$.length;o--;a[$[o]]=i);return a},"o"),r=[1,3],u=[1,4],h=[1,5],f=[1,6],n=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],c=[1,22],p=[2,7],y=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],R=[1,39],g=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ae=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ve=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:m(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:m(function(i,a,o,s,d,t,de){var l=t.length-1;switch(d){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:Line truncated
`+_.showPosition()+`
Expecting `+_e.join(", ")+", got '"+(this.terminals_[b]||b)+"'":Te="Parse error on line "+(ge+1)+": Unexpected "+(b==Pe?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(Te,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Ie,expected:_e})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(N[0]){case 1:o.push(b),d.push(_.yytext),t.push(_.yylloc),o.push(N[1]),b=null,$e=_.yyleng,l=_.yytext,ge=_.yylineno,Ie=_.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=d[d.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},je&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),ke=this.performAction.apply(J,[l,$e,ge,G.yy,N[1],d,t].concat(We)),typeof ke<"u")return ke;F&&(o=o.slice(0,-1*F*2),d=d.slice(0,-1*F),t=t.slice(0,-1*F)),o.push(this.productions_[N[1]][0]),d.push(J.$),t.push(J._$),Ye=de[o[o.length-2]][o[o.length-1]],o.push(Ye);break;case 3:return!0}}return!0},"parse")},He=(function(){var $={EOF:1,parseError:m(function(a,o){if(this.yy.parser)this.yy.parser.parseError(a,o);else throw new Error(a)},"parseError"),setInput:m(function(i,a){return this.yy=a||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:m(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:m(function(i){var a=i.length,o=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===s.length?this.yylloc.first_column:0)+s[s.length-o.length].length-o[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:m(function(){return this._more=!0,this},"more"),reject:m(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:m(function(i){this.unput(this.match.slice(i))},"less"),pastInput:m(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:m(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:m(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
`+a+"^"},"showPosition"),test_match:m(function(i,a){var o,s,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),s=i[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],o=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in d)this[t]=d[t];return!1}return!1},"test_match"),next:m(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,a,o,s;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),t=0;t<d.length;t++)if(o=this._input.match(this.rules[d[t]]),o&&(!a||o[0].length>a[0].length)){if(a=o,s=t,this.options.backtrack_lexer){if(i=this.test_match(o,d[t]),i!==!1)return i;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(i=this.test_match(a,d[s]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:m(function(){var a=this.next();return a||this.lex()},"lex"),begin:m(function(a){this.conditionStack.push(a)},"begin"),popState:m(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:m(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:m(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:m(function(a){this.begin(a)},"pushState"),stateStackSize:m(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:m(function(a,o,s,d){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return o.yytext=o.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return $})();Se.lexer=He;function Re(){this.yy={}}return m(Re,"Parser"),Re.prototype=Se,Se.Parser=Re,new Re})();Ce.parser=Ce;var ot=Ce,Z,ht=(Z=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Mediu Line truncated
[data-look="${h}"][data-color-id="color-${p}"].node path {
stroke: ${n[p]};
fill: ${f?.length?f[p]:""};
}
[data-look="${h}"][data-color-id="color-${p}"].node rect {
stroke: ${n[p]};
fill: ${f?.length?f[p]:""};
}
`;return c},"genColor"),ft=m(e=>{const r=Be(),{look:u,themeVariables:h}=r,{requirementEdgeLabelBackground:f}=h;return`
${ut(e)}
marker {
fill: ${e.relationColor};
stroke: ${e.relationColor};
}
marker.cross {
stroke: ${e.lineColor};
}
svg {
font-family: ${e.fontFamily};
font-size: ${e.fontSize};
}
.reqBox {
fill: ${e.requirementBackground};
fill-opacity: 1.0;
stroke: ${e.requirementBorderColor};
stroke-width: ${e.requirementBorderSize};
}
.reqTitle, .reqLabel{
fill: ${e.requirementTextColor};
}
.reqLabelBox {
fill: ${e.relationLabelBackground};
fill-opacity: 1.0;
}
.req-title-line {
stroke: ${e.requirementBorderColor};
stroke-width: ${e.requirementBorderSize};
}
.relationshipLine {
stroke: ${e.relationColor};
stroke-width: ${u==="neo"?e.strokeWidth:"1px"};
}
.relationshipLabel {
fill: ${e.relationLabelColor};
}
.edgeLabel {
background-color: ${e.edgeLabelBackground};
}
.edgeLabel .label rect {
fill: ${e.edgeLabelBackground};
}
.edgeLabel .label text {
fill: ${e.relationLabelColor};
}
.divider {
stroke: ${e.nodeBorder};
stroke-width: 1;
}
.label {
font-family: ${e.fontFamily};
color: ${e.nodeTextColor||e.textColor};
}
.label text,span {
fill: ${e.nodeTextColor||e.textColor};
color: ${e.nodeTextColor||e.textColor};
}
.labelBkg {
background-color: ${f??e.edgeLabelBackground};
}
`},"getStyles"),mt=ft,Qe={};nt(Qe,{draw:()=>dt});var dt=m(async function(e,r,u,h){qe.info("REF0:"),qe.info("Drawing requirement diagram (unified)",r);const{securityLevel:f,state:n,layout:c,look:p}=Ne(),y=h.db.getData(),S=ze(r,f);y.type=h.type,y.layoutAlgorithm=at(c),y.nodeSpacing=n?.nodeSpacing??50,y.rankSpacing=n?.rankSpacing??50,y.markers=p==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],y.diagramId=r,await lt(y,S);const k=8;ct.insertTitle(S,"requirementDiagramTitleText",n?.titleTopMargin??25,h.db.getDiagramTitle()),Xe(S,k,"requirementDiagram",n?.useMaxWidth??!0)},"draw"),yt={parser:ot,get db(){return new ht},renderer:Qe,styles:mt};export{yt as diagram};
+40
View File
@@ -0,0 +1,40 @@
import{n as xt,o as _t,s as vt,g as bt,b as St,a as wt,_ as y,c as lt,b7 as Lt,j as X,Y as Et,p as At,k as Tt}from"./mermaid.core.js";import{o as Mt}from"./ordinal.js";import"./index.js";import"./init.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a<n;)s[a]="#"+t.slice(a*6,++a*6);return s}const Ct=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,n){return Q(t.source,n.source)||t.index-n.index}function ht(t,n){return Q(t.target,n.target)||t.index-n.index}function Q(t,n){return t.y0-n.y0}function it(t){return t.value}function jt(t){return t.index}function Dt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,x=8,g,k=jt,o=kt,l,h,m=Dt,_=zt,d=6;function v(){const i={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(k=typeof i=="function"?i:q(i),v):k},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:q(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(x=g=+i,v):x},v.nodes=function(i){return arguments.length?(m=typeof i=="function"?i:q(i),v):m},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:q(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(d=+i,v):d};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[k(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ft(c,p)),typeof b!="object"&&(b=r.target=ft(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(l)for(const r of e)r.sort(l);return e}function j(i){const f=pt(i,c=>(a-n-(c.length-1)*g)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(a-e+g)/(c.length+1);for(let r=0;r<c.length;++r){const p=c[r];p.y0+=e*(r+1),p.y1+=e*(r+1)}w(c)}}function S(i){const f=N(i);g=Math.min(x,(a-n)/(ct(f,c=>c.length)-1)),j(f);for(let c=0;c<d;++c){const e=Math.pow(.99,c),r=Math.max(1-e,(c+1)/d);R(f,e,r),C(f,e,r)}}function C(i,f,c){for(let e=1,r=i.length;e<r;++e){const p=i[e];for(const b of p){let L=0,B=0;for(const{source:Y,value:et}of b.targetLinks){let H=et*(b.layer-Y.layer);L+=P(Y,b)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&p.sort(Q),D(p,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const p=i[r];for(const b of p){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&p.sort(Q),D(p,c)}}function DLine truncated
`+S.showPosition()+`
Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:D,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,D=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},V&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),i=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,d].concat(j)),typeof i<"u")return i;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(l,h){if(this.yy.parser)this.yy.parser.parseError(l,h);else throw new Error(l)},"parseError"),setInput:y(function(o,l){return this.yy=l||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:y(function(o){var l=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(o){this.unput(this.match.slice(o))},"less"),pastInput:y(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
`+l+"^"},"showPosition"),test_match:y(function(o,l){var h,m,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),m=o[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],h=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!l||h[0].length>l[0].length)){if(l=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,_[m]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var l=this.next();return l||this.lex()},"lex"),begin:y(function(l){this.conditionStack.push(l)},"begin"),popState:y(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:y(function(l){this.begin(l)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(l,h,m,_){switch(m){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();at.parser=at;var K=at,J=[],tt=[],Z=new Map,Zt=y(()=>{J=[],tt=[],Z=new Map,At()},"clear"),W,Jt=(W=class{constructor(n,s,a=0){this.source=n,this.target=s,this.value=a}},y(W,"SankeyLink"),W),te=y((t,n,s)=>{J.push(new Jt(t,n,s))},"addLink"),G,ee=(G=class{constructor(n){this.ID=n}},y(G,"SankeyNode"),G),ne=y(t=>{t=Tt.sanitizeText(t,lt());let n=Z.get(t);return n===void 0&&(n=new ee(t),Z.set(t,n),tt.push(n)),n},"findOrCreateNode"),ie=y(()=>tt,"getNodes"),re=y(()=>J,"getLinks"),se=y(()=>({nodes:tt.map(t=>({id:t.ID})),links:J.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:Z,getConfig:y(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:re,getGraph:se,addLink:te,findOrCreateNode:ne,getAccTitle:wt,setAccTitle:St,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:_t,setDiagramTitle:xt,clear:Zt},$,gt=($=class{static next(n){return new $(n+ ++$.count)}constructor(n){this.id=n,this.href=`#${n}`}toString(){return"url("+this.href+")"}},y($,"Uid"),$.count=0,$),ae={left:It,right:Ot,center:$t,justify:kt},le=y(t=>{let n=0,s=0;for(const a of t){const u=a.value??0;u>n&&(n=u,s=a.layer??0)}return s},"findCentralNodeLayer"),ce=y(function(t,n,s,a){const{securityLevel:u,sankey:x}=lt(),g=Lt.sankey;let k;u==="sandbox"&&(k=X("#i"+n));const o=u==="sandbox"?X(k.nodes()[0].contentDocument.body):X("body"),l=u==="sandbox"?o.select(`[id="${n}"]`):X(`[id="${n}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",j=x?.nodeColors??{},S=a.db.getGraph(),C=ae[d];Bt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(C).extent([[0,0],[h,m]])(S);const D=le(S.nodes),V=Mt(Ct),O=y(e=>j[e]??V(e),"getNodeColor");l.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=gt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const z=y(({id:e,value:r})=>A?`${e}
${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)<D?{x:e.x0-6,anchor:"end"}:{x:e.x1+6,anchor:"start"}:e.x0<h/2?{x:e.x1+6,anchor:"start"}:{x:e.x0-6,anchor:"end"},"getLabelPosition"),P=l.append("g").attr("class","node-labels").attr("font-size",14),E=y(e=>P.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(z),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const i=l.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=i.append("linearGradient").attr("id",r=>(r.uid=gt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}i.append("path").attr("d",Kt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),Et(void 0,l,0,_)},"draw"),ue={draw:ce},he=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
`).trim(),"prepareTextForParsing"),fe=y(t=>`.label {
font-family: ${t.fontFamily};
}
.node-labels {
font-family: ${t.fontFamily};
}
/* Outlined label style - background stroke for better readability */
.sankey-label-bg {
stroke: ${t.mainBkg||t.background||"#fff"};
stroke-width: 4px;
stroke-linejoin: round;
paint-order: stroke;
}
/* Foreground label text */
.sankey-label-fg {
fill: ${t.textColor};
}
/* Node styling */
.node rect {
shape-rendering: crispEdges;
}
/* Link styling */
.link {
fill: none;
stroke-opacity: 0.5;
mix-blend-mode: multiply;
}
`,"getStyles"),ye=fe,de=K.parse.bind(K);K.parse=t=>de(he(t));var xe={styles:ye,parser:K,db:oe,renderer:ue};export{xe as diagram};
+162
View File
@@ -0,0 +1,162 @@
import{I as er}from"./chunk-2Q5K7J3B.js";import{_ as x,F as rr,c as $,j as Yt,l as at,G as Me,d as ar,e as sr,k as N,b as De,s as ir,n as nr,a as or,g as cr,o as lr,H as hr,J as dr,p as Tr,i as Wt,x as Z,I as Q,K as kt,L as Be,Z as pr,y as Ft,M as Er,N as Ve}from"./mermaid.core.js";import{a as ur,g as se,b as dt,d as fr,c as ie,e as ne}from"./chunk-F27PBJKO.js";import"./index.js";var ee=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],c=[1,12],E=[1,14],h=[1,15],p=[1,17],_=[1,18],u=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],q=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],St=[1,74],Dt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],me=[2,78],wt=[4,5,17,51,53,54],vt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Xt=[5,52],F=[70,71,72,73],ot=[1,151],Jt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[1Line truncated
`+J.showPosition()+`
Expecting `+Vt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":jt="Parse error on line "+(Mt+1)+": Unexpected "+(rt==Ne?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(jt,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Qt,expected:Vt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+rt);switch(ct[0]){case 1:P.push(rt),z.push(J.yytext),o.push(J.yylloc),P.push(ct[1]),rt=null,we=J.yyleng,d=J.yytext,Mt=J.yylineno,Qt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Lt.$=z[z.length-Tt],Lt._$={first_line:o[o.length-(Tt||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Tt||1)].first_column,last_column:o[o.length-1].last_column},je&&(Lt._$.range=[o[o.length-(Tt||1)].range[0],o[o.length-1].range[1]]),$t=this.performAction.apply(Lt,[d,we,Mt,gt.yy,ct[1],z,o].concat($e)),typeof $t<"u")return $t;Tt&&(P=P.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),o=o.slice(0,-1*Tt)),P.push(this.productions_[ct[1]][0]),z.push(Lt.$),o.push(Lt._$),ke=Nt[P[P.length-2]][P[P.length-1]],P.push(ke);break;case 3:return!0}}return!0},"parse")},Ze=(function(){var ut={EOF:1,parseError:x(function(v,P){if(this.yy.parser)this.yy.parser.parseError(v,P);else throw new Error(v)},"parseError"),setInput:x(function(S,v){return this.yy=v||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var v=S.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:x(function(S){var v=S.length,P=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===y.length?this.yylloc.first_column:0)+y[y.length-P.length].length-P[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),v=new Array(S.length+1).join("-");return S+this.upcomingInput()+`
`+v+"^"},"showPosition"),test_match:x(function(S,v){var P,y,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),y=S[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],P=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var o in z)this[o]=z[o];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,v,P,y;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),o=0;o<z.length;o++)if(P=this._input.match(this.rules[z[o]]),P&&(!v||P[0].length>v[0].length)){if(v=P,y=o,this.options.backtrack_lexer){if(S=this.test_match(P,z[o]),S!==!1)return S;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(S=this.test_match(v,z[y]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var v=this.next();return v||this.lex()},"lex"),begin:x(function(v){this.conditionStack.push(v)},"begin"),popState:x(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:x(function(v){this.begin(v)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(v,P,y,z){switch(y){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return P.yytext=P.yytext.trim(),73;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),73;case 13:return P.yytext=P.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return P.yytext=P.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return P.yytext=P.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/ Line truncated
`)?h=n+`
`:h=`{
`+n+`
}`,c=hr(h,{schema:dr})}i=c?.type??i,c?.alias&&(!r||r.text===a)&&(r={text:c.alias,wrap:r?.wrap,type:i});const E=this.state.records.actors.get(t);if(E){if(this.state.records.currentBox&&E.box&&this.state.records.currentBox!==E.box)throw new Error(`A same participant should only be defined in one Box: ${E.name} can't be in '${E.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=E.box?E.box:this.state.records.currentBox,E.box=s,E&&a===E.name&&r==null)return}if(r?.text==null&&(r={text:a,type:i}),(i==null||r.text==null)&&(r={text:a,type:i}),this.state.records.actors.set(t,{box:s,name:a,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const h=this.state.records.actors.get(this.state.records.prevActor);h&&(h.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let a,r=0;if(!t)return 0;for(a=0;a<this.state.records.messages.length;a++)this.state.records.messages[a].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[a].from===t&&r++,this.state.records.messages[a].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[a].from===t&&r--;return r}addMessage(t,a,r,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:r.text,wrap:r.wrap??this.autoWrap(),answer:i})}addSignal(t,a,r,i,n=!1,s){if(i===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){const E=new Error("Trying to inactivate an inactive participant ("+t+")");throw E.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},E}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:i,activate:n,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();const a=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(a===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:a}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),Tr()}parseMessage(t){const a=t.trim(),{wrap:r,cleanedText:i}=this.extractWrap(a),n={text:i,wrap:r};return at.debug(`parseMessage: ${JSON.stringify(n)}`),n}parseBoxData(t){const a=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let r=a?.[1]?a[1].trim():"transparent",i=a?.[2]?a[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",i=t.trim());else{const c=new Option().style;c.color=r,c.color!==r&&(r="transparent",i=t.trim())}const{wrap:n,cleanedText:s}=this.extractWrap(i);return{text:s?Wt(s,$()):void 0,color:r,wrap:n}}addNote(t,a,r){const i={actor:t,placement:a,message:r.text,wrap:r.wrap??this.autoWrap()},n=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:n[0],to:n[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:a})}addLinks(t,a){const r=this.getActor(t);try{let i=Wt(a.text,$());i=i.replace(/&equals;/g,"="),i=i.replace(/&amp;/g,"&");const n=JSON.parse(i);this.insertLinks(r,n)}catch(i){at.error("error while parsing actor link text",i)}}addALink(t,a){const r=this.getActor(t);try{const i={};let n=Wt(a.text,$());const s=n.indexOf("@");n=n.replace(/&equals;/g,"="),n=n.replace(/&amp;/g,"&");const c=n.slice(0,s-1).trim(),E=n.slice(s+1).trim();i[c]=E,this.insertLinks(r,i)}catch(i){at.error("error while parsing actor link text",i)}}insertLinks(t,a){if(t.links==null)t.links=a;else for(const r in a)t.links[r]=a[r]}addProperties(t,a){const r=this.getActor(t);try{const i=Wt(a.text,$()),n=JSON.parse(i);this.insertProperties(r,n)}catch(i){at.error("error while parsing actor properties text",i)}}insertProperties(t,a){if(t.properties==null)t.properties=a;else for(const r in a)t.properties[r]=a[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,a){const r=this.getActor(t),i=document.getElementById(a.text);try{const n=i.inLine truncated
stroke: ${e.actorBorder};
fill: ${e.actorBkg};
stroke-width: ${e.strokeWidth??1};
}
rect.actor.outer-path[data-look="neo"] {
filter: ${t};
}
rect.note[data-look="neo"] {
stroke:${e.noteBorderColor};
fill:${e.noteBkgColor};
filter: ${t};
}
text.actor > tspan {
fill: ${e.actorTextColor};
stroke: none;
}
.actor-line {
stroke: ${e.actorLineColor};
}
.innerArc {
stroke-width: 1.5;
stroke-dasharray: none;
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: none;
stroke: ${e.signalColor};
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: 2, 2;
stroke: ${e.signalColor};
}
[id$="-arrowhead"] path {
fill: ${e.signalColor};
stroke: ${e.signalColor};
}
.sequenceNumber {
fill: ${e.sequenceNumberColor};
}
[id$="-sequencenumber"] {
fill: ${e.signalColor};
}
[id$="-crosshead"] path {
fill: ${e.signalColor};
stroke: ${e.signalColor};
}
.messageText {
fill: ${e.signalTextColor};
stroke: none;
}
.labelBox {
stroke: ${e.labelBoxBorderColor};
fill: ${e.labelBoxBkgColor};
filter: ${a==="neo"?t:"none"};
}
.labelText, .labelText > tspan {
fill: ${e.labelTextColor};
stroke: none;
}
.loopText, .loopText > tspan {
fill: ${e.loopTextColor};
stroke: none;
}
.sectionTitle, .sectionTitle > tspan {
fill: ${e.loopTextColor};
stroke: none;
}
.loopLine {
stroke-width: 2px;
stroke-dasharray: 2, 2;
stroke: ${e.labelBoxBorderColor};
fill: ${e.labelBoxBorderColor};
}
.note {
//stroke: #decc93;
stroke: ${e.noteBorderColor};
fill: ${e.noteBkgColor};
}
.noteText, .noteText > tspan {
fill: ${e.noteTextColor};
stroke: none;
${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""}
}
.activation0 {
fill: ${e.activationBkgColor};
stroke: ${e.activationBorderColor};
}
.activation1 {
fill: ${e.activationBkgColor};
stroke: ${e.activationBorderColor};
}
.activation2 {
fill: ${e.activationBkgColor};
stroke: ${e.activationBorderColor};
}
.actorPopupMenu {
position: absolute;
}
.actorPopupMenuPanel {
position: absolute;
fill: ${e.actorBkg};
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
.actor-man circle, line {
fill: ${e.actorBkg};
stroke-width: 2px;
}
g rect.rect {
filter: ${t};
stroke: ${e.nodeBorder};
}
`},"getStyles"),Or=Rr,It=36,ft="actor-top",_t="actor-bottom",qt="actor-box",yt="actor-man",pt=new Set(["redux-color","redux-dark-color"]),Pt=x(function(e,t){const a=fr(e,t);return Ft().look==="neo"&&a.attr("data-look","neo"),a},"drawRect"),Lr=x(function(e,t,a,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const n=t.links,s=t.actorCnt,c=t.rectData;var E="none";i&&(E="block !important");const h=e.append("g");h.attr("id","actor"+s+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",E);var p="";c.class!==void 0&&(p=" "+c.class);let _=c.width>a?c.width:a;const u=h.append("rect");if(u.attr("class","actorPopupMenuPanel"+p),u.attr("x",c.x),u.attr("y",c.height),u.attr("fill",c.fill),u.attr("stroke",c.stroke),u.attr("width",_),u.attr("height",c.height),u.attr("rx",c.rx),u.attr("ry",c.ry),n!=null){var O=20;for(let f in n){var T=h.append("a"),g=Me.sanitizeUrl(n[f]);T.attr("xlink:href",g),T.attr("target","_blank"),Gr(r)(f,T,c.x+10,c.height+O,_,20,{class:"actor"},r),O+=30}}return u.attr("height",O),{height:c.height+O,width:_}},"drawPopup"),zt=x(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Ht=x(async function(e,t,a=null){let r=e.append("foreignObject");const i=await Ve(t.text,Ft()),s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){const c=e.node().firstChild;c.setAttribute("height",s.height+2*t.textMargin);const E=c.getBBox();r.attr("x",Math.round(E.x+E.width/2-s.width/2)).attr("y",Math.round(E.y+E.height/2-s.height/2))}else if(a){let{startx:c,stopx:E,starty:h}=a;if(c>E){const p=c;c=E,E=p}r.attr("x",Math.round(c+Math.abs(c-E)/2-s.width/2)),t.class==="loopText"?r.attr("y",Math.round(h)):r.attr("y",Math.round(h-s.height))}return[r]},"drawKatex"),At=x(function(e,t){let a=0,r=0;const i=t.text.split(N.lineBreakRegex),[n,s]=Be(t.fontSize);let c=[],E=0,h=x(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":h=x(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":h=x(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":h=x(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[p,_]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&n!==void 0&&(E=p*n);const u=e.append("text");u.attr("x",t.x),u.attr("y",h()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),s!==void 0&&u.style("font-size",s),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);const O=_||pr;if(t.tspan){const T=u.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(O)}else u.text(O);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),c.push(u)}return c},"drawText"),Ye=x(function(e,t){function a(i,n,s,c,E){return i+","+n+" "+(i+s)+","+n+" "+(i+s)+","+(n+c-E)+" "+(i+s-E*1.2)+","+(n+c)+" "+i+","+(n+c)}x(a,"genPoints");const r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,At(e,t),r},"drawLabel"),B=-1,We=x((e,t,a,r)=>{e.select&&a.forEach(i=>{const n=t.get(i),s=e.select("#actor"+n.actorCnt);!r.mirrorActors&&n.stopy?s.attr("y2",n.stopy+n.height/2):r.mirrorActors&&s.attr("y2",n.stopy)})},"fixLifeLineHeights"),br=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower();var T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look", Line truncated
a ${L},${I} 0 0 0 0,${g.height}
h ${g.width-2*L}
a ${L},${I} 0 0 0 0,-${g.height}
Z
`;b.append("path").attr("d",A),w.append("path").attr("d",`M ${g.x},${g.y+I}
a ${L},${I} 0 0 0 0,${g.height}`),b.attr("transform",`translate(${L}, ${-(g.height/2)})`),w.attr("transform",`translate(${g.width-L}, ${-g.height/2})`),t.rectData=g,E==="neo"&&b.attr("filter","url(#drop-shadow)");const D=i.get(t.name)??0;if(pt.has(h)&&(b.style("stroke",u[D%u.length]),b.style("fill",_[D%u.length]),w.style("stroke",u[D%u.length]),w.style("fill",_[D%u.length])),t.properties?.icon){const W=t.properties.icon.trim(),U=g.x+g.width-20,G=g.y+10;W.charAt(0)==="@"?ie(T,U,G,W.substr(1)):ne(T,U,G,W)}Et(a,Q(t.description))(t.description,T,g.x,g.y,g.width,g.height,{class:`actor ${qt}`},a);let M=t.height;const V=b.select("path:last-child");if(V.node()){const W=V.node().getBBox();t.height=W.height,M=W.height}return r||(T.attr("data-et","participant"),T.attr("data-type","queue"),T.attr("data-id",t.name)),M},"drawActorTypeQueue"),Sr=x(function(e,t,a,r,i,n){const s=r?t.stopy:t.starty,c=t.x+t.width/2,E=s+75,{look:h,theme:p,themeVariables:_}=a,{bkgColorArray:u,borderColorArray:O,actorBorder:T,actorBkg:g}=_,f=e.append("g").lower();r||(B++,f.append("line").attr("id","actor"+B).attr("x1",c).attr("y1",E).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const I=e.append("g");let L=yt;r?L+=` ${_t}`:L+=` ${ft}`,I.attr("class",L),I.attr("name",t.name);const b=dt();b.x=t.x,b.y=s,b.fill="#eaeaea",b.width=t.width,b.height=t.height,b.class="actor";const w=t.x+t.width/2,A=s+32,D=22;I.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),I.append("circle").attr("cx",w).attr("cy",A).attr("r",D).attr("filter",`${h==="neo"?"url(#drop-shadow)":""}`),I.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${A-D})`);const M=n.get(t.name)??0;pt.has(p)?(I.style("stroke",O[M%O.length]),I.style("fill",u[M%O.length])):(I.style("stroke",T),I.style("fill",g));const V=I.node().getBBox();return t.height=V.height+2*(a?.sequence?.labelBoxHeight??0),Et(a,Q(t.description))(t.description,I,b.x,b.y+D+(r?5:12),b.width,b.height,{class:`actor ${yt}`},a),r||(I.attr("data-et","participant"),I.attr("data-type","control"),I.attr("data-id",t.name)),t.height},"drawActorTypeControl"),wr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+75,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower(),T=e.append("g");let g="actor";r?g+=` ${_t}`:g+=` ${ft}`,T.attr("class",g),T.attr("name",t.name);const f=dt();f.x=t.x,f.y=n,f.fill="#eaeaea",f.width=t.width,f.height=t.height,f.class="actor";const I=t.x+t.width/2,L=n+(r?10:25),b=22;T.append("circle").attr("cx",I).attr("cy",L).attr("r",b).attr("width",t.width).attr("height",t.height),T.append("line").attr("x1",I-b).attr("x2",I+b).attr("y1",L+b).attr("y2",L+b).attr("stroke-width",2),E==="neo"&&T.attr("filter","url(#drop-shadow)");const w=i.get(t.name)??0;pt.has(h)&&(T.style("stroke",u[w%u.length]),T.style("fill",_[w%u.length]));const A=T.node().getBBox();return t.height=A.height+(a?.sequence?.labelBoxHeight??0),r||(B++,O.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B),Et(a,Q(t.description))(t.description,T,f.x,f.y+(r?15:30),f.width,f.height,{class:`actor ${yt}`},a),r?T.attr("transform",`translate(0, ${b})`):(T.attr("transform",`translate(0, ${b/2-5})`),T.attr("data-et","participant"),T.attr("data-type","entity"),T.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),Nr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height+2*a.boxTextMargin,{theme:E,themeVariables:h,look:p}=a,{bkgColorArray:_,borderColorArray:u,actorBorder:O}=h,T=e.append("g").lower();let g=T;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&g.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),g=T.append("g"),t.actorCnt=B,t.links!=null&&g.attr("id","root-"+B),p==="neo"&&g.attr("data-look","neo"));const f=dt();let I="actor";t.properties?.class?I=t.properties.class:f.fill="#eaeaea",r?I+=` ${_t}`:I+=` ${ft}`,f.x=t.x,f.y=n,f.width=t.width,f.height=t.height,f.class=I,f.name=t.name,f.x=t.x,f.y=n;const L=f.width/3,b=f.width/3,w=L/2,A=w/(2.5+L/50),D=g.append("g");D.attr("class",I);const M=`
M ${f.x},${f.y+A}
a ${w},${A} 0 0 0 ${L},0
a ${w},${A} 0 0 0 -${L},0
l 0,${b-2*A}
a ${w},${A} 0 0 0 ${L},0
l 0,-${b-2*A}
`;D.append("path").attr("d",M),p==="neo"&&D.attr("filter","url(#drop-shadow)");const V=i.get(t.name)??0;pt.has(E)?(D.style("stroke",u[V%u.length]),D.style("fill",_[V%u.length])):D.style("stroke",O),D.attr("transform",`translate(${L}, ${A})`),t.rectData=f,Et(a,Q(t.description))(t.description,g,f.x,f.y+35,f.width,f.height,{class:`actor ${qt}`},a);const W=D.select("path:last-child");if(W.node()){const U=W.node().getBBox();t.height=U.height+(a.sequence.labelBoxHeight??0)}return r||(g.attr("data-et","participant"),g.attr("data-type","database"),g.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Pr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+80,E=22,h=e.append("g").lower(),{look:p,theme:_,themeVariables:u}=a,{bkgColorArray:O,borderColorArray:T,actorBorder:g}=u;r||(B++,h.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const f=e.append("g");let I=yt;r?I+=` ${_t}`:I+=` ${ft}`,f.attr("class",I),f.attr("name",t.name);const L=dt();L.x=t.x,L.y=n,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor",f.append("line").attr("id","actor-man-torso"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+12).attr("x2",t.x+t.width/2-15).attr("y2",n+12),f.append("line").attr("id","actor-man-arms"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",n+22),f.append("circle").attr("cx",t.x+t.width/2).attr("cy",n+12).attr("r",E),p==="neo"&&f.attr("filter","url(#drop-shadow)");const b=i.get(t.name)??0;pt.has(_)?(f.style("stroke",T[b%T.length]),f.style("fill",O[b%T.length])):f.style("stroke",g);const w=f.node().getBBox();return t.height=w.height+(a.sequence.labelBoxHeight??0),Et(a,Q(t.description))(t.description,f,L.x,L.y+15,L.width,L.height,{class:`actor ${yt}`},a),f.attr("transform",`translate(0,${E/2+10})`),r||(f.attr("data-et","participant"),f.attr("data-type","boundary"),f.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),kr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+80,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u,actorBorder:O}=p,T=e.append("g").lower();r||(B++,T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const g=e.append("g");let f=yt;r?f+=` ${_t}`:f+=` ${ft}`,g.attr("class",f),g.attr("name",t.name),r||g.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);const I=E==="neo"?.5:1,L=E==="neo"?n+(1-I)*30:n;g.append("line").attr("id","actor-man-torso"+B).attr("x1",s).attr("y1",L+25*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("id","actor-man-arms"+B).attr("x1",s-It/2*I).attr("y1",L+33*I).attr("x2",s+It/2*I).attr("y2",L+33*I),g.append("line").attr("x1",s-It/2*I).attr("y1",L+60*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("x1",s).attr("y1",L+45*I).attr("x2",s+(It/2-2)*I).attr("y2",L+60*I);const b=g.append("circle");b.attr("cx",t.x+t.width/2),b.attr("cy",L+10*I),b.attr("r",15*I),b.attr("width",t.width*I),b.attr("height",t.height*I);const w=g.node().getBBox();t.height=w.height;const A=dt();A.x=t.x,A.y=L,A.fill="#eaeaea",A.width=t.width,A.height=t.height/I,A.class="actor",A.rx=3,A.ry=3;const D=i.get(t.name)??0;return pt.has(h)?(g.style("stroke",u[D%u.length]),g.style("fill",_[D%u.length])):g.style("stroke",O),Et(a,Q(t.description))(t.description,g,A.x,L+35*I-(E==="neo"?10:0),A.width,A.height,{class:`actor ${yt}`},a),t.height},"drawActorTypeActor"),Dr=x(async function(e,t,a,r,i,n,s){const c=s??new Map([...n.db.getActors().values()].map((E,h)=>[E.name,h]));switch(t.type){case"actor":return await kr(e,t,a,r,c);case"participant":return await br(e,t,a,r,c);case"boundary":return await Pr(e,t,a,r,c);case"control":return await Sr(e,t,a,r,i,c);case"entity":return await wr(e,t,a,r,c);case"database":return await Nr(e,t,a,r,c);case"collections":return await mr(e,t,a,r,c);case"queue":return await Ar(e,t,a,r,c)}},"drawActor"),vr=x(function(e,t,a){const i=e.append("g");Ke(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),Cr=x(function(e){return e.append("g")},"anchorElement"),Mr=x(function(e,t,a,r,i,n,s){const{theme:c,themeVariables:E}=r,{bkgColorArray:h,borderColorArray:p,mainBkg:_}=E,u=dt(),O=t.anchored,T=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+i%3,u.width=t.stopx-t.startx,u.height=a-t.starty;const g=Pt(O,u),I=(s??new Map([...n.db.getActors().values()].map((L,b)=>[L.name,b]))).get(T)??0;pt.has(c)&&(g.style("stroke",p[I%p.length]),g.style("fill",h[I%p.length]??_))},"drawActivation"),Br=x(async function(e,t,a,r,i){const{boxMargin:n,boxTextMargin:s,labelBoxHeight:c,l Line truncated
+1
View File
@@ -0,0 +1 @@
import{_ as o}from"./mermaid.core.js";import"./index.js";var c=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function p(){return!!i()?.mermaidCaptureSizes}o(p,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,p as shouldCaptureSizes};
+1
View File
@@ -0,0 +1 @@
import{s as G,a as W,S as N}from"./chunk-IMKFNOWR.js";import{_ as f,c as t,j as H,l as S,d as P,Q as _,k as z,R as U,S as C,M as F,x as O}from"./mermaid.core.js";import{l as J}from"./layout.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./index.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),q=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Q=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),Z=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Q(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","sLine truncated
Loaded 100 of 684 files, more files were not shown because too many files have changed in this diff. Show more